diff --git a/README.md b/README.md index 8f2971a..ec9c615 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ repositories { - add to your module gradle file ```gradle -implementation 'com.github.dtboy1995:android-sex-ring:0.2.2' +implementation 'com.github.dtboy1995:android-sex-ring:0.2.3' ``` # screenshot @@ -54,20 +54,22 @@ implementation 'com.github.dtboy1995:android-sex-ring:0.2.2' RingView rv = (RingView)findViewById(R.id.ring_view); // set progress - true is animated rv.go(20, true); +// set prgress range mapped +rv.go(10, -20, 30, true); // set progress callback rv.setCallback(new AVCallback() { + // progress 0~100 @Override public void step(int progress) { - // progress 0~100 - tv.setText(String.valueOf(progress)); + } }); // set range mapped progress callback [0, 100] map to => [-20, 30] rv.setCallback(new AVRangeMapCallback(-20, 30) { + // progress -20~30 @Override public void step(int progress) { - // progress -20~30 - tv.setText(String.valueOf(progress)); + } }); ``` diff --git a/example/src/main/java/org/ithot/android/example/ring/ExampleActivity.java b/example/src/main/java/org/ithot/android/example/ring/ExampleActivity.java index 1c244e8..93e0d94 100644 --- a/example/src/main/java/org/ithot/android/example/ring/ExampleActivity.java +++ b/example/src/main/java/org/ithot/android/example/ring/ExampleActivity.java @@ -29,6 +29,10 @@ public void go2(View v) { ring2.go(30, true); } + public void goRangeMapped(View v) { + ring1.go(-20, -20, 30, true); + } + public void step1(int progress) { tv1.setText(String.valueOf(progress)); } diff --git a/example/src/main/res/layout/activity_main.xml b/example/src/main/res/layout/activity_main.xml index 1db19fb..53e9e0b 100644 --- a/example/src/main/res/layout/activity_main.xml +++ b/example/src/main/res/layout/activity_main.xml @@ -53,12 +53,22 @@