Example #1
0
 /// 1. set applying paper id
 /// 2. save using paper id for current theme, which restore while
 /// come back to the theme later, see to: markThemeAsApply()
 public static void markPaperAsApply(Context context, String productId) {
   MarketUtils.updatePlugIn(context, productId, true, MarketUtils.CATEGORY_WALLPAPER);
   ThemeInfo themeInfo = HomeManager.getInstance().getCurrentThemeInfo();
   if (null != themeInfo) {
     SettingsActivity.setWallpaperId(context, themeInfo.mProductID, productId);
   }
 }
Example #2
0
  /// 1. clear current possible applied theme id
  /// 2. set new applying theme id
  /// 3. set last used paper id for new theme
  public static void markThemeAsApply(Context context, String productId) {
    String where = ThemeColumns.IS_APPLY + "=" + 1;
    ContentValues values = new ContentValues();
    values.put(ThemeColumns.IS_APPLY, 0);
    context.getContentResolver().update(ThemeColumns.CONTENT_URI, values, where, null);

    values = new ContentValues();
    where = ThemeColumns.PRODUCT_ID + "='" + productId + "'";
    int status = 1;
    values.put(ThemeColumns.IS_APPLY, status);
    context.getContentResolver().update(ThemeColumns.CONTENT_URI, values, where, null);
    if (productId != null) {
      MarketUtils.updatePlugIn(context, productId, true, MarketUtils.CATEGORY_THEME);
      WallpaperUtils.clearAppliedFlag(context);
      String themePaperId = SettingsActivity.getWallpaperId(context, productId);
      if (!TextUtils.isEmpty(themePaperId)) {
        MarketUtils.updatePlugIn(context, themePaperId, true, MarketUtils.CATEGORY_WALLPAPER);
      }
    }
  }