diff --git a/CHANGES.md b/CHANGES.md index 64d041a14c..a4d1976a04 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ Improvements 🙌: - Add a setting to show timestamp for all messages (#2123) - Use cache for user color - Allow using an outdated homeserver, at user's risk (#1972) + - Restore small logo on login screens and fix scrolling issue on those screens Bugfix 🐛: - Long message cannot be sent/takes infinite time & blocks other messages #1397 diff --git a/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt b/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt index 735521fc3c..2a692c2d53 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginActivity.kt @@ -19,10 +19,12 @@ package im.vector.app.features.login import android.content.Context import android.content.Intent import android.view.View +import android.view.ViewGroup import androidx.annotation.CallSuper import androidx.appcompat.app.AlertDialog import androidx.appcompat.widget.Toolbar import androidx.core.view.ViewCompat +import androidx.core.view.children import androidx.core.view.isVisible import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager @@ -72,6 +74,13 @@ open class LoginActivity : VectorBaseActivity(), ToolbarConfigurable, UnlockedAc get() = supportFragmentManager.findFragmentById(R.id.loginFragmentContainer) private val commonOption: (FragmentTransaction) -> Unit = { ft -> + // Find the loginLogo on the current Fragment, this should not return null + (topFragment?.view as? ViewGroup) + // Find findViewById does not work, I do not know why + // findViewById(R.id.loginLogo) + ?.children + ?.firstOrNull { it.id == R.id.loginLogo } + ?.let { ft.addSharedElement(it, ViewCompat.getTransitionName(it) ?: "") } ft.setCustomAnimations(enterAnim, exitAnim, popEnterAnim, popExitAnim) } @@ -136,6 +145,7 @@ open class LoginActivity : VectorBaseActivity(), ToolbarConfigurable, UnlockedAc addFragmentToBackstack(R.id.loginFragmentContainer, LoginServerSelectionFragment::class.java, option = { ft -> + findViewById(R.id.loginSplashLogo)?.let { ft.addSharedElement(it, ViewCompat.getTransitionName(it) ?: "") } findViewById(R.id.loginSplashTitle)?.let { ft.addSharedElement(it, ViewCompat.getTransitionName(it) ?: "") } findViewById(R.id.loginSplashSubmit)?.let { ft.addSharedElement(it, ViewCompat.getTransitionName(it) ?: "") } // TODO Disabled because it provokes a flickering diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt index b6f4e13a91..989fc0aadb 100644 --- a/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt +++ b/vector/src/main/java/im/vector/app/features/signout/soft/SoftLogoutController.kt @@ -28,6 +28,7 @@ import im.vector.app.core.resources.StringProvider import im.vector.app.features.login.LoginMode import im.vector.app.features.signout.soft.epoxy.loginCenterButtonItem import im.vector.app.features.signout.soft.epoxy.loginErrorWithRetryItem +import im.vector.app.features.signout.soft.epoxy.loginHeaderItem import im.vector.app.features.signout.soft.epoxy.loginPasswordFormItem import im.vector.app.features.signout.soft.epoxy.loginRedButtonItem import im.vector.app.features.signout.soft.epoxy.loginTextItem @@ -64,6 +65,9 @@ class SoftLogoutController @Inject constructor( } private fun buildHeader(state: SoftLogoutViewState) { + loginHeaderItem { + id("header") + } loginTitleItem { id("title") text(stringProvider.getString(R.string.soft_logout_title)) diff --git a/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt new file mode 100644 index 0000000000..0ce50b9cdb --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/signout/soft/epoxy/LoginHeaderItem.kt @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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.app.features.signout.soft.epoxy + +import com.airbnb.epoxy.EpoxyModelClass +import im.vector.app.R +import im.vector.app.core.epoxy.VectorEpoxyHolder +import im.vector.app.core.epoxy.VectorEpoxyModel + +@EpoxyModelClass(layout = R.layout.item_login_header) +abstract class LoginHeaderItem : VectorEpoxyModel() { + class Holder : VectorEpoxyHolder() +} diff --git a/vector/src/main/res/drawable/element_logotype.xml b/vector/src/main/res/drawable/element_logotype.xml new file mode 100644 index 0000000000..0419447b32 --- /dev/null +++ b/vector/src/main/res/drawable/element_logotype.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/vector/src/main/res/drawable/element_logotype_combined.xml b/vector/src/main/res/drawable/element_logotype_combined.xml deleted file mode 100644 index 7516bd63e1..0000000000 --- a/vector/src/main/res/drawable/element_logotype_combined.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - diff --git a/vector/src/main/res/layout/activity_signed_out.xml b/vector/src/main/res/layout/activity_signed_out.xml index 20b03a6a2c..cc02625431 100644 --- a/vector/src/main/res/layout/activity_signed_out.xml +++ b/vector/src/main/res/layout/activity_signed_out.xml @@ -1,19 +1,20 @@ - - - + + + - + diff --git a/vector/src/main/res/layout/fragment_login.xml b/vector/src/main/res/layout/fragment_login.xml index 608041ec03..6300d6cb41 100644 --- a/vector/src/main/res/layout/fragment_login.xml +++ b/vector/src/main/res/layout/fragment_login.xml @@ -1,5 +1,5 @@ - - - + - + + + - @@ -120,25 +119,24 @@ style="@style/Style.Vector.Login.Button.Text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/auth_forgot_password" - app:layout_constraintStart_toStartOf="parent" /> + android:layout_gravity="start" + android:text="@string/auth_forgot_password" /> - + - + diff --git a/vector/src/main/res/layout/fragment_login_captcha.xml b/vector/src/main/res/layout/fragment_login_captcha.xml index 259eab8ef9..f106660dde 100644 --- a/vector/src/main/res/layout/fragment_login_captcha.xml +++ b/vector/src/main/res/layout/fragment_login_captcha.xml @@ -1,22 +1,24 @@ - - + android:paddingBottom="16dp"> + + - - + diff --git a/vector/src/main/res/layout/fragment_login_generic_text_input_form.xml b/vector/src/main/res/layout/fragment_login_generic_text_input_form.xml index e87274635d..93b73b7063 100644 --- a/vector/src/main/res/layout/fragment_login_generic_text_input_form.xml +++ b/vector/src/main/res/layout/fragment_login_generic_text_input_form.xml @@ -1,5 +1,5 @@ - - - + - + + + - + diff --git a/vector/src/main/res/layout/fragment_login_reset_password.xml b/vector/src/main/res/layout/fragment_login_reset_password.xml index 098bd047a9..341435bdc4 100644 --- a/vector/src/main/res/layout/fragment_login_reset_password.xml +++ b/vector/src/main/res/layout/fragment_login_reset_password.xml @@ -1,19 +1,18 @@ - - - + - + + + - + diff --git a/vector/src/main/res/layout/fragment_login_reset_password_mail_confirmation.xml b/vector/src/main/res/layout/fragment_login_reset_password_mail_confirmation.xml index 47608b4cec..ef799c134b 100644 --- a/vector/src/main/res/layout/fragment_login_reset_password_mail_confirmation.xml +++ b/vector/src/main/res/layout/fragment_login_reset_password_mail_confirmation.xml @@ -1,18 +1,17 @@ - - - + - + + + - + diff --git a/vector/src/main/res/layout/fragment_login_reset_password_success.xml b/vector/src/main/res/layout/fragment_login_reset_password_success.xml index 6d013db7d2..805f1c2c2c 100644 --- a/vector/src/main/res/layout/fragment_login_reset_password_success.xml +++ b/vector/src/main/res/layout/fragment_login_reset_password_success.xml @@ -1,18 +1,17 @@ - - - + - + + + - + diff --git a/vector/src/main/res/layout/fragment_login_server_selection.xml b/vector/src/main/res/layout/fragment_login_server_selection.xml index 3917dd72dd..00fcfa9183 100644 --- a/vector/src/main/res/layout/fragment_login_server_selection.xml +++ b/vector/src/main/res/layout/fragment_login_server_selection.xml @@ -1,30 +1,33 @@ - - - + - + + + + app:layout_constraintTop_toBottomOf="@id/loginLogo" /> - + diff --git a/vector/src/main/res/layout/fragment_login_server_url_form.xml b/vector/src/main/res/layout/fragment_login_server_url_form.xml index cb0dae4171..94f724b12a 100644 --- a/vector/src/main/res/layout/fragment_login_server_url_form.xml +++ b/vector/src/main/res/layout/fragment_login_server_url_form.xml @@ -1,5 +1,5 @@ - - - + - + + + - + diff --git a/vector/src/main/res/layout/fragment_login_signup_signin_selection.xml b/vector/src/main/res/layout/fragment_login_signup_signin_selection.xml index 222a2afc4f..c0efe15074 100644 --- a/vector/src/main/res/layout/fragment_login_signup_signin_selection.xml +++ b/vector/src/main/res/layout/fragment_login_signup_signin_selection.xml @@ -1,27 +1,32 @@ - - - + + + @@ -79,5 +84,5 @@ - + diff --git a/vector/src/main/res/layout/fragment_login_splash.xml b/vector/src/main/res/layout/fragment_login_splash.xml index 237db2dd4e..2a43ece5ec 100644 --- a/vector/src/main/res/layout/fragment_login_splash.xml +++ b/vector/src/main/res/layout/fragment_login_splash.xml @@ -18,18 +18,29 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + + - - + + + app:layout_constraintTop_toBottomOf="@id/loginLogo" /> - + diff --git a/vector/src/main/res/layout/fragment_login_wait_for_email.xml b/vector/src/main/res/layout/fragment_login_wait_for_email.xml index 159fe30917..1d904a93da 100644 --- a/vector/src/main/res/layout/fragment_login_wait_for_email.xml +++ b/vector/src/main/res/layout/fragment_login_wait_for_email.xml @@ -1,19 +1,18 @@ - - - + - + + + - + diff --git a/vector/src/main/res/layout/item_login_header.xml b/vector/src/main/res/layout/item_login_header.xml new file mode 100644 index 0000000000..d033c4f9f9 --- /dev/null +++ b/vector/src/main/res/layout/item_login_header.xml @@ -0,0 +1,9 @@ + + diff --git a/vector/src/main/res/values-land/styles_login.xml b/vector/src/main/res/values-land/styles_login.xml deleted file mode 100644 index d781ec5f1e..0000000000 --- a/vector/src/main/res/values-land/styles_login.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/vector/src/main/res/values/styles_login.xml b/vector/src/main/res/values/styles_login.xml index c5180384a8..6dab3fac51 100644 --- a/vector/src/main/res/values/styles_login.xml +++ b/vector/src/main/res/values/styles_login.xml @@ -8,35 +8,40 @@ 36dp + + + - - -