From bbd8f269b5c4d72e91ed0bb0da457b186ac937cc Mon Sep 17 00:00:00 2001 From: ezio84 Date: Thu, 7 Sep 2017 17:38:27 +0200 Subject: [PATCH] New fresh look for CustomSeekbar Oreo prefs style thanks @Mazda-- for suggestion on how to remove the top divider Signed-off-by: xyyx --- res/layout/preference_cherish_seekbar.xml | 68 ++++++++++++------- .../preferences/CustomSeekBarPreference.java | 3 + 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/res/layout/preference_cherish_seekbar.xml b/res/layout/preference_cherish_seekbar.xml index f872b5e..73ef6d5 100644 --- a/res/layout/preference_cherish_seekbar.xml +++ b/res/layout/preference_cherish_seekbar.xml @@ -14,14 +14,37 @@ limitations under the License. --> - + android:clickable="false" + android:orientation="horizontal"> + + + + - + + android:fadingEdge="horizontal"/> - + android:orientation="vertical"/> - - - - - + android:layout_gravity="center_vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + - + diff --git a/src/com/cherish/settings/preferences/CustomSeekBarPreference.java b/src/com/cherish/settings/preferences/CustomSeekBarPreference.java index a101ca3..9a4552c 100644 --- a/src/com/cherish/settings/preferences/CustomSeekBarPreference.java +++ b/src/com/cherish/settings/preferences/CustomSeekBarPreference.java @@ -135,6 +135,9 @@ public class CustomSeekBarPreference extends Preference implements SeekBar.OnSee mStatusText.setMinimumWidth(30); mSeekBar.setProgress(mCurrentValue - mMin); mTitle = (TextView) view.findViewById(android.R.id.title); + + view.setDividerAllowedAbove(false); + //view.setDividerAllowedBelow(false); } public void setMax(int max) {