summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-04-16 17:09:20 -0700
committernicolasroard <nicolasroard@google.com>2013-04-16 17:32:13 -0700
commit83bd8d346d295e4fe06212da957feb77ee23c04d (patch)
tree39d18182c654658f6eb1ba3bbed14a889252b81b
parent113e0fbd251966629719f390e43b320b84751304 (diff)
downloadandroid_packages_apps_Gallery2-83bd8d346d295e4fe06212da957feb77ee23c04d.tar.gz
android_packages_apps_Gallery2-83bd8d346d295e4fe06212da957feb77ee23c04d.tar.bz2
android_packages_apps_Gallery2-83bd8d346d295e4fe06212da957feb77ee23c04d.zip
Remove History panel
Now that we have the state, history is not that useful. For clarity's sake we are removing it. bug:8620913 bug:8503386 bug:8324322 bug:8324023 Change-Id: Ife86f3ab67c05d5781234496c7518866b506631b
-rw-r--r--res/menu/filtershow_activity_menu.xml6
-rw-r--r--res/values/filtershow_strings.xml4
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java101
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageShow.java12
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/MasterImage.java1
5 files changed, 3 insertions, 121 deletions
diff --git a/res/menu/filtershow_activity_menu.xml b/res/menu/filtershow_activity_menu.xml
index f62bf3967..0a8f4e97a 100644
--- a/res/menu/filtershow_activity_menu.xml
+++ b/res/menu/filtershow_activity_menu.xml
@@ -20,12 +20,6 @@
android:id="@+id/resetHistoryButton"
android:title="@string/reset"/>
<item
- android:id="@+id/operationsButton"
- android:icon="@drawable/filtershow_button_operations"
- android:showAsAction="never"
- android:visible="true"
- android:title="@string/show_history_panel"/>
- <item
android:id="@+id/showImageStateButton"
android:showAsAction="never"
android:visible="true"
diff --git a/res/values/filtershow_strings.xml b/res/values/filtershow_strings.xml
index 11f27cf1b..e2b04d2cc 100644
--- a/res/values/filtershow_strings.xml
+++ b/res/values/filtershow_strings.xml
@@ -39,10 +39,6 @@
<string name="filtershow_undo">Undo</string>
<!-- Text for redo menu item [CHAR LIMIT=20] -->
<string name="filtershow_redo">Redo</string>
- <!-- Text for the history panel menu item [CHAR LIMIT=20] -->
- <string name="show_history_panel">Show History</string>
- <!-- Text for the history panel menu item [CHAR LIMIT=20] -->
- <string name="hide_history_panel">Hide History</string>
<!-- Text for the image state panel menu item [CHAR LIMIT=20] -->
<string name="show_imagestate_panel">Show Image State</string>
<!-- Text for the image state panel menu item [CHAR LIMIT=20] -->
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index da466f484..4133d8915 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -122,7 +122,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
private static int mImageBorderSize = 4; // in percent
private boolean mShowingTinyPlanet = false;
- private boolean mShowingHistoryPanel = false;
private boolean mShowingImageStatePanel = false;
private final Vector<ImageShow> mImageViews = new Vector<ImageShow>();
@@ -153,15 +152,12 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
fillEditors();
loadXML();
+
if (getResources().getConfiguration().orientation
== Configuration.ORIENTATION_LANDSCAPE) {
mShowingImageStatePanel = true;
}
- if (mShowingHistoryPanel) {
- findViewById(R.id.historyPanel).setVisibility(View.VISIBLE);
- } else {
- findViewById(R.id.historyPanel).setVisibility(View.GONE);
- }
+
if (mShowingImageStatePanel && (savedInstanceState == null)) {
loadImageStatePanel();
}
@@ -176,7 +172,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
((ViewStub) findViewById(R.id.stateCategoryStub)).inflate();
((ViewStub) findViewById(R.id.editorPanelStub)).inflate();
- ((ViewStub) findViewById(R.id.historyPanelStub)).inflate();
ActionBar actionBar = getActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
@@ -221,7 +216,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
mPanelController.addView(findViewById(R.id.applyEffect));
- setupHistoryPanel();
setupStatePanel();
mImageCategoryPanel = findViewById(R.id.imageCategoryPanel);
@@ -235,14 +229,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
mImageCategoryPanel.setVisibility(View.VISIBLE);
}
- public void setupHistoryPanel() {
- findViewById(R.id.resetOperationsButton).setOnClickListener(
- createOnClickResetOperationsButton());
- ListView operationsList = (ListView) findViewById(R.id.operationsList);
- operationsList.setAdapter(mMasterImage.getHistory());
- operationsList.setOnItemClickListener(this);
- }
-
public void setupStatePanel() {
mImageLoader.setAdapter(mMasterImage.getHistory());
mPanelController.setRowPanel(findViewById(R.id.secondRowPanel));
@@ -509,7 +495,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
}
pipeline.turnOnPipeline(true);
MasterImage.getImage().setOriginalGeometry(largeBitmap);
- MasterImage.getImage().getHistory().setOriginalBitmap(mImageLoader.getOriginalBitmapSmall());
mLoadBitmapTask = null;
if (mAction == CROP_ACTION) {
@@ -660,12 +645,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.filtershow_activity_menu, menu);
- MenuItem showHistory = menu.findItem(R.id.operationsButton);
- if (mShowingHistoryPanel) {
- showHistory.setTitle(R.string.hide_history_panel);
- } else {
- showHistory.setTitle(R.string.show_history_panel);
- }
MenuItem showState = menu.findItem(R.id.showImageStateButton);
if (mShowingImageStatePanel) {
showState.setTitle(R.string.hide_imagestate_panel);
@@ -728,10 +707,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
toggleImageStatePanel();
return true;
}
- case R.id.operationsButton: {
- toggleHistoryPanel();
- return true;
- }
case android.R.id.home: {
saveImage();
return true;
@@ -844,10 +819,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
// //////////////////////////////////////////////////////////////////////////////
// imageState panel...
- public boolean isShowingHistoryPanel() {
- return mShowingHistoryPanel;
- }
-
private void toggleImageStatePanel() {
invalidateOptionsMenu();
}
@@ -876,9 +847,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
if (mShowingImageStatePanel) {
loadImageStatePanel();
}
- if (mShowingHistoryPanel) {
- toggleHistoryPanel();
- }
if (mShowingTinyPlanet == false) {
View tinyPlanetView = findViewById(EditorTinyPlanet.ID);
if (tinyPlanetView != null) {
@@ -911,61 +879,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
}
}
- // //////////////////////////////////////////////////////////////////////////////
- // history panel...
-
- public void toggleHistoryPanel() {
- final View view = findViewById(R.id.mainPanel);
- final View viewList = findViewById(R.id.historyPanel);
-
- int translate = translateMainPanel(viewList);
- if (!mShowingHistoryPanel) {
- mShowingHistoryPanel = true;
- if (getResources().getConfiguration().orientation
- == Configuration.ORIENTATION_PORTRAIT) {
- // If portrait, always remove the state panel
- mShowingImageStatePanel = false;
- if (PanelController.useAnimationsLayer()) {
- view.animate().setDuration(200).x(translate)
- .withLayer().withEndAction(new Runnable() {
- @Override
- public void run() {
- viewList.setAlpha(0);
- viewList.setVisibility(View.VISIBLE);
- viewList.animate().setDuration(100)
- .alpha(1.0f).start();
- }
- }).start();
- } else {
- view.setX(translate);
- viewList.setAlpha(0);
- viewList.setVisibility(View.VISIBLE);
- viewList.animate().setDuration(100)
- .alpha(1.0f).start();
- }
- } else {
- findViewById(R.id.filtersPanel).setVisibility(View.GONE);
- viewList.setVisibility(View.VISIBLE);
- }
- } else {
- mShowingHistoryPanel = false;
- if (getResources().getConfiguration().orientation
- == Configuration.ORIENTATION_PORTRAIT) {
- viewList.setVisibility(View.INVISIBLE);
- if (PanelController.useAnimationsLayer()) {
- view.animate().setDuration(200).x(0).withLayer()
- .start();
- } else {
- view.setX(0);
- }
- } else {
- viewList.setVisibility(View.GONE);
- findViewById(R.id.filtersPanel).setVisibility(View.VISIBLE);
- }
- }
- invalidateOptionsMenu();
- }
-
public void dispatchNullFilterClick() {
mNullFxFilter.onClick(mNullFxFilter);
mNullBorderFilter.onClick(mNullBorderFilter);
@@ -981,16 +894,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
invalidateViews();
}
- // reset button in the history panel.
- private OnClickListener createOnClickResetOperationsButton() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- resetHistory();
- }
- };
- }
-
@Override
public void onBackPressed() {
if (mPanelController.onBackPressed()) {
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java b/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
index 1ab9e5466..65fe523c0 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
@@ -49,7 +49,6 @@ public class ImageShow extends View implements OnGestureListener,
OnDoubleTapListener {
private static final String LOGTAG = "ImageShow";
- private static final boolean ENABLE_HISTORY_SWAP = false;
private static final boolean ENABLE_ZOOMED_COMPARISON = false;
protected Paint mPaint = new Paint();
@@ -593,7 +592,7 @@ public class ImageShow extends View implements OnGestureListener,
translation.y = (int) (originalTranslation.y + translateY);
MasterImage.getImage().setTranslation(translation);
mTouchShowOriginal = false;
- } else if (enableComparison() && !mOriginalDisabled && !mActivity.isShowingHistoryPanel()
+ } else if (enableComparison() && !mOriginalDisabled
&& (System.currentTimeMillis() - mTouchShowOriginalDate
> mTouchShowOriginalDelayMin)
&& event.getPointerCount() == 1) {
@@ -665,15 +664,6 @@ public class ImageShow extends View implements OnGestureListener,
if (endEvent.getPointerCount() == 2) {
return false;
}
- if (ENABLE_HISTORY_SWAP && (!mActivity.isShowingHistoryPanel() && startEvent.getX() > endEvent.getX())
- || (mActivity.isShowingHistoryPanel() && endEvent.getX() > startEvent.getX())) {
- if (!mTouchShowOriginal
- || (mTouchShowOriginal &&
- (System.currentTimeMillis() - mTouchShowOriginalDate
- < mTouchShowOriginalDelayMax))) {
- mActivity.toggleHistoryPanel();
- }
- }
return true;
}
diff --git a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
index c36befc2c..304d2db24 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
@@ -138,7 +138,6 @@ public class MasterImage implements RenderingRequestCaller {
mPreset.fillImageStateAdapter(mState);
if (addToHistory) {
mHistory.addHistoryItem(mPreset);
- renderHistoryPreview();
}
updatePresets(true);
GeometryMetadata geo = mPreset.mGeoData;