mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Login screens: server selection
This commit is contained in:
parent
bdfc4ad8a7
commit
fa6a9cab7e
@ -3,6 +3,7 @@
|
|||||||
<words>
|
<words>
|
||||||
<w>backstack</w>
|
<w>backstack</w>
|
||||||
<w>bytearray</w>
|
<w>bytearray</w>
|
||||||
|
<w>checkables</w>
|
||||||
<w>ciphertext</w>
|
<w>ciphertext</w>
|
||||||
<w>coroutine</w>
|
<w>coroutine</w>
|
||||||
<w>decryptor</w>
|
<w>decryptor</w>
|
||||||
|
@ -24,4 +24,5 @@ sealed class LoginAction : VectorViewModelAction {
|
|||||||
data class Login(val login: String, val password: String) : LoginAction()
|
data class Login(val login: String, val password: String) : LoginAction()
|
||||||
data class SsoLoginSuccess(val credentials: Credentials) : LoginAction()
|
data class SsoLoginSuccess(val credentials: Credentials) : LoginAction()
|
||||||
data class InitWith(val loginConfig: LoginConfig) : LoginAction()
|
data class InitWith(val loginConfig: LoginConfig) : LoginAction()
|
||||||
|
data class UpdateServerType(val serverType: ServerType) : LoginAction()
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import android.content.Intent
|
|||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import com.airbnb.mvrx.Success
|
import com.airbnb.mvrx.Success
|
||||||
import com.airbnb.mvrx.viewModel
|
import com.airbnb.mvrx.viewModel
|
||||||
|
import com.airbnb.mvrx.withState
|
||||||
import im.vector.riotx.R
|
import im.vector.riotx.R
|
||||||
import im.vector.riotx.core.di.ScreenComponent
|
import im.vector.riotx.core.di.ScreenComponent
|
||||||
import im.vector.riotx.core.extensions.addFragment
|
import im.vector.riotx.core.extensions.addFragment
|
||||||
@ -58,9 +59,10 @@ class LoginActivity : VectorBaseActivity() {
|
|||||||
loginSharedActionViewModel.observe()
|
loginSharedActionViewModel.observe()
|
||||||
.subscribe {
|
.subscribe {
|
||||||
when (it) {
|
when (it) {
|
||||||
is LoginNavigation.OpenServerSelection -> addFragmentToBackstack(R.id.simpleFragmentContainer, LoginFragment::class.java)
|
is LoginNavigation.OpenServerSelection -> addFragmentToBackstack(R.id.simpleFragmentContainer, LoginServerSelectionFragment::class.java)
|
||||||
is LoginNavigation.OpenSsoLoginFallback -> addFragmentToBackstack(R.id.simpleFragmentContainer, LoginSsoFallbackFragment::class.java)
|
is LoginNavigation.OnServerSelectionDone -> onServerSelectionDone()
|
||||||
is LoginNavigation.GoBack -> supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
is LoginNavigation.OpenSsoLoginFallback -> addFragmentToBackstack(R.id.simpleFragmentContainer, LoginSsoFallbackFragment::class.java)
|
||||||
|
is LoginNavigation.GoBack -> supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.disposeOnDestroy()
|
.disposeOnDestroy()
|
||||||
@ -74,6 +76,14 @@ class LoginActivity : VectorBaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun onServerSelectionDone() = withState(loginViewModel) {
|
||||||
|
when (it.serverType) {
|
||||||
|
ServerType.MatrixOrg -> addFragmentToBackstack(R.id.simpleFragmentContainer, LoginSignUpSignInSelectionFragment::class.java)
|
||||||
|
ServerType.Modular,
|
||||||
|
ServerType.Other -> addFragmentToBackstack(R.id.simpleFragmentContainer, LoginEnterHomeServerFragment::class.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import im.vector.riotx.core.platform.VectorSharedAction
|
|||||||
// Supported navigation actions for LoginActivity
|
// Supported navigation actions for LoginActivity
|
||||||
sealed class LoginNavigation : VectorSharedAction {
|
sealed class LoginNavigation : VectorSharedAction {
|
||||||
object OpenServerSelection : LoginNavigation()
|
object OpenServerSelection : LoginNavigation()
|
||||||
|
object OnServerSelectionDone : LoginNavigation()
|
||||||
object OpenSsoLoginFallback : LoginNavigation()
|
object OpenSsoLoginFallback : LoginNavigation()
|
||||||
object GoBack : LoginNavigation()
|
object GoBack : LoginNavigation()
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package im.vector.riotx.features.login
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import butterknife.OnClick
|
||||||
|
import com.airbnb.mvrx.withState
|
||||||
|
import im.vector.riotx.R
|
||||||
|
import kotlinx.android.synthetic.main.fragment_login_server_selection.*
|
||||||
|
import me.gujun.android.span.span
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment() {
|
||||||
|
|
||||||
|
override fun getLayoutResId() = R.layout.fragment_login_server_selection
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
initTextViews()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateSelectedChoice(serverType: ServerType) {
|
||||||
|
loginServerChoiceMatrixOrg.isChecked = serverType == ServerType.MatrixOrg
|
||||||
|
loginServerChoiceModular.isChecked = serverType == ServerType.Modular
|
||||||
|
loginServerChoiceOther.isChecked = serverType == ServerType.Other
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initTextViews() {
|
||||||
|
loginServerChoiceModularLearnMore.text = span {
|
||||||
|
text = getString(R.string.login_server_modular_learn_more)
|
||||||
|
textDecorationLine = "underline"
|
||||||
|
onClick = {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.loginServerChoiceMatrixOrg)
|
||||||
|
fun selectMatrixOrg() {
|
||||||
|
viewModel.handle(LoginAction.UpdateServerType(ServerType.MatrixOrg))
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.loginServerChoiceModular)
|
||||||
|
fun selectModular() {
|
||||||
|
viewModel.handle(LoginAction.UpdateServerType(ServerType.Modular))
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.loginServerChoiceOther)
|
||||||
|
fun selectOther() {
|
||||||
|
viewModel.handle(LoginAction.UpdateServerType(ServerType.Other))
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.loginServerSubmit)
|
||||||
|
fun submit() {
|
||||||
|
loginSharedActionViewModel.post(LoginNavigation.OnServerSelectionDone)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun invalidate() = withState(viewModel) {
|
||||||
|
updateSelectedChoice(it.serverType)
|
||||||
|
}
|
||||||
|
}
|
@ -62,6 +62,7 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi
|
|||||||
|
|
||||||
override fun handle(action: LoginAction) {
|
override fun handle(action: LoginAction) {
|
||||||
when (action) {
|
when (action) {
|
||||||
|
is LoginAction.UpdateServerType -> handleUpdateServerType(action)
|
||||||
is LoginAction.InitWith -> handleInitWith(action)
|
is LoginAction.InitWith -> handleInitWith(action)
|
||||||
is LoginAction.UpdateHomeServer -> handleUpdateHomeserver(action)
|
is LoginAction.UpdateHomeServer -> handleUpdateHomeserver(action)
|
||||||
is LoginAction.Login -> handleLogin(action)
|
is LoginAction.Login -> handleLogin(action)
|
||||||
@ -69,6 +70,14 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun handleUpdateServerType(action: LoginAction.UpdateServerType) {
|
||||||
|
setState {
|
||||||
|
copy(
|
||||||
|
serverType = action.serverType
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun handleInitWith(action: LoginAction.InitWith) {
|
private fun handleInitWith(action: LoginAction.InitWith) {
|
||||||
loginConfig = action.loginConfig
|
loginConfig = action.loginConfig
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import com.airbnb.mvrx.MvRxState
|
|||||||
import com.airbnb.mvrx.Uninitialized
|
import com.airbnb.mvrx.Uninitialized
|
||||||
|
|
||||||
data class LoginViewState(
|
data class LoginViewState(
|
||||||
|
val serverType: ServerType = ServerType.MatrixOrg,
|
||||||
val asyncLoginAction: Async<Unit> = Uninitialized,
|
val asyncLoginAction: Async<Unit> = Uninitialized,
|
||||||
val asyncHomeServerLoginFlowRequest: Async<LoginMode> = Uninitialized
|
val asyncHomeServerLoginFlowRequest: Async<LoginMode> = Uninitialized
|
||||||
) : MvRxState
|
) : MvRxState
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package im.vector.riotx.features.login
|
||||||
|
|
||||||
|
enum class ServerType {
|
||||||
|
MatrixOrg,
|
||||||
|
Modular,
|
||||||
|
Other
|
||||||
|
}
|
12
vector/src/main/res/drawable/bg_login_server.xml
Normal file
12
vector/src/main/res/drawable/bg_login_server.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:width="1.2dp"
|
||||||
|
android:color="#E7E7E7" />
|
||||||
|
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
|
||||||
|
</shape>
|
12
vector/src/main/res/drawable/bg_login_server_checked.xml
Normal file
12
vector/src/main/res/drawable/bg_login_server_checked.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:width="1.2dp"
|
||||||
|
android:color="@color/riotx_accent" />
|
||||||
|
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
|
||||||
|
</shape>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:drawable="@drawable/bg_login_server_checked" android:state_checked="true" />
|
||||||
|
|
||||||
|
<item android:drawable="@drawable/bg_login_server" />
|
||||||
|
|
||||||
|
</selector>
|
34
vector/src/main/res/drawable/ic_logo_modular.xml
Normal file
34
vector/src/main/res/drawable/ic_logo_modular.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="83dp"
|
||||||
|
android:height="14dp"
|
||||||
|
android:viewportWidth="83"
|
||||||
|
android:viewportHeight="14">
|
||||||
|
<path
|
||||||
|
android:pathData="M21.722,11.239V4.628h1.93v0.739c0.355,-0.584 1.182,-0.973 1.93,-0.973 0.946,0 1.655,0.39 1.97,1.05 0.513,-0.738 1.182,-1.05 2.088,-1.05 1.26,0 2.482,0.74 2.482,2.528V11.2h-1.97V7.389c0,-0.622 -0.354,-1.128 -1.063,-1.128 -0.71,0 -1.103,0.545 -1.103,1.128V11.2h-2.01V7.389c0,-0.622 -0.354,-1.128 -1.063,-1.128s-1.103,0.545 -1.103,1.128V11.2h-2.088v0.039z"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="evenOdd"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M41.459,7.933c0,2.061 -1.537,3.5 -3.546,3.5 -1.97,0 -3.545,-1.477 -3.545,-3.5 0,-2.06 1.575,-3.5 3.545,-3.5 2.01,0 3.546,1.478 3.546,3.5m-2.049,0c0,-1.127 -0.709,-1.633 -1.497,-1.633 -0.748,0 -1.497,0.506 -1.497,1.633 0,1.09 0.749,1.634 1.497,1.634 0.788,0.039 1.497,-0.506 1.497,-1.634"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M57.807,10.578c-0.354,0.583 -1.103,0.816 -1.773,0.816 -1.615,0 -2.52,-1.166 -2.52,-2.566V4.667h2.048V8.4c0,0.622 0.354,1.128 1.063,1.128 0.67,0 1.103,-0.467 1.103,-1.128V4.667h2.049v5.405c0,0.584 0.04,1.09 0.079,1.167h-1.97c-0.04,-0.117 -0.079,-0.467 -0.079,-0.661"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="evenOdd"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M72.068,10.383c-0.315,0.623 -0.985,1.05 -1.812,1.05 -1.97,0 -3.31,-1.477 -3.31,-3.5 0,-1.944 1.261,-3.46 3.27,-3.46 1.182,0 1.734,0.66 1.852,0.971v-0.777h1.97v5.405c0,0.622 0.039,1.05 0.039,1.167h-1.97c-0.04,-0.156 -0.04,-0.506 -0.04,-0.778v-0.078zM70.531,9.683c0.828,0 1.537,-0.622 1.537,-1.75 0,-1.127 -0.67,-1.75 -1.537,-1.75 -0.866,0 -1.536,0.584 -1.536,1.75 0,1.09 0.71,1.75 1.536,1.75zM80.97,4.55c0.75,0 1.34,0.583 1.34,1.322 0,0.74 -0.59,1.284 -1.34,1.284 -0.748,0 -1.3,-0.584 -1.3,-1.284 0,-0.778 0.552,-1.322 1.3,-1.322zM78.922,11.239h-2.048L76.874,4.628h2.048v6.61z"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M62.573,2.644h2.048v8.633h-2.048z"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="evenOdd"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M50.716,2.644h-2.009v2.528c-0.158,-0.233 -0.67,-0.66 -1.812,-0.66 -1.891,0 -3.23,1.477 -3.23,3.421 0,2.023 1.418,3.461 3.309,3.461 0.788,0 1.497,-0.35 1.772,-0.777 0,0.272 0.04,0.544 0.04,0.622h1.97c0,-0.156 -0.04,-0.583 -0.04,-1.167V2.644zM47.21,9.606c-0.788,0 -1.497,-0.545 -1.497,-1.634s0.71,-1.633 1.497,-1.633c0.788,0 1.497,0.544 1.497,1.633 0,1.05 -0.709,1.634 -1.497,1.634z"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="nonZero"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M16.374,1.233L14.346,0.09l-2.028,1.142 -0.016,11.534 2.044,1.157 2.028,-1.141zM4.189,7L2.145,5.859 0.117,7v5.767l2.044,1.157 2.028,-1.157zM8.245,8.157l3.035,-1.72V4.124L9.252,2.983l-1.007,0.593 -4.072,-2.328L2.145,0.09 0.117,1.248v2.298l8.128,4.61"
|
||||||
|
android:fillColor="#2E2F32"
|
||||||
|
android:fillType="evenOdd"/>
|
||||||
|
</vector>
|
197
vector/src/main/res/layout/fragment_login_server_selection.xml
Normal file
197
vector/src/main/res/layout/fragment_login_server_selection.xml
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="36dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:layout_marginEnd="36dp"
|
||||||
|
android:layout_marginBottom="32dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/loginServerLogo"
|
||||||
|
style="@style/LoginTopIcon"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerTitle"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="84dp"
|
||||||
|
android:text="@string/login_server_title"
|
||||||
|
android:textAppearance="@style/TextAppearance.Vector.Login.Title"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerLogo" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerText"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_vertical_margin"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/login_server_text"
|
||||||
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerTitle" />
|
||||||
|
|
||||||
|
<im.vector.riotx.core.platform.CheckableConstraintLayout
|
||||||
|
android:id="@+id/loginServerChoiceMatrixOrg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:background="@drawable/bg_login_server_selector"
|
||||||
|
android:minHeight="80dp"
|
||||||
|
android:paddingStart="@dimen/layout_horizontal_margin"
|
||||||
|
android:paddingEnd="@dimen/layout_horizontal_margin"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerText">
|
||||||
|
|
||||||
|
<!-- TODO Icon -->
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/loginServerChoiceMatrixOrgIcon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_settings_x"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceMatrixOrgText"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerChoiceMatrixOrgText"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/login_server_matrix_org_text"
|
||||||
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceMatrixOrgIcon" />
|
||||||
|
|
||||||
|
</im.vector.riotx.core.platform.CheckableConstraintLayout>
|
||||||
|
|
||||||
|
<im.vector.riotx.core.platform.CheckableConstraintLayout
|
||||||
|
android:id="@+id/loginServerChoiceModular"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_vertical_margin"
|
||||||
|
android:background="@drawable/bg_login_server_selector"
|
||||||
|
android:minHeight="80dp"
|
||||||
|
android:paddingStart="@dimen/layout_horizontal_margin"
|
||||||
|
android:paddingEnd="@dimen/layout_horizontal_margin"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceMatrixOrg">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/loginServerChoiceModularIcon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_logo_modular"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceModularText"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerChoiceModularText"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/login_server_matrix_org_text"
|
||||||
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/loginServerChoiceModularLearnMore"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceModularIcon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerChoiceModularLearnMore"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
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_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/loginServerChoiceModularText" />
|
||||||
|
|
||||||
|
</im.vector.riotx.core.platform.CheckableConstraintLayout>
|
||||||
|
|
||||||
|
<im.vector.riotx.core.platform.CheckableConstraintLayout
|
||||||
|
android:id="@+id/loginServerChoiceOther"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/layout_vertical_margin"
|
||||||
|
android:background="@drawable/bg_login_server_selector"
|
||||||
|
android:minHeight="80dp"
|
||||||
|
android:paddingStart="@dimen/layout_horizontal_margin"
|
||||||
|
android:paddingEnd="@dimen/layout_horizontal_margin"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceModular">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerChoiceOtherTitle"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/login_server_other_title"
|
||||||
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
||||||
|
android:textColor="?riotx_text_primary"
|
||||||
|
android:textSize="16sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/loginServerChoiceOtherText"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/loginServerChoiceOtherText"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/login_server_other_text"
|
||||||
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text.Small"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceOtherTitle" />
|
||||||
|
|
||||||
|
</im.vector.riotx.core.platform.CheckableConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatButton
|
||||||
|
android:id="@+id/loginServerSubmit"
|
||||||
|
style="@style/Style.Vector.Login.Button"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:text="@string/login_server_submit"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginServerChoiceOther" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
@ -25,9 +25,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
android:text="@string/login_splash_title"
|
android:text="@string/login_splash_title"
|
||||||
android:textColor="?riotx_text_primary"
|
android:textAppearance="@style/TextAppearance.Vector.Login.Title"
|
||||||
android:textSize="20sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginSplashText1"
|
app:layout_constraintBottom_toTopOf="@+id/loginSplashText1"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginSplashLogo" />
|
app:layout_constraintTop_toBottomOf="@+id/loginSplashLogo" />
|
||||||
@ -51,8 +49,7 @@
|
|||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:text="@string/login_splash_text1"
|
android:text="@string/login_splash_text1"
|
||||||
android:textColor="?vctr_notice_secondary"
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
||||||
android:textSize="16sp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginSplashText2"
|
app:layout_constraintBottom_toTopOf="@+id/loginSplashText2"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/loginSplashPicto1"
|
app:layout_constraintStart_toEndOf="@id/loginSplashPicto1"
|
||||||
@ -76,8 +73,7 @@
|
|||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:text="@string/login_splash_text2"
|
android:text="@string/login_splash_text2"
|
||||||
android:textColor="?vctr_notice_secondary"
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
||||||
android:textSize="16sp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/loginSplashText3"
|
app:layout_constraintBottom_toTopOf="@id/loginSplashText3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/loginSplashPicto2"
|
app:layout_constraintStart_toEndOf="@id/loginSplashPicto2"
|
||||||
@ -100,9 +96,8 @@
|
|||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:text="@string/login_splash_text1"
|
android:text="@string/login_splash_text3"
|
||||||
android:textColor="?vctr_notice_secondary"
|
android:textAppearance="@style/TextAppearance.Vector.Login.Text"
|
||||||
android:textSize="16sp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginSplashSubmit"
|
app:layout_constraintBottom_toTopOf="@+id/loginSplashSubmit"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/loginSplashPicto3"
|
app:layout_constraintStart_toEndOf="@id/loginSplashPicto3"
|
||||||
@ -110,7 +105,7 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<androidx.appcompat.widget.AppCompatButton
|
||||||
android:id="@+id/loginSplashSubmit"
|
android:id="@+id/loginSplashSubmit"
|
||||||
style="@style/VectorButtonStyle"
|
style="@style/Style.Vector.Login.Button"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
|
@ -29,4 +29,14 @@
|
|||||||
<string name="login_splash_text3">Extend & customise your experience</string>
|
<string name="login_splash_text3">Extend & customise your experience</string>
|
||||||
<string name="login_splash_submit">Get started</string>
|
<string name="login_splash_submit">Get started</string>
|
||||||
|
|
||||||
|
<string name="login_server_title">Select a server</string>
|
||||||
|
<string name="login_server_text">Just like email, accounts have one home, although you can talk to anyone</string>
|
||||||
|
<string name="login_server_matrix_org_text">Join millions free on the largest public server</string>
|
||||||
|
<string name="login_server_modular_text">Premium hosting for organisations</string>
|
||||||
|
<string name="login_server_modular_learn_more">Learn more</string>
|
||||||
|
<string name="login_server_other_title">Other</string>
|
||||||
|
<string name="login_server_other_text">Custom & advanced settings</string>
|
||||||
|
<string name="login_server_submit">Continue</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
14
vector/src/main/res/values/styles_login.xml
Normal file
14
vector/src/main/res/values/styles_login.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="LoginTopIcon">
|
||||||
|
<item name="android:layout_width">60dp</item>
|
||||||
|
<item name="android:layout_height">60dp</item>
|
||||||
|
<item name="android:src">@drawable/riotx_logo</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Style.Vector.Login.Button" parent="VectorButtonStyle">
|
||||||
|
<item name="android:textAllCaps">false</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
@ -37,4 +37,23 @@
|
|||||||
<item name="android:textColor">?riotx_text_secondary</item>
|
<item name="android:textColor">?riotx_text_secondary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.Vector.Login.Title" parent="TextAppearance.AppCompat">
|
||||||
|
<item name="android:textSize">20sp</item>
|
||||||
|
<item name="android:fontFamily">sans-serif-medium</item>
|
||||||
|
<item name="android:textStyle">bold</item>
|
||||||
|
<item name="android:textColor">?riotx_text_primary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.Vector.Login.Text" parent="TextAppearance.AppCompat">
|
||||||
|
<item name="android:textSize">16sp</item>
|
||||||
|
<item name="android:fontFamily">sans-serif</item>
|
||||||
|
<item name="android:textStyle">normal</item>
|
||||||
|
<item name="android:textColor">?vctr_notice_secondary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.Vector.Login.Text.Small">
|
||||||
|
<item name="android:textSize">12sp</item>
|
||||||
|
<item name="android:textColor">?riotx_android_secondary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user