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

Allow "injection" directly into certain widgets #14

Closed
denley opened this issue Feb 26, 2015 · 1 comment
Closed

Allow "injection" directly into certain widgets #14

denley opened this issue Feb 26, 2015 · 1 comment
Milestone

Comments

@denley
Copy link
Owner

denley commented Feb 26, 2015

This could be done in a few ways:

By inferring the type from the widget type (only one "injection" type per widget type):

@BindPref("username")
TextView loggedInUser;

Or maybe by using different annotations for each type:

@BindBackgroundColorPreference("background_color")
View rootView;

Or maybe by manually specifying the type:

@BindPref(value = "background_color", bindTo = BACKGROUND_COLOR)
View rootView;
@denley denley modified the milestone: 3.0.0 Jul 23, 2015
@denley
Copy link
Owner Author

denley commented Jul 23, 2015

Possible binding types:

enum value binding method %2 type
ASSIGN (default) %1 = %2 -
ACTIVATED %1.setActivated(%2) View
ENABLED %1.setEnabled(%2) View
SELECTED %1.setSelected(%2) View
VISIBILITY %1.setVisibility(%2 ? View.VISIBLE : View.GONE) View
CHECKED %1.setChecked(%2) Checkable/CompoundButton
TEXT %1.setText(%2) TextView
PROGRESS %1.setProgress(%2) ProgressBar
MAX_PROGRESS %1.setMax(%2) ProgressBar

denley added a commit that referenced this issue Jul 24, 2015
Preference values can now be bound directly into
certain common Android widgets.  In some cases,
user input on the widget is also saved back into
the SharedPreferences file.

A select few widgets have been included. They are
tablulated in README.md

#14
@denley denley closed this as completed Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant