Fixed titles not setting to activity toolbar
This commit is contained in:
parent
bcd1064e94
commit
7e5e14163c
@ -56,6 +56,14 @@ open class MainActivity : MagiskActivity<MainViewModel, ActivityMainBinding>() {
|
||||
|
||||
}
|
||||
|
||||
override fun setTitle(title: CharSequence?) {
|
||||
supportActionBar?.title = title
|
||||
}
|
||||
|
||||
override fun setTitle(titleId: Int) {
|
||||
supportActionBar?.setTitle(titleId)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (binding.drawerLayout.isDrawerOpen(binding.navView)) {
|
||||
binding.drawerLayout.closeDrawer(binding.navView)
|
||||
|
@ -46,6 +46,11 @@ class MagiskFragment : NewMagiskFragment<HomeViewModel, FragmentMagiskBinding>()
|
||||
setHasOptionsMenu(true)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
requireActivity().setTitle(R.string.magisk)
|
||||
}
|
||||
|
||||
private fun installMagisk() {
|
||||
// Show Manager update first
|
||||
if (Config.remoteManagerVersionCode > BuildConfig.VERSION_CODE) {
|
||||
|
@ -40,11 +40,16 @@ public class SettingsFragment extends BasePreferenceFragment {
|
||||
private ListPreference updateChannel, autoRes, suNotification,
|
||||
requestTimeout, rootConfig, multiuserConfig, nsConfig;
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
requireActivity().setTitle(R.string.settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
getPreferenceManager().setStorageDeviceProtected();
|
||||
setPreferencesFromResource(R.xml.app_settings, rootKey);
|
||||
requireActivity().setTitle(R.string.settings);
|
||||
|
||||
boolean showSuperuser = Utils.showSuperUser();
|
||||
app.getPrefs().edit()
|
||||
@ -100,7 +105,7 @@ public class SettingsFragment extends BasePreferenceFragment {
|
||||
.setTitle(R.string.settings_update_custom)
|
||||
.setView(v)
|
||||
.setPositiveButton(R.string.ok, (d, i) ->
|
||||
Config.set(Config.Key.CUSTOM_CHANNEL, url.getText().toString()))
|
||||
Config.set(Config.Key.CUSTOM_CHANNEL, url.getText().toString()))
|
||||
.setNegativeButton(R.string.close, (d, i) ->
|
||||
Config.set(Config.Key.UPDATE_CHANNEL, prev))
|
||||
.setOnCancelListener(d ->
|
||||
|
@ -13,7 +13,7 @@ class SuperuserFragment :
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
magiskActivity.supportActionBar?.title = getString(R.string.superuser)
|
||||
requireActivity().setTitle(R.string.superuser)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
Loading…
Reference in New Issue
Block a user