Fix footer icon tints.

This commit is contained in:
Greyson Parrelli 2018-07-20 15:40:13 -07:00
parent 860047c2d3
commit aa25f39fe9
10 changed files with 34 additions and 16 deletions

View File

@ -65,7 +65,6 @@
android:id="@+id/footer_delivery_status"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:iconColor="?attr/conversation_item_delivery_icon_color"/>
android:layout_gravity="center_vertical" />
</merge>

View File

@ -166,7 +166,9 @@
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:clipChildren="false"
android:clipToPadding="false"
app:footer_color="?conversation_item_received_text_secondary_color"/>
android:alpha="0.7"
app:footer_text_color="?conversation_item_received_text_secondary_color"
app:footer_icon_color="?conversation_item_received_text_secondary_color"/>
</LinearLayout>

View File

@ -6,4 +6,6 @@
android:layout_width="@dimen/media_bubble_default_dimens"
android:layout_height="wrap_content"
app:contact_titleColor="?conversation_item_received_text_primary_color"
app:contact_captionColor="?conversation_item_received_text_secondary_color" />
app:contact_captionColor="?conversation_item_received_text_secondary_color"
app:contact_footerIconColor="?conversation_item_received_text_secondary_color"
app:contact_footerAlpha="0.7"/>

View File

@ -127,7 +127,8 @@
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:clipChildren="false"
android:clipToPadding="false"
app:footer_color="?conversation_item_sent_text_secondary_color"/>
app:footer_text_color="?attr/conversation_item_sent_text_secondary_color"
app:footer_icon_color="?attr/conversation_item_sent_icon_color"/>
</LinearLayout>

View File

@ -6,4 +6,5 @@
android:layout_width="@dimen/media_bubble_default_dimens"
android:layout_height="wrap_content"
app:contact_titleColor="?conversation_item_sent_text_primary_color"
app:contact_captionColor="?conversation_item_sent_text_secondary_color"/>
app:contact_captionColor="?conversation_item_sent_text_secondary_color"
app:contact_footerIconColor="?conversation_item_sent_icon_color"/>

View File

@ -30,6 +30,7 @@
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
app:footer_color="@color/core_white"/>
app:footer_text_color="@color/core_white"
app:footer_icon_color="@color/core_white"/>
</merge>

View File

@ -71,6 +71,7 @@
<attr name="conversation_item_received_text_secondary_color" format="reference|color"/>
<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_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"/>
@ -78,7 +79,6 @@
<attr name="conversation_item_quote_text_color" format="reference"/>
<attr name="conversation_item_sticky_date_background" format="reference" />
<attr name="conversation_item_sticky_date_text_color" format="color" />
<attr name="conversation_item_delivery_icon_color" format="color" />
<attr name="dialog_info_icon" format="reference" />
<attr name="dialog_alert_icon" format="reference" />
@ -265,6 +265,8 @@
<declare-styleable name="SharedContactView">
<attr name="contact_titleColor" format="color" />
<attr name="contact_captionColor" format="color" />
<attr name="contact_footerIconColor" format="color" />
<attr name="contact_footerAlpha" format="float" />
</declare-styleable>
<declare-styleable name="DocumentView">
@ -273,7 +275,8 @@
</declare-styleable>
<declare-styleable name="ConversationItemFooter">
<attr name="footer_color" format="color" />
<attr name="footer_text_color" format="color" />
<attr name="footer_icon_color" format="color" />
</declare-styleable>
<declare-styleable name="ConversationItemThumbnail">

View File

@ -188,7 +188,7 @@
<item name="conversation_item_sent_text_secondary_color">@color/core_light_60</item>
<item name="conversation_item_sent_text_indicator_tab_color">#99000000</item>
<item name="conversation_item_received_text_primary_color">@color/white</item>
<item name="conversation_item_received_text_secondary_color">#b3ffffff</item>
<item name="conversation_item_received_text_secondary_color">#ffffff</item>
<item name="conversation_item_update_text_color">@color/core_light_60</item>
<item name="conversation_item_last_seen_text_color">@color/core_light_90</item>
<item name="conversation_item_last_seen_line_color">@color/core_light_60</item>
@ -196,7 +196,7 @@
<item name="conversation_item_quote_text_color">@color/core_light_90</item>
<item name="conversation_item_sticky_date_background">@drawable/sticky_date_header_background_light</item>
<item name="conversation_item_sticky_date_text_color">@color/core_light_60</item>
<item name="conversation_item_delivery_icon_color">@color/core_light_45</item>
<item name="conversation_item_sent_icon_color">@color/core_light_45</item>
<item name="quick_camera_icon">@drawable/quick_camera_light</item>
<item name="quick_mic_icon">@drawable/ic_mic_grey600_24dp</item>
@ -287,7 +287,7 @@
<item name="conversation_item_sent_text_secondary_color">@color/core_dark_30</item>
<item name="conversation_item_sent_text_indicator_tab_color">#99ffffff</item>
<item name="conversation_item_received_text_primary_color">@color/core_dark_05</item>
<item name="conversation_item_received_text_secondary_color">#b3efefef</item>
<item name="conversation_item_received_text_secondary_color">#efefef</item>
<item name="conversation_item_sent_indicator_text_background">@drawable/conversation_item_sent_indicator_text_shape_dark</item>
<item name="conversation_item_update_text_color">@color/core_light_35</item>
<item name="conversation_item_last_seen_text_color">@color/core_dark_30</item>
@ -296,7 +296,7 @@
<item name="conversation_item_quote_text_color">@color/core_dark_05</item>
<item name="conversation_item_sticky_date_background">@drawable/sticky_date_header_background_dark</item>
<item name="conversation_item_sticky_date_text_color">@color/core_dark_30</item>
<item name="conversation_item_delivery_icon_color">@color/core_dark_60</item>
<item name="conversation_item_sent_icon_color">@color/core_dark_60</item>
<item name="contact_list_divider">@drawable/contact_list_divider_dark</item>

View File

@ -60,7 +60,8 @@ public class ConversationItemFooter extends LinearLayout {
if (attrs != null) {
TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.ConversationItemFooter, 0, 0);
setColor(typedArray.getInt(R.styleable.ConversationItemFooter_footer_color, getResources().getColor(R.color.core_white)));
setTextColor(typedArray.getInt(R.styleable.ConversationItemFooter_footer_text_color, getResources().getColor(R.color.core_white)));
setIconColor(typedArray.getInt(R.styleable.ConversationItemFooter_footer_icon_color, getResources().getColor(R.color.core_white)));
typedArray.recycle();
}
}
@ -79,11 +80,15 @@ public class ConversationItemFooter extends LinearLayout {
presentDeliveryStatus(messageRecord);
}
public void setColor(int color) {
public void setTextColor(int color) {
dateView.setTextColor(color);
simView.setTextColor(color);
}
public void setIconColor(int color) {
timerView.setColorFilter(color);
insecureIndicatorView.setColorFilter(color);
deliveryStatusView.setTint(color);
}
private void presentDate(@NonNull MessageRecord messageRecord, @NonNull Locale locale) {

View File

@ -91,11 +91,15 @@ public class SharedContactView extends LinearLayout implements RecipientModified
TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.SharedContactView, 0, 0);
int titleColor = typedArray.getInt(R.styleable.SharedContactView_contact_titleColor, Color.BLACK);
int captionColor = typedArray.getInt(R.styleable.SharedContactView_contact_captionColor, Color.BLACK);
int iconColor = typedArray.getInt(R.styleable.SharedContactView_contact_footerIconColor, Color.BLACK);
float footerAlpha = typedArray.getFloat(R.styleable.SharedContactView_contact_footerAlpha, 1);
typedArray.recycle();
nameView.setTextColor(titleColor);
numberView.setTextColor(captionColor);
footer.setColor(captionColor);
footer.setTextColor(captionColor);
footer.setIconColor(iconColor);
footer.setAlpha(footerAlpha);
}
if (cornerMask.isLegacy()) {