Keys backup: migrate settings to Epoxy and MvRx

This commit is contained in:
Benoit Marty
2019-06-12 13:09:32 +02:00
parent 53dd9c3427
commit b47ef9220e
25 changed files with 672 additions and 539 deletions

View File

@ -46,8 +46,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputLayout
style="@style/VectorTextInputLayout"

View File

@ -66,6 +66,7 @@
android:layout_height="@dimen/layout_touch_size"
android:background="?attr/selectableItemBackground"
android:scaleType="center"
android:layout_marginTop="8dp"
android:src="@drawable/ic_eye_black"
android:tint="?colorAccent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
<com.airbnb.epoxy.EpoxyRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/keys_backup_settings_recycler_view"
android:id="@+id/keysBackupSettingsRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"

View File

@ -51,6 +51,7 @@
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_margin="16dp"
android:maxWidth="@dimen/button_max_width"
android:minWidth="200dp"
android:padding="8dp"
android:text="@string/keys_backup_setup"

View File

@ -72,6 +72,7 @@
android:id="@+id/keys_backup_view_show_password"
android:layout_width="@dimen/layout_touch_size"
android:layout_height="@dimen/layout_touch_size"
android:layout_marginTop="8dp"
android:background="?attr/selectableItemBackground"
android:scaleType="center"
android:src="@drawable/ic_eye_black"
@ -145,6 +146,8 @@
style="@style/VectorButtonStyleFlat"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="@dimen/layout_vertical_margin"
android:maxWidth="@dimen/button_max_width"
android:text="@string/keys_backup_setup_step2_skip_button_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -46,7 +46,7 @@
android:layout_marginRight="@dimen/layout_horizontal_margin"
android:text="@string/keys_backup_setup_step3_text_line1"
android:textAlignment="center"
android:textColor="?riotx_text_secondary"
android:textColor="?riotx_text_primary"
android:textSize="15sp" />
<TextView
@ -80,6 +80,7 @@
android:id="@+id/keys_backup_setup_step3_copy_button"
style="@style/VectorButtonStyleFlat"
android:layout_gravity="center"
android:maxWidth="@dimen/button_max_width"
android:text="@string/keys_backup_setup_step3_copy_button_title" />
<com.google.android.material.button.MaterialButton

View File

@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_generic_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/colorBackground"
@ -9,22 +10,26 @@
<TextView
android:id="@+id/item_generic_title_text"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_marginBottom="4dp"
android:textColor="?riotx_text_primary"
android:textStyle="bold"
android:visibility="gone"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toTopOf="@+id/item_generic_description_text"
app:layout_constraintEnd_toStartOf="@+id/item_generic_barrier"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Item Title"
tools:textSize="14sp" />
tools:textSize="14sp"
tools:visibility="visible" />
<TextView
android:id="@+id/item_generic_description_text"
@ -32,10 +37,10 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_marginBottom="4dp"
android:textColor="?riotx_text_secondary"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/item_generic_action_button"
@ -49,6 +54,7 @@
android:id="@+id/item_generic_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="start"
app:constraint_referenced_ids="item_generic_accessory_image,item_generic_progress_bar"
tools:ignore="MissingConstraints" />
@ -76,17 +82,20 @@
app:layout_constraintTop_toTopOf="@+id/item_generic_title_text"
tools:visibility="visible" />
<!-- Set a maw width because the text can be long -->
<com.google.android.material.button.MaterialButton
android:id="@+id/item_generic_action_button"
style="@style/VectorButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:padding="8dp"
android:maxWidth="@dimen/button_max_width"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/item_generic_description_text"
app:layout_constraintEnd_toStartOf="@+id/item_generic_barrier"
app:layout_constraintTop_toBottomOf="@+id/item_generic_description_text"
tools:text="@string/settings_troubleshoot_test_device_settings_quickfix"
tools:visibility="visible" />

View File

@ -5,15 +5,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:orientation="vertical">
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/keys_backup_settings_footer_button1"
style="@style/VectorButtonStyle"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:minWidth="200dp"
android:layout_width="@dimen/button_max_width"
android:visibility="gone"
tools:text="@string/keys_backup_settings_restore_backup_button"
tools:visibility="visible" />
@ -21,10 +19,8 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/keys_backup_settings_footer_button2"
style="@style/VectorButtonStyle"
android:layout_width="@dimen/button_max_width"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:minWidth="200dp"
android:visibility="gone"
app:backgroundTint="@color/vector_warning_color"
tools:text="@string/keys_backup_settings_delete_backup_button"

View File

@ -30,4 +30,7 @@
<dimen name="item_form_min_height">76dp</dimen>
<!-- Max width for some buttons -->
<dimen name="button_max_width">280dp</dimen>
</resources>

View File

@ -51,4 +51,7 @@
<string name="create_room_directory_title">"Room Directory"</string>
<string name="create_room_directory_description">"Publish this room in the room directory"</string>
<string name="keys_backup_unable_to_get_trust_info">"An error occurred getting trust info"</string>
<string name="keys_backup_unable_to_get_keys_backup_data">"An error occurred getting keys backup data"</string>
</resources>