Tweak purchase page designs

This commit is contained in:
Phillip Thelen 2019-10-15 18:22:54 +02:00
parent c83720056d
commit e904d37db6
8 changed files with 35 additions and 22 deletions

View file

@ -149,7 +149,7 @@ android {
multiDexEnabled true
resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW"
versionCode 2261
versionCode 2263
versionName "2.2"
}

View file

@ -79,7 +79,6 @@
android:layout_weight="1"
app:gemAmount="4"
app:gemDrawable="@drawable/gems_4"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
/>
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
@ -104,7 +103,6 @@
android:layout_weight="1"
app:gemAmount="42"
app:gemDrawable="@drawable/gems_42"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp" />
<com.habitrpg.android.habitica.ui.GemPurchaseOptionsView
android:id="@+id/gems_84_view"
@ -115,6 +113,15 @@
app:gemDrawable="@drawable/gems_84" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/gift_gems_disclaimer"
android:gravity="center"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_large"
style="@style/Caption2"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View file

@ -5,7 +5,8 @@
android:layout_height="match_parent"
android:scrollbarSize="3dp"
android:scrollbarThumbVertical="@color/scrollbarThumb"
android:scrollbars="vertical">
android:scrollbars="vertical"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -125,6 +126,7 @@
android:textColor="@color/gray_300"
android:text="@string/gems_gift_description"
android:gravity="center_horizontal"
style="@style/Body2"
android:layout_marginLeft="@dimen/spacing_large"
android:layout_marginRight="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"/>
@ -137,20 +139,22 @@
android:textColor="?colorAccent"
android:textAllCaps="false"/>
<TextView android:id="@+id/supportTextView"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingBottom="20dp"
android:layout_marginTop="16dp"
android:text="@string/gem_purchase_title"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textColor="@color/blue_10"
android:textSize="14sp"
android:lineSpacingExtra="4dp" />
</LinearLayout>
<TextView android:id="@+id/supportTextView"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="41dp"
android:paddingRight="41dp"
android:paddingBottom="14dp"
android:paddingTop="14dp"
android:text="@string/gem_purchase_title"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textColor="@color/gray_200"
android:textSize="14sp"
android:lineSpacingExtra="4dp"
android:background="@color/gray_700"
android:drawablePadding="@dimen/spacing_medium"/>
<com.habitrpg.android.habitica.ui.views.promo.SubscriptionBuyGemsPromoView
android:id="@+id/subscription_promo"

View file

@ -309,14 +309,15 @@
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:paddingBottom="20dp"
android:paddingBottom="16dp"
android:text="@string/subscribe_title"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textColor="@color/gray_300"
android:textSize="14sp"
android:lineSpacingExtra="4dp"
android:layout_marginTop="16dp"/>
android:layout_marginTop="16dp"
android:drawablePadding="@dimen/spacing_medium"/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -855,4 +855,5 @@
<string name="profile_gift_gems">Gift\nGems</string>
<string name="profile_gift_subscription">Gift\nSubscription</string>
<string name="gems_gift_description">Want to bestow a shiny haul of Gems to someone else?</string>
<string name="gift_gems_disclaimer">Habitica will never require you to gift gems to other players. Begging people for gems is a violation of the Community Guidelines and should be reported to admin@habitica.com.</string>
</resources>

View file

@ -112,7 +112,7 @@ class GiftSubscriptionActivity : BaseActivity() {
purchaseHandler?.startListening()
purchaseHandler?.getAllGiftSubscriptionProducts {
//skus = it.skus
skus = it.skus
for (sku in it.skus) {
updateButtonLabel(sku, sku.price, it)
}

View file

@ -67,7 +67,7 @@ class GemsPurchaseFragment : BaseFragment(), GemPurchaseActivity.CheckoutFragmen
gems84View?.setOnPurchaseClickListener(View.OnClickListener { purchaseGems(PurchaseTypes.Purchase84Gems) })
val heartDrawable = BitmapDrawable(resources, HabiticaIconsHelper.imageOfHeartLarge())
supportTextView?.setCompoundDrawables(null, null, null, heartDrawable)
supportTextView?.setCompoundDrawablesWithIntrinsicBounds(null, null, null, heartDrawable)
compositeSubscription.add(userRepository.getUser().subscribe(Consumer {
subscriptionPromoView?.visibility = if (it.isSubscribed) View.GONE else View.VISIBLE

View file

@ -119,7 +119,7 @@ class SubscriptionFragment : BaseFragment(), GemPurchaseActivity.CheckoutFragmen
this.subscribeListitem4Box?.setOnClickListener { toggleDescriptionView(this.subscribeListitem4Button, this.subscribeListItem4Description) }
val heartDrawable = BitmapDrawable(resources, HabiticaIconsHelper.imageOfHeartLarge())
supportTextView?.setCompoundDrawables(null, null, null, heartDrawable)
supportTextView?.setCompoundDrawablesWithIntrinsicBounds(null, null, null, heartDrawable)
subscribeButton.setOnClickListener { subscribeUser() }