mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Fix modular link to EMS
This commit is contained in:
parent
a488e88f93
commit
35fe4f7268
9 changed files with 27 additions and 27 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
package im.vector.riotx.features.login
|
||||
|
||||
const val MODULAR_LINK = "https://modular.im/services/matrix-hosting-riot" +
|
||||
"?utm_source=riot-x-android" +
|
||||
const val EMS_LINK = "https://element.io/matrix-services" +
|
||||
"?utm_source=element-android" +
|
||||
"&utm_medium=native" +
|
||||
"&utm_campaign=riot-x-android-authentication"
|
||||
"&utm_campaign=element-android-authentication"
|
||||
|
|
|
@ -231,7 +231,7 @@ open class LoginActivity : VectorBaseActivity(), ToolbarConfigurable {
|
|||
private fun onServerSelectionDone(loginViewEvents: LoginViewEvents.OnServerSelectionDone) {
|
||||
when (loginViewEvents.serverType) {
|
||||
ServerType.MatrixOrg -> Unit // In this case, we wait for the login flow
|
||||
ServerType.Modular,
|
||||
ServerType.EMS,
|
||||
ServerType.Other -> addFragmentToBackstack(R.id.loginFragmentContainer,
|
||||
LoginServerUrlFormFragment::class.java,
|
||||
option = commonOption)
|
||||
|
|
|
@ -155,7 +155,7 @@ class LoginFragment @Inject constructor() : AbstractLoginFragment() {
|
|||
loginTitle.text = getString(resId, state.homeServerUrl.toReducedUrl())
|
||||
loginNotice.text = getString(R.string.login_server_matrix_org_text)
|
||||
}
|
||||
ServerType.Modular -> {
|
||||
ServerType.EMS -> {
|
||||
loginServerIcon.isVisible = true
|
||||
loginServerIcon.setImageResource(R.drawable.ic_logo_element_matrix_services)
|
||||
loginTitle.text = getString(resId, "Element Matrix Services")
|
||||
|
|
|
@ -43,15 +43,15 @@ class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment
|
|||
}
|
||||
|
||||
private fun initTextViews() {
|
||||
loginServerChoiceModularLearnMore.text = span {
|
||||
loginServerChoiceEMSLearnMore.text = span {
|
||||
text = getString(R.string.login_server_modular_learn_more)
|
||||
textDecorationLine = "underline"
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerChoiceModularLearnMore)
|
||||
@OnClick(R.id.loginServerChoiceEMSLearnMore)
|
||||
fun learnMore() {
|
||||
openUrlInChromeCustomTab(requireActivity(), null, MODULAR_LINK)
|
||||
openUrlInChromeCustomTab(requireActivity(), null, EMS_LINK)
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerChoiceMatrixOrg)
|
||||
|
@ -59,9 +59,9 @@ class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment
|
|||
loginViewModel.handle(LoginAction.UpdateServerType(ServerType.MatrixOrg))
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerChoiceModular)
|
||||
fun selectModular() {
|
||||
loginViewModel.handle(LoginAction.UpdateServerType(ServerType.Modular))
|
||||
@OnClick(R.id.loginServerChoiceEMS)
|
||||
fun selectEMS() {
|
||||
loginViewModel.handle(LoginAction.UpdateServerType(ServerType.EMS))
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerChoiceOther)
|
||||
|
|
|
@ -62,7 +62,7 @@ class LoginServerUrlFormFragment @Inject constructor() : AbstractLoginFragment()
|
|||
|
||||
private fun setupUi(state: LoginViewState) {
|
||||
when (state.serverType) {
|
||||
ServerType.Modular -> {
|
||||
ServerType.EMS -> {
|
||||
loginServerUrlFormIcon.isVisible = true
|
||||
loginServerUrlFormTitle.text = getString(R.string.login_connect_to_modular)
|
||||
loginServerUrlFormText.text = getString(R.string.login_server_url_form_modular_text)
|
||||
|
@ -70,7 +70,7 @@ class LoginServerUrlFormFragment @Inject constructor() : AbstractLoginFragment()
|
|||
loginServerUrlFormHomeServerUrlTil.hint = getText(R.string.login_server_url_form_modular_hint)
|
||||
loginServerUrlFormNotice.text = getString(R.string.login_server_url_form_common_notice)
|
||||
}
|
||||
else -> {
|
||||
else -> {
|
||||
loginServerUrlFormIcon.isVisible = false
|
||||
loginServerUrlFormTitle.text = getString(R.string.login_server_other_title)
|
||||
loginServerUrlFormText.text = getString(R.string.login_connect_to_a_custom_server)
|
||||
|
@ -83,7 +83,7 @@ class LoginServerUrlFormFragment @Inject constructor() : AbstractLoginFragment()
|
|||
|
||||
@OnClick(R.id.loginServerUrlFormLearnMore)
|
||||
fun learnMore() {
|
||||
openUrlInChromeCustomTab(requireActivity(), null, MODULAR_LINK)
|
||||
openUrlInChromeCustomTab(requireActivity(), null, EMS_LINK)
|
||||
}
|
||||
|
||||
override fun resetViewModel() {
|
||||
|
|
|
@ -38,7 +38,7 @@ open class LoginSignUpSignInSelectionFragment @Inject constructor() : AbstractLo
|
|||
loginSignupSigninTitle.text = getString(R.string.login_connect_to, state.homeServerUrl.toReducedUrl())
|
||||
loginSignupSigninText.text = getString(R.string.login_server_matrix_org_text)
|
||||
}
|
||||
ServerType.Modular -> {
|
||||
ServerType.EMS -> {
|
||||
loginSignupSigninServerIcon.setImageResource(R.drawable.ic_logo_element_matrix_services)
|
||||
loginSignupSigninServerIcon.isVisible = true
|
||||
loginSignupSigninTitle.text = getString(R.string.login_connect_to_modular)
|
||||
|
|
|
@ -410,7 +410,7 @@ class LoginViewModel @AssistedInject constructor(
|
|||
ServerType.MatrixOrg ->
|
||||
// Request login flow here
|
||||
handle(LoginAction.UpdateHomeServer(matrixOrgUrl))
|
||||
ServerType.Modular,
|
||||
ServerType.EMS,
|
||||
ServerType.Other -> _viewEvents.post(LoginViewEvents.OnServerSelectionDone(action.serverType))
|
||||
}.exhaustive
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@ package im.vector.riotx.features.login
|
|||
enum class ServerType {
|
||||
Unknown,
|
||||
MatrixOrg,
|
||||
Modular,
|
||||
EMS,
|
||||
Other
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
</im.vector.riotx.core.platform.CheckableConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/loginServerChoiceModular"
|
||||
android:id="@+id/loginServerChoiceEMS"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/layout_vertical_margin"
|
||||
|
@ -100,19 +100,19 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceMatrixOrg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/loginServerChoiceModularIcon"
|
||||
android:id="@+id/loginServerChoiceEMSIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_logo_element_matrix_services"
|
||||
android:tint="?riotx_text_primary"
|
||||
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceModularText"
|
||||
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceEMSText"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loginServerChoiceModularText"
|
||||
android:id="@+id/loginServerChoiceEMSText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
|
@ -120,21 +120,21 @@
|
|||
android:text="@string/login_server_modular_text"
|
||||
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/loginServerChoiceModularLearnMore"
|
||||
app:layout_constraintEnd_toStartOf="@+id/loginServerChoiceEMSLearnMore"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceModularIcon" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceEMSIcon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loginServerChoiceModularLearnMore"
|
||||
android:id="@+id/loginServerChoiceEMSLearnMore"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:text="@string/login_server_modular_learn_more"
|
||||
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
||||
android:textColor="@color/riotx_accent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/loginServerChoiceModularText"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/loginServerChoiceEMSText"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/loginServerChoiceModularText" />
|
||||
app:layout_constraintTop_toTopOf="@+id/loginServerChoiceEMSText" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@ -150,7 +150,7 @@
|
|||
android:paddingEnd="@dimen/layout_horizontal_margin"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceModular">
|
||||
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceEMS">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loginServerChoiceOtherTitle"
|
||||
|
|
Loading…
Reference in a new issue