Skip to content

Commit 1bd13fa

Browse files
committed
Widen subscription and lifetime click targets to the whole row
1 parent d4969ae commit 1bd13fa

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

presentation/src/main/java/org/cryptomator/presentation/ui/layout/LicenseContentViewBinder.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class LicenseContentViewBinder(
3030
binding.purchaseOptionsGroup.visibility = View.VISIBLE
3131
binding.tvRestorePurchase.visibility = View.VISIBLE
3232
binding.legalLinksGroup.visibility = View.VISIBLE
33+
binding.rowSubscription.isEnabled = false
3334
binding.btnSubscription.isEnabled = false
35+
binding.rowLifetime.isEnabled = false
3436
binding.btnLifetime.isEnabled = false
3537
}
3638

@@ -72,10 +74,10 @@ class LicenseContentViewBinder(
7274
onTrialClicked: () -> Unit
7375
) {
7476
binding.btnTrial.setOnClickListener { onTrialClicked() }
75-
binding.btnSubscription.setOnClickListener {
77+
binding.rowSubscription.setOnClickListener {
7678
app.launchPurchaseFlow(WeakReference(activity), ProductInfo.PRODUCT_YEARLY_SUBSCRIPTION)
7779
}
78-
binding.btnLifetime.setOnClickListener {
80+
binding.rowLifetime.setOnClickListener {
7981
app.launchPurchaseFlow(WeakReference(activity), ProductInfo.PRODUCT_FULL_VERSION)
8082
}
8183
binding.tvRestorePurchase.setOnClickListener {
@@ -105,10 +107,12 @@ class LicenseContentViewBinder(
105107
fun bindProductPrices(subscriptionPrice: String?, lifetimePrice: String?) {
106108
if (!subscriptionPrice.isNullOrEmpty()) {
107109
binding.btnSubscription.text = subscriptionPrice
110+
binding.rowSubscription.isEnabled = true
108111
binding.btnSubscription.isEnabled = true
109112
}
110113
if (!lifetimePrice.isNullOrEmpty()) {
111114
binding.btnLifetime.text = lifetimePrice
115+
binding.rowLifetime.isEnabled = true
112116
binding.btnLifetime.isEnabled = true
113117
}
114118
}

presentation/src/main/res/layout/view_license_check_content.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@
235235
android:id="@+id/rowSubscription"
236236
android:layout_width="match_parent"
237237
android:layout_height="wrap_content"
238+
android:background="?android:attr/selectableItemBackground"
239+
android:clickable="true"
240+
android:focusable="true"
238241
android:gravity="center_vertical"
239242
android:orientation="horizontal"
240243
android:paddingVertical="12dp">
@@ -250,6 +253,7 @@
250253
<LinearLayout
251254
android:layout_width="wrap_content"
252255
android:layout_height="wrap_content"
256+
android:duplicateParentState="true"
253257
android:gravity="center"
254258
android:orientation="vertical">
255259

@@ -258,6 +262,9 @@
258262
style="@style/Widget.Material3.Button.TonalButton"
259263
android:layout_width="wrap_content"
260264
android:layout_height="36dp"
265+
android:clickable="false"
266+
android:duplicateParentState="true"
267+
android:focusable="false"
261268
android:insetTop="0dp"
262269
android:insetBottom="0dp"
263270
android:minWidth="85dp"
@@ -284,6 +291,9 @@
284291
android:id="@+id/rowLifetime"
285292
android:layout_width="match_parent"
286293
android:layout_height="wrap_content"
294+
android:background="?android:attr/selectableItemBackground"
295+
android:clickable="true"
296+
android:focusable="true"
287297
android:gravity="center_vertical"
288298
android:orientation="horizontal"
289299
android:paddingVertical="12dp">
@@ -299,6 +309,7 @@
299309
<LinearLayout
300310
android:layout_width="wrap_content"
301311
android:layout_height="wrap_content"
312+
android:duplicateParentState="true"
302313
android:gravity="center"
303314
android:orientation="vertical">
304315

@@ -307,6 +318,9 @@
307318
style="@style/Widget.Material3.Button.TonalButton"
308319
android:layout_width="wrap_content"
309320
android:layout_height="36dp"
321+
android:clickable="false"
322+
android:duplicateParentState="true"
323+
android:focusable="false"
310324
android:insetTop="0dp"
311325
android:insetBottom="0dp"
312326
android:minWidth="85dp"

0 commit comments

Comments
 (0)