|
|
|
@ -2,11 +2,9 @@ package io.legado.app.ui.config |
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
|
|
import android.content.ComponentName |
|
|
|
|
import android.content.Intent |
|
|
|
|
import android.content.SharedPreferences |
|
|
|
|
import android.content.pm.PackageManager |
|
|
|
|
import android.os.Bundle |
|
|
|
|
import android.os.Process |
|
|
|
|
import android.view.View |
|
|
|
|
import androidx.preference.ListPreference |
|
|
|
|
import androidx.preference.Preference |
|
|
|
@ -21,7 +19,6 @@ import io.legado.app.lib.dialogs.alert |
|
|
|
|
import io.legado.app.lib.theme.primaryColor |
|
|
|
|
import io.legado.app.receiver.SharedReceiverActivity |
|
|
|
|
import io.legado.app.service.WebService |
|
|
|
|
import io.legado.app.ui.main.MainActivity |
|
|
|
|
import io.legado.app.ui.widget.number.NumberPickerDialog |
|
|
|
|
import io.legado.app.utils.* |
|
|
|
|
import splitties.init.appCtx |
|
|
|
@ -113,10 +110,7 @@ class OtherConfigFragment : BasePreferenceFragment(), |
|
|
|
|
} |
|
|
|
|
PreferKey.showDiscovery, PreferKey.showRss -> postEvent(EventBus.NOTIFY_MAIN, true) |
|
|
|
|
PreferKey.language -> listView.postDelayed({ |
|
|
|
|
val intent = Intent(appCtx, MainActivity::class.java) |
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK) |
|
|
|
|
appCtx.startActivity(intent) |
|
|
|
|
Process.killProcess(Process.myPid()) |
|
|
|
|
appCtx.restart() |
|
|
|
|
}, 1000) |
|
|
|
|
PreferKey.userAgent -> listView.post { |
|
|
|
|
upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent) |
|
|
|
|