summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMangesh Ghiware <mghiware@google.com>2013-08-23 13:28:21 -0700
committerMangesh Ghiware <mghiware@google.com>2013-09-04 16:32:42 -0700
commit33035c19cc47adfb738c20cef66652ae451c8e10 (patch)
tree0ccc411e4ee754d53b38c858f96d3679037bff7f /src/com
parent121022cb590955e37f1264f77190ce4711159976 (diff)
downloadandroid_packages_apps_Snap-33035c19cc47adfb738c20cef66652ae451c8e10.tar.gz
android_packages_apps_Snap-33035c19cc47adfb738c20cef66652ae451c8e10.tar.bz2
android_packages_apps_Snap-33035c19cc47adfb738c20cef66652ae451c8e10.zip
Bring back 'share 360 photosphere' to filmstrip
Bug: 10367406 Change-Id: Icb07e9e890a72bec6ed3b4c5a7e33400be3446f8
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/CameraActivity.java96
-rw-r--r--src/com/android/camera/ui/FilmStripView.java3
2 files changed, 62 insertions, 37 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 47a964f06..3521de2d4 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -230,38 +230,37 @@ public class CameraActivity extends Activity
}
@Override
- public void onCurrentDataChanged(int dataID, boolean current) {
- if (!current) {
- hidePanoStitchingProgress();
- } else {
- LocalData currentData = mDataAdapter.getLocalData(dataID);
- if (currentData == null) {
- Log.w(TAG, "Current data ID not found.");
- hidePanoStitchingProgress();
- return;
- }
-
- if (currentData.getLocalDataType() ==
- LocalData.LOCAL_CAMERA_PREVIEW) {
- // Don't show the action bar in Camera preview.
- mActionBar.hide();
- } else {
- updateActionBarMenu(dataID);
- }
-
- Uri contentUri = currentData.getContentUri();
- if (contentUri == null) {
- hidePanoStitchingProgress();
- return;
- }
- int panoStitchingProgress = mPanoramaManager.getTaskProgress(contentUri);
- if (panoStitchingProgress < 0) {
- hidePanoStitchingProgress();
- return;
+ public void onCurrentDataChanged(final int dataID, final boolean current) {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (!current) {
+ hidePanoStitchingProgress();
+ } else {
+ LocalData currentData = mDataAdapter.getLocalData(dataID);
+ if (currentData == null) {
+ Log.w(TAG, "Current data ID not found.");
+ hidePanoStitchingProgress();
+ return;
+ }
+ updateActionBarMenu(dataID);
+
+ Uri contentUri = currentData.getContentUri();
+ if (contentUri == null) {
+ hidePanoStitchingProgress();
+ return;
+ }
+ int panoStitchingProgress = mPanoramaManager.getTaskProgress(
+ contentUri);
+ if (panoStitchingProgress < 0) {
+ hidePanoStitchingProgress();
+ return;
+ }
+ showPanoStitchingProgress();
+ updateStitchingProgress(panoStitchingProgress);
+ }
}
- showPanoStitchingProgress();
- updateStitchingProgress(panoStitchingProgress);
- }
+ });
}
@Override
@@ -369,14 +368,35 @@ public class CameraActivity extends Activity
setMenuItemVisible(mActionBarMenu, R.id.action_trim,
(supported & SUPPORT_TRIM) != 0);
- if ((supported & SUPPORT_SHARE) != 0) {
- setMenuItemVisible(mActionBarMenu, R.id.action_share, true);
- setStandardShareIntent(currentData.getContentUri(), currentData.getMimeType());
- }
- if ((supported & SUPPORT_SHARE_PANORAMA360) != 0) {
- setMenuItemVisible(mActionBarMenu, R.id.action_share_panorama, true);
+ boolean standardShare = (supported & SUPPORT_SHARE) != 0;
+ boolean panoramaShare = (supported & SUPPORT_SHARE_PANORAMA360) != 0;
+ setMenuItemVisible(mActionBarMenu, R.id.action_share, standardShare);
+ setMenuItemVisible(mActionBarMenu, R.id.action_share_panorama, panoramaShare);
+
+ if (panoramaShare) {
+ // For 360 PhotoSphere, relegate standard share to the overflow menu
+ MenuItem item = mActionBarMenu.findItem(R.id.action_share);
+ if (item != null) {
+ item.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
+ item.setTitle(getResources().getString(R.string.share_as_photo));
+ }
+ // And, promote "share as panorama" to action bar
+ item = mActionBarMenu.findItem(R.id.action_share_panorama);
+ if (item != null) {
+ item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ }
setPanoramaShareIntent(currentData.getContentUri());
}
+ if (standardShare) {
+ if (!panoramaShare) {
+ MenuItem item = mActionBarMenu.findItem(R.id.action_share);
+ if (item != null) {
+ item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ item.setTitle(getResources().getString(R.string.share));
+ }
+ }
+ setStandardShareIntent(currentData.getContentUri(), currentData.getMimeType());
+ }
boolean itemHasLocation = currentData.getLatLong() != null;
setMenuItemVisible(mActionBarMenu, R.id.action_show_on_map,
@@ -496,6 +516,7 @@ public class CameraActivity extends Activity
// Configure the standard share action provider
MenuItem item = menu.findItem(R.id.action_share);
mStandardShareActionProvider = (ShareActionProvider) item.getActionProvider();
+ mStandardShareActionProvider.setShareHistoryFileName("standard_share_history.xml");
if (mStandardShareIntent != null) {
mStandardShareActionProvider.setShareIntent(mStandardShareIntent);
}
@@ -503,6 +524,7 @@ public class CameraActivity extends Activity
// Configure the panorama share action provider
item = menu.findItem(R.id.action_share_panorama);
mPanoramaShareActionProvider = (ShareActionProvider) item.getActionProvider();
+ mPanoramaShareActionProvider.setShareHistoryFileName("panorama_share_history.xml");
if (mPanoramaShareIntent != null) {
mPanoramaShareActionProvider.setShareIntent(mPanoramaShareIntent);
}
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index 1805177e2..fd532fb00 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -971,6 +971,9 @@ public class FilmStripView extends ViewGroup implements BottomControlsListener {
boolean isPanorama360) {
// Make sure the returned data is for the current image.
if (requestId == getCurrentId()) {
+ if (mListener != null) {
+ mListener.onCurrentDataChanged(requestId, true);
+ }
mBottomControls.setViewPhotoSphereButtonVisibility(isPanorama);
mBottomControls.setTinyPlanetButtonVisibility(isPanorama360);
}