Add seekbar and list settings preferences

Taken from AICP
This commit is contained in:
SpiritCroc
2018-03-25 19:50:45 -07:00
committed by unknown
parent cd35b45d96
commit baff4b6ed0
18 changed files with 1142 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014-2017 AICP
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<declare-styleable name="SeekBarPreference">
<!-- preference -->
<attr name="unitsLeft" format="string|reference" />
<attr name="unitsRight" format="string|reference" />
<attr name="interval" format="integer" />
<!-- style -->
<attr name="thumb_default_value_color" format="color" />
<attr name="value_popup_view_fg" format="color" />
<attr name="value_popup_view_bg" format="color" />
</declare-styleable>
</resources>

View File

@@ -0,0 +1,7 @@
<resources>
<!-- SeekBarPreferenceCham: offset of the value popup -->
<dimen name="seek_bar_preference_cham_value_x_offset">0dp</dimen>
<dimen name="seek_bar_preference_cham_value_y_offset">-16dp</dimen>
</resources>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright (C) 2017 AICP
*
* 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
*
* 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.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="seekbar_no_default_value">No default value set</string>
<string name="seekbar_default_value_set">Value set to default of <xliff:g id="number">%d</xliff:g></string>
<string name="seekbar_default_value_already_set">Default value is already set</string>
<string name="seekbar_default_string">Default</string>
</resources>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 AICP
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="SeekBarPreferenceChamValueTextAppearance" parent="@*android:style/TextAppearance.Toast" />
<!-- SeekBarPreferenceCham value popup -->
<style name="SeekBarPreferenceChamValueView">
<item name="android:textColor">?attr/value_popup_view_fg</item>
<item name="android:textAppearance">@style/SeekBarPreferenceChamValueTextAppearance</item>
<item name="android:background">@drawable/seekbar_popup_bg</item>
<item name="android:paddingHorizontal">24dp</item>
<item name="android:paddingVertical">15dp</item>
<item name="android:fitsSystemWindows">false</item>
</style>
</resources>