Visually note quotes for messages you don't have.

We will now show a small footer under quotes for messages that you
don't have locally.

Also fixes #7850
This commit is contained in:
Greyson Parrelli
2018-08-11 09:55:52 -04:00
parent 4d565990c9
commit 13c72779af
21 changed files with 241 additions and 135 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

View File

@@ -11,133 +11,167 @@
tools:visibility="visible">
<LinearLayout
android:id="@+id/quote_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/quote_bar"
android:layout_width="@dimen/quote_corner_radius_bottom"
android:layout_height="match_parent"
android:src="@color/white"
tools:tint="@color/purple_400" />
android:orientation="vertical">
<LinearLayout
android:layout_width="0dp"
android:id="@+id/quote_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
android:layout_weight="1">
android:orientation="horizontal">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/quote_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Signal.Text.Caption"
android:textColor="@color/core_black"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
tools:text="Peter Parker" />
<ImageView
android:id="@+id/quote_bar"
android:layout_width="@dimen/quote_corner_radius_bottom"
android:layout_height="match_parent"
android:src="@color/white"
tools:tint="@color/purple_400" />
<LinearLayout
android:id="@+id/quote_attachment_container"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:visibility="gone"
tools:visibility="visible">
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:layout_width="27dp"
android:layout_height="35dp"
android:layout_marginRight="4dp"
android:layout_marginEnd="4dp"
android:paddingLeft="-4dp"
android:paddingStart="-4dp"
android:src="?attr/attachment_document_icon_small" />
<TextView
android:id="@+id/quote_attachment_name"
android:layout_width="match_parent"
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/quote_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Signal.Text.Body"
android:textColor="@color/core_light_90"
style="@style/Signal.Text.Caption"
android:textColor="@color/core_black"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
tools:text="The-Amazing-Spider-Man.cba" />
tools:text="Peter Parker" />
<LinearLayout
android:id="@+id/quote_attachment_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:layout_width="27dp"
android:layout_height="35dp"
android:layout_marginRight="4dp"
android:layout_marginEnd="4dp"
android:paddingLeft="-4dp"
android:paddingStart="-4dp"
android:src="?attr/attachment_document_icon_small" />
<TextView
android:id="@+id/quote_attachment_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Signal.Text.Body"
android:textColor="@color/core_light_90"
android:maxLines="1"
android:ellipsize="end"
tools:text="The-Amazing-Spider-Man.cba" />
</LinearLayout>
<TextView
android:id="@+id/media_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
style="@style/Signal.Text.Caption"
android:textColor="@color/core_light_90"
android:paddingTop="4dp"
android:textStyle="italic"
android:visibility="gone"
tools:text="Photo"
tools:visibility="visible" />
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/quote_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Signal.Text.Body"
android:ellipsize="end"
android:maxLines="2"
tools:text="With great power comes great responsibility."
tools:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/media_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
style="@style/Signal.Text.Caption"
android:textColor="@color/core_light_90"
android:paddingTop="4dp"
android:textStyle="italic"
android:visibility="gone"
tools:text="Photo"
tools:visibility="visible" />
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/quote_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Signal.Text.Body"
android:ellipsize="end"
android:maxLines="2"
tools:text="With great power comes great responsibility."
tools:visibility="visible" />
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/quote_thumbnail"
android:layout_width="60dp"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:visibility="gone"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/quote_video_overlay"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@drawable/circle_white"
android:layout_gravity="center"
android:longClickable="false"
android:visibility="gone"
tools:visibility="visible">
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:layout_width="13dp"
android:layout_height="16dp"
android:layout_marginLeft="11dp"
android:layout_marginStart="11dp"
android:layout_marginTop="8dp"
android:tint="@color/core_blue"
android:scaleType="fitXY"
app:srcCompat="@drawable/triangle_right" />
android:id="@+id/quote_thumbnail"
android:layout_width="60dp"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:visibility="gone"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/quote_video_overlay"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@drawable/circle_white"
android:layout_gravity="center"
android:longClickable="false"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:layout_width="13dp"
android:layout_height="16dp"
android:layout_marginLeft="11dp"
android:layout_marginStart="11dp"
android:layout_marginTop="8dp"
android:tint="@color/core_blue"
android:scaleType="fitXY"
app:srcCompat="@drawable/triangle_right" />
</FrameLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/quote_missing_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:src="@drawable/ic_broken_link"
android:tint="?attr/quote_missing_icon_color"/>
<TextView
android:id="@+id/quote_missing_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Signal.Text.Caption"
android:text="@string/QuoteView_original_missing"
android:textColor="@color/core_light_90"/>
</LinearLayout>
</LinearLayout>

View File

@@ -127,6 +127,8 @@
<attr name="pref_divider" format="reference" />
<attr name="quote_missing_icon_color" format="color" />
<declare-styleable name="CustomDefaultPreference">
<attr name="custom_pref_toggle" format="string"/>
</declare-styleable>

View File

@@ -29,6 +29,7 @@
<color name="transparent_black_30">#30000000</color>
<color name="transparent_black_40">#40000000</color>
<color name="transparent_black_70">#70000000</color>
<color name="transparent_black_90">#90000000</color>
<color name="transparent_white_05">#05ffffff</color>
<color name="transparent_white_10">#10ffffff</color>
@@ -38,6 +39,7 @@
<color name="transparent_white_60">#60ffffff</color>
<color name="transparent_white_70">#70ffffff</color>
<color name="transparent_white_aa">#aaffffff</color>
<color name="transparent_white_bb">#bbffffff</color>
<color name="transparent_white_dd">#ddffffff</color>
<color name="conversation_compose_divider">#32000000</color>

View File

@@ -204,7 +204,8 @@
<string name="ConversationFragment_sms">SMS</string>
<string name="ConversationFragment_deleting">Deleting</string>
<string name="ConversationFragment_deleting_messages">Deleting messages...</string>
<string name="ConversationFragment_quoted_message_not_found">Quoted message not found</string>
<string name="ConversationFragment_quoted_message_not_found">Original message not found</string>
<string name="ConversationFragment_quoted_message_no_longer_available">Original message no longer available</string>
<!-- ConversationListActivity -->
<string name="ConversationListActivity_there_is_no_browser_installed_on_your_device">There is no browser installed on your device.</string>
@@ -793,6 +794,7 @@
<string name="QuoteView_photo">Photo</string>
<string name="QuoteView_document">Document</string>
<string name="QuoteView_you">You</string>
<string name="QuoteView_original_missing">Original message not found</string>
<!-- conversation_fragment -->
<string name="conversation_fragment__scroll_to_the_bottom_content_description">Scroll to the bottom</string>

View File

@@ -243,6 +243,8 @@
<item name="pref_divider">@drawable/preference_divider_light</item>
<item name="quote_missing_icon_color">@color/core_light_60</item>
<item name="group_members_dialog_icon">@drawable/ic_group_grey600_24dp</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
@@ -386,6 +388,8 @@
<item name="pref_divider">@drawable/preference_divider_dark</item>
<item name="quote_missing_icon_color">@color/core_dark_05</item>
<item name="group_members_dialog_icon">@drawable/ic_group_white_24dp</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
<item name="search_toolbar_background">@color/black</item>