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
This commit is contained in:
SpiritCroc 2023-12-07 17:44:58 +01:00
parent 2ddb0fd252
commit 46cd827e95
2 changed files with 9 additions and 0 deletions

View File

@ -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
}

View File

@ -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<FragmentLoginServerSelectionBinding>() {
@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() }