mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 14:45:08 +00:00
Set action bar title in SettingsFragment
Set the title "Settings" to the action bar in the SettingsFragment. Previously, depending on where you came from, it just read "KDE Connect Devices", "About" or the device name.
This commit is contained in:
committed by
Nicolas Fella
parent
a2d7a1b58a
commit
a2c20d93f2
@@ -8,7 +8,12 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.EditTextPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
@@ -33,6 +38,14 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
||||
|
||||
private EditTextPreference renameDevice;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
if (getActivity() != null) {
|
||||
((MainActivity) requireActivity()).getSupportActionBar().setTitle(R.string.settings);
|
||||
}
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
|
||||
|
Reference in New Issue
Block a user