Back to project page fruit.thememanager.
The source code is released under:
Apache License
If you think the Android project fruit.thememanager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.fruit.thememanager.helper; // w w w .j ava2s.c o m import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.util.Log; public class ThemeResourceCustomLoader implements ThemeResourceLoader { private ThemeInfo mThemeInfo; private ThemeResources mThemeRes; public ThemeResourceCustomLoader(Context context, ThemeInfo info) { this.mThemeInfo = info; try { mThemeRes = new ThemeResources(context, mThemeInfo.mPkgName); } catch (PackageManager.NameNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public Drawable loadDrawable(String resName) { // TODO Auto-generated method stub Drawable d = null; try { d = mThemeRes.loadDrawable(resName); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); d = null; } catch (OutOfMemoryError e) { e.printStackTrace(); d = null; } return d; } @Override public Bitmap loadBitmap(String resName) { // TODO Auto-generated method stub Bitmap bmp = null; try { bmp = mThemeRes.loadBitmap(resName); } catch (OutOfMemoryError e) { e.printStackTrace(); bmp = null; } return bmp; } @Override public String loadString(String resName) { // TODO Auto-generated method stub return mThemeRes.loadString(resName); } @Override public int loadColor(String resName) { // TODO Auto-generated method stub return mThemeRes.loadColor(resName); } @Override public String[] loadStringArray(String resName) { // TODO Auto-generated method stub return mThemeRes.loadStringArray(resName); } }