Implemented app-theme-helper. Needs to be cleaned up.

This commit is contained in:
Karim Abou Zeid 2016-01-25 22:20:59 +01:00
commit 8b98a9be85
39 changed files with 275 additions and 1370 deletions

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/black" />
</shape>

View file

@ -50,10 +50,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
app:tabContentStart="72dp"
app:tabIndicatorColor="@color/primary_text_default_material_dark"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/primary_text_default_material_dark"
app:tabTextColor="@color/secondary_text_default_material_dark" />
app:tabMode="scrollable" />
</android.support.design.widget.AppBarLayout>

View file

@ -1,24 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:paddingTop="16dp"
android:gravity="start|center_vertical"
android:layout_gravity="start|center_vertical"
tools:ignore="UnusedAttribute">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="?colorAccent"
android:fontFamily="@string/font_fontFamily_medium"
android:textStyle="@integer/font_textStyle_medium"
android:textSize="14sp"
android:gravity="start|center_vertical"
android:layout_gravity="start|center_vertical"
android:textAlignment="viewStart" />
</FrameLayout>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.kabouzeid.gramophone.views.ColorView
android:id="@+id/circle"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center_vertical|end"
xmlns:android="http://schemas.android.com/apk/res/android" />

View file

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingEnd="?android:attr/scrollbarSize"
android:paddingRight="?android:attr/scrollbarSize"
tools:ignore="RtlSymmetry,UnusedAttribute"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dip"
android:layout_marginEnd="6dip"
android:layout_marginLeft="16dip"
android:layout_marginRight="6dip"
android:layout_marginStart="16dip"
android:layout_marginTop="12dip"
android:layout_weight="1">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:fontFamily="sans-serif"
android:gravity="start"
android:singleLine="true"
android:textAlignment="viewStart"
android:textColor="?android:textColorPrimary"
android:textSize="16sp"
tools:text="Title" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@android:id/title"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignStart="@android:id/title"
android:layout_below="@android:id/title"
android:layout_marginTop="2dp"
android:fontFamily="sans-serif"
android:gravity="start"
android:maxLines="6"
android:textAlignment="viewStart"
android:textColor="?android:textColorSecondary"
android:textSize="14sp"
tools:text="Summary" />
</RelativeLayout>
<!-- Preference should place its actual preference widget here. -->
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:gravity="center_vertical"
android:orientation="vertical" />
</LinearLayout>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.kabouzeid.gramophone.views.DynamicCheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false" />

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/scrollbar_width_plus_inset"
android:layout_height="match_parent"
tools:layout_gravity="end">
<View
android:id="@+id/scroll_bar"
android:layout_width="@dimen/scrollbar_width_plus_inset"
android:layout_height="match_parent"
android:layout_gravity="end"
android:alpha="0.3" />
<View
android:id="@+id/scroll_handle"
android:layout_width="@dimen/scrollbar_width_plus_inset"
android:layout_height="48dp"
android:layout_gravity="end" />
</FrameLayout>

View file

@ -22,9 +22,9 @@
</string-array>
<string-array name="pref_general_theme_list_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>light</item>
<item>dark</item>
<item>black</item>
</string-array>
<string-array name="pref_auto_download_images_titles">

View file

@ -58,7 +58,7 @@
</style>
<style name="Theme.Phonograph.Base.Black" parent="@style/Theme.Phonograph.Base">
<item name="android:windowBackground">@drawable/black</item>
<item name="android:windowBackground">@android:color/black</item>
<item name="divider_color">#18FFFFFF</item>
<item name="default_bar_color">@color/grey_800</item>
<item name="cardBackgroundColor">@color/grey_900</item>

View file

@ -1,21 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory android:title="@string/pref_header_audio">
<com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory android:title="@string/pref_header_audio">
<CheckBoxPreference
<com.kabouzeid.appthemehelper.common.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="gapless_playback"
android:layout="@layout/preference_custom"
android:summary="@string/pref_summary_gapless_playback"
android:title="@string/pref_title_gapless_playback"
android:widgetLayout="@layout/preference_dynamic_checkbox" />
android:title="@string/pref_title_gapless_playback" />
<Preference
<com.kabouzeid.appthemehelper.common.prefs.ATEPreference
android:key="equalizer"
android:layout="@layout/preference_custom"
android:title="@string/equalizer" />
</com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory>
</com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory>
</PreferenceScreen>

View file

@ -1,43 +1,32 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory android:title="@string/pref_header_colors">
<com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory android:title="@string/pref_header_colors">
<com.afollestad.materialdialogs.prefs.MaterialListPreference
android:defaultValue="0"
android:entries="@array/pref_general_theme_list_titles"
android:entryValues="@array/pref_general_theme_list_values"
android:key="general_theme"
android:layout="@layout/preference_custom"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_general_theme" />
<com.kabouzeid.gramophone.prefs.ColorChooserPreference
<com.kabouzeid.appthemehelper.common.prefs.ATEColorPreference
android:key="primary_color"
android:persistent="false"
android:summary="@string/primary_color_desc"
android:title="@string/primary_color" />
<com.kabouzeid.gramophone.prefs.ColorChooserPreference
<com.kabouzeid.appthemehelper.common.prefs.ATEColorPreference
android:key="accent_color"
android:persistent="false"
android:summary="@string/accent_color_desc"
android:title="@string/accent_color" />
<CheckBoxPreference
<com.kabouzeid.appthemehelper.common.prefs.ATESwitchPreference
android:defaultValue="true"
android:key="colored_notification"
android:layout="@layout/preference_custom"
android:summary="@string/pref_summary_colored_notification"
android:title="@string/pref_title_colored_notification"
android:widgetLayout="@layout/preference_dynamic_checkbox" />
android:title="@string/pref_title_colored_notification" />
<CheckBoxPreference
<com.kabouzeid.appthemehelper.common.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="should_color_navigation_bar"
android:layout="@layout/preference_custom"
android:persistent="false"
android:summary="@string/pref_summary_colored_navigation_bar"
android:title="@string/pref_title_navigation_bar"
android:widgetLayout="@layout/preference_dynamic_checkbox" />
android:title="@string/pref_title_navigation_bar" />
</com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory>
</com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory>
</PreferenceScreen>

View file

@ -1,17 +1,25 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory android:title="@string/pref_header_general">
<com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory android:title="@string/pref_header_general">
<com.afollestad.materialdialogs.prefs.MaterialListPreference
<com.kabouzeid.appthemehelper.common.prefs.ATEListPreference
android:defaultValue="-1"
android:entries="@array/pref_start_page_list_titles"
android:entryValues="@array/pref_start_page_list_values"
android:key="default_start_page"
android:layout="@layout/preference_custom"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_set_default_start_page" />
</com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory>
<com.kabouzeid.appthemehelper.common.prefs.ATEListPreference
android:defaultValue="light"
android:entries="@array/pref_general_theme_list_titles"
android:entryValues="@array/pref_general_theme_list_values"
android:key="general_theme"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_general_theme" />
</com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory>
</PreferenceScreen>

View file

@ -1,26 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory android:title="@string/pref_header_images">
<com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory android:title="@string/pref_header_images">
<CheckBoxPreference
<com.kabouzeid.appthemehelper.common.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="ignore_media_store_artwork"
android:layout="@layout/preference_custom"
android:summary="@string/pref_summary_ignore_media_store_artwork"
android:title="@string/pref_title_ignore_media_store_artwork"
android:widgetLayout="@layout/preference_dynamic_checkbox" />
android:title="@string/pref_title_ignore_media_store_artwork" />
<com.afollestad.materialdialogs.prefs.MaterialListPreference
<com.kabouzeid.appthemehelper.common.prefs.ATEListPreference
android:defaultValue="only_wifi"
android:entries="@array/pref_auto_download_images_titles"
android:entryValues="@array/pref_auto_download_images_values"
android:key="auto_download_images_policy"
android:layout="@layout/preference_custom"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_auto_download_artist_images" />
</com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory>
</com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory>
</PreferenceScreen>

View file

@ -1,24 +1,20 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory android:title="@string/pref_header_lockscreen">
<com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory android:title="@string/pref_header_lockscreen">
<CheckBoxPreference
<com.kabouzeid.appthemehelper.common.prefs.ATESwitchPreference
android:defaultValue="true"
android:key="album_art_on_lockscreen"
android:layout="@layout/preference_custom"
android:summary="@string/pref_summary_album_art_on_lockscreen"
android:title="@string/pref_title_album_art_on_lockscreen"
android:widgetLayout="@layout/preference_dynamic_checkbox" />
android:title="@string/pref_title_album_art_on_lockscreen" />
<CheckBoxPreference
<com.kabouzeid.appthemehelper.common.prefs.ATESwitchPreference
android:defaultValue="false"
android:dependency="album_art_on_lockscreen"
android:key="blurred_album_art"
android:layout="@layout/preference_custom"
android:summary="@string/pref_summary_blurred_album_art"
android:title="@string/pref_title_blurred_album_art"
android:widgetLayout="@layout/preference_dynamic_checkbox" />
android:title="@string/pref_title_blurred_album_art" />
</com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory>
</com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory>
</PreferenceScreen>

View file

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory android:title="@string/pref_header_now_playing_screen">
<com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory android:title="@string/pref_header_now_playing_screen">
<com.afollestad.materialdialogs.prefs.MaterialListPreference
<com.kabouzeid.appthemehelper.common.prefs.ATEListPreference
android:enabled="false"
android:key="now_playing_layout"
android:layout="@layout/preference_custom"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:summary="Coming soon"
android:title="@string/pref_title_now_playing_layout" />
</com.kabouzeid.gramophone.prefs.DynamicPreferenceCategory>
</com.kabouzeid.appthemehelper.common.prefs.ATEPreferenceCategory>
</PreferenceScreen>