mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-20 08:50:25 +00:00
Added dynamic action bar titles in settings
This commit is contained in:
parent
b37a2eca3b
commit
5a7e5cf506
3 changed files with 32 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.dslul.openboard.inputmethod.latin.settings;
|
package org.dslul.openboard.inputmethod.latin.settings;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -107,6 +108,15 @@ public final class CustomInputStyleSettingsFragment extends PreferenceFragment
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
final ActionBar actionBar = getActivity().getActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setTitle(R.string.custom_input_styles_title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
||||||
final Bundle savedInstanceState) {
|
final Bundle savedInstanceState) {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.dslul.openboard.inputmethod.latin.settings;
|
package org.dslul.openboard.inputmethod.latin.settings;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -58,6 +59,16 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
final ActionBar actionBar = getActivity().getActionBar();
|
||||||
|
final CharSequence screenTitle = getPreferenceScreen().getTitle();
|
||||||
|
if (actionBar != null && screenTitle != null) {
|
||||||
|
actionBar.setTitle(screenTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
|
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
|
||||||
if (FeedbackUtils.isHelpAndFeedbackFormSupported()) {
|
if (FeedbackUtils.isHelpAndFeedbackFormSupported()) {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.dslul.openboard.inputmethod.latin.settings;
|
package org.dslul.openboard.inputmethod.latin.settings;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
import android.app.backup.BackupManager;
|
import android.app.backup.BackupManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
@ -131,6 +132,16 @@ public abstract class SubScreenFragment extends PreferenceFragment
|
||||||
mSharedPreferenceChangeListener);
|
mSharedPreferenceChangeListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
final ActionBar actionBar = getActivity().getActionBar();
|
||||||
|
final CharSequence screenTitle = getPreferenceScreen().getTitle();
|
||||||
|
if (actionBar != null && screenTitle != null) {
|
||||||
|
actionBar.setTitle(screenTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
getSharedPreferences().unregisterOnSharedPreferenceChangeListener(
|
getSharedPreferences().unregisterOnSharedPreferenceChangeListener(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue