summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui
diff options
context:
space:
mode:
authorBobby Georgescu <georgescu@google.com>2012-12-26 00:52:28 -0800
committerBobby Georgescu <georgescu@google.com>2013-01-07 14:43:56 -0800
commita4205e4eab691b402e7a6dc1e913a611b7fdc45f (patch)
treebaa01cd5497b0616a4cf324feca8e3700b6460c8 /src/com/android/gallery3d/ui
parentbf7af1173998fe8ac9e0eb7059d2b64e75a1c417 (diff)
downloadandroid_packages_apps_Snap-a4205e4eab691b402e7a6dc1e913a611b7fdc45f.tar.gz
android_packages_apps_Snap-a4205e4eab691b402e7a6dc1e913a611b7fdc45f.tar.bz2
android_packages_apps_Snap-a4205e4eab691b402e7a6dc1e913a611b7fdc45f.zip
Replace camera importer
Change-Id: Icfeb23301bc6c9f8c8b12824bcbb0d8b41852d07
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java6
-rw-r--r--src/com/android/gallery3d/ui/AlbumLabelMaker.java4
-rw-r--r--src/com/android/gallery3d/ui/ImportCompleteListener.java53
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java10
4 files changed, 2 insertions, 71 deletions
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 9b84bf75c..cd3ca091d 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -55,7 +55,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
private static final int SUPPORT_MULTIPLE_MASK = MediaObject.SUPPORT_DELETE
| MediaObject.SUPPORT_ROTATE | MediaObject.SUPPORT_SHARE
- | MediaObject.SUPPORT_CACHE | MediaObject.SUPPORT_IMPORT;
+ | MediaObject.SUPPORT_CACHE;
public interface ActionModeListener {
public boolean onActionItemClicked(MenuItem item);
@@ -173,9 +173,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
ProgressListener listener = null;
String confirmMsg = null;
int action = item.getItemId();
- if (action == R.id.action_import) {
- listener = new ImportCompleteListener(mActivity);
- } else if (action == R.id.action_delete) {
+ if (action == R.id.action_delete) {
confirmMsg = mActivity.getResources().getQuantityString(
R.plurals.delete_selection, mSelectionManager.getSelectedCount());
if (mDeleteProgressListener == null) {
diff --git a/src/com/android/gallery3d/ui/AlbumLabelMaker.java b/src/com/android/gallery3d/ui/AlbumLabelMaker.java
index cd6c77861..6eeeec045 100644
--- a/src/com/android/gallery3d/ui/AlbumLabelMaker.java
+++ b/src/com/android/gallery3d/ui/AlbumLabelMaker.java
@@ -46,7 +46,6 @@ public class AlbumLabelMaker {
private final LazyLoadedBitmap mLocalSetIcon;
private final LazyLoadedBitmap mPicasaIcon;
private final LazyLoadedBitmap mCameraIcon;
- private final LazyLoadedBitmap mMtpIcon;
public AlbumLabelMaker(Context context, AlbumSetSlotRenderer.LabelSpec spec) {
mContext = context;
@@ -57,7 +56,6 @@ public class AlbumLabelMaker {
mLocalSetIcon = new LazyLoadedBitmap(R.drawable.frame_overlay_gallery_folder);
mPicasaIcon = new LazyLoadedBitmap(R.drawable.frame_overlay_gallery_picasa);
mCameraIcon = new LazyLoadedBitmap(R.drawable.frame_overlay_gallery_camera);
- mMtpIcon = new LazyLoadedBitmap(R.drawable.frame_overlay_gallery_ptp);
}
public static int getBorderSize() {
@@ -70,8 +68,6 @@ public class AlbumLabelMaker {
return mCameraIcon.get();
case DataSourceType.TYPE_LOCAL:
return mLocalSetIcon.get();
- case DataSourceType.TYPE_MTP:
- return mMtpIcon.get();
case DataSourceType.TYPE_PICASA:
return mPicasaIcon.get();
}
diff --git a/src/com/android/gallery3d/ui/ImportCompleteListener.java b/src/com/android/gallery3d/ui/ImportCompleteListener.java
deleted file mode 100644
index 8d6e981ce..000000000
--- a/src/com/android/gallery3d/ui/ImportCompleteListener.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.gallery3d.ui;
-
-import android.os.Bundle;
-import android.widget.Toast;
-
-import com.android.gallery3d.R;
-import com.android.gallery3d.app.AbstractGalleryActivity;
-import com.android.gallery3d.app.AlbumPage;
-import com.android.gallery3d.util.MediaSetUtils;
-
-public class ImportCompleteListener extends WakeLockHoldingProgressListener {
- private static final String WAKE_LOCK_LABEL = "Gallery Album Import";
-
- public ImportCompleteListener(AbstractGalleryActivity galleryActivity) {
- super(galleryActivity, WAKE_LOCK_LABEL);
- }
-
- @Override
- public void onProgressComplete(int result) {
- super.onProgressComplete(result);
- int message;
- if (result == MenuExecutor.EXECUTION_RESULT_SUCCESS) {
- message = R.string.import_complete;
- goToImportedAlbum();
- } else {
- message = R.string.import_fail;
- }
- Toast.makeText(getActivity().getAndroidContext(), message, Toast.LENGTH_LONG).show();
- }
-
- private void goToImportedAlbum() {
- String pathOfImportedAlbum = "/local/all/" + MediaSetUtils.IMPORTED_BUCKET_ID;
- Bundle data = new Bundle();
- data.putString(AlbumPage.KEY_MEDIA_PATH, pathOfImportedAlbum);
- getActivity().getStateManager().startState(AlbumPage.class, data);
- }
-}
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 46e400483..28fd71e10 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -178,7 +178,6 @@ public class MenuExecutor {
boolean supportCache = (supported & MediaObject.SUPPORT_CACHE) != 0;
boolean supportEdit = (supported & MediaObject.SUPPORT_EDIT) != 0;
boolean supportInfo = (supported & MediaObject.SUPPORT_INFO) != 0;
- boolean supportImport = (supported & MediaObject.SUPPORT_IMPORT) != 0;
setMenuItemVisible(menu, R.id.action_delete, supportDelete);
setMenuItemVisible(menu, R.id.action_rotate_ccw, supportRotate);
@@ -193,7 +192,6 @@ public class MenuExecutor {
setMenuItemVisible(menu, R.id.action_show_on_map, supportShowOnMap);
setMenuItemVisible(menu, R.id.action_edit, supportEdit);
setMenuItemVisible(menu, R.id.action_details, supportInfo);
- setMenuItemVisible(menu, R.id.action_import, supportImport);
}
public static void updateMenuForPanorama(Menu menu, boolean shareAsPanorama360,
@@ -271,9 +269,6 @@ public class MenuExecutor {
case R.id.action_show_on_map:
title = R.string.show_on_map;
break;
- case R.id.action_import:
- title = R.string.Import;
- break;
default:
return;
}
@@ -394,11 +389,6 @@ public class MenuExecutor {
}
break;
}
- case R.id.action_import: {
- MediaObject obj = manager.getMediaObject(path);
- result = obj.Import();
- break;
- }
default:
throw new AssertionError();
}