Disable click on preference category items (#1239)
* Disable click on preference category item. tuskyapp#1221 Changed compat preferences widget to AndroidX according to (https://developer.android.com/guide/topics/ui/settings.html) * Update preference categories clickable
This commit is contained in:
parent
bd7f0dfe62
commit
c75b046483
7 changed files with 88 additions and 79 deletions
|
@ -20,13 +20,11 @@ import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import androidx.preference.SwitchPreference
|
|
||||||
import androidx.preference.ListPreference
|
|
||||||
import androidx.preference.Preference
|
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.preference.*
|
||||||
import com.keylesspalace.tusky.*
|
import com.keylesspalace.tusky.*
|
||||||
|
import com.keylesspalace.tusky.R
|
||||||
import com.keylesspalace.tusky.appstore.EventHub
|
import com.keylesspalace.tusky.appstore.EventHub
|
||||||
import com.keylesspalace.tusky.appstore.PreferenceChangedEvent
|
import com.keylesspalace.tusky.appstore.PreferenceChangedEvent
|
||||||
import com.keylesspalace.tusky.db.AccountManager
|
import com.keylesspalace.tusky.db.AccountManager
|
||||||
|
@ -63,15 +61,15 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(),
|
||||||
private lateinit var blockedUsersPreference: Preference
|
private lateinit var blockedUsersPreference: Preference
|
||||||
|
|
||||||
private lateinit var defaultPostPrivacyPreference: ListPreference
|
private lateinit var defaultPostPrivacyPreference: ListPreference
|
||||||
private lateinit var defaultMediaSensitivityPreference: SwitchPreference
|
private lateinit var defaultMediaSensitivityPreference: SwitchPreferenceCompat
|
||||||
private lateinit var alwaysShowSensitiveMediaPreference: SwitchPreference
|
private lateinit var alwaysShowSensitiveMediaPreference: SwitchPreferenceCompat
|
||||||
private lateinit var mediaPreviewEnabledPreference: SwitchPreference
|
private lateinit var mediaPreviewEnabledPreference: SwitchPreferenceCompat
|
||||||
private lateinit var homeFiltersPreference: Preference
|
private lateinit var homeFiltersPreference: Preference
|
||||||
private lateinit var notificationFiltersPreference: Preference
|
private lateinit var notificationFiltersPreference: Preference
|
||||||
private lateinit var publicFiltersPreference: Preference
|
private lateinit var publicFiltersPreference: Preference
|
||||||
private lateinit var threadFiltersPreference: Preference
|
private lateinit var threadFiltersPreference: Preference
|
||||||
|
|
||||||
private val iconSize by lazy {resources.getDimensionPixelSize(R.dimen.preference_icon_size)}
|
private val iconSize by lazy { resources.getDimensionPixelSize(R.dimen.preference_icon_size) }
|
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
addPreferencesFromResource(R.xml.account_preferences)
|
addPreferencesFromResource(R.xml.account_preferences)
|
||||||
|
@ -81,9 +79,9 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(),
|
||||||
mutedUsersPreference = requirePreference("mutedUsersPreference")
|
mutedUsersPreference = requirePreference("mutedUsersPreference")
|
||||||
blockedUsersPreference = requirePreference("blockedUsersPreference")
|
blockedUsersPreference = requirePreference("blockedUsersPreference")
|
||||||
defaultPostPrivacyPreference = requirePreference("defaultPostPrivacy") as ListPreference
|
defaultPostPrivacyPreference = requirePreference("defaultPostPrivacy") as ListPreference
|
||||||
defaultMediaSensitivityPreference = requirePreference("defaultMediaSensitivity") as SwitchPreference
|
defaultMediaSensitivityPreference = requirePreference("defaultMediaSensitivity") as SwitchPreferenceCompat
|
||||||
mediaPreviewEnabledPreference = requirePreference("mediaPreviewEnabled") as SwitchPreference
|
mediaPreviewEnabledPreference = requirePreference("mediaPreviewEnabled") as SwitchPreferenceCompat
|
||||||
alwaysShowSensitiveMediaPreference = requirePreference("alwaysShowSensitiveMedia") as SwitchPreference
|
alwaysShowSensitiveMediaPreference = requirePreference("alwaysShowSensitiveMedia") as SwitchPreferenceCompat
|
||||||
homeFiltersPreference = requirePreference("homeFilters")
|
homeFiltersPreference = requirePreference("homeFilters")
|
||||||
notificationFiltersPreference = requirePreference("notificationFilters")
|
notificationFiltersPreference = requirePreference("notificationFilters")
|
||||||
publicFiltersPreference = requirePreference("publicFilters")
|
publicFiltersPreference = requirePreference("publicFilters")
|
||||||
|
@ -126,7 +124,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(),
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
|
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
|
||||||
when(preference) {
|
when (preference) {
|
||||||
defaultPostPrivacyPreference -> {
|
defaultPostPrivacyPreference -> {
|
||||||
preference.icon = getIconForVisibility(Status.Visibility.byString(newValue as String))
|
preference.icon = getIconForVisibility(Status.Visibility.byString(newValue as String))
|
||||||
syncWithServer(visibility = newValue)
|
syncWithServer(visibility = newValue)
|
||||||
|
@ -156,7 +154,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(),
|
||||||
|
|
||||||
override fun onPreferenceClick(preference: Preference): Boolean {
|
override fun onPreferenceClick(preference: Preference): Boolean {
|
||||||
|
|
||||||
return when(preference) {
|
return when (preference) {
|
||||||
notificationPreference -> {
|
notificationPreference -> {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
val intent = Intent()
|
val intent = Intent()
|
||||||
|
@ -213,13 +211,14 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(),
|
||||||
|
|
||||||
private fun syncWithServer(visibility: String? = null, sensitive: Boolean? = null) {
|
private fun syncWithServer(visibility: String? = null, sensitive: Boolean? = null) {
|
||||||
mastodonApi.accountUpdateSource(visibility, sensitive)
|
mastodonApi.accountUpdateSource(visibility, sensitive)
|
||||||
.enqueue(object: Callback<Account>{
|
.enqueue(object : Callback<Account> {
|
||||||
override fun onResponse(call: Call<Account>, response: Response<Account>) {
|
override fun onResponse(call: Call<Account>, response: Response<Account>) {
|
||||||
val account = response.body()
|
val account = response.body()
|
||||||
if(response.isSuccessful && account != null) {
|
if (response.isSuccessful && account != null) {
|
||||||
|
|
||||||
accountManager.activeAccount?.let {
|
accountManager.activeAccount?.let {
|
||||||
it.defaultPostPrivacy = account.source?.privacy ?: Status.Visibility.PUBLIC
|
it.defaultPostPrivacy = account.source?.privacy
|
||||||
|
?: Status.Visibility.PUBLIC
|
||||||
it.defaultMediaSensitivity = account.source?.sensitive ?: false
|
it.defaultMediaSensitivity = account.source?.sensitive ?: false
|
||||||
accountManager.saveAccount(it)
|
accountManager.saveAccount(it)
|
||||||
}
|
}
|
||||||
|
@ -238,9 +237,9 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(),
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showErrorSnackbar(visibility: String?, sensitive: Boolean?) {
|
private fun showErrorSnackbar(visibility: String?, sensitive: Boolean?) {
|
||||||
view?.let {view ->
|
view?.let { view ->
|
||||||
Snackbar.make(view, R.string.pref_failed_to_sync, Snackbar.LENGTH_LONG)
|
Snackbar.make(view, R.string.pref_failed_to_sync, Snackbar.LENGTH_LONG)
|
||||||
.setAction(R.string.action_retry) { syncWithServer( visibility, sensitive)}
|
.setAction(R.string.action_retry) { syncWithServer(visibility, sensitive) }
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
package com.keylesspalace.tusky.fragment.preference
|
package com.keylesspalace.tusky.fragment.preference
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.preference.SwitchPreference
|
import android.view.View
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
import android.view.View
|
import androidx.preference.SwitchPreferenceCompat
|
||||||
import com.keylesspalace.tusky.R
|
import com.keylesspalace.tusky.R
|
||||||
import com.keylesspalace.tusky.db.AccountManager
|
import com.keylesspalace.tusky.db.AccountManager
|
||||||
import com.keylesspalace.tusky.di.Injectable
|
import com.keylesspalace.tusky.di.Injectable
|
||||||
|
@ -42,39 +42,39 @@ class NotificationPreferencesFragment : PreferenceFragmentCompat(), Preference.O
|
||||||
|
|
||||||
if (activeAccount != null) {
|
if (activeAccount != null) {
|
||||||
|
|
||||||
val notificationPref = requirePreference("notificationsEnabled") as SwitchPreference
|
val notificationPref = requirePreference("notificationsEnabled") as SwitchPreferenceCompat
|
||||||
notificationPref.isChecked = activeAccount.notificationsEnabled
|
notificationPref.isChecked = activeAccount.notificationsEnabled
|
||||||
notificationPref.onPreferenceChangeListener = this
|
notificationPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val mentionedPref = requirePreference("notificationFilterMentions") as SwitchPreference
|
val mentionedPref = requirePreference("notificationFilterMentions") as SwitchPreferenceCompat
|
||||||
mentionedPref.isChecked = activeAccount.notificationsMentioned
|
mentionedPref.isChecked = activeAccount.notificationsMentioned
|
||||||
mentionedPref.onPreferenceChangeListener = this
|
mentionedPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val followedPref = requirePreference("notificationFilterFollows") as SwitchPreference
|
val followedPref = requirePreference("notificationFilterFollows") as SwitchPreferenceCompat
|
||||||
followedPref.isChecked = activeAccount.notificationsFollowed
|
followedPref.isChecked = activeAccount.notificationsFollowed
|
||||||
followedPref.onPreferenceChangeListener = this
|
followedPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val boostedPref = requirePreference("notificationFilterReblogs") as SwitchPreference
|
val boostedPref = requirePreference("notificationFilterReblogs") as SwitchPreferenceCompat
|
||||||
boostedPref.isChecked = activeAccount.notificationsReblogged
|
boostedPref.isChecked = activeAccount.notificationsReblogged
|
||||||
boostedPref.onPreferenceChangeListener = this
|
boostedPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val favoritedPref = requirePreference("notificationFilterFavourites") as SwitchPreference
|
val favoritedPref = requirePreference("notificationFilterFavourites") as SwitchPreferenceCompat
|
||||||
favoritedPref.isChecked = activeAccount.notificationsFavorited
|
favoritedPref.isChecked = activeAccount.notificationsFavorited
|
||||||
favoritedPref.onPreferenceChangeListener = this
|
favoritedPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val pollsPref = requirePreference("notificationFilterPolls") as SwitchPreference
|
val pollsPref = requirePreference("notificationFilterPolls") as SwitchPreferenceCompat
|
||||||
pollsPref.isChecked = activeAccount.notificationsPolls
|
pollsPref.isChecked = activeAccount.notificationsPolls
|
||||||
pollsPref.onPreferenceChangeListener = this
|
pollsPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val soundPref = requirePreference("notificationAlertSound") as SwitchPreference
|
val soundPref = requirePreference("notificationAlertSound") as SwitchPreferenceCompat
|
||||||
soundPref.isChecked = activeAccount.notificationSound
|
soundPref.isChecked = activeAccount.notificationSound
|
||||||
soundPref.onPreferenceChangeListener = this
|
soundPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val vibrationPref = requirePreference("notificationAlertVibrate") as SwitchPreference
|
val vibrationPref = requirePreference("notificationAlertVibrate") as SwitchPreferenceCompat
|
||||||
vibrationPref.isChecked = activeAccount.notificationVibration
|
vibrationPref.isChecked = activeAccount.notificationVibration
|
||||||
vibrationPref.onPreferenceChangeListener = this
|
vibrationPref.onPreferenceChangeListener = this
|
||||||
|
|
||||||
val lightPref = requirePreference("notificationAlertLight") as SwitchPreference
|
val lightPref = requirePreference("notificationAlertLight") as SwitchPreferenceCompat
|
||||||
lightPref.isChecked = activeAccount.notificationLight
|
lightPref.isChecked = activeAccount.notificationLight
|
||||||
lightPref.onPreferenceChangeListener = this
|
lightPref.onPreferenceChangeListener = this
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ class NotificationPreferencesFragment : PreferenceFragmentCompat(), Preference.O
|
||||||
when (preference.key) {
|
when (preference.key) {
|
||||||
"notificationsEnabled" -> {
|
"notificationsEnabled" -> {
|
||||||
activeAccount.notificationsEnabled = newValue as Boolean
|
activeAccount.notificationsEnabled = newValue as Boolean
|
||||||
if(NotificationHelper.areNotificationsEnabled(preference.context, accountManager)) {
|
if (NotificationHelper.areNotificationsEnabled(preference.context, accountManager)) {
|
||||||
NotificationHelper.enablePullNotifications()
|
NotificationHelper.enablePullNotifications()
|
||||||
} else {
|
} else {
|
||||||
NotificationHelper.disablePullNotifications()
|
NotificationHelper.disablePullNotifications()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:key="@string/preferences_file_key">
|
android:key="@string/preferences_file_key">
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
|
@ -18,8 +18,9 @@
|
||||||
android:key="blockedUsersPreference"
|
android:key="blockedUsersPreference"
|
||||||
android:title="@string/action_view_blocks" />
|
android:title="@string/action_view_blocks" />
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/pref_publishing">
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
|
android:title="@string/pref_publishing">
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="public"
|
android:defaultValue="public"
|
||||||
android:entries="@array/post_privacy_names"
|
android:entries="@array/post_privacy_names"
|
||||||
|
@ -28,40 +29,42 @@
|
||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/pref_default_post_privacy" />
|
android:title="@string/pref_default_post_privacy" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:icon="@drawable/ic_eye_24dp"
|
android:icon="@drawable/ic_eye_24dp"
|
||||||
android:key="defaultMediaSensitivity"
|
android:key="defaultMediaSensitivity"
|
||||||
android:title="@string/pref_default_media_sensitivity" />
|
android:title="@string/pref_default_media_sensitivity" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/pref_title_timelines">
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
<SwitchPreference
|
android:title="@string/pref_title_timelines">
|
||||||
|
<SwitchPreferenceCompat
|
||||||
android:key="mediaPreviewEnabled"
|
android:key="mediaPreviewEnabled"
|
||||||
android:title="@string/pref_title_show_media_preview" />
|
android:title="@string/pref_title_show_media_preview" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:key="alwaysShowSensitiveMedia"
|
android:key="alwaysShowSensitiveMedia"
|
||||||
android:title="@string/pref_title_alway_show_sensitive_media" />
|
android:title="@string/pref_title_alway_show_sensitive_media" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/pref_title_timeline_filters">
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
|
android:title="@string/pref_title_timeline_filters">
|
||||||
<Preference
|
<Preference
|
||||||
android:key="publicFilters"
|
android:key="publicFilters"
|
||||||
android:title="@string/pref_title_public_filter_keywords"
|
android:title="@string/pref_title_public_filter_keywords" />
|
||||||
/>
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="notificationFilters"
|
android:key="notificationFilters"
|
||||||
android:title="@string/title_notifications"
|
android:title="@string/title_notifications" />
|
||||||
/>
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="homeFilters"
|
android:key="homeFilters"
|
||||||
android:title="@string/title_home"
|
android:title="@string/title_home" />
|
||||||
/>
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="threadFilters"
|
android:key="threadFilters"
|
||||||
android:title="@string/pref_title_thread_filter_keywords"
|
android:title="@string/pref_title_thread_filter_keywords" />
|
||||||
/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</androidx.preference.PreferenceScreen>
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:title="@string/pref_title_http_proxy_settings">
|
android:title="@string/pref_title_http_proxy_settings">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="httpProxyEnabled"
|
android:key="httpProxyEnabled"
|
||||||
android:title="@string/pref_title_http_proxy_enable"
|
android:title="@string/pref_title_http_proxy_enable"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:key="httpProxyServer"
|
android:key="httpProxyServer"
|
||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/pref_title_http_proxy_server"
|
android:title="@string/pref_title_http_proxy_server"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:key="httpProxyPort"
|
android:key="httpProxyPort"
|
||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/pref_title_http_proxy_port"
|
android:title="@string/pref_title_http_proxy_port"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
</androidx.preference.PreferenceScreen>
|
||||||
</PreferenceScreen>
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:key="notificationSettings"
|
android:key="notificationSettings"
|
||||||
android:title="@string/pref_title_edit_notification_settings">
|
android:title="@string/pref_title_edit_notification_settings">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationsEnabled"
|
android:key="notificationsEnabled"
|
||||||
android:title="@string/pref_title_notifications_enabled"
|
android:title="@string/pref_title_notifications_enabled"
|
||||||
|
@ -12,64 +12,63 @@
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:dependency="notificationsEnabled"
|
android:dependency="notificationsEnabled"
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/pref_title_notification_filters"
|
android:title="@string/pref_title_notification_filters"
|
||||||
app:iconSpaceReserved="false">
|
app:iconSpaceReserved="false">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationFilterMentions"
|
android:key="notificationFilterMentions"
|
||||||
android:title="@string/pref_title_notification_filter_mentions"
|
android:title="@string/pref_title_notification_filter_mentions"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationFilterFollows"
|
android:key="notificationFilterFollows"
|
||||||
android:title="@string/pref_title_notification_filter_follows"
|
android:title="@string/pref_title_notification_filter_follows"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationFilterReblogs"
|
android:key="notificationFilterReblogs"
|
||||||
android:title="@string/pref_title_notification_filter_reblogs"
|
android:title="@string/pref_title_notification_filter_reblogs"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationFilterFavourites"
|
android:key="notificationFilterFavourites"
|
||||||
android:title="@string/pref_title_notification_filter_favourites"
|
android:title="@string/pref_title_notification_filter_favourites"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationFilterPolls"
|
android:key="notificationFilterPolls"
|
||||||
android:title="@string/pref_title_notification_filter_poll"
|
android:title="@string/pref_title_notification_filter_poll"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:dependency="notificationsEnabled"
|
android:dependency="notificationsEnabled"
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/pref_title_notification_alerts"
|
android:title="@string/pref_title_notification_alerts"
|
||||||
app:iconSpaceReserved="false">
|
app:iconSpaceReserved="false">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationAlertSound"
|
android:key="notificationAlertSound"
|
||||||
android:title="@string/pref_title_notification_alert_sound"
|
android:title="@string/pref_title_notification_alert_sound"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationAlertVibrate"
|
android:key="notificationAlertVibrate"
|
||||||
android:title="@string/pref_title_notification_alert_vibrate"
|
android:title="@string/pref_title_notification_alert_vibrate"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="notificationAlertLight"
|
android:key="notificationAlertLight"
|
||||||
android:title="@string/pref_title_notification_alert_light"
|
android:title="@string/pref_title_notification_alert_light"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
</androidx.preference.PreferenceScreen>
|
||||||
</PreferenceScreen>
|
|
|
@ -1,8 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:key="@string/preferences_file_key">
|
android:key="@string/preferences_file_key">
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/pref_title_appearance_settings">
|
android:title="@string/pref_title_appearance_settings">
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
|
@ -15,9 +16,9 @@
|
||||||
|
|
||||||
<com.keylesspalace.tusky.EmojiPreference
|
<com.keylesspalace.tusky.EmojiPreference
|
||||||
android:defaultValue="@string/system_default"
|
android:defaultValue="@string/system_default"
|
||||||
|
android:icon="@drawable/ic_emoji_24dp"
|
||||||
android:key="emojiCompat"
|
android:key="emojiCompat"
|
||||||
android:summary="@string/system_default"
|
android:summary="@string/system_default"
|
||||||
android:icon="@drawable/ic_emoji_24dp"
|
|
||||||
android:title="@string/emoji_style" />
|
android:title="@string/emoji_style" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
|
@ -36,45 +37,48 @@
|
||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/pref_status_text_size" />
|
android:title="@string/pref_status_text_size" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="fabHide"
|
android:key="fabHide"
|
||||||
android:title="@string/pref_title_hide_follow_button" />
|
android:title="@string/pref_title_hide_follow_button" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="absoluteTimeView"
|
android:key="absoluteTimeView"
|
||||||
android:title="@string/pref_title_absolute_time" />
|
android:title="@string/pref_title_absolute_time" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="showBotOverlay"
|
android:key="showBotOverlay"
|
||||||
android:title="@string/pref_title_bot_overlay" />
|
android:title="@string/pref_title_bot_overlay" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/pref_title_browser_settings">
|
android:title="@string/pref_title_browser_settings">
|
||||||
<SwitchPreference
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="customTabs"
|
android:key="customTabs"
|
||||||
android:title="@string/pref_title_custom_tabs" />
|
android:title="@string/pref_title_custom_tabs" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/pref_title_status_filter">
|
android:title="@string/pref_title_status_filter">
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="timelineFilterPreferences"
|
android:key="timelineFilterPreferences"
|
||||||
android:title="@string/pref_title_status_tabs" />
|
android:title="@string/pref_title_status_tabs" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/pref_title_proxy_settings">
|
android:title="@string/pref_title_proxy_settings">
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="httpProxyPreferences"
|
android:key="httpProxyPreferences"
|
||||||
android:summary="%s"
|
android:summary="%s"
|
||||||
android:title="@string/pref_title_http_proxy_settings" />
|
android:title="@string/pref_title_http_proxy_settings" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</androidx.preference.PreferenceScreen>
|
||||||
|
|
|
@ -1,20 +1,23 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:title="@string/pref_title_status_tabs">
|
android:title="@string/pref_title_status_tabs">
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
android:shouldDisableView="true"
|
||||||
android:title="@string/title_home"
|
android:title="@string/title_home"
|
||||||
app:iconSpaceReserved="false">
|
app:iconSpaceReserved="false">
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="tabFilterHomeBoosts"
|
android:key="tabFilterHomeBoosts"
|
||||||
android:title="@string/pref_title_show_boosts"
|
android:title="@string/pref_title_show_boosts"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="tabFilterHomeReplies"
|
android:key="tabFilterHomeReplies"
|
||||||
android:title="@string/pref_title_show_replies"
|
android:title="@string/pref_title_show_replies"
|
||||||
app:iconSpaceReserved="false" />
|
app:iconSpaceReserved="false" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</androidx.preference.PreferenceScreen>
|
Loading…
Reference in a new issue