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() }