Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Android library for settings activity #452

Merged

Conversation

@chrgernoe chrgernoe linked an issue Feb 6, 2024 that may be closed by this pull request
@github-actions github-actions bot added the feature New feature or request label Feb 6, 2024
@chrgernoe chrgernoe requested a review from paetz February 6, 2024 23:04
Use external library for lead and follow colorization.
@chrgernoe chrgernoe force-pushed the feature/429-use-android-preference-library-for-app-settings branch from b1f1ace to 51f09d7 Compare February 18, 2024 20:53
@chrgernoe chrgernoe marked this pull request as ready for review February 18, 2024 20:54
paetz
paetz previously approved these changes Feb 20, 2024
app/build.gradle Show resolved Hide resolved
for (stringResource in listOf(R.string.lead, R.string.follow)) {
findPreference<ColorPickerPreference>(getString(stringResource))?.getColorPickerView()?.let { view ->
context?.let { context ->
view.getSharedPreferenceManager().setSharedPreferences(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is view.getSharedPreferenceManager the same object as preferenceManager?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The object preferenceManager (defined in Android library) is the preference manager for the settings in our app and the object that is returned by view.getSharedPreferenceManager is of type ColorPickerPreferenceManager. This is a child of the class defined in the Android library but defined inside the external library.

@chrgernoe chrgernoe merged commit 9b51034 into master Mar 5, 2024
5 checks passed
@chrgernoe chrgernoe deleted the feature/429-use-android-preference-library-for-app-settings branch March 5, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
2 participants