File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
MaterialDesignDemo/src/com/gc/materialdesigndemo/ui Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 5
5
import com .gc .materialdesign .widgets .ColorSelector ;
6
6
import com .gc .materialdesign .widgets .ColorSelector .OnColorSelectedListener ;
7
7
import com .gc .materialdesigndemo .R ;
8
+ import com .nineoldandroids .view .ViewHelper ;
9
+
8
10
import android .annotation .SuppressLint ;
9
11
import android .annotation .TargetApi ;
10
12
import android .app .Activity ;
17
19
import android .view .View .OnClickListener ;
18
20
19
21
20
- @ TargetApi (Build .VERSION_CODES .HONEYCOMB )
21
22
public class MainActivity extends Activity implements OnColorSelectedListener {
22
23
23
24
int backgroundColor = Color .parseColor ("#1E88E5" );
@@ -98,16 +99,15 @@ public void onClick(View arg0) {
98
99
});
99
100
}
100
101
101
- @ TargetApi (Build .VERSION_CODES .HONEYCOMB )
102
102
private void setOriginRiple (final LayoutRipple layoutRipple ){
103
103
104
104
layoutRipple .post (new Runnable () {
105
105
106
106
@ Override
107
107
public void run () {
108
108
View v = layoutRipple .getChildAt (0 );
109
- layoutRipple .setxRippleOrigin (v .getX ()+v .getWidth ()/2 );
110
- layoutRipple .setyRippleOrigin (v .getY ()+v .getHeight ()/2 );
109
+ layoutRipple .setxRippleOrigin (ViewHelper .getX (v )+v .getWidth ()/2 );
110
+ layoutRipple .setyRippleOrigin (ViewHelper .getY (v )+v .getHeight ()/2 );
111
111
112
112
layoutRipple .setRippleColor (Color .parseColor ("#1E88E5" ));
113
113
You can’t perform that action at this time.
0 commit comments