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

android: persistent settings #47

Merged
merged 4 commits into from
Jul 23, 2021
Merged

Conversation

elig0n
Copy link
Contributor

@elig0n elig0n commented Jul 22, 2021

This adds saving & restoring for the settings: subtitles toggle state, IP address, port & password. The saved states are read on startup and are saved everytime they are modified and applied/lose focus.

For the IP if no IP address is already saved (i.e. at first run) or is set to an empty string or app storage was cleared then the usual procedure of default IP prefix construction and scan is done. This still allows people to utilize them on first run.

#34

Comment on lines 43 to 47
BackgroundToggleButton subtitles2 = (miccah.mpvremote.BackgroundToggleButton)
findViewById(R.id.subtitles2);
subtitles2.setChecked(PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("SUBTITLES", true));

Copy link
Owner

Choose a reason for hiding this comment

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

What is this code doing? Where is the subtitles2 view defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry it's a typo.

Copy link
Owner

Choose a reason for hiding this comment

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

No worries, I see it's getting the SUBTITLES preference here but I'm not seeing where it gets set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my bad, I got it into another branch by mistake

@mcastorina
Copy link
Owner

Great work!

@mcastorina mcastorina merged commit 8c3080b into mcastorina:master Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants