Beispiel #1
0
 public void debug(boolean enable) {
   HomeUtils.DEBUG = enable;
   File file = new File(HomeUtils.get3DHomePath() + File.separator + ".debug");
   if (enable) {
     if (!file.exists()) {
       try {
         file.createNewFile();
       } catch (IOException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
       }
     }
     Toast.makeText(HomeManager.getInstance().getContext(), "Open debug!!!", Toast.LENGTH_SHORT)
         .show();
     SELoadResThread.getInstance().process(mDetectMemoryTask, 10000);
   } else {
     if (file.exists()) {
       file.delete();
     }
     Toast.makeText(HomeManager.getInstance().getContext(), "Close debug!!!", Toast.LENGTH_SHORT)
         .show();
     SELoadResThread.getInstance().cancel(mDetectMemoryTask);
   }
   SESceneManager.setDebug_JNI(enable);
 }
Beispiel #2
0
        @Override
        public void onClick(View v) {
          switch (v.getId()) {
            case R.id.menu00:
              SESceneManager.getInstance()
                  .removeMessage(HomeScene.MSG_TYPE_SHOW_WALL_LONG_CLICK_DIALOG);
              SESceneManager.getInstance()
                  .handleMessage(HomeScene.MSG_TYPE_SHOW_WALL_LONG_CLICK_DIALOG, null);
              break;
            case R.id.menu01:
              HomeUtils.gotoSettingsActivity();
              break;
            case R.id.menu02:
              Intent intentSetting = new Intent();
              intentSetting.setAction("android.settings.SETTINGS");
              intentSetting.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              HomeManager.getInstance().startActivity(intentSetting);
              break;
            case R.id.menu03:
              Intent intentAppMgr = new Intent();
              intentAppMgr.setClassName(
                  "com.android.settings",
                  "com.android.settings.Settings$ManageApplicationsActivity");
              intentAppMgr.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              HomeManager.getInstance().startActivity(intentAppMgr);
              break;

            default:
              break;
          }

          OptionMenu.this.dismiss();
        }
Beispiel #3
0
 public static int searchMaxIndex(SEScene scene, String table, String name) {
   String where =
       ObjectInfoColumns.SCENE_NAME
           + "='"
           + scene.getSceneName()
           + "' AND "
           + ObjectInfoColumns.OBJECT_NAME
           + "='"
           + name
           + "'";
   Context context = HomeManager.getInstance().getContext();
   Cursor cursor =
       HomeDataBaseHelper.getInstance(context)
           .getReadableDatabase()
           .query(
               table,
               new String[] {"max(" + ObjectInfoColumns.OBJECT_INDEX + ") as max_index"},
               where,
               null,
               null,
               null,
               null);
   if (cursor != null && cursor.moveToFirst()) {
     int max_index = cursor.getInt(0);
     cursor.close();
     return max_index;
   }
   return 0;
 }
Beispiel #4
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);
   }
 }
Beispiel #5
0
 /** ****************** for wall paper *********************************** */
 public static void applyWallpaperFromMarket(ArrayList<WallPaperItem> wallpapers, String paperId) {
   if (null != mHomeManager) {
     HomeScene scene = mHomeManager.getHomeScene();
     if (null != scene) {
       scene.applyWallpaperFromMarket(wallpapers, paperId);
     }
   }
 }
Beispiel #6
0
 public static ArrayList<RawPaperItem> exportWallPaperToMarket() {
   if (null != mHomeManager) {
     HomeScene scene = mHomeManager.getHomeScene();
     if (null != scene) {
       return scene.exportWallPaperToMarket();
     }
   }
   return new ArrayList<RawPaperItem>();
 }
Beispiel #7
0
 @Override
 public void handOnClick() {
   Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
   intent.setType("image/*");
   intent.putExtra("crop", "true");
   intent.putExtra("aspectX", mWidth);
   intent.putExtra("aspectY", mHeight);
   intent.putExtra("output", Uri.fromFile(new File(HomeUtils.createImageTmpFile())));
   intent.putExtra("outputFormat", "JPEG");
   HomeManager.getInstance().startActivityForResult(intent, mRequestCode);
 }
Beispiel #8
0
 public static void gotoSettingsActivity() {
   Intent intentHome = new Intent();
   intentHome.setAction(HomeUtils.PKG_CURRENT_NAME + ".settings");
   intentHome.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   HomeManager.getInstance().startActivity(intentHome);
 }