Added sync settings in preferences

This commit is contained in:
CappielloAntonio 2021-04-15 10:37:08 +02:00
parent 26ba9467f1
commit a68f45e7dc
8 changed files with 114 additions and 35 deletions

View file

@ -293,21 +293,6 @@
android:paddingEnd="8dp"
android:paddingBottom="8dp" />
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/sync_music_button"
style="@style/Widget.MaterialComponents.Button.TextButton.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:layout_gravity="center"
android:textColor="@color/titleTextColor"
android:textAllCaps="false"
app:iconTint="@color/titleTextColor"
android:text="@string/action_sync_music"
app:icon="@drawable/ic_downloading" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View file

@ -111,7 +111,13 @@
android:id="@+id/settingsFragment"
android:name="com.cappielloantonio.play.ui.fragment.SettingsFragment"
android:label="SettingsFragment"
tools:layout="@layout/fragment_settings"/>
tools:layout="@layout/fragment_settings">
<action
android:id="@+id/action_settingsFragment_to_syncFragment"
app:destination="@id/syncFragment"
app:popUpTo="@id/settingsFragment"
app:popUpToInclusive="true" />
</fragment>
<fragment
android:id="@+id/searchFragment"
android:name="com.cappielloantonio.play.ui.fragment.SearchFragment"

View file

@ -24,6 +24,19 @@
<string name="label_placeholder">--</string>
<string name="save_filters">Save filters between sessions</string>
<string name="sync_header">Synchronization</string>
<string name="music_sync">Music sync</string>
<string name="music_sync_caption">Sync tracks, albums, artists, genres and playlists</string>
<string name="genres_music_cross_sync">Genres-music cross sync</string>
<string name="genres_music_cross_sync_caption">Cross sync genres for each track</string>
<string name="about_header">About</string>
<string name="summary_about">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</string>
<string name="app_version">1.1</string>
<string name="title_version">Version</string>
<string name="github_page">Github</string>
<string name="development">Follow the development</string>
<string name="github_url">https://github.com/CappielloAntonio/Play</string>
<string name="battery_optimizations_title">Battery Optimizations</string>
<string name="battery_optimizations_message">Please disable battery optimizations for media playback while the screen is off.</string>

View file

@ -1,4 +1,5 @@
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory app:title="@string/general_header">
<ListPreference
app:defaultValue="400000000"
@ -27,4 +28,37 @@
app:title="@string/save_filters"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/sync_header">
<Preference
android:title="@string/music_sync"
android:key="@string/music_sync"
android:summary="@string/music_sync_caption" />
<Preference
android:title="@string/genres_music_cross_sync"
android:key="@string/genres_music_cross_sync"
android:summary="@string/genres_music_cross_sync_caption" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/about_header">
<Preference
app:selectable="false"
app:summary="@string/summary_about" />
<Preference
app:title="@string/title_version"
app:summary="@string/app_version" />
<!-- preference opens url in browser -->
<Preference
app:title="@string/github_page"
app:summary="@string/development">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/github_url" />
</Preference>
</PreferenceCategory>
</PreferenceScreen>