From 5f9baee927e36e143185e2f6acfa12756a5747f9 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 10 Jun 2021 14:11:25 +0200 Subject: [PATCH 01/20] Fix some spelling errors --- vector/src/main/res/values-es/strings.xml | 4 ++-- vector/src/main/res/values-hu/strings.xml | 8 ++++---- vector/src/main/res/values-pt-rBR/strings.xml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vector/src/main/res/values-es/strings.xml b/vector/src/main/res/values-es/strings.xml index 4dc18d5b86..5e5b4727e6 100644 --- a/vector/src/main/res/values-es/strings.xml +++ b/vector/src/main/res/values-es/strings.xml @@ -2725,7 +2725,7 @@ Por favor permite el acceso en la próxima ventana emergente para descubrir usua Salir de la conferencia actual y cambiar a otra\? Lo siento, un error ha ocurrido cuando se intentaba unir a la conferencia Configuración de acceso desconocido (%s) - Publicar esta sala publicamente en el directorio de salas %1$s\? + Publicar esta sala públicamente en el directorio de salas %1$s\? Permitir que invitados se unan Quitar publicación de esta dirección No se puede recibir la visibilidad actual de esta sala (%1$s). @@ -2759,7 +2759,7 @@ Por favor permite el acceso en la próxima ventana emergente para descubrir usua Direcciones de la Sala Direcciones de la sala Acceso a la sala - No puedes hacer eso desde ${app_name} movil + No puedes hacer eso desde ${app_name} móvil Siempre preguntar Espacios mostrar todas las salas en el directorio de salas, incluyendo salas con contenido explícito. diff --git a/vector/src/main/res/values-hu/strings.xml b/vector/src/main/res/values-hu/strings.xml index a2ac2c93aa..838ed7860f 100644 --- a/vector/src/main/res/values-hu/strings.xml +++ b/vector/src/main/res/values-hu/strings.xml @@ -2416,7 +2416,7 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró Push tesztelése Ellenőrizd, hogy rákattintottál arra a hivatkozásra amit e-mailben küldtünk neked. %s törlése\? - Titkosított szobákban való keresés egyenlőre nem támogatott. + Titkosított szobákban való keresés egyelőre nem támogatott. Kitiltott felhasználók szűrése Téma megváltoztatása Szoba fejlesztése @@ -2469,7 +2469,7 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró \nNincs jogosultságod szobák hozzáadásához. Ezen a Téren nincsenek szobák További információért vedd fel a kapcsolatot a matrix szerver adminisztrátorával - Úgy látszik a matrix szervered nem támogatja egyenlőre a Tereket + Úgy látszik a matrix szervered nem támogatja egyelőre a Tereket Szeretsz kísérletezni\? \nTereket adhatsz terekhez. Kísérleti tér - Csak árvák mutatása a Kezdőlapon @@ -2506,7 +2506,7 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró Belépés mindenképpen Belépés a Térbe Tér készítése - Kihagy egyenlőre + Kihagy egyelőre Csatlakozz a Teremhez %1$s %2$s Nem lesznek a részesei ennek: %s Csak ehhez a szobához @@ -2515,7 +2515,7 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró Megosztás hivatkozás Meghívás felhasználónévvel Meghívás e-maillel - Egyenlőre csak te vagy itt, %s még jobb lehet másokkal együtt. + Egyelőre csak te vagy itt, %s még jobb lehet másokkal együtt. Meghívó ide: %s Emberek meghívása a teredbe Személyek meghívása diff --git a/vector/src/main/res/values-pt-rBR/strings.xml b/vector/src/main/res/values-pt-rBR/strings.xml index 7b4a6a60ff..15b383649f 100644 --- a/vector/src/main/res/values-pt-rBR/strings.xml +++ b/vector/src/main/res/values-pt-rBR/strings.xml @@ -2068,8 +2068,8 @@ \nA confirmação vai ser salvada localmente e compartilhada numa versão futura do app. Salas recentes Outras salas - Envia a dada mensagem colorida como um arcoíris - Envia o dado emote colorido como um arcoíris + Envia a dada mensagem colorida como um arco-íris + Envia o dado emote colorido como um arco-íris Timeline Editor de mensagem Ativar encriptação ponta-a-ponta… From e91b09ca44525854fdab46e058390344f1f60dff Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 10 Jun 2021 14:30:53 +0200 Subject: [PATCH 02/20] Restore Onuray's code: do not allow to send blank text --- .../features/home/room/detail/RoomDetailFragment.kt | 2 +- .../home/room/detail/composer/ComposerEditText.kt | 10 +++++----- .../home/room/detail/composer/TextComposerView.kt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 9ed4feebc4..0d4fcc31b5 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -1189,7 +1189,7 @@ class RoomDetailFragment @Inject constructor( return sendUri(contentUri) } - override fun onTextEmptyStateChanged(isEmpty: Boolean) { + override fun onTextBlankStateChanged(isBlank: Boolean) { // No op } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt index 2a2ae56c4c..79ff7be441 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt @@ -37,11 +37,11 @@ class ComposerEditText @JvmOverloads constructor(context: Context, attrs: Attrib interface Callback { fun onRichContentSelected(contentUri: Uri): Boolean - fun onTextEmptyStateChanged(isEmpty: Boolean) + fun onTextBlankStateChanged(isBlank: Boolean) } var callback: Callback? = null - private var isEmptyText = true + private var isBlankText = true override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? { val ic = super.onCreateInputConnection(editorInfo) ?: return null @@ -96,9 +96,9 @@ class ComposerEditText @JvmOverloads constructor(context: Context, attrs: Attrib spanToRemove = null } // Report blank status of EditText to be able to arrange other elements of the composer - if (s.isEmpty() != isEmptyText) { - isEmptyText = !isEmptyText - callback?.onTextEmptyStateChanged(isEmptyText) + if (s.isBlank() != isBlankText) { + isBlankText = !isBlankText + callback?.onTextBlankStateChanged(isBlankText) } } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt index d5e24dbb6b..96d592fe4b 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt @@ -70,8 +70,8 @@ class TextComposerView @JvmOverloads constructor( return callback?.onRichContentSelected(contentUri) ?: false } - override fun onTextEmptyStateChanged(isEmpty: Boolean) { - views.sendButton.isVisible = currentConstraintSetId == R.layout.composer_layout_constraint_set_expanded || !isEmpty + override fun onTextBlankStateChanged(isBlank: Boolean) { + views.sendButton.isVisible = currentConstraintSetId == R.layout.composer_layout_constraint_set_expanded || !isBlank } } views.composerRelatedMessageCloseButton.setOnClickListener { From 3f4e80992b7323ac8363563c627dab88c83335a0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 10 Jun 2021 14:55:17 +0200 Subject: [PATCH 03/20] Animate the transition (faster than default), and ensure the callback is called, even if it's a no-op --- .../home/room/detail/composer/TextComposerView.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt index 96d592fe4b..fa5e736c1c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerView.kt @@ -25,6 +25,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.core.text.toSpannable import androidx.core.view.isVisible +import androidx.transition.AutoTransition import androidx.transition.ChangeBounds import androidx.transition.Fade import androidx.transition.Transition @@ -35,7 +36,6 @@ import im.vector.app.databinding.ComposerLayoutBinding /** * Encapsulate the timeline composer UX. - * */ class TextComposerView @JvmOverloads constructor( context: Context, @@ -71,7 +71,15 @@ class TextComposerView @JvmOverloads constructor( } override fun onTextBlankStateChanged(isBlank: Boolean) { - views.sendButton.isVisible = currentConstraintSetId == R.layout.composer_layout_constraint_set_expanded || !isBlank + callback?.onTextBlankStateChanged(isBlank) + val shouldBeVisible = currentConstraintSetId == R.layout.composer_layout_constraint_set_expanded || !isBlank + if (views.sendButton.isVisible != shouldBeVisible) { + TransitionManager.beginDelayedTransition( + this@TextComposerView, + AutoTransition().also { it.duration = 150 } + ) + views.sendButton.isVisible = shouldBeVisible + } } } views.composerRelatedMessageCloseButton.setOnClickListener { From 0ccd8ba071c15656cafcebdd9788ddf39bcbb40c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 10 Jun 2021 15:36:26 +0200 Subject: [PATCH 04/20] Configure the toolbar in the debug activity --- .../debug/DebugMaterialThemeActivity.kt | 6 + .../layout/activity_test_material_theme.xml | 741 +++++++++--------- 2 files changed, 382 insertions(+), 365 deletions(-) diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt index de6b981c02..3378740eea 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt @@ -33,6 +33,12 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { val views = ActivityTestMaterialThemeBinding.inflate(layoutInflater) setContentView(views.root) + setSupportActionBar(views.debugToolbar) + supportActionBar?.let { + it.setDisplayShowHomeEnabled(true) + it.setDisplayHomeAsUpEnabled(true) + } + views.debugShowSnackbar.setOnClickListener { Snackbar.make(views.coordinatorLayout, "Snackbar!", Snackbar.LENGTH_SHORT) .setAction("Action") { } diff --git a/vector/src/debug/res/layout/activity_test_material_theme.xml b/vector/src/debug/res/layout/activity_test_material_theme.xml index 2ec23a4b31..c2baded7f2 100644 --- a/vector/src/debug/res/layout/activity_test_material_theme.xml +++ b/vector/src/debug/res/layout/activity_test_material_theme.xml @@ -8,437 +8,448 @@ tools:context=".features.debug.DebugMaterialThemeActivity" tools:ignore="HardcodedText"> - - + app:layout_constraintTop_toTopOf="parent" + app:subtitle="Toolbar Subtitle" + app:title="Toolbar Title" /> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:hint="OutlinedBox"> - + - + - + android:hint="OutlinedBox.Dense"> - + + + - - - + android:hint="FilledBox"> - + - + - + android:hint="FilledBox.Dense"> - + - - -