This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ddcd66
commit 858ff6b
Showing
10 changed files
with
68 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 21 additions & 4 deletions
25
app/src/main/kotlin/moe/reimu/weiboxposed/SettingsActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
package moe.reimu.weiboxposed | ||
|
||
import android.support.v4.app.Fragment | ||
import android.annotation.SuppressLint | ||
import android.content.SharedPreferences | ||
import android.preference.PreferenceActivity | ||
import android.os.Bundle | ||
import android.widget.Toast | ||
|
||
class SettingsActivity : SingleFragmentActivity() { | ||
override fun createFragment(): Fragment { | ||
return GeneralPreferenceFragment() | ||
class SettingsActivity : PreferenceActivity(), SharedPreferences.OnSharedPreferenceChangeListener { | ||
@Suppress("DEPRECATION") | ||
@SuppressLint("WorldReadableFiles") | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
getSharedPreferences(GeneralPreferenceFragment.PREF_NAME, MODE_WORLD_READABLE) | ||
.registerOnSharedPreferenceChangeListener(this) | ||
fragmentManager.beginTransaction().replace(android.R.id.content, GeneralPreferenceFragment()).commit() | ||
} | ||
|
||
override fun isValidFragment(fragmentName: String): Boolean { | ||
return GeneralPreferenceFragment::class.java.name == fragmentName | ||
} | ||
|
||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { | ||
Toast.makeText(this, R.string.restart_weibo, Toast.LENGTH_SHORT).show() | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
app/src/main/kotlin/moe/reimu/weiboxposed/SingleFragmentActivity.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,54 @@ | ||
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<android.support.v7.preference.PreferenceCategory | ||
<PreferenceCategory | ||
android:key="features" | ||
android:title="@string/pref_features_title"> | ||
|
||
<android.support.v7.preference.SwitchPreferenceCompat | ||
<SwitchPreference | ||
android:defaultValue="true" | ||
android:key="global_enabled" | ||
android:title="@string/pref_title_global_enabled"/> | ||
|
||
<SwitchPreference | ||
android:defaultValue="false" | ||
android:key="remove_hot" | ||
android:title="@string/pref_title_remove_hot" | ||
android:summary="@string/pref_description_remove_hot"/> | ||
|
||
<android.support.v7.preference.SwitchPreferenceCompat | ||
<SwitchPreference | ||
android:defaultValue="false" | ||
android:key="force_browser" | ||
android:summary="@string/pref_description_force_browser" | ||
android:title="@string/pref_title_force_browser"/> | ||
|
||
<android.support.v7.preference.SwitchPreferenceCompat | ||
<SwitchPreference | ||
android:defaultValue="false" | ||
android:key="disable_new_message_flow" | ||
android:title="@string/pref_title_disable_new_message_flow"/> | ||
|
||
<android.support.v7.preference.SwitchPreferenceCompat | ||
<SwitchPreference | ||
android:defaultValue="false" | ||
android:key="debug_mode" | ||
android:title="@string/pref_title_debug_mode"/> | ||
</android.support.v7.preference.PreferenceCategory> | ||
</PreferenceCategory> | ||
|
||
<android.support.v7.preference.PreferenceCategory | ||
<PreferenceCategory | ||
android:key="filtering" | ||
android:title="@string/pref_filtering_title"> | ||
<android.support.v7.preference.EditTextPreference | ||
<EditTextPreference | ||
android:defaultValue="" | ||
android:key="content_keyword" | ||
android:title="@string/pref_title_content_keyword"/> | ||
<android.support.v7.preference.EditTextPreference | ||
<EditTextPreference | ||
android:defaultValue="" | ||
android:key="user_keyword" | ||
android:title="@string/pref_title_user_keyword"/> | ||
</android.support.v7.preference.PreferenceCategory> | ||
<android.support.v7.preference.PreferenceCategory | ||
</PreferenceCategory> | ||
<PreferenceCategory | ||
android:title="@string/pref_donate_title"> | ||
<android.support.v7.preference.Preference | ||
<Preference | ||
android:key="alipay" | ||
android:title="@string/pref_title_alipay"/> | ||
</android.support.v7.preference.PreferenceCategory> | ||
</PreferenceCategory> | ||
|
||
</android.support.v7.preference.PreferenceScreen> | ||
</PreferenceScreen> |