Move session restore prompt from message level to conversation level.

This commit is contained in:
Mikunj
2019-12-06 13:00:08 +11:00
parent 0caeb3a109
commit 97ffea040f
20 changed files with 232 additions and 124 deletions

View File

@@ -51,6 +51,13 @@
android:inflatedId="@+id/unverified_banner"
android:layout="@layout/conversation_activity_unverified_banner_stub" />
<ViewStub
android:id="@+id/session_restore_banner_stub"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inflatedId="@+id/session_restore_banner"
android:layout="@layout/conversation_activity_unverified_banner_stub" />
<ViewStub
android:id="@+id/reminder_stub"
android:layout_width="match_parent"

View File

@@ -74,15 +74,6 @@
android:textColor="?conversation_item_update_text_color"
tools:text="30 min ago" />
<Button
android:id="@+id/conversation_update_button"
style="@style/Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Button"
android:visibility="gone" />
</LinearLayout>
</org.thoughtcrime.securesms.conversation.ConversationUpdateItem>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/session_restore_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/core_grey_60"
android:focusable="true"
android:nextFocusDown="@+id/cancel"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingTop="24dp"
android:paddingEnd="8dp"
android:paddingBottom="8dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/restoreTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="@string/session_restore_banner_title" />
<TextView
android:id="@+id/restoreText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="sans-serif-light"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="@string/session_restore_banner_message" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="right"
android:orientation="horizontal">
<Button
android:id="@+id/dismissButton"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:text="@string/session_restore_banner_dismiss_button_title" />
<android.support.v4.widget.Space
android:layout_width="8dp"
android:layout_height="wrap_content" />
<Button
android:id="@+id/restoreButton"
style="@style/Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:text="@string/session_restore_banner_restore_button_title" />
</LinearLayout>
</LinearLayout>

View File

@@ -735,9 +735,7 @@
<!-- MessageDisplayHelper -->
<string name="MessageDisplayHelper_bad_encrypted_message">Bad encrypted message</string>
<string name="MessageDisplayHelper_message_encrypted_for_non_existing_session">Message encrypted for non-existing session</string>
<string name="MessageRecord_session_restore_required">Could not decrypt an incoming message. Would you like to start a new session with %s?</string>
<string name="MessageRecord_session_restore_sent">You have sent a session restore request to %s</string>
<string name="MessageRecord_session_restore_button_title">Restore session</string>
<!-- MmsMessageRecord -->
<string name="MmsMessageRecord_bad_encrypted_mms_message">Bad encrypted MMS message</string>
@@ -1654,5 +1652,9 @@
<!-- Device unlink dialog -->
<string name="dialog_device_unlink_title">Device unlinked</string>
<string name="dialog_device_unlink_message">This device has been successfully unlinked</string>
<!-- Session restore banner -->
<string name="session_restore_banner_title">Could not decrypt an incoming message.</string>
<string name="session_restore_banner_message">Would you like to start a new session with %s?</string>
<string name="session_restore_banner_restore_button_title">Restore session</string>
<string name="session_restore_banner_dismiss_button_title">Dismiss</string>
</resources>