Skip to content

Commit

Permalink
Android: Add mandatories subscription terms
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <gervais.maxime@gmail.com>
  • Loading branch information
g-maxime committed Apr 2, 2024
1 parent 73c41b3 commit b536289
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class SubscribeActivity : AppCompatActivity() {
.replace("%PRICE%", subscriptionDetails.price)
activitySubscribeBinding.subscriptionDetailText.visibility = View.VISIBLE
activitySubscribeBinding.subscriptionDetailText.gravity = Gravity.CENTER_HORIZONTAL

activitySubscribeBinding.subscriptionConditionText.text = activitySubscribeBinding.subscriptionConditionText.text.toString()
.replace("%PRICE%", subscriptionDetails.price)
activitySubscribeBinding.subscriptionConditionText.visibility = View.VISIBLE
activitySubscribeBinding.subscriptionConditionText.gravity = Gravity.CENTER_HORIZONTAL
})

subscriptionManager.lifetimeDetails.observe (this, Observer {
Expand Down
22 changes: 19 additions & 3 deletions Source/GUI/Android/app/src/main/res/layout/activity_subscribe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@
android:textColor="@android:color/white"
android:background="@color/colorPrimary"
android:layout_gravity="center_horizontal" />

<TextView
android:id="@+id/subscription_detail_text"
android:visibility="invisible"
android:scaleX="0.6"
android:scaleY="0.6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="invisible"
android:scaleX="0.7"
android:scaleY="0.7"
android:text="@string/subscription_detail_text" />
<View
android:layout_width="match_parent"
Expand All @@ -73,4 +74,19 @@
android:textColor="@android:color/white"
android:background="@color/colorPrimary"
android:layout_gravity="center_horizontal" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="?android:attr/listDivider"/>

<TextView
android:id="@+id/subscription_condition_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"

android:scaleX="0.7"
android:scaleY="0.7"
android:text="@string/subscription_condition_text" />
</LinearLayout>
16 changes: 13 additions & 3 deletions Source/GUI/Android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,21 @@
<string name="premium_summary" csv="Premium_Summary">Exclusive features for premium subscribers</string>
<string name="subscribe_title" csv="Subscribe">Subscribe</string>
<string name="subscribe_text" csv="Subscribe">Subscribe</string>
<string name="subscribe_button_text" csv="Subscribe_Button">Subscribe for %PRICE% per year</string>
<string name="lifetime_subscribe_button_text" csv="Lifetime_Subscribe_Button">Lifetime subscription for %PRICE%</string>
<string name="subscribe_button_text" csv="Subscribe_Button" formatted="false">Subscribe for %PRICE% per year</string>
<string name="lifetime_subscribe_button_text" csv="Lifetime_Subscribe_Button" formatted="false">Lifetime subscription for %PRICE%</string>
<string name="subscribed_text" csv="Subscribe_Manage">Manage subscription</string>
<string name="thanks_text" csv="Subscription_Thanks">Subscription detected. Thanks for your support!</string>
<string name="subscription_detail_text" formatted="false" csv="Subscription_Android">Free 3 days trial period.</string>
<string name="subscription_detail_text" csv="Subscription_Android">Free 3 days trial period.</string>
<string name="subscription_condition_text" formatted="false">
3-Day Free Trial Subscription:\n\n
During this trial period, you\'ll have unlimited access to all the premium features.\n\n
Please remind that we currently don\'t provide many premium features, we provide a premium offer here for giving you an easy way to show your support to our open source project.\n\n
Subscription Terms:\n\n
Duration: Your 3-day trial subscription begins as soon as you sign up for the annual subscription for the first time.\n\n
Cost: The price for the subscription is %PRICE%. This amount will be charged to your Google Play account upon the end of the trial period annually unless canceled before the end of the trial period.
Conversion: At the end of the trial period, your subscription will automatically convert to a paid subscription unless canceled before the trial ends.\n\n
Cancellation: You can cancel your subscription at any time during the trial period to avoid being charged. To cancel, simply go to your Google Play Store account settings.\n\n
</string>
<string name="store_text" csv="SupportUs">Support us. Get the dark theme and more features to come.</string>
<string name="clear_text" csv="ClearList">Clear list</string>
<string name="text_output_desc" csv="Text">Text</string>
Expand Down

0 comments on commit b536289

Please sign in to comment.