Skip to content

Commit

Permalink
remove useless simple menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Asutorufa committed May 3, 2024
1 parent 2fcf07f commit 53fd62e
Show file tree
Hide file tree
Showing 31 changed files with 15 additions and 1,272 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ dependencies {

implementation(project(":yuhaiin"))
implementation(project(":logcatviewer"))
implementation(project(":preferencex-simplemenu"))

/*
//compose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import com.google.android.material.transition.platform.MaterialSharedAxis
import com.takisoft.preferencex.SimpleMenuPreference
import io.github.asutorufa.yuhaiin.database.DNS
import io.github.asutorufa.yuhaiin.database.Manager.profile
import io.github.asutorufa.yuhaiin.database.Manager.setOnPreferenceChangeListener
Expand Down Expand Up @@ -81,7 +80,7 @@ class DnsFragment : PreferenceFragmentCompat() {
}
}

findPreference<SimpleMenuPreference>(resources.getString(R.string.remote_dns_type_key))!!.apply {
findPreference<ListPreference>(resources.getString(R.string.remote_dns_type_key))!!.apply {
value = dnsTypeToStr(DNS.Type.fromInt(profile.remoteDns.type))
setOnPreferenceChangeListener(this) { _, newValue ->
profile.remoteDns.type = strToDNSType(newValue as String).value
Expand Down Expand Up @@ -116,7 +115,7 @@ class DnsFragment : PreferenceFragmentCompat() {
profile.localDns.host = newValue as String
}
}
findPreference<SimpleMenuPreference>(resources.getString(R.string.local_dns_type_key))!!.apply {
findPreference<ListPreference>(resources.getString(R.string.local_dns_type_key))!!.apply {
value = dnsTypeToStr(DNS.Type.fromInt(profile.localDns.type))
setOnPreferenceChangeListener(this) { _, newValue ->
profile.localDns.type = strToDNSType(newValue as String).value
Expand Down Expand Up @@ -145,7 +144,7 @@ class DnsFragment : PreferenceFragmentCompat() {
profile.bootstrapDns.host = newValue as String
}
}
findPreference<SimpleMenuPreference>(resources.getString(R.string.bootstrap_dns_type_key))!!.apply {
findPreference<ListPreference>(resources.getString(R.string.bootstrap_dns_type_key))!!.apply {
value = dnsTypeToStr(DNS.Type.fromInt(profile.bootstrapDns.type))
setOnPreferenceChangeListener(this) { _, newValue ->
profile.bootstrapDns.type = strToDNSType(newValue as String).value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.preference.SwitchPreferenceCompat
import com.github.logviewer.LogcatActivity
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.transition.platform.MaterialSharedAxis
import com.takisoft.preferencex.SimpleMenuPreference
import io.github.asutorufa.yuhaiin.database.Manager
import io.github.asutorufa.yuhaiin.database.Manager.profile
import io.github.asutorufa.yuhaiin.database.Manager.setOnPreferenceChangeListener
Expand Down Expand Up @@ -229,7 +228,7 @@ class ProfileFragment : PreferenceFragmentCompat() {
refreshPreferences.add { it.isChecked = profile.saveLogcat }
}

findPreference<SimpleMenuPreference>(resources.getString(R.string.log_level))!!.also {
findPreference<ListPreference>(resources.getString(R.string.log_level))!!.also {
setOnPreferenceChangeListener(it) { _, newValue ->
profile.logLevel = strToLogLevel(newValue.toString())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.view.View
import androidx.preference.*
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.transition.platform.MaterialSharedAxis
import com.takisoft.preferencex.SimpleMenuPreference
import io.github.asutorufa.yuhaiin.database.Bypass
import io.github.asutorufa.yuhaiin.database.Manager.profile
import io.github.asutorufa.yuhaiin.database.Manager.setOnPreferenceChangeListener
Expand Down Expand Up @@ -40,7 +39,7 @@ class RulePreferenceFragment : PreferenceFragmentCompat() {

preferenceManager.preferenceDataStore = mainActivity.dataStore

findPreference<SimpleMenuPreference>(resources.getString(R.string.adv_route_Key))!!.also {
findPreference<ListPreference>(resources.getString(R.string.adv_route_Key))!!.also {
it.value = profile.route
setOnPreferenceChangeListener(it) { _, newValue ->
profile.route = newValue as String
Expand Down Expand Up @@ -103,14 +102,14 @@ class RulePreferenceFragment : PreferenceFragmentCompat() {
}
}

findPreference<SimpleMenuPreference>(resources.getString(R.string.bypass_tcp))!!.also {
findPreference<ListPreference>(resources.getString(R.string.bypass_tcp))!!.also {
it.value = bypassTypeToStr(Bypass.Type.fromInt(profile.bypass.tcp))
setOnPreferenceChangeListener(it) { _, newValue ->
profile.bypass.tcp = strToBypassType(newValue as String).value
}
}

findPreference<SimpleMenuPreference>(resources.getString(R.string.bypass_udp))!!.also {
findPreference<ListPreference>(resources.getString(R.string.bypass_udp))!!.also {
it.value = bypassTypeToStr(Bypass.Type.fromInt(profile.bypass.udp))
setOnPreferenceChangeListener(it) { _, newValue ->
profile.bypass.udp = strToBypassType(newValue as String).value
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/xml/dns.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
android:singleLine="true"
android:key="@string/remote_dns_host_key"
app:useSimpleSummaryProvider="true" />
<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:title="@string/dns_type_title"
android:entries="@array/dns_types"
android:key="@string/remote_dns_type_key"
Expand Down Expand Up @@ -71,7 +71,7 @@
android:singleLine="true"
android:key="@string/local_dns_host_key"
app:useSimpleSummaryProvider="true" />
<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:title="@string/dns_type_title"
android:entries="@array/dns_types"
app:useSimpleSummaryProvider="true"
Expand All @@ -97,7 +97,7 @@
android:key="@string/bootstrap_dns_host_key"
android:singleLine="true"
app:useSimpleSummaryProvider="true" />
<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:title="@string/dns_type_title"
android:key="@string/bootstrap_dns_type_key"
android:entries="@array/dns_types"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/xml/rule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<androidx.preference.PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">

<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:icon="@drawable/router"
android:key="@string/adv_route_Key"
android:title="@string/adv_route_title"
Expand All @@ -16,14 +16,14 @@
app:useSimpleSummaryProvider="true"
android:singleLine="true" />

<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:key="@string/bypass_tcp"
android:title="@string/bypass_tcp"
android:entries="@array/adv_bypass_mode"
app:useSimpleSummaryProvider="true"
android:entryValues="@array/adv_bypass_mode" />

<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:key="@string/bypass_udp"
android:title="@string/bypass_udp"
android:entries="@array/adv_bypass_mode"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
android:title="@string/save_logcat_name"
android:summary="@string/save_logcat_summary" />

<com.takisoft.preferencex.SimpleMenuPreference
<ListPreference
android:key="@string/log_level"
android:title="@string/log_level_name"
android:entries="@array/log_levels"
Expand Down
1 change: 0 additions & 1 deletion preferencex-simplemenu/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions preferencex-simplemenu/build.gradle

This file was deleted.

21 changes: 0 additions & 21 deletions preferencex-simplemenu/proguard-rules.pro

This file was deleted.

1 change: 0 additions & 1 deletion preferencex-simplemenu/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 53fd62e

Please sign in to comment.