You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
SharedPreferences should allow a default value specified from a resource #536
Currently, the @DefaultX annotations support fixed values, however it is a common use case where this default may vary based on language/other resource qualifiers. The @DefaultX annotations should have an argument valueRes that takes a resource of the appropriate type.
Ok. I just looked further into the code dealing with Android's resources injection and everything is tied up to the value and resName paired attributes. So, we can't just modify the existing annotations without breaking the API.
We have to create new a set of annotations @DefaultResString, @DefaultResInteger, etc.. And the implementation should be like this :
public @interface DefaultResString {
Stringvalue() defaultResId.DEFAULT_VALUE;
StringresName() default"";
}
Currently, the
@DefaultXannotations support fixed values, however it is a common use case where this default may vary based on language/other resource qualifiers. The@DefaultXannotations should have an argument valueRes that takes a resource of the appropriate type.