From 46cd827e951ec1ea546f0f7fff347f5336868fd0 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Thu, 7 Dec 2023 17:44:58 +0100 Subject: [PATCH] Hide quick-access to matrix.org account registration for Play Store New Play Store guidelines require easy account deletion links etc. when the app provides a way to create accounts. For SchildiChat, we do not provide any homeservers for users, which is hard to teach the Google Play Store testers. Accordingly, require users to enter their homeserver themselves. Note that entering matrix.org in the "Custom server" picker will lead you to the same UX like previously checking the existing box. Change-Id: I93d313e22dc18b4c1b7469cd4a7e9761c5b6ee5f --- .../src/main/java/im/vector/app/core/resources/BuildMeta.kt | 3 +++ .../app/features/login/LoginServerSelectionFragment.kt | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/vector/src/main/java/im/vector/app/core/resources/BuildMeta.kt b/vector/src/main/java/im/vector/app/core/resources/BuildMeta.kt index 9f6cbf29cb..7dc2f350c5 100644 --- a/vector/src/main/java/im/vector/app/core/resources/BuildMeta.kt +++ b/vector/src/main/java/im/vector/app/core/resources/BuildMeta.kt @@ -30,4 +30,7 @@ data class BuildMeta( val flavorShortDescription: String, ) { val isInternalBuild: Boolean = BuildConfig.DEBUG || gitBranchName == "sm_fdroid" + // Play Store has some annoying forms to fill out if we have all features, like easy-access to registering an account at matrix.org. + // Accordingly, we want to disable some features for releases that go to the Play Store, while keeping them in all fdroid-based releases. + val isPlayStoreBuild: Boolean = "gplay" in gitBranchName } diff --git a/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt index 0813957e99..83823e4b7a 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginServerSelectionFragment.kt @@ -20,11 +20,14 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.view.isVisible import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R +import im.vector.app.core.resources.BuildMeta import im.vector.app.core.utils.openUrlInChromeCustomTab import im.vector.app.databinding.FragmentLoginServerSelectionBinding import me.gujun.android.span.span +import javax.inject.Inject /** * In this screen, the user will choose between matrix.org, modular or other type of homeserver. @@ -33,6 +36,8 @@ import me.gujun.android.span.span class LoginServerSelectionFragment : AbstractLoginFragment() { + @Inject lateinit var buildMeta: BuildMeta + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginServerSelectionBinding { return FragmentLoginServerSelectionBinding.inflate(inflater, container, false) } @@ -47,6 +52,7 @@ class LoginServerSelectionFragment : private fun initViews() { views.loginServerChoiceEmsLearnMore.debouncedClicks { learnMore() } views.loginServerChoiceMatrixOrg.debouncedClicks { selectMatrixOrg() } + views.loginServerChoiceMatrixOrg.isVisible = !buildMeta.isPlayStoreBuild views.loginServerChoiceEms.debouncedClicks { selectEMS() } views.loginServerChoiceOther.debouncedClicks { selectOther() } views.loginServerIKnowMyIdSubmit.debouncedClicks { loginWithMatrixId() }