Skip to content

Commit

Permalink
ROMControl: Upgraded About
Browse files Browse the repository at this point in the history
Improved about section.... SEXY!
Images are pulled from your twitter account profile

Patch AOKP#2
  - put back in strings i removed on accident...

Patch AOKP#3
  - use url image helper (https://github.com/koush/UrlImageViewHelper)
  to handle downloading and caching profile pictures.
  - add more aokp fellas
  - randomly sort order in which devs are shown

Patch AOKP#4
  - add more donate links, still missing Nitroz's

Patch AOKP#5
  - add stevespearderp

Patch AOKP#6
  - fix kwes' url
  - add birdman

Patch AOKP#7
  - add nitroz

Change-Id: I420d29689e0530db8d805c06529801e1b6ea6ba4
Signed-off-by: Adam Fisch <adammfisch@gmail.com>
  • Loading branch information
adamthecashew authored and LorDClockaN committed Aug 1, 2012
1 parent eb2cb87 commit 4e09220
Show file tree
Hide file tree
Showing 17 changed files with 620 additions and 113 deletions.
7 changes: 7 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,12 @@
<category android:name="com.aokp.romcontrol.SHORTCUT" />
</intent-filter>
</activity>
<activity
android:name=".fragments.About"
android:label="@string/about_aokp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
Binary file added res/drawable-hdpi/paypal_donate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/twitter_birdy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/paypal_donate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/twitter_birdy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions res/layout/dev_card.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dip"
android:paddingRight="15dip">

<RelativeLayout
android:id="@+id/image_here"
android:layout_width="wrap_content"
android:layout_height="150dip"
android:paddingTop="8dip"
android:gravity="center_vertical"
android:orientation="vertical">

<ImageView
android:id="@+id/photo"
android:layout_width="match_parent"
android:layout_height="150dip"
android:scaleType="centerCrop" />

<View
android:id="@+id/photo_text_bar"
android:layout_width="wrap_content"
android:layout_height="42dip"
android:layout_alignBottom="@id/photo"
android:layout_alignLeft="@id/photo"
android:background="#7F000000" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="42dip"
android:layout_alignBottom="@id/photo"
android:layout_alignLeft="@id/photo"
android:gravity="center_vertical">

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:singleLine="true"
android:ellipsize="end"
android:textColor="@android:color/white"
android:textAppearance="?android:attr/textAppearanceMedium" />

<ImageView
android:id="@+id/twitter_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dip"
android:scaleType="centerInside"
android:src="@drawable/twitter_birdy"/>

</LinearLayout>

<ImageView
android:id="@+id/donate_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/photo"
android:paddingRight="4dip"
android:paddingBottom="4dp"
android:layout_alignParentRight="true"
android:scaleType="centerInside"
android:src="@drawable/paypal_donate"/>

</RelativeLayout>

</FrameLayout>
65 changes: 0 additions & 65 deletions res/layout/developer_preference.xml

This file was deleted.

1 change: 1 addition & 0 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<declare-styleable name="DeveloperPreference">
<attr name="twitterHandle" format="string" />
<attr name="nameDev" format="string"/>
<attr name="donateLink" format="string" />
</declare-styleable>

Expand Down
16 changes: 13 additions & 3 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<string name="app_name">ROM Control</string>

<!-- Header Strings -->
<string name="user_interface">User Interface</string>
<string name="cancel">Cancel</string>
<string name="ok">OK</string>
<string name="menu_main_activity_change_locale">Blank!</string>
Expand Down Expand Up @@ -39,7 +40,7 @@
<string name="group_applications">Applications</string>

<!-- About -->
<string name="devs">Developers</string>
<string name="devs">The Crew</string>
<string name="aokp">Android Open Kang Project</string>
<string name="aokp_website_title">AOKP Website</string>
<string name="aokp_website_summary">www.aokp.co - Find all newest releases here.</string>
Expand All @@ -57,7 +58,16 @@
<string name="donate_protekk">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=YJTUMSBC2TRHS</string>
<string name="donate_khasmek">http://nyan.cat</string>
<string name="donate_sethyx">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=5R4DYJLDYDRAU</string>

<string name="donate_adam">http://goo.gl/fRj57</string>
<string name="donate_kwes">https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=HGAN9G5ZJ2AAS&amp;lc=US&amp;item_name=kwes1020&amp;currency_code=USD&amp;bn=PP%%2dDonationsBF%%3abtn_donateCC_LG%2egif%%3aNonHosted</string>
<string name="donate_nitroz">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=U27ZAWB8995TS</string>
<string name="donate_xoom">http://bit.ly/t7YC5Z</string>
<string name="donate_marclandis">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=7FN44KF8XZXFW</string>
<string name="donate_sixstringsg">https://www.paypal.com/cgi-bin/webscr?cmd=_flow&amp;SESSION=U3KYhTz6itHx8bKvx-F79EFVY5sQKKQu9f1ftkJ1pevFN6wdaJLu8yz3Y3e&amp;dispatch=5885d80a13c0db1f8e263663d3faee8d1e83f46a36995b3856cef1e18897ad75</string>
<string name="donate_just_reboot">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=WEZKU46DAFMSW</string>
<string name="donate_stevespear">https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=6SY3WH7AZNR7Y</string>
<string name="donate_birdman">https://support.woundedwarriorproject.org/Default.aspx?tsid=66&amp;campaignSource=WEBSITE</string>

<!-- General UI -->
<string name="enable_volume_options">Enable Volume Panel</string>
<string name="status_bar_notif_count_title">Show notification count</string>
Expand Down Expand Up @@ -133,8 +143,8 @@
<string name="summary_pref_navigation_menu_display">How and when do you want the menu buttons to appear?</string>
<string name="navbar_qty_title">Navigation button quantity</string>
<string name="navbar_qty_summary">Choose the number of navigation buttons</string>
<string name="button_transparency_title">Nav button transparency</string>
<string name="navbar_action_title">Button %1$s action &amp; icon</string>
<string name="button_transparency_title">Nav button transparency</string>
<string name="navbar_longpress_title">Button %1$s longpress action</string>
<string name="navbar_action_home">Home</string>
<string name="navbar_action_back">Back</string>
Expand Down
9 changes: 9 additions & 0 deletions res/xml/preference_headers.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android" >

<header
android:id="@+id/about"
android:fragment="com.aokp.romcontrol.fragments.About"
android:title="@string/about_aokp"
android:summary="@string/about_aokp_summary" />

<header android:title="@string/user_interface" />

<header
android:id="@+id/user_interface"
android:fragment="com.aokp.romcontrol.fragments.UserInterface"
Expand Down
66 changes: 61 additions & 5 deletions res/xml/prefs_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,93 @@
android:title="@string/devs">
<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="Roman"
aokp:nameDev="romanbb"
aokp:twitterHandle="romanbb"
aokp:donateLink="@string/donate_roman" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="Whitehawkx"
aokp:nameDev="Whitehawkx"
aokp:twitterHandle="whitehawkx"
aokp:donateLink="@string/donate_whitehawk" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="kwes"
aokp:nameDev="kwes"
aokp:twitterHandle="kwes1020"
aokp:donateLink="@string/donate_kwes" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="Zaphod-Beeble"
aokp:nameDev="Zaphod-Beeble"
aokp:twitterHandle="Dont_Panic_Zaph"
aokp:donateLink="@string/donate_zaph" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="Jonathon Grigg"
aokp:twitterHandle="jonathongrigg" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="ProTekk"
aokp:nameDev="ProTekk"
aokp:twitterHandle="protekkfzs"
aokp:donateLink="@string/donate_protekk" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="Khas Mek"
aokp:nameDev="Khas Mek"
aokp:twitterHandle="KhasMek"
aokp:donateLink="@string/donate_khasmek" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="sethyx"
aokp:nameDev="sethyx"
aokp:twitterHandle="sethyx"
aokp:donateLink="@string/donate_sethyx" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="MarcLandis"
aokp:nameDev="MarcLandis"
aokp:twitterHandle="MarcLandis"
aokp:donateLink="@string/donate_marclandis" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="justreboot"
aokp:nameDev="Just Reboot"
aokp:twitterHandle="just_reboot"
aokp:donateLink="@string/donate_just_reboot" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="nitroz"
aokp:nameDev="Nitroz"
aokp:twitterHandle="NitrozK"
aokp:donateLink="@string/donate_nitroz" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="sixstringsg"
aokp:nameDev="sixstringsg"
aokp:twitterHandle="sixstringsg"
aokp:donateLink="@string/donate_sixstringsg" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="adamthecashew"
aokp:nameDev="adamthecashew"
aokp:twitterHandle="adamthecashew"
aokp:donateLink="@string/donate_adam" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="xoom"
aokp:nameDev="xoomdev"
aokp:twitterHandle="xoomdev"
aokp:donateLink="@string/donate_xoom" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="stevespear"
aokp:nameDev="Stevespear426"
aokp:twitterHandle="stevespeartweet"
aokp:donateLink="@string/donate_stevespear" />

<com.aokp.romcontrol.widgets.DeveloperPreference
android:title="birdman"
aokp:nameDev="birdman"
aokp:twitterHandle="_mrbirdman_"
aokp:donateLink="@string/donate_birdman" />
</PreferenceCategory>

</PreferenceScreen>
21 changes: 20 additions & 1 deletion src/com/aokp/romcontrol/fragments/About.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;

import com.aokp.romcontrol.AOKPPreferenceFragment;
import com.aokp.romcontrol.R;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class About extends AOKPPreferenceFragment {

public static final String TAG = "About";
Expand All @@ -29,6 +34,20 @@ public void onCreate(Bundle savedInstanceState) {
mReviewUrl = findPreference("aokp_review");
mIrcUrl = findPreference("aokp_irc");

PreferenceGroup devsGroup = (PreferenceGroup) findPreference("devs");
ArrayList<Preference> devs = new ArrayList<Preference>();
for (int i = 0; i < devsGroup.getPreferenceCount(); i++) {
devs.add(devsGroup.getPreference(i));
}
devsGroup.removeAll();
devsGroup.setOrderingAsAdded(false);
Collections.shuffle(devs);
for(int i = 0; i < devs.size(); i++) {
Preference p = devs.get(i);
p.setOrder(i);

devsGroup.addPreference(p);
}
}

@Override
Expand All @@ -37,7 +56,7 @@ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preferen
launchUrl("http://aokp.co/");
} else if (preference == mSourceUrl) {
launchUrl("http://github.com/aokp");
} else if (preference == mReviewUrl) {
} else if (preference == mReviewUrl) {
launchUrl("http://gerrit.aokp.co");
} else if (preference == mIrcUrl) {
launchUrl("http://webchat.freenode.net/?channels=teamkang");
Expand Down
Loading

0 comments on commit 4e09220

Please sign in to comment.