Skip to content

Commit

Permalink
fix: 修复自定义 Git 仓库的设置功能
Browse files Browse the repository at this point in the history
  • Loading branch information
xz-dev committed Jan 29, 2022
1 parent 30e2206 commit fbd7f3d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "net.xzos.upgradeall"
minSdkVersion 21
targetSdkVersion 31
versionCode 92
versionName "0.11-rc.2"
versionCode 93
versionName "0.11-rc.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
kapt {
arguments {
Expand Down Expand Up @@ -75,17 +75,17 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'

implementation "androidx.activity:activity-ktx:1.4.0"
implementation 'androidx.fragment:fragment-ktx:1.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.fragment:fragment-ktx:1.4.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0'

// Kotlin
implementation 'androidx.core:core-ktx:1.7.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object PreferencesMap {
get() {
val customCloudRulesHubUrl =
prefs.getString(CUSTOM_CLOUD_RULES_HUB_URL_KEY, "FromUpdateServer")!!
return customCloudRulesHubUrl.lowercase(Locale.ENGLISH) == "Custom"
return customCloudRulesHubUrl == "Custom"
}

var cloud_rules_hub_url: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ class LanguageFragment : PrefFragment(R.xml.preferences_language),
SharedPreferences.OnSharedPreferenceChangeListener {
override fun onResume() {
super.onResume()
preferenceScreen.sharedPreferences
.registerOnSharedPreferenceChangeListener(this)
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
}

override fun onPause() {
super.onPause()
preferenceScreen.sharedPreferences
.unregisterOnSharedPreferenceChangeListener(this)
preferenceScreen.sharedPreferences!!.unregisterOnSharedPreferenceChangeListener(this)
}

override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class UISettingFragment : PrefFragment(R.xml.preferences_ui),

override fun onResume() {
super.onResume()
preferenceScreen.sharedPreferences.registerOnSharedPreferenceChangeListener(this)
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
}

override fun onPause() {
super.onPause()
preferenceScreen.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)
preferenceScreen.sharedPreferences!!.unregisterOnSharedPreferenceChangeListener(this)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ import net.xzos.upgradeall.data.PreferencesMap
import net.xzos.upgradeall.data.PreferencesMap.CUSTOM_CLOUD_RULES_HUB_URL_KEY
import net.xzos.upgradeall.databinding.ViewEditviewBinding

class UpdatesPrefFragment : PrefFragment(R.xml.preferences_update), SharedPreferences.OnSharedPreferenceChangeListener {
class UpdatesPrefFragment : PrefFragment(R.xml.preferences_update),
SharedPreferences.OnSharedPreferenceChangeListener {

override fun onResume() {
super.onResume()
preferenceScreen.sharedPreferences
.registerOnSharedPreferenceChangeListener(this)
preferenceScreen.sharedPreferences!!.registerOnSharedPreferenceChangeListener(this)
}

override fun onPause() {
super.onPause()
preferenceScreen.sharedPreferences
.unregisterOnSharedPreferenceChangeListener(this)
preferenceScreen.sharedPreferences!!.unregisterOnSharedPreferenceChangeListener(this)
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down

0 comments on commit fbd7f3d

Please sign in to comment.