From b93456ef9e58941341bf33b51ae18b29a4407f21 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Fri, 27 May 2022 14:48:26 +0200 Subject: [PATCH] Open the purchase site when clicking on the link in UpdateLicenseDialog Fixes #444 --- .../presentation/ui/dialog/UpdateLicenseDialog.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/dialog/UpdateLicenseDialog.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/dialog/UpdateLicenseDialog.kt index 58dee01e..dcc76bbe 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/dialog/UpdateLicenseDialog.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/dialog/UpdateLicenseDialog.kt @@ -1,6 +1,8 @@ package org.cryptomator.presentation.ui.dialog import android.content.DialogInterface +import android.content.Intent +import android.net.Uri import android.os.Bundle import android.view.View import android.widget.Button @@ -11,6 +13,7 @@ import org.cryptomator.presentation.ui.layout.ObscuredAwareDialogCoordinatorLayo import org.cryptomator.util.SharedPreferencesHandler import kotlinx.android.synthetic.main.dialog_enter_license.dssialogRootView import kotlinx.android.synthetic.main.dialog_enter_license.et_license +import kotlinx.android.synthetic.main.dialog_enter_license.tv_message @Dialog(R.layout.dialog_enter_license) class UpdateLicenseDialog : BaseProgressErrorDialog() { @@ -38,6 +41,12 @@ class UpdateLicenseDialog : BaseProgressErrorDialog et_license.nextFocusForwardId = button.id } + tv_message?.setOnClickListener { + Intent(Intent.ACTION_VIEW).let { + it.data = Uri.parse("https://cryptomator.org/android/") + startActivity(it) + } + } } /* need to manually handle this in case of dialogs as otherwise the onFilterTouchEventForSecurity method of the ViewGroup