Skip to content

Commit

Permalink
ProperSeekBarPreference: Improve layout
Browse files Browse the repository at this point in the history
  • Loading branch information
SKULSHADY authored and ralf979 committed Feb 8, 2023
1 parent 4752859 commit a51b08b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
3 changes: 1 addition & 2 deletions res/drawable/ic_proper_seekbar_minus.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 Project-Xtended
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -21,5 +20,5 @@
android:viewportHeight="24.0" >
<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M19,13H5V11H19V13Z" />
android:pathData="M14.102040767669678,13 H0.10204076766967773 V11 H14.102040767669678 V13 z" />
</vector>
30 changes: 16 additions & 14 deletions res/drawable/ic_proper_seekbar_reset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
<!--
Copyright (C) 2022 Project-Xtended
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0" >
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal" >

<path
android:fillColor="?android:attr/colorControlNormal"
android:pathData="M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z" />
android:fillColor="#FFFFFFFF"
android:pathData="M14.123456746339798,12.042328000068665 c0,-0.7430335164070133 -0.6079365134239197,-1.3509700298309326 -1.3509700298309326,-1.3509700298309326 s-1.3509700298309326,0.6079365134239197 -1.3509700298309326,1.3509700298309326 s0.6079365134239197,1.3509700298309326 1.3509700298309326,1.3509700298309326 s1.3509700298309326,-0.6079365134239197 1.3509700298309326,-1.3509700298309326 zM12.772486716508865,5.962962865829468 c-3.3571605241298674,0 -6.079365134239197,2.7222046101093293 -6.079365134239197,6.079365134239197 L4.66666653752327,12.042328000068665 l2.7019400596618652,2.7019400596618652 l2.7019400596618652,-2.7019400596618652 L8.044091612100601,12.042328000068665 c0,-2.6141270077228547 2.1142680966854095,-4.728395104408264 4.728395104408264,-4.728395104408264 s4.728395104408264,2.1142680966854095 4.728395104408264,4.728395104408264 s-2.1142680966854095,4.728395104408264 -4.728395104408264,4.728395104408264 c-1.0199823725223542,0 -1.965661393404007,-0.3309876573085789 -2.742469160556793,-0.8781305193901066 l-0.9591887211799618,0.9726984214782719 C10.097566057443618,17.648853623867033 11.380987585783004,18.12169313430786 12.772486716508865,18.12169313430786 c3.3571605241298674,0 6.079365134239197,-2.7222046101093293 6.079365134239197,-6.079365134239197 s-2.7222046101093293,-6.079365134239197 -6.079365134239197,-6.079365134239197 z" />
</vector>
2 changes: 2 additions & 0 deletions res/layout/preference_proper_seekbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
android:id="@+id/value_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_below="@android:id/summary"
android:layout_alignStart="@android:id/title" >

Expand Down Expand Up @@ -127,6 +128,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="3dp"
android:layout_toEndOf="@id/minus"
android:layout_toStartOf="@id/plus"
android:layout_centerVertical="true" />
Expand Down
4 changes: 2 additions & 2 deletions res/values/custom_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<!-- Proper seekbar -->
<string name="proper_seekbar_value">Value: <xliff:g id="v">%s</xliff:g></string>
<string name="proper_seekbar_default_value">by default</string>
<string name="proper_seekbar_default_value_to_set">Default value: <xliff:g id="v">%s</xliff:g>\nLong tap to set</string>
<string name="proper_seekbar_default_value">Default</string>
<string name="proper_seekbar_default_value_to_set">Default value: <xliff:g id="v">%s</xliff:g>\nLong press to set</string>
<string name="proper_seekbar_default_value_is_set">Default value is set</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected void updateValueViews() {
(!mTrackingTouch || mContinuousUpdates ? getTextValue(mValue) +
(mDefaultValueExists && mValue == mDefaultValue ? " (" +
getContext().getString(R.string.proper_seekbar_default_value) + ")" : "")
: "[" + getTextValue(mTrackingValue) + "]")));
: getTextValue(mTrackingValue))));
}
if (mResetImageView != null) {
if (!mDefaultValueExists || mValue == mDefaultValue || mTrackingTouch)
Expand Down

0 comments on commit a51b08b

Please sign in to comment.