Android Open Source - fruit.thememanager Theme Info Default Loader






From Project

Back to project page fruit.thememanager.

License

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.

Java Source Code

package com.fruit.thememanager.helper;
// w ww .jav a 2  s .  com
import java.util.ArrayList;

import com.fruit.thememanager.R;
import com.fruit.thememanager.ThemeUtils;
import com.fruit.thememanager.ThemeUtils.ThemeType;
import android.content.Context;
import android.content.res.Resources;

public final class ThemeInfoDefaultLoader implements ThemeInfoLoader {

  private static ThemeInfoDefaultLoader sInstance;

  public static ThemeInfoDefaultLoader getInstance() {
    if (sInstance == null) {
      sInstance = new ThemeInfoDefaultLoader();
    }
    return sInstance;
  }

  @Override
  public final ThemeInfo loadThemeInfo(Context context, String themePkgName) {
    // TODO Auto-generated method stub
    if(!themePkgName.equals(ThemeUtils.DEFAULT_THEME_PACKAGENAME)){
      return null;
    }
    
    final Resources res = context.getResources();
    ThemeInfo info = new ThemeInfo();

    info.mPkgName = new String(ThemeUtils.DEFAULT_THEME_PACKAGENAME); 
    info.mThemeName = res.getString(R.string.theme_name_default);
    info.mThemeAuthor = res.getString(R.string.theme_author_default);
    info.mThemeDesc = res.getString(R.string.theme_description_default);
    info.mThemeType = ThemeType.THEME_DEFAULT;
    info.mThemeVer = Integer.parseInt(res.getString(R.string.theme_version_default));
    info.mThemeSupportVer = Integer.parseInt(res.getString(R.string.theme_support_version_default));

    return info;
  }

  @Override
  public final ArrayList<ThemeInfo> loadInstalledThemes(Context context, String themeCategory) {
    // TODO Auto-generated method stub
    ArrayList<ThemeInfo> list = new ArrayList<ThemeInfo>(1);
    
    list.add(loadThemeInfo(context, ThemeUtils.DEFAULT_THEME_PACKAGENAME));
    return list;
  }
}




Java Source Code List

com.fruit.thememanager.ListItemThemeElement.java
com.fruit.thememanager.ListItem.java
com.fruit.thememanager.ThemeApplyActivity.java
com.fruit.thememanager.ThemeCustomActivity.java
com.fruit.thememanager.ThemeCustomOptActivity.java
com.fruit.thememanager.ThemeManager.java
com.fruit.thememanager.ThemeProvider.java
com.fruit.thememanager.ThemeSettingActivity.java
com.fruit.thememanager.ThemeShowAdapter.java
com.fruit.thememanager.ThemeShowImageAdapter.java
com.fruit.thememanager.ThemeUtils.java
com.fruit.thememanager.helper.ThemeInfoCustomLoader.java
com.fruit.thememanager.helper.ThemeInfoDefaultLoader.java
com.fruit.thememanager.helper.ThemeInfoLoader.java
com.fruit.thememanager.helper.ThemeInfo.java
com.fruit.thememanager.helper.ThemeLoaderHelper.java
com.fruit.thememanager.helper.ThemeResourceCustomLoader.java
com.fruit.thememanager.helper.ThemeResourceDefaultLoader.java
com.fruit.thememanager.helper.ThemeResourceLoader.java
com.fruit.thememanager.helper.ThemeResources.java