<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto">

  <PreferenceCategory android:title="@string/settings_general">

    <ListPreference
      android:defaultValue="quality"
      android:entries="@array/media_qualities"
      android:entryValues="@array/media_qualities_values"
      android:icon="@drawable/quality"
      android:key="media_quality"
      android:title="@string/settings_media_quality" />

    <SeekBarPreference
      android:defaultValue="1"
      android:icon="@drawable/storage"
      android:key="media_cache_size"
      android:max="5"
      android:min="0"
      android:title="@string/settings_media_cache_size"
      app:showSeekBarValue="true"
      app:updatesContinuously="true" />

    <ListPreference
      android:defaultValue="shuffle"
      android:entries="@array/play_orders"
      android:entryValues="@array/play_orders_values"
      android:icon="@drawable/play"
      android:key="play_order"
      android:title="@string/settings_play_order" />

  </PreferenceCategory>

  <PreferenceCategory android:title="@string/settings_other">

    <ListPreference
      android:defaultValue="system"
      android:entries="@array/night_mode"
      android:entryValues="@array/night_mode_values"
      android:icon="@drawable/brightness"
      android:key="night_mode"
      android:title="@string/settings_night_mode" />

    <CheckBoxPreference
      android:icon="@drawable/experimental"
      android:key="experiments"
      android:summary="@string/settings_experiments_description"
      android:title="@string/settings_experiments" />

    <Preference
      android:icon="@drawable/bug"
      android:key="crash"
      android:summary="@string/settings_crash_report_description"
      android:title="@string/settings_crash_report_title" />

    <Preference
      android:icon="@drawable/logout"
      android:key="logout"
      android:title="@string/settings_logout" />

  </PreferenceCategory>

  <PreferenceCategory android:title="@string/settings_information">

    <Preference
      android:icon="@drawable/license"
      android:summary="@string/settings_information_license_description"
      android:title="@string/settings_information_license_title">

      <intent
        android:action="android.intent.action.VIEW"
        android:data="https://github.com/apognu/otter/blob/master/LICENSE" />

    </Preference>

    <Preference
      android:icon="@drawable/repository"
      android:summary="@string/settings_information_repository_description"
      android:title="@string/settings_information_repository_title">

      <intent
        android:action="android.intent.action.VIEW"
        android:data="https://github.com/apognu/otter" />

    </Preference>

    <Preference
      android:icon="@drawable/favorite"
      android:key="oss_licences"
      android:title="@string/title_oss_licences" />

    <Preference
      android:key="version"
      android:title="@string/settings_version_title" />

  </PreferenceCategory>

</androidx.preference.PreferenceScreen>