Skip to content

Commit

Permalink
Merge pull request #68 from androidsx/refactor-rate-me
Browse files Browse the repository at this point in the history
Refactor rate me
  • Loading branch information
espinchi committed Feb 23, 2015
2 parents fddc117 + f56f532 commit 1b6f4a6
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 133 deletions.
14 changes: 0 additions & 14 deletions LibraryRateMe/res/drawable-hdpi/customshape.xml

This file was deleted.

12 changes: 0 additions & 12 deletions LibraryRateMe/res/drawable-hdpi/itemselected.xml

This file was deleted.

6 changes: 0 additions & 6 deletions LibraryRateMe/res/drawable-hdpi/selector.xml

This file was deleted.

33 changes: 24 additions & 9 deletions LibraryRateMe/res/layout/feedback_dialog_message.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/linearLayoutBodyDialog" >
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding">

<LinearLayout
android:id="@+id/LinearMail"
style="@style/linearLayoutBody" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<ImageView
android:id="@+id/icon"
style="@style/iconApp"
android:paddingBottom="15dp" />
android:id="@+id/app_icon_dialog_mail"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:scaleType="centerInside"
android:layout_margin="@dimen/margin"
android:paddingBottom="@dimen/padding_bottom" />

<LinearLayout
style="@style/linearLayoutMessageDialog" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/phraseMail"
android:id="@+id/mail_dialog_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/textStyle"
android:text="@string/rateme_message_confirm_dialog" />
</LinearLayout>
Expand All @@ -25,16 +36,20 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dp" >
android:layout_marginTop="@dimen/margin_top" >

<Button
android:id="@+id/buttonCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/buttonGoToMail"
android:text="@android:string/cancel" >
</Button>

<Button
android:id="@+id/buttonYes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/buttonGoToMail"
android:text="@android:string/yes" >
</Button>
Expand Down
2 changes: 2 additions & 0 deletions LibraryRateMe/res/layout/feedback_dialog_title.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

<TextView
android:id="@+id/confirmDialogTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/textStyle"
android:text="@string/rateme_title" />

Expand Down
44 changes: 28 additions & 16 deletions LibraryRateMe/res/layout/rateme_dialog_message.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/linearLayoutBodyDialog"
tools:background="#212121">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding">

<LinearLayout
android:id="@+id/Linear"
style="@style/linearLayoutBody"
tools:background="#43A047" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:id="@+id/picture"
style="@style/iconApp" />
android:id="@+id/app_icon_dialog_rating"
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:layout_marginTop="@dimen/margin"
android:scaleType="centerInside" />

<LinearLayout
tools:background="#795548"
style="@style/linearLayoutMessageDialog" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:background="#795548" >

<TextView
android:id="@+id/phraseCenter"
style="@style/textStyle"
android:id="@+id/rating_dialog_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size"
android:text="@string/rateme_message" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp" >
android:layout_marginBottom="@dimen/margin_bottom" >

<RatingBar
android:id="@+id/ratingBar"
Expand All @@ -37,20 +46,23 @@
android:rotationX="0.3"
android:scaleX="1.0"
android:scaleY="1.0"
android:stepSize="0.5" />
android:stepSize="0.5"
android:layout_gravity="center" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

<Button
android:id="@+id/buttonRateMe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/buttonRateMe"
android:text="@string/rateme"
tools:background="#444444"
tools:visibility="visible" />
android:text="@string/rateme" />

<Button
android:id="@+id/buttonThanks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/buttonRateMe"
android:text="@string/rateme_no_thanks" />

Expand Down
6 changes: 4 additions & 2 deletions LibraryRateMe/res/layout/rateme_dialog_title.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp" >
android:padding="@dimen/padding" >

<Button
android:id="@+id/buttonClose"
Expand All @@ -20,7 +20,9 @@
android:background="@drawable/ic_action_share" />

<TextView
android:id="@+id/title"
android:id="@+id/dialog_tiitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/textStyle"
android:layout_alignBottom="@+id/buttonClose"
android:text="@string/rateme_title" />
Expand Down
8 changes: 7 additions & 1 deletion LibraryRateMe/res/values/dimen.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="text_size">20sp</dimen>
<dimen name="button_title_size">30sp</dimen>
<dimen name="button_title_size">30dp</dimen>
<dimen name="icon_size">65dp</dimen>
<dimen name="margin">5dp</dimen>
<dimen name="padding">10dp</dimen>
<dimen name="padding_bottom">15dp</dimen>
<dimen name="margin_top">15dp</dimen>
<dimen name="margin_bottom">15dp</dimen>

</resources>
49 changes: 9 additions & 40 deletions LibraryRateMe/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,27 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="textStyle" parent="@style/linearLayoutWrapContent">
<item name="android:layout_marginLeft">5dp</item>
<style name="textStyle">
<item name="android:layout_marginLeft">@dimen/margin</item>
<item name="android:textSize">@dimen/text_size</item>
<item name="android:layout_alignParentLeft">true</item>
</style>

<!-- Config Buttons -->
<style name="buttonDialog" parent="@style/linearLayoutTakeAllWidth">
<style name="buttonRateMe">
<item name="android:visibility">visible</item>
<item name="android:layout_gravity">center_horizontal</item>
<item name="android:textSize">@dimen/text_size</item>
<item name="android:background">@drawable/selector</item>
</style>

<style name="buttonRateMe" parent="@style/buttonDialog">
<item name="android:visibility">gone</item>
</style>

<style name="buttonGoToMail" parent="@style/buttonDialog">
<item name="android:layout_weight">50</item>
<item name="android:layout_margin">4dp</item>
</style>

<style name="iconApp">
<item name="android:layout_width">@dimen/icon_size</item>
<item name="android:layout_height">@dimen/icon_size</item>
<item name="android:layout_margin">5dp</item>
<item name="android:layout_margin">@dimen/margin</item>
<item name="android:scaleType">centerInside</item>
</style>
<style name="buttonGoToMail">
<item name="android:layout_weight">0.5</item>
<item name="android:layout_margin">@dimen/margin</item>

<!-- LinearLayout -->
<style name="linearLayoutTakeAllWidth">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>

<style name="linearLayoutWrapContent">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>

<style name="linearLayoutBodyDialog">
<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:padding">10dp</item>
</style>

<style name="linearLayoutBody" parent="@style/linearLayoutWrapContent">
<item name="android:orientation">horizontal</item>
</style>

<style name="linearLayoutMessageDialog" parent="@style/linearLayoutWrapContent">
<item name="android:orientation">vertical</item>
<item name="android:layout_marginLeft">5dp</item>
</style>

</resources>
Loading

0 comments on commit 1b6f4a6

Please sign in to comment.