Skip to content

Commit

Permalink
rilling#94 Profile Settings: Create a new Profile menu item in settin…
Browse files Browse the repository at this point in the history
…gs and open new screen accordingly
  • Loading branch information
jaedusg committed Mar 23, 2024
1 parent 30640ac commit ee12399
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public class MainSettingsFragment extends PreferenceFragmentCompat {
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.settings);

findPreference(getString(R.string.settings_profile_key)).setOnPreferenceClickListener(preference -> {
((SettingsActivity) getActivity()).openScreen(getString(R.string.settings_profile_key));
return true;
});

findPreference(getString(R.string.settings_defaults_key)).setOnPreferenceClickListener(preference -> {
((SettingsActivity) getActivity()).openScreen(getString(R.string.settings_defaults_key));
return true;
Expand Down Expand Up @@ -67,4 +72,4 @@ public void onDisplayPreferenceDialog(@NonNull Preference preference) {

super.onDisplayPreferenceDialog(preference);
}
}
}
11 changes: 8 additions & 3 deletions src/main/res/drawable/ic_profile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp">
<path />
</vector>
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z"/>
</vector>

0 comments on commit ee12399

Please sign in to comment.