@Override
  public void onClick(View v) {

    int id = v.getId();
    if (id == R.id.delete_or_download) {
      if (PRODUCT_STATUS == PRODUCT_STATUS_PURCHASE || PRODUCT_STATUS == PRODUCT_STATUS_DOWNLOAD) {
        purchase();
        StaticUtil.staticWallpaper(mContext, "WALLPAPER_DOWNLOAD");
        //                StaticUtil.onEvent(mActivity, "WALLPAPER_DOWNLOAD", "wallpaper download");
      } else if (PRODUCT_STATUS == PRODUCT_STATUS_DOWNLOADING) {
        // TODO cancle download
      } else if (PRODUCT_STATUS == PRODUCT_STATUS_DOWNLOADED) {
        IntentUtil.sendBroadCastforInstall(mActivity, mData.localUrl, mData.product_id);
      } else if (PRODUCT_STATUS == PRODUCT_STATUS_INSTALLED) {
        if (isSupportApply(mData.type)) {
          mDownloadOrDeleteButton.setText(R.string.action_wallpaper_setting);
          IntentUtil.sendBroadCastforApplyed(mActivity, mData.localUrl, mData.product_id);
        } else {
          // 删除
          showConfirmDialog();
        }
      } else if (PRODUCT_STATUS == PRODUCT_STATUS_NEED_UPDATE) {
        purchase();
        // TODO update version
      } else if (PRODUCT_STATUS == PRODUCT_STATUS_APPLIED) {
        //                showConfirmDialog();
      }
    }
  }
Ejemplo n.º 2
0
 private static void gotoProductDetailActivity(String productId) {
   IntentUtil.startProductDetailActivity(
       SESceneManager.getInstance().getGLActivity(),
       productId,
       0,
       null,
       Utils.isScreenOrientationPortrait());
 }