Skip to content

Commit

Permalink
Merge branch 'master_prefix'
Browse files Browse the repository at this point in the history
  • Loading branch information
medyo committed May 2, 2016
2 parents 84b3522 + 3a2be01 commit 9b14695
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
2 changes: 2 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

resourcePrefix 'about_'
}

dependencies {
Expand Down
20 changes: 10 additions & 10 deletions library/src/main/java/mehdi/sakout/aboutpage/AboutPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public AboutPage addFacebook(String id){
Element facebookElement = new Element();
facebookElement.setTitle(mContext.getString(R.string.about_facebook));
facebookElement.setIcon(R.drawable.about_icon_facebook);
facebookElement.setColor(ContextCompat.getColor(mContext, R.color.facebook_color));
facebookElement.setColor(ContextCompat.getColor(mContext, R.color.about_facebook_color));
facebookElement.setValue(id);

Intent intent = new Intent();
Expand Down Expand Up @@ -108,7 +108,7 @@ public AboutPage addTwitter(String id){
Element twitterElement = new Element();
twitterElement.setTitle(mContext.getString(R.string.about_twitter));
twitterElement.setIcon(R.drawable.about_icon_twitter);
twitterElement.setColor(ContextCompat.getColor(mContext, R.color.twitter_color));
twitterElement.setColor(ContextCompat.getColor(mContext, R.color.about_twitter_color));
twitterElement.setValue(id);

Intent intent = new Intent();
Expand All @@ -134,7 +134,7 @@ public AboutPage addPlayStore(String id){
Element playStoreElement = new Element();
playStoreElement.setTitle(mContext.getString(R.string.about_play_store));
playStoreElement.setIcon(R.drawable.about_icon_google_play);
playStoreElement.setColor(ContextCompat.getColor(mContext, R.color.play_store_color));
playStoreElement.setColor(ContextCompat.getColor(mContext, R.color.about_play_store_color));
playStoreElement.setValue(id);

Uri uri = Uri.parse("market://details?id=" + id);
Expand All @@ -152,7 +152,7 @@ public AboutPage addYoutube(String id){
Element youtubeElement = new Element();
youtubeElement.setTitle(mContext.getString(R.string.about_youtube));
youtubeElement.setIcon(R.drawable.about_icon_youtube);
youtubeElement.setColor(ContextCompat.getColor(mContext, R.color.youtube_color));
youtubeElement.setColor(ContextCompat.getColor(mContext, R.color.about_youtube_color));
youtubeElement.setValue(id);

Intent intent = new Intent();
Expand All @@ -176,7 +176,7 @@ public AboutPage addInstagram(String id){
Element instagramElement = new Element();
instagramElement.setTitle(mContext.getString(R.string.about_instagram));
instagramElement.setIcon(R.drawable.about_icon_instagram);
instagramElement.setColor(ContextCompat.getColor(mContext, R.color.instagram_color));
instagramElement.setColor(ContextCompat.getColor(mContext, R.color.about_instagram_color));
instagramElement.setValue(id);

Intent intent = new Intent();
Expand All @@ -200,7 +200,7 @@ public AboutPage addGitHub(String id){
Element gitHubElement = new Element();
gitHubElement.setTitle(mContext.getString(R.string.about_github));
gitHubElement.setIcon(R.drawable.about_icon_github);
gitHubElement.setColor(ContextCompat.getColor(mContext, R.color.github_color));
gitHubElement.setColor(ContextCompat.getColor(mContext, R.color.about_github_color));
gitHubElement.setValue(id);

Intent intent = new Intent();
Expand Down Expand Up @@ -253,9 +253,9 @@ public AboutPage addGroup(String name){
TextView textView = new TextView(mContext);
textView.setText(name);
if (Build.VERSION.SDK_INT < 23) {
textView.setTextAppearance(mContext, R.style.About_GroupTextAppearance);
textView.setTextAppearance(mContext, R.style.about_groupTextAppearance);
} else {
textView.setTextAppearance(R.style.About_GroupTextAppearance);
textView.setTextAppearance(R.style.about_groupTextAppearance);
}

LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Expand Down Expand Up @@ -339,9 +339,9 @@ public void onClick(View view) {

TextView textView = new TextView(mContext);
if (Build.VERSION.SDK_INT < 23) {
textView.setTextAppearance(mContext, R.style.About_elementTextAppearance);
textView.setTextAppearance(mContext, R.style.about_elementTextAppearance);
} else {
textView.setTextAppearance(R.style.About_elementTextAppearance);
textView.setTextAppearance(R.style.about_elementTextAppearance);
}

LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Expand Down
14 changes: 7 additions & 7 deletions library/src/main/res/layout/about_page.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/About.wrapper">
style="@style/about_About.wrapper">

<LinearLayout style="@style/About.wrapper">
<LinearLayout style="@style/About.sub_wrapper">
<ImageView android:id="@+id/image" style="@style/About.image"/>
<TextView android:id="@+id/description" style="@style/About.description"/>
<LinearLayout style="@style/about_About.wrapper">
<LinearLayout style="@style/about_sub_wrapper">
<ImageView android:id="@+id/image" style="@style/about_image"/>
<TextView android:id="@+id/description" style="@style/about_description"/>
</LinearLayout>

<View style="@style/About.separator"/>
<View style="@style/about_separator"/>

<LinearLayout
android:id="@+id/about_providers"
style="@style/About.sub_wrapper"
style="@style/about_sub_wrapper"
android:padding="0dp">

</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/res/layout/about_page_separator.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<View android:height="@dimen/about_separator_height"
style="@style/About.separator"
style="@style/about_separator"
xmlns:android="http://schemas.android.com/apk/res/android" />
12 changes: 6 additions & 6 deletions library/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Social -->
<color name="facebook_color">#3b5998</color>
<color name="twitter_color">#55acee</color>
<color name="instagram_color">#3f729b</color>
<color name="play_store_color">#45BBC2</color>
<color name="youtube_color">#cd201f</color>
<color name="github_color">#333333</color>
<color name="about_facebook_color">#3b5998</color>
<color name="about_twitter_color">#55acee</color>
<color name="about_instagram_color">#3f729b</color>
<color name="about_play_store_color">#45BBC2</color>
<color name="about_youtube_color">#cd201f</color>
<color name="about_github_color">#333333</color>
<color name="about_item_icon_color">#313131</color>
<color name="about_description_color">#595959</color>
<color name="about_separator_color">#e1e1e1</color>
Expand Down
16 changes: 8 additions & 8 deletions library/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="About"/>
<style name="About.wrapper">
<style name="about_About"/>
<style name="about_About.wrapper">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:orientation">vertical</item>
<item name="android:gravity">center</item>
<item name="android:background">#ffffff</item>
</style>
<style name="About.sub_wrapper">
<style name="about_sub_wrapper">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
<item name="android:gravity">center</item>
<item name="android:padding">20dp</item>
</style>
<style name="About.image">
<style name="about_image">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center</item>
<item name="android:layout_marginBottom">30dp</item>
<item name="android:layout_marginTop">20dp</item>
</style>
<style name="About.description" parent="@android:style/TextAppearance">
<style name="about_description" parent="@android:style/TextAppearance">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:text">@string/about_page_description</item>
Expand All @@ -31,7 +31,7 @@
<item name="android:textColor">@color/about_description_color</item>
<item name="android:textSize">@dimen/about_description_text_size</item>
</style>
<style name="About.separator">
<style name="about_separator">
<item name="android:layout_height">@dimen/about_separator_height</item>
<item name="android:layout_width">match_parent</item>
<item name="android:background">@color/about_separator_color</item>
Expand All @@ -41,12 +41,12 @@
<item name="android:layout_marginBottom">0dp</item>
</style>

<style name="About.elementTextAppearance" parent="@android:style/TextAppearance">
<style name="about_elementTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/about_text_color</item>
<item name="android:textSize">@dimen/about_item_text_size</item>
</style>

<style name="About.GroupTextAppearance" parent="@android:style/TextAppearance">
<style name="about_groupTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/about_item_text_color</item>
<item name="android:textSize">@dimen/about_group_item_text_size</item>
</style>
Expand Down

0 comments on commit 9b14695

Please sign in to comment.