Skip to content

Commit

Permalink
Merge branch 'master' into androidx
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	app/build.gradle
#	build.gradle
#	vectorcompattextview/build.gradle
  • Loading branch information
woxingxiao committed Dec 22, 2020
2 parents 54ad44d + 8c80b86 commit 4d43120
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:textSize="12sp"
android:text="click them →"
android:textColor="@color/colorPrimary"/>

<com.xw.repo.VectorCompatTextView
android:id="@+id/checkable_text_view1"
android:layout_width="120dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
Expand All @@ -302,7 +303,7 @@
android:gravity="center"
android:text="SELECTED TAB"
android:textColor="@drawable/selector_text_color_tab"
app:drawableAdjustViewWidth="true"
app:drawableAdjustTextWidth="true"
app:drawableBottomCompat="@drawable/selector_drawable_tab"
app:drawableHeight="2dp"/>

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 02 09:47:31 CST 2019
#Tue Dec 22 17:02:44 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void initAttrs(Context context, AttributeSet attrs) {
}

isTintDrawableInTextColor = a.getBoolean(R.styleable.VectorCompatTextView_tintDrawableInTextColor, false);
mDrawableCompatColor = a.getColor(R.styleable.VectorCompatTextView_drawableCompatColor, 0);
mDrawableCompatColor = a.getColor(R.styleable.VectorCompatTextView_drawableCompatColor, -1);
isDrawableAdjustTextWidth = a.getBoolean(R.styleable.VectorCompatTextView_drawableAdjustTextWidth, false);
isDrawableAdjustTextHeight = a.getBoolean(R.styleable.VectorCompatTextView_drawableAdjustTextHeight, false);
isDrawableAdjustViewWidth = a.getBoolean(R.styleable.VectorCompatTextView_drawableAdjustViewWidth, false);
Expand Down Expand Up @@ -194,7 +194,7 @@ private void tintDrawable(Drawable drawable) {
if (drawable != null) {
if (isTintDrawableInTextColor) {
DrawableCompat.setTint(drawable.mutate(), getCurrentTextColor());
} else if (mDrawableCompatColor != 0) {
} else if (mDrawableCompatColor >= 0) {
DrawableCompat.setTint(drawable.mutate(), mDrawableCompatColor);
}
}
Expand Down Expand Up @@ -434,7 +434,7 @@ public void toggle() {
protected void drawableStateChanged() {
super.drawableStateChanged();

if (isTintDrawableInTextColor || mDrawableCompatColor != 0) {
if (isTintDrawableInTextColor || mDrawableCompatColor >= 0) {
Drawable[] drawables = getCompoundDrawablesInCompatibility();

boolean needRefresh = false;
Expand All @@ -460,7 +460,7 @@ protected void drawableStateChanged() {
*/
private static class InvisibleDrawable extends Drawable {

private Rect mRect = new Rect();
private final Rect mRect = new Rect();

void updateBounds(Rect rect) {
if (rect != null) {
Expand Down Expand Up @@ -499,7 +499,7 @@ public int getIntrinsicHeight() {
////////////////////////////////////////////////////////////////////////////////////////////////
public static class CompoundDrawableConfigBuilder {

private VectorCompatTextView mVectorCompatTextView;
private final VectorCompatTextView mVectorCompatTextView;

public CompoundDrawableConfigBuilder(@NonNull VectorCompatTextView vectorCompatTextView) {
mVectorCompatTextView = vectorCompatTextView;
Expand Down

0 comments on commit 4d43120

Please sign in to comment.