Is something like this possible with Roboguice on Android?
<resources>
<dimen name="radius">10dip</dimen>
</resources>
and then
@InjectResource(R.dimen.radius)
private int radius; // in px
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I looked into sources and there are supported types as:
String resources.getString(id)boolean resources.getBoolean(id)ColorStateList resources.getColorStateList(id)int resources.getInteger(id)Drawable resources.getDrawable(id)String[] resources.getStringArray(id)int[] resources.getIntArray(id)Animation AnimationUtils.loadAnimation(application, id)Movie resources.getMovie(id)I couldn’t find
int resources.getDimensionPixelSize(id).That what you could do is to keep dimension as an
intvalue:But it’s not a clean solution.