Properly set the document download icon tint.

This commit is contained in:
Greyson Parrelli 2018-10-16 10:58:19 -07:00
parent e1f572e1f4
commit 7cadb0d35a
6 changed files with 10 additions and 2 deletions

View File

@ -9,4 +9,5 @@
android:visibility="gone"
app:doc_titleColor="?conversation_item_received_text_primary_color"
app:doc_captionColor="?conversation_item_received_text_secondary_color"
app:doc_downloadButtonTint="@color/core_white"
tools:visibility="visible"/>

View File

@ -9,4 +9,5 @@
android:visibility="gone"
app:doc_titleColor="?conversation_item_sent_text_primary_color"
app:doc_captionColor="?conversation_item_sent_text_secondary_color"
app:doc_downloadButtonTint="?conversation_item_sent_download_icon_color"
tools:visibility="visible"/>

View File

@ -77,7 +77,6 @@
android:visibility="gone"
android:background="@drawable/circle_touch_highlight_background"
android:src="@drawable/ic_download_circle_fill_white_48dp"
android:tint="@color/core_grey_60"
android:contentDescription="@string/audio_view__download_accessibility_description"/>
</org.thoughtcrime.securesms.components.AnimatingToggle>

View File

@ -76,6 +76,7 @@
<attr name="conversation_item_sent_text_indicator_tab_color" format="reference|color"/>
<attr name="conversation_item_sent_indicator_text_background" format="reference" />
<attr name="conversation_item_sent_icon_color" format="color" />
<attr name="conversation_item_sent_download_icon_color" format="reference|color"/>
<attr name="conversation_item_update_text_color" format="reference"/>
<attr name="conversation_item_last_seen_text_color" format="reference"/>
<attr name="conversation_item_last_seen_line_color" format="reference"/>
@ -278,6 +279,7 @@
<declare-styleable name="DocumentView">
<attr name="doc_titleColor" format="color" />
<attr name="doc_captionColor" format="color" />
<attr name="doc_downloadButtonTint" format="color" />
</declare-styleable>
<declare-styleable name="ConversationItemFooter">

View File

@ -191,6 +191,7 @@
<item name="conversation_item_sent_text_primary_color">@color/core_grey_90</item>
<item name="conversation_item_sent_text_secondary_color">@color/core_grey_60</item>
<item name="conversation_item_sent_icon_color">@color/core_grey_60</item>
<item name="conversation_item_sent_download_icon_color">@color/core_grey_60</item>
<item name="conversation_item_sent_text_indicator_tab_color">#99000000</item>
<item name="conversation_item_received_text_primary_color">@color/core_white</item>
<item name="conversation_item_received_text_secondary_color">@color/core_white</item>
@ -295,6 +296,7 @@
<item name="conversation_item_sent_text_primary_color">@color/core_grey_05</item>
<item name="conversation_item_sent_text_secondary_color">@color/core_grey_25</item>
<item name="conversation_item_sent_icon_color">@color/core_grey_25</item>
<item name="conversation_item_sent_download_icon_color">@color/core_white</item>
<item name="conversation_item_sent_text_indicator_tab_color">#99ffffff</item>
<item name="conversation_item_received_text_primary_color">@color/core_grey_05</item>
<item name="conversation_item_received_text_secondary_color">@color/core_grey_25</item>

View File

@ -70,10 +70,13 @@ public class DocumentView extends FrameLayout {
TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.DocumentView, 0, 0);
int titleColor = typedArray.getInt(R.styleable.DocumentView_doc_titleColor, Color.BLACK);
int captionColor = typedArray.getInt(R.styleable.DocumentView_doc_captionColor, Color.BLACK);
int downloadTint = typedArray.getInt(R.styleable.DocumentView_doc_downloadButtonTint, Color.WHITE);
typedArray.recycle();
fileName.setTextColor(titleColor);
fileSize.setTextColor(captionColor);
downloadButton.setColorFilter(downloadTint, PorterDuff.Mode.MULTIPLY);
downloadProgress.setBarColor(downloadTint);
}
}