diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt b/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt index d3986a2..0cfb338 100644 --- a/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt +++ b/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt @@ -18,14 +18,11 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.lifecycleScope import androidx.navigation.NavController import androidx.navigation.NavDestination -import androidx.navigation.findNavController import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.navigateUp import androidx.navigation.ui.setupActionBarWithNavController import androidx.navigation.ui.setupWithNavController -import androidx.preference.Preference -import androidx.preference.PreferenceFragmentCompat import com.google.android.material.dialog.MaterialAlertDialogBuilder import io.nekohasekai.libbox.Libbox import io.nekohasekai.libbox.ProfileContent @@ -46,7 +43,6 @@ import io.nekohasekai.sfa.ktx.errorDialogBuilder import io.nekohasekai.sfa.ktx.hasPermission import io.nekohasekai.sfa.ktx.launchCustomTab import io.nekohasekai.sfa.ui.profile.NewProfileActivity -import io.nekohasekai.sfa.ui.settings.CoreFragment import io.nekohasekai.sfa.ui.shared.AbstractActivity import io.nekohasekai.sfa.utils.MIUIUtils import io.nekohasekai.sfa.vendor.Vendor @@ -57,7 +53,6 @@ import java.io.File import java.util.Date class MainActivity : AbstractActivity(), - PreferenceFragmentCompat.OnPreferenceStartFragmentCallback, ServiceConnection.Callback { companion object { @@ -111,21 +106,6 @@ class MainActivity : AbstractActivity(), binding.dashboardTabContainer.isVisible = destinationId == R.id.navigation_dashboard } - override fun onPreferenceStartFragment( - caller: PreferenceFragmentCompat, - pref: Preference - ): Boolean { - val navController = findNavController(R.id.nav_host_fragment_activity_my) - when (pref.fragment) { - CoreFragment::class.java.name -> { - navController.navigate(R.id.navigation_settings_core) - return true - } - - else -> return false - } - } - override public fun onNewIntent(intent: Intent) { super.onNewIntent(intent) val uri = intent.data ?: return diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment0.kt b/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment0.kt deleted file mode 100644 index 9c3dfb1..0000000 --- a/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment0.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.nekohasekai.sfa.ui.main - -import io.nekohasekai.sfa.R -import io.nekohasekai.sfa.ui.settings.AbstractSettingsFragment - -class SettingsFragment0 : AbstractSettingsFragment(R.xml.preferences_settings) { - - -} \ No newline at end of file diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/settings/AbstractSettingsFragment.kt b/app/src/main/java/io/nekohasekai/sfa/ui/settings/AbstractSettingsFragment.kt deleted file mode 100644 index 5043c1e..0000000 --- a/app/src/main/java/io/nekohasekai/sfa/ui/settings/AbstractSettingsFragment.kt +++ /dev/null @@ -1,27 +0,0 @@ -package io.nekohasekai.sfa.ui.settings - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.ViewGroup -import androidx.annotation.XmlRes -import androidx.preference.PreferenceFragmentCompat -import androidx.recyclerview.widget.RecyclerView -import io.nekohasekai.sfa.R - -open class AbstractSettingsFragment(@XmlRes val resId: Int) : PreferenceFragmentCompat() { - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - setPreferencesFromResource(resId, rootKey) - } - - override fun onCreateRecyclerView( - inflater: LayoutInflater, - parent: ViewGroup, - savedInstanceState: Bundle? - ): RecyclerView { - val recyclerView = inflater - .inflate(R.layout.view_prefenence_screen, parent, false) as RecyclerView - recyclerView.layoutManager = onCreateLayoutManager() - return recyclerView - } - -} \ No newline at end of file diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/settings/CoreFragment.kt b/app/src/main/java/io/nekohasekai/sfa/ui/settings/CoreFragment.kt deleted file mode 100644 index b326885..0000000 --- a/app/src/main/java/io/nekohasekai/sfa/ui/settings/CoreFragment.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.nekohasekai.sfa.ui.settings - -import androidx.fragment.app.Fragment - -class CoreFragment : Fragment() { -} \ No newline at end of file diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/settings/Preference.kt b/app/src/main/java/io/nekohasekai/sfa/ui/settings/Preference.kt deleted file mode 100644 index 738d624..0000000 --- a/app/src/main/java/io/nekohasekai/sfa/ui/settings/Preference.kt +++ /dev/null @@ -1,45 +0,0 @@ -package io.nekohasekai.sfa.ui.settings - -import android.content.Context -import android.util.AttributeSet -import android.util.TypedValue -import androidx.preference.Preference -import io.nekohasekai.sfa.ktx.getAttrColor - -class Preference : Preference { - - constructor( - context: Context, - attrs: AttributeSet?, - defStyleAttr: Int, - defStyleRes: Int - ) : super(context, attrs, defStyleAttr, defStyleRes) { - icon?.setTint(context.getAttrColor(com.google.android.material.R.attr.colorOnSurface)) - } - - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : this( - context, - attrs, - defStyleAttr, - 0 - ) - - constructor(context: Context, attrs: AttributeSet?) : this( - context, attrs, getAttr( - context, androidx.preference.R.attr.preferenceStyle, - android.R.attr.preferenceStyle - ) - ) - - companion object { - private fun getAttr(context: Context, attr: Int, fallbackAttr: Int): Int { - val value = TypedValue() - context.theme.resolveAttribute(attr, value, true) - if (value.resourceId != 0) { - return attr - } - return fallbackAttr - } - } - -} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_settings_core.xml b/app/src/main/res/layout/fragment_settings_core.xml deleted file mode 100644 index 77d9ef6..0000000 --- a/app/src/main/res/layout/fragment_settings_core.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml index 1cf86db..cc64ba4 100644 --- a/app/src/main/res/navigation/mobile_navigation.xml +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -29,10 +29,5 @@ android:label="@string/title_settings" tools:layout="@layout/fragment_settings" /> - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 80a3535..0172808 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -194,6 +194,5 @@ background location permission is required. Select Allow all the time to grant the permission.]]> Open Settings - Core \ No newline at end of file diff --git a/app/src/main/res/xml/preferences_settings.xml b/app/src/main/res/xml/preferences_settings.xml deleted file mode 100644 index 1ba928f..0000000 --- a/app/src/main/res/xml/preferences_settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9958810..644045e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,10 +5,10 @@ buildscript { } plugins { - id 'com.android.application' version '8.7.2' apply false - id 'com.android.library' version '8.7.2' apply false - id 'org.jetbrains.kotlin.android' version '1.9.23' apply false - id 'com.google.devtools.ksp' version '1.9.23-1.0.20' apply false + id 'com.android.application' version '8.7.3' apply false + id 'com.android.library' version '8.7.3' apply false + id 'org.jetbrains.kotlin.android' version '2.1.0' apply false + id 'com.google.devtools.ksp' version '2.1.0-1.0.29' apply false id 'com.github.triplet.play' version '3.8.4' apply false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a32e0b5..d0124e5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ -#Sun Oct 06 20:10:49 CST 2024 +#Fri Nov 29 14:47:37 CST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME