Skip to content

Commit

Permalink
subscription and sharing improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Aug 28, 2023
1 parent 16b90c7 commit 3a06fe4
Show file tree
Hide file tree
Showing 43 changed files with 1,055 additions and 504 deletions.
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 Habitica/res/drawable-mdpi/sub_benefits_armoire.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 Habitica/res/drawable-xhdpi/sub_benefits_armoire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Habitica/res/drawable/ad_button_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:angle="0"
android:startColor="@color/green_100"
android:endColor="@color/green_500" />
<corners android:radius="8dp" />
<corners android:radius="12dp" />
</shape>
</item>
<item
Expand All @@ -20,7 +20,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<solid android:color="@color/brand_400" />
<corners android:radius="6dp" />
<corners android:radius="10dp" />
</shape>
<ripple android:color="@color/white" />
</item>
Expand Down
4 changes: 2 additions & 2 deletions Habitica/res/drawable/ad_button_background_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:angle="0"
android:startColor="@color/green_100"
android:endColor="@color/green_500" />
<corners android:radius="8dp" />
<corners android:radius="12dp" />
</shape>
</item>
<item
Expand All @@ -20,7 +20,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<solid android:color="?attr/colorContentBackground" />
<corners android:radius="6dp" />
<corners android:radius="10dp" />
</shape>
<ripple android:color="@color/white" />
</item>
Expand Down
11 changes: 11 additions & 0 deletions Habitica/res/drawable/armoire_background_full.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="top">
<bitmap android:src="@drawable/armoire_background" />
</item>
<item android:top="80dp" android:gravity="bottom">
<shape android:shape="rectangle">
<solid android:color="@color/brand_400" />
</shape>
</item>
</layer-list>
5 changes: 5 additions & 0 deletions Habitica/res/drawable/sub_perk_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#005737" />
<corners android:radius="8dp" />
</shape>
4 changes: 4 additions & 0 deletions Habitica/res/drawable/subscribe_incentive_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

</selector>
5 changes: 5 additions & 0 deletions Habitica/res/drawable/subscribe_incentive_bg_topround.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:startColor="#72CFFF" android:endColor="#77F4C7" />
<corners android:topLeftRadius="24dp" android:topRightRadius="24dp" />
</shape>
16 changes: 16 additions & 0 deletions Habitica/res/drawable/subscriber_benefit_button_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:startColor="#77F4C7" android:endColor="#72CFFF" />
<corners android:radius="12dp" />
</shape>
</item>

<item android:left="3dp" android:right="3dp" android:top="3dp" android:bottom="3dp">
<shape android:shape="rectangle">
<gradient android:startColor="#72CFFF" android:endColor="#77F4C7" />
<corners android:radius="10dp" />
</shape>
</item>
</layer-list>
83 changes: 78 additions & 5 deletions Habitica/res/layout/activity_armoire.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/armoire_background"
android:background="@drawable/armoire_background_full"
android:orientation="vertical"
android:gravity="center"
android:paddingHorizontal="24dp"
android:paddingTop="36dp">
<TextView
android:id="@+id/equipment_count_view"
Expand All @@ -130,7 +129,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
android:layout_marginTop="8dp"
android:paddingHorizontal="24dp">
<Button
android:id="@+id/equip_button"
android:layout_width="0dp"
Expand All @@ -140,7 +140,6 @@
android:textStyle="bold"
style="@style/HabiticaButton.White"
android:padding="0dp"

android:layout_marginEnd="12dp"/>
<Button
android:id="@+id/close_button"
Expand All @@ -158,7 +157,81 @@
android:layout_height="60dp"
app:text="@string/watch_ad_to_open"
android:layout_marginTop="4dp"
android:layout_marginHorizontal="24dp"
app:currency="gold" />

<FrameLayout
android:id="@+id/open_armoire_subscriber_wrapper"
android:layout_width="match_parent"
android:layout_height="65dp"
android:paddingStart="24dp"
android:paddingEnd="18dp"
android:layout_marginTop="4dp">
<TextView
android:id="@+id/open_armoire_subscriber_button"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="@string/subscriber_button_armoire"
android:textStyle="bold"
android:background="@drawable/subscriber_benefit_button_bg"
android:gravity="center"
android:textSize="16sp"
android:backgroundTint="@null"
android:textColor="@color/green_1"
android:layout_marginEnd="6dp"
android:layout_marginTop="5dp"
android:padding="0dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/sub_perk_bg"
android:textColor="@color/green_500"
android:paddingHorizontal="6dp"
android:paddingVertical="4dp"
style="@style/Caption2"
android:layout_gravity="top|end"
android:text="@string/sub_perk"/>
</FrameLayout>

<LinearLayout
android:id="@+id/unsubbed_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/spacing_large"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="8dp"
android:paddingHorizontal="24dp"
android:background="@drawable/subscribe_incentive_bg_topround"
>
<Button
android:id="@+id/subscribe_modal_button"
android:layout_width="match_parent"
android:layout_height="69dp"
android:text="@string/subscribe_incentive_button_armoire"
android:textStyle="bold"
style="@style/HabiticaButton.White"
android:textColor="@color/teal_10"
android:padding="0dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/subscribe_incentive_text_armoire"
android:textColor="@color/teal_1"
android:layout_marginHorizontal="16dp"
style="@style/Body1"
android:layout_marginTop="3dp"/>
<TextView
android:id="@+id/drop_rate_button_unsubbed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/armoire_drop_rates"
android:textColor="@color/teal_1"
android:layout_marginTop="5dp"
style="@style/Body2"/>
</LinearLayout>
<TextView
android:id="@+id/drop_rate_button"
android:layout_width="wrap_content"
Expand All @@ -169,4 +242,4 @@
style="@style/Body2"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
109 changes: 91 additions & 18 deletions Habitica/res/layout/activity_death.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools">

<FrameLayout
android:id="@+id/confetti_container"
Expand All @@ -18,8 +19,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingHorizontal="23dp">
android:orientation="vertical">

<Space
android:layout_width="wrap_content"
Expand Down Expand Up @@ -53,7 +53,8 @@
android:layout_marginHorizontal="@dimen/spacing_xlarge"
android:gravity="center"
android:text="@string/you_ran_out_of_health"
android:textStyle="bold" />
android:textStyle="bold"
android:paddingHorizontal="24dp" />

<TextView
android:id="@+id/loss_description"
Expand All @@ -64,17 +65,16 @@
android:gravity="center"
android:lineSpacingExtra="4dp"
android:textColor="@color/text_primary"
android:textSize="20sp" />
android:textSize="20sp"
android:paddingHorizontal="12dp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_xlarge"
android:layout_margin="@dimen/spacing_large"
android:gravity="center"
android:lineSpacingExtra="4dp"
android:text="@string/death_description"
android:textColor="@color/text_secondary"
android:textSize="20sp" />
android:text="@string/faint_broken_equipment"
android:textColor="@color/text_quad" />

<Space
android:layout_width="wrap_content"
Expand All @@ -88,23 +88,96 @@
android:layout_height="69dp"
android:layout_marginBottom="6dp"
android:text="@string/faint_button"
android:textStyle="bold" />
android:textStyle="bold"
android:layout_marginHorizontal="24dp" />

<com.habitrpg.android.habitica.ui.views.ads.AdButton
android:id="@+id/ad_button"
android:layout_width="match_parent"
android:layout_height="60dp"
app:activeBackground="@drawable/ad_button_background_content"
app:text="@string/watch_ad_to_open"
app:textColor="@color/text_primary" />
app:text="@string/watch_ad_to_hang_on"
app:textColor="@color/text_primary"
android:layout_marginHorizontal="24dp" />

<FrameLayout
android:id="@+id/revive_subscriber_wrapper"
android:layout_width="match_parent"
android:layout_height="65dp"
android:paddingStart="24dp"
android:paddingEnd="18dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="@dimen/spacing_large">
<TextView
android:id="@+id/revive_subscriber_button"
android:layout_width="match_parent"
android:layout_height="60dp"
android:text="@string/subscriber_button_faint"
android:textStyle="bold"
android:background="@drawable/subscriber_benefit_button_bg"
android:gravity="center"
android:textSize="16sp"
android:backgroundTint="@null"
android:textColor="@color/green_1"
android:layout_marginEnd="6dp"
android:layout_marginTop="5dp"
android:padding="0dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/sub_perk_bg"
android:textColor="@color/green_500"
android:paddingHorizontal="6dp"
android:paddingVertical="4dp"
style="@style/Caption2"
android:layout_gravity="top|end"
android:text="@string/sub_perk"/>
</FrameLayout>


<TextView
android:layout_width="wrap_content"
android:id="@+id/subscriber_benefit_used_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_large"
android:gravity="center"
android:text="@string/faint_broken_equipment"
android:textColor="@color/text_quad" />
android:gravity="center_horizontal"
android:textColor="@color/text_teal"
android:layout_marginHorizontal="42dp"
tools:text="@string/subscriber_benefit_used_faint"
style="@style/Body1"
android:layout_marginBottom="@dimen/spacing_large"
android:layout_marginTop="8dp"/>

<LinearLayout
android:id="@+id/unsubbed_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/spacing_large"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="12dp"
android:paddingHorizontal="24dp"
android:background="@drawable/subscribe_incentive_bg_topround"
>
<Button
android:id="@+id/subscribe_modal_button"
android:layout_width="match_parent"
android:layout_height="69dp"
android:text="@string/subscribe_incentive_button_armoire"
android:textStyle="bold"
style="@style/HabiticaButton.White"
android:textColor="@color/teal_10"
android:padding="0dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/subscribe_incentive_text_faint"
android:textColor="@color/teal_1"
android:layout_marginHorizontal="16dp"
style="@style/Body1"
android:layout_marginTop="3dp"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
15 changes: 0 additions & 15 deletions Habitica/res/layout/fragment_items_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,5 @@
android:scrollbarThumbVertical="@color/scrollbarThumb"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:scrollbars="vertical" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/footerTextView"
tools:text="Need more items. Check the Market"
android:gravity="center"
android:padding="8dp"/>
<Button
android:id="@+id/openMarketButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/open_market"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"/>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Loading

0 comments on commit 3a06fe4

Please sign in to comment.