Skip to content

Commit d15a09c

Browse files
committed
release v1.2
1 parent c8785e8 commit d15a09c

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For example, we can build a card style background for RecyclerView:
1313

1414
![example.png](./example.png "example.png")
1515

16-
Here has a [demo apk](https://github.com/mthli/Slice/releases/download/v1.1/SliceDemo.1.1.apk "SliceDemo.1.1.apk"), and it's [source code](https://github.com/mthli/Slice/tree/master/app "SliceDemo.1.1.apk's source code"), very easy to understand~
16+
Here has a [demo apk](https://github.com/mthli/Slice/releases/download/v1.2/SliceDemo.1.2.apk "SliceDemo.1.2.apk"), and it's [source code](https://github.com/mthli/Slice/tree/master/app "SliceDemo.1.2.apk's source code"), very easy to understand~
1717

1818
## API
1919

@@ -55,7 +55,7 @@ At your top-level `build.gradle` file:
5555
And then at your project `build.gradle` file:
5656

5757
dependencies {
58-
compile 'com.github.mthli:Slice:v1.1'
58+
compile 'com.github.mthli:Slice:v1.2'
5959
}
6060

6161
Done!

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ android {
2424
applicationId "io.github.mthli.slicedemo"
2525
minSdkVersion 14
2626
targetSdkVersion 23
27-
versionCode 2
28-
versionName "1.1"
27+
versionCode 3
28+
versionName "1.2"
2929
}
3030

3131
buildTypes {

slice/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323
defaultConfig {
2424
minSdkVersion 7
2525
targetSdkVersion 23
26-
versionCode 2
27-
versionName "1.1"
26+
versionCode 3
27+
versionName "1.2"
2828
}
2929

3030
buildTypes {

slice/src/main/java/io/github/mthli/slice/Slice.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ private float dp2px(float dp) {
6868
return view.getResources().getDisplayMetrics().density * dp;
6969
}
7070

71-
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
72-
private ColorStateList buildColorStateList(int normal, int pressed) {
71+
private ColorStateList buildColorStateList(int pressed) {
7372
return new ColorStateList(new int[][]{
7473
new int[] {android.R.attr.state_pressed},
7574
new int[] {android.R.attr.state_focused},
76-
new int[] {android.R.attr.state_activated},
7775
new int[] {}},
78-
new int[] {pressed, pressed, pressed, normal}
76+
new int[] {pressed, pressed, pressed}
7977
);
8078
}
8179

@@ -117,9 +115,7 @@ public void draw(Canvas canvas, Paint paint) {
117115
}
118116
});
119117

120-
int color = ((CustomRoundRectDrawable) drawable).getColor();
121-
RippleDrawable ripple = new RippleDrawable(buildColorStateList(color, mask), drawable, shape);
122-
118+
RippleDrawable ripple = new RippleDrawable(buildColorStateList(mask), drawable, shape);
123119
view.setBackground(ripple);
124120
} else {
125121
view.setBackground(drawable);

0 commit comments

Comments
 (0)