Skip to content

Commit

Permalink
修复 Button、CheckBox、EditText、RadioButton 在布局中设置 Shape 没有生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
getActivity committed Aug 2, 2021
1 parent 0866dc3 commit c365baa
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
dependencies {
// Shape 框架:https://github.com/getActivity/ShapeView
implementation 'com.github.getActivity:ShapeView:3.0'
implementation 'com.github.getActivity:ShapeView:3.2'
}
```

Expand Down
Binary file modified ShapeView.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.hjq.shape.demo"
minSdkVersion 16
targetSdkVersion 28
versionCode 30
versionName "3.0"
versionCode 32
versionName "3.2"

// 支持 Java JDK 8
compileOptions {
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {

defaultConfig {
minSdkVersion 16
versionCode 30
versionName "3.0"
versionCode 32
versionName "3.2"
}

// 支持 Java JDK 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeConstraintLayout(Context context, AttributeSet attrs, int defStyleAt

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeLinearLayout(Context context, AttributeSet attrs, int defStyleAttr)

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeRecyclerView(Context context, AttributeSet attrs, int defStyleAttr)

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down
7 changes: 2 additions & 5 deletions library/src/main/java/com/hjq/shape/view/ShapeButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public ShapeButton(Context context) {
}

public ShapeButton(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.buttonStyle);
this(context, attrs, 0);
}

public ShapeButton(Context context, AttributeSet attrs, int defStyleAttr) {
Expand Down Expand Up @@ -116,10 +116,7 @@ public ShapeButton(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}

intoBackground();
intoTextColor();
}

Expand Down
5 changes: 1 addition & 4 deletions library/src/main/java/com/hjq/shape/view/ShapeCheckBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ public ShapeCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}

intoBackground();
intoTextColor();
}

Expand Down
5 changes: 1 addition & 4 deletions library/src/main/java/com/hjq/shape/view/ShapeEditText.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ public ShapeEditText(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}

intoBackground();
intoTextColor();
}

Expand Down
4 changes: 1 addition & 3 deletions library/src/main/java/com/hjq/shape/view/ShapeImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeImageView(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ public ShapeRadioButton(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}

intoBackground();
intoTextColor();
}

Expand Down
5 changes: 1 addition & 4 deletions library/src/main/java/com/hjq/shape/view/ShapeTextView.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ public ShapeTextView(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}

intoBackground();
intoTextColor();
}

Expand Down
4 changes: 1 addition & 3 deletions library/src/main/java/com/hjq/shape/view/ShapeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public ShapeView(Context context, AttributeSet attrs, int defStyleAttr) {

typedArray.recycle();

if (getBackground() == null) {
intoBackground();
}
intoBackground();
}

/**
Expand Down

0 comments on commit c365baa

Please sign in to comment.