Skip to content

Commit

Permalink
Subscription page tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Sep 30, 2024
1 parent c61d43b commit c746896
Show file tree
Hide file tree
Showing 32 changed files with 399 additions and 113 deletions.
Binary file added Habitica/res/drawable-hdpi/extra_gem_cap_left.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.
Binary file added Habitica/res/drawable-hdpi/gem_gold_left.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-hdpi/gem_gold_right.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-mdpi/extra_gem_cap_left.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-mdpi/extra_gem_cap_right.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-mdpi/gem_gold_left.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-mdpi/gem_gold_right.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.
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/gem_gold_left.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/gem_gold_right.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.
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-xxhdpi/gem_gold_left.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-xxhdpi/gem_gold_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions Habitica/res/drawable/gem_extra_progress.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/background"
android:gravity="center_vertical|fill_horizontal">
<shape android:shape="rectangle">
<corners android:radius="4dp" />
<size android:height="8dp" />
<solid android:color="@color/brand_100" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress"
android:gravity="center_vertical|fill_horizontal">
<scale android:scaleWidth="100%">
<shape android:shape="rectangle">
<corners android:radius="4dp" />
<size android:height="8dp" />
<solid android:color="@color/yellow_100" />
</shape>
</scale>
</item>
<item android:id="@android:id/progress"
android:gravity="center_vertical|fill_horizontal">
<scale android:scaleWidth="100%">
<shape android:shape="rectangle"
android:tint="?attr/colorControlActivated">
<corners android:radius="4dp" />
<size android:height="8dp" />
<solid android:color="@color/white" />
</shape>
</scale>
</item>
</layer-list>
5 changes: 5 additions & 0 deletions Habitica/res/drawable/layout_extra_rounded_teal_1.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">
<corners android:radius="12dp" />
<solid android:color="@color/teal_1" />
</shape>
68 changes: 46 additions & 22 deletions Habitica/res/layout/activity_gift_subscription.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,53 +82,77 @@
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_large">

<com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView
android:id="@+id/subscription1MonthView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:recurringText="@string/one_month_one_time"
app:isNonRecurring="true"
app:isGifted="true" />
<com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView
android:id="@+id/subscription3MonthView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:recurringText="@string/three_months_one_time"
app:isNonRecurring="true" />

app:isNonRecurring="true"
app:isGifted="true" />
<com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView
android:id="@+id/subscription6MonthView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:recurringText="@string/six_months_one_time"
app:isNonRecurring="true" >

<com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView
android:id="@+id/subscription1MonthView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:recurringText="@string/one_month_one_time"
app:isNonRecurring="true" />
</com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView>

app:isNonRecurring="true"
app:isGifted="true" />
<com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView
android:id="@+id/subscription12MonthView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:recurringText="@string/twelve_months_one_time"
app:gemCapText="50"
app:isNonRecurring="true"
app:flagText="@string/popular">

</com.habitrpg.android.habitica.ui.views.subscriptions.SubscriptionOptionView>
app:flagText="@string/popular"
app:isGifted="true" />

<Button
android:text="@string/send_gift"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/subscription_button"
style="@style/HabiticaButton.Purple.Small"
android:textAllCaps="false"
android:layout_marginTop="8dp" />
android:layout_marginTop="8dp">

<com.facebook.shimmer.ShimmerFrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:shimmer_auto_start="true"
app:shimmer_repeat_delay="6000"
app:shimmer_duration="100"
app:shimmer_base_color="@color/yellow_100"
app:shimmer_base_alpha="1.0"
app:shimmer_highlight_alpha="1.0"
app:shimmer_colored="true"
app:shimmer_highlight_color="@color/yellow_400">

<View
style="@style/HabiticaButton"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/button_background" />
</com.facebook.shimmer.ShimmerFrameLayout>

<Button
android:id="@+id/subscription_button"
style="@style/HabiticaButton.Borderless"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/send_gift"
android:textColor="@color/brand_100"
android:textAllCaps="false" />
</FrameLayout>
</LinearLayout>

<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/subscription_bg" />

<LinearLayout
android:id="@+id/gift_subscription_container"
android:layout_width="match_parent"
Expand Down
171 changes: 153 additions & 18 deletions Habitica/res/layout/fragment_subscription_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,54 @@
android:scrollbarThumbVertical="@color/scrollbarThumb"
android:background="@color/brand_300"
android:scrollbars="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:id="@+id/gems_for_gold_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:background="@drawable/layout_extra_rounded_teal_1"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gem_gold_left" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="18sp"
android:fontFamily="@string/font_family_medium"
android:text="@string/buy_gems_with_gold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:text="@string/subscriber_benefit"
android:textSize="10sp"
android:textColor="@color/white"
android:letterSpacing="0.15"
/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gem_gold_right" />

</LinearLayout>

<androidx.compose.ui.platform.ComposeView
android:id="@+id/promo_compose_view"
android:layout_width="match_parent"
Expand Down Expand Up @@ -103,7 +146,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp">
android:padding="18dp">

<ImageView
android:id="@+id/header_image_view"
Expand All @@ -130,9 +173,9 @@
<TextView
android:id="@+id/subscribeBenefitsTitle"
style="@style/SubHeader1"
android:layout_width="250dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginHorizontal="30dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:lineSpacingExtra="4dp"
Expand All @@ -141,10 +184,66 @@

<include layout="@layout/separator_fancy" />

<LinearLayout
android:id="@+id/existing_gem_cap_bonus_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="6dp"
android:paddingVertical="@dimen/spacing_large"
android:gravity="center"
android:visibility="gone">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/extra_gem_cap_left" />

<TextView
android:id="@+id/gem_cap_extra_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:fontFamily="@string/font_family_medium"
android:textColor="@color/white"
android:paddingHorizontal="8dp"/>

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/extra_gem_cap_right" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rescrubscribe_to_pick_up"
android:textSize="15sp"
android:textColor="@color/white"
android:gravity="center"
android:layout_marginBottom="6dp"
android:layout_marginTop="2dp"/>
<ProgressBar
android:id="@+id/extra_gems_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:progressDrawable="@drawable/gem_extra_progress"
android:progress="40"
android:max="50"
android:indeterminate="false"
android:progressTint="@color/green_100"/>
</LinearLayout>

<com.habitrpg.android.habitica.ui.views.subscriptions.SubscriberBenefitView
android:id="@+id/subscriber_benefits"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:paddingHorizontal="6dp" />

<TextView
android:id="@+id/subscribeBenefitsFooter"
Expand Down Expand Up @@ -222,27 +321,52 @@
app:gemCapText="50"
app:recurringText="@string/twelve_months" />

<Button
android:id="@+id/subscribeButton"
style="@style/HabiticaButton"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/subscribe"
android:textColor="@color/brand_100"
android:backgroundTint="@color/yellow_100"
android:textAllCaps="false" />
android:layout_marginTop="8dp">

<com.facebook.shimmer.ShimmerFrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:shimmer_auto_start="true"
app:shimmer_repeat_delay="6000"
app:shimmer_duration="100"
app:shimmer_base_color="@color/yellow_100"
app:shimmer_base_alpha="1.0"
app:shimmer_highlight_alpha="1.0"
app:shimmer_colored="true"
app:shimmer_highlight_color="@color/yellow_400">

<View
style="@style/HabiticaButton"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/button_background" />
</com.facebook.shimmer.ShimmerFrameLayout>

<Button
android:id="@+id/subscribeButton"
style="@style/HabiticaButton.Borderless"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/subscribe"
android:textColor="@color/brand_100"
android:textAllCaps="false" />
</FrameLayout>


<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="13sp"
android:textSize="14sp"
android:textStyle="italic"
android:gravity="center"
android:text="@string/subscribe_title"
android:layout_marginTop="6dp"
android:layout_marginBottom="32dp" />
android:layout_marginBottom="32dp"
android:layout_marginHorizontal="14dp"/>
</LinearLayout>

<include
Expand All @@ -256,8 +380,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/subscription_bg"
android:scaleType="centerCrop"
/>
android:scaleType="centerCrop" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -266,14 +390,25 @@
android:paddingTop="6dp"
android:paddingBottom="32dp"
android:paddingHorizontal="24dp">

<TextView
android:id="@+id/subscription_disclaimer_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textColorLink="@color/yellow_100"
android:textSize="13sp"
android:textStyle="italic"/>
android:textSize="14sp"
android:textStyle="italic" />

<Button
android:id="@+id/see_more_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/see_more_subscription_options"
style="@style/HabiticaButton.Borderless"
android:textColor="@color/yellow_100"
android:visibility="gone"
/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Loading

0 comments on commit c746896

Please sign in to comment.