-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
BackgroundToggleButton subtitles2 = (miccah.mpvremote.BackgroundToggleButton) | ||
findViewById(R.id.subtitles2); | ||
subtitles2.setChecked(PreferenceManager.getDefaultSharedPreferences(this) | ||
.getBoolean("SUBTITLES", true)); | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Great work! |
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