Load default ACRA enable preference
This commit is contained in:
parent
930a561db2
commit
e7e5ae2b77
|
@ -47,6 +47,10 @@
|
||||||
<string name="pref_title_composing">Composing</string>
|
<string name="pref_title_composing">Composing</string>
|
||||||
<string name="pref_title_composing_title">Composing using zero-width space characters in emojis</string>
|
<string name="pref_title_composing_title">Composing using zero-width space characters in emojis</string>
|
||||||
|
|
||||||
|
<string name="pref_acra_category">ACRA Settings</string>
|
||||||
|
<string name="pref_acra_body">Enable ACRA reporting</string>
|
||||||
|
<string name="key_enable_acra">acra.enable</string>
|
||||||
|
|
||||||
<string name="pref_title_anonymize_upload_filenames">Anonymize uploaded file names</string>
|
<string name="pref_title_anonymize_upload_filenames">Anonymize uploaded file names</string>
|
||||||
<string name="pref_title_live_notifications">Live notifications</string>
|
<string name="pref_title_live_notifications">Live notifications</string>
|
||||||
<string name="pref_summary_live_notifications">May slightly increase power consumption</string>
|
<string name="pref_summary_live_notifications">May slightly increase power consumption</string>
|
||||||
|
|
|
@ -250,6 +250,13 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
|
||||||
// Flush old media that was cached for sharing
|
// Flush old media that was cached for sharing
|
||||||
deleteStaleCachedMedia(applicationContext.getExternalFilesDir("Husky"))
|
deleteStaleCachedMedia(applicationContext.getExternalFilesDir("Husky"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load the default settings for the app but does not overwrite changed values
|
||||||
|
PreferenceManager.setDefaultValues(
|
||||||
|
this,
|
||||||
|
R.xml.app_preferences,
|
||||||
|
true
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initPullNotifications() {
|
private fun initPullNotifications() {
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.keylesspalace.tusky
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
|
|
|
@ -45,6 +45,7 @@ import com.mikepenz.iconics.utils.colorInt
|
||||||
import com.mikepenz.iconics.utils.sizePx
|
import com.mikepenz.iconics.utils.sizePx
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
import org.acra.ACRA.PREF_ENABLE_ACRA
|
||||||
|
|
||||||
class PreferencesFragment : PreferenceFragmentCompat(), Injectable {
|
class PreferencesFragment : PreferenceFragmentCompat(), Injectable {
|
||||||
|
|
||||||
|
@ -336,23 +337,12 @@ class PreferencesFragment : PreferenceFragmentCompat(), Injectable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
preferenceCategory(R.string.pref_title_proxy_settings) {
|
preferenceCategory(R.string.pref_acra_category) {
|
||||||
httpProxyPref = preference {
|
switchPreference {
|
||||||
setTitle(R.string.pref_title_http_proxy_settings)
|
setDefaultValue(false)
|
||||||
setOnPreferenceClickListener {
|
key = PREF_ENABLE_ACRA
|
||||||
activity?.let { activity ->
|
setTitle(R.string.pref_acra_body)
|
||||||
val intent = PreferencesActivity.newIntent(
|
isSingleLineTitle = false
|
||||||
activity,
|
|
||||||
PreferencesActivity.PROXY_PREFERENCES
|
|
||||||
)
|
|
||||||
activity.startActivity(intent)
|
|
||||||
activity.overridePendingTransition(
|
|
||||||
R.anim.slide_from_right,
|
|
||||||
R.anim.slide_to_left
|
|
||||||
)
|
|
||||||
}
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,4 @@ object PrefKeys {
|
||||||
|
|
||||||
const val TAB_FILTER_HOME_REPLIES = "tabFilterHomeReplies"
|
const val TAB_FILTER_HOME_REPLIES = "tabFilterHomeReplies"
|
||||||
const val TAB_FILTER_HOME_BOOSTS = "tabFilterHomeBoosts"
|
const val TAB_FILTER_HOME_BOOSTS = "tabFilterHomeBoosts"
|
||||||
|
|
||||||
const val ACRA_ENABLE_REPORT = "acraEnable"
|
|
||||||
}
|
}
|
||||||
|
|
13
husky/app/src/main/res/xml/app_preferences.xml
Normal file
13
husky/app/src/main/res/xml/app_preferences.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="@string/pref_acra_category">
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="@string/key_enable_acra"
|
||||||
|
android:title="@string/pref_acra_body" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
Loading…
Reference in a new issue