Add support for view-once messages.

This commit is contained in:
Greyson Parrelli
2019-06-11 02:18:45 -04:00
parent 9f7bb69341
commit c77809fa90
80 changed files with 1803 additions and 148 deletions

View File

@@ -153,6 +153,16 @@
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
<ViewStub
android:id="@+id/revealable_view_stub"
android:layout="@layout/conversation_item_received_revealable"
android:layout_width="148dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/message_bubble_top_padding"
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/conversation_item_body"
android:layout_width="wrap_content"

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.revealable.RevealableMessageView
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/revealable_view"
android:layout_width="148dp"
android:layout_height="wrap_content"
android:visibility="gone"
app:revealable_unopenedForegroundColor="?conversation_item_received_text_primary_color"
app:revealable_openedForegroundColor="?conversation_item_sent_text_primary_color"
tools:visibility="visible"/>

View File

@@ -94,6 +94,16 @@
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
<ViewStub
android:id="@+id/revealable_view_stub"
android:layout="@layout/conversation_item_sent_revealable"
android:layout_width="148dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/message_bubble_top_padding"
android:layout_marginBottom="@dimen/message_bubble_collapsed_footer_padding"
android:layout_marginStart="@dimen/message_bubble_horizontal_padding"
android:layout_marginEnd="@dimen/message_bubble_horizontal_padding" />
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/conversation_item_body"
android:layout_width="wrap_content"

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.revealable.RevealableMessageView
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/revealable_view"
android:layout_width="148dp"
android:layout_height="wrap_content"
android:visibility="gone"
app:revealable_unopenedForegroundColor="?conversation_item_sent_text_primary_color"
app:revealable_openedForegroundColor="?conversation_item_sent_text_primary_color"
tools:visibility="visible"/>

View File

@@ -60,6 +60,15 @@
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/mediasend_reveal_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:layout_marginBottom="4dp"
android:layout_gravity="bottom"
tools:src="@drawable/ic_view_infinite_32" />
<LinearLayout
android:id="@+id/mediasend_compose_container"

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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"
android:background="@color/core_black">
<ImageView
android:id="@+id/reveal_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"/>
<ImageView
android:id="@+id/reveal_close_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="19dp"
android:layout_marginStart="19dp"
android:tint="@color/core_white"
app:srcCompat="@drawable/ic_x"/>
</FrameLayout>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:parentTag="android.widget.LinearLayout">
<FrameLayout
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_gravity="center_vertical">
<ImageView
android:id="@+id/revealable_icon"
android:layout_width="24dp"
android:layout_height="24dp"
tools:src="@drawable/ic_play_solid_24"/>
<com.pnikosis.materialishprogress.ProgressWheel
android:id="@+id/revealable_progress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:matProg_barColor="@color/core_white"
app:matProg_rimColor="@color/transparent"
app:matProg_linearProgress="true"
app:matProg_spinSpeed="0.2"
app:matProg_barWidth="2dp"
app:matProg_rimWidth="2dp"
app:matProg_circleRadius="24dp"
tools:visibility="visible"/>
</FrameLayout>
<TextView
android:id="@+id/revealable_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
style="@style/Signal.Text.Preview"
android:fontFamily="sans-serif-medium"
android:maxLines="2"
android:ellipsize="end"
tools:text="@string/RevealableMessageView_view_photo" />
</merge>