fix requested changes part 1
This commit is contained in:
parent
f158276939
commit
421be909a8
3 changed files with 36 additions and 19 deletions
|
|
@ -190,4 +190,16 @@ public class ThemeHelper {
|
|||
String defaultTheme = context.getResources().getString(R.string.default_theme_value);
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getString(themeKey, defaultTheme);
|
||||
}
|
||||
|
||||
/**
|
||||
* This will get the R.drawable.* resource to which attr is currently pointing to.
|
||||
*
|
||||
* @param attr a R.attribute.* resource value
|
||||
* @param context the context to use
|
||||
* @return a R.drawable.* resource value
|
||||
*/
|
||||
public static int getIconByAttr(final int attr, final Context context) {
|
||||
return context.obtainStyledAttributes(new int[] {attr})
|
||||
.getResourceId(0, -1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue