Bug 880118 - Dynamically pull resource IDs to avoid R.java reordering r=kats

This commit is contained in:
Mark Finkle 2013-09-05 00:29:29 -04:00
Родитель 6d8ac130b9
Коммит 8b7d6d5ca2
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -443,18 +443,20 @@ public class LayerView extends FrameLayout {
return mGLController;
}
private Bitmap getDrawable(int resId) {
private Bitmap getDrawable(String name) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = false;
return BitmapUtils.decodeResource(getContext(), resId, options);
Context context = getContext();
int resId = context.getResources().getIdentifier(name, "drawable", context.getPackageName());
return BitmapUtils.decodeResource(context, resId, options);
}
Bitmap getShadowPattern() {
return getDrawable(R.drawable.shadow);
return getDrawable("shadow");
}
Bitmap getScrollbarImage() {
return getDrawable(R.drawable.scrollbar);
return getDrawable("scrollbar");
}
/* When using a SurfaceView (mSurfaceView != null), resizing happens in two