diff --git a/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconButton.java b/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconButton.java index 408d44f28..4e065ec48 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconButton.java +++ b/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconButton.java @@ -6,6 +6,8 @@ import android.graphics.PorterDuff.Mode; import android.util.AttributeSet; import android.widget.ImageButton; +import org.mariotaku.twidere.R; + /** * Created by mariotaku on 14/11/5. */ @@ -23,13 +25,9 @@ public class ActionIconButton extends ImageButton { public ActionIconButton(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - final TypedArray a = context.obtainStyledAttributes(attrs, new int[]{android.R.attr.color, - android.R.attr.colorForeground}); - if (a.hasValue(0)) { - mDefaultColor = a.getColor(0, 0); - } else { - mDefaultColor = a.getColor(1, 0); - } + final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconActionButton, + R.attr.cardActionButtonStyle, R.style.Widget_CardActionButton); + mDefaultColor = a.getColor(R.styleable.IconActionButton_iabColor, 0); setColorFilter(mDefaultColor, Mode.SRC_ATOP); a.recycle(); } diff --git a/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconThemedTextView.java b/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconThemedTextView.java index 0e0910762..d7c931900 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconThemedTextView.java +++ b/twidere/src/main/java/org/mariotaku/twidere/view/ActionIconThemedTextView.java @@ -60,7 +60,8 @@ public class ActionIconThemedTextView extends AppCompatTextView { } public void init(Context context, AttributeSet attrs) { - final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconActionButton); + final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconActionButton, + R.attr.cardActionButtonStyle, R.style.Widget_CardActionButton); mColor = a.getColor(R.styleable.IconActionButton_iabColor, 0); mDisabledColor = a.getColor(R.styleable.IconActionButton_iabDisabledColor, 0); mActivatedColor = a.getColor(R.styleable.IconActionButton_iabActivatedColor, 0); @@ -94,6 +95,18 @@ public class ActionIconThemedTextView extends AppCompatTextView { updateCompoundDrawables(start, top, end, bottom); } + @Override + public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) { + super.setCompoundDrawables(left, top, right, bottom); + updateCompoundDrawables(left, top, right, bottom); + } + + @Override + public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end, Drawable bottom) { + super.setCompoundDrawablesRelative(start, top, end, bottom); + updateCompoundDrawables(start, top, end, bottom); + } + @ColorInt public int getColor() { if (mColor != 0) return mColor; @@ -126,7 +139,7 @@ public class ActionIconThemedTextView extends AppCompatTextView { @Override protected void drawableStateChanged() { super.drawableStateChanged(); - updateCompoundDrawables(TextViewSupport.getCompoundDrawablesRelative(this)); + updateCompoundDrawables(getCompoundDrawables()); } private void updateCompoundDrawables(Drawable... drawables) { diff --git a/twidere/src/main/res/layout/card_item_status_common.xml b/twidere/src/main/res/layout/card_item_status_common.xml index 3c9feea2a..7e59f8859 100644 --- a/twidere/src/main/res/layout/card_item_status_common.xml +++ b/twidere/src/main/res/layout/card_item_status_common.xml @@ -291,8 +291,7 @@ android:paddingLeft="@dimen/element_spacing_normal" android:paddingRight="@dimen/element_spacing_normal" android:textAppearance="?android:textAppearanceSmall" - app:iabActivatedColor="@color/highlight_reply" - app:iabColor="?android:textColorTertiary"/> + app:iabActivatedColor="@color/highlight_reply"/> + app:iabActivatedColor="@color/highlight_retweet"/> @@ -337,7 +334,6 @@ android:layout_alignTop="@+id/action_buttons" android:layout_marginLeft="@dimen/element_spacing_normal" android:layout_marginRight="@dimen/element_spacing_normal" - android:color="?android:textColorTertiary" android:focusable="false" android:src="@drawable/ic_action_more_vertical"/> diff --git a/twidere/src/main/res/layout/card_item_status_compact.xml b/twidere/src/main/res/layout/card_item_status_compact.xml index a78dfd4b6..20170042e 100644 --- a/twidere/src/main/res/layout/card_item_status_compact.xml +++ b/twidere/src/main/res/layout/card_item_status_compact.xml @@ -258,8 +258,7 @@ android:paddingLeft="@dimen/element_spacing_msmall" android:paddingRight="@dimen/element_spacing_msmall" android:textAppearance="?android:textAppearanceSmall" - app:iabActivatedColor="@color/highlight_reply" - app:iabColor="?android:textColorTertiary"/> + app:iabActivatedColor="@color/highlight_reply"/> + app:iabActivatedColor="@color/highlight_retweet"/> @@ -306,7 +303,6 @@ android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_alignTop="@+id/action_buttons" - android:color="?android:textColorTertiary" android:focusable="false" android:src="@drawable/ic_action_more_horizontal" tools:visibility="visible"/> diff --git a/twidere/src/main/res/values-v21/styles.xml b/twidere/src/main/res/values-v21/styles.xml index aafeb5acb..17da6f4cf 100644 --- a/twidere/src/main/res/values-v21/styles.xml +++ b/twidere/src/main/res/values-v21/styles.xml @@ -1,16 +1,6 @@ - - - - -