summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-03-27 22:16:47 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-03-27 22:16:47 -0700
commit44d9efdd4be831a63e978c94c22093a5ed2a34fb (patch)
treecf913fe167d792f41379a9e057d608007dc831eb /src
parent88592e7579104869bb5440e27442eb8eee2d3a6a (diff)
parent7deb94a29d29ac7ab4536d35f2aeb00cf33ab207 (diff)
downloadandroid_packages_apps_Gallery2-44d9efdd4be831a63e978c94c22093a5ed2a34fb.tar.gz
android_packages_apps_Gallery2-44d9efdd4be831a63e978c94c22093a5ed2a34fb.tar.bz2
android_packages_apps_Gallery2-44d9efdd4be831a63e978c94c22093a5ed2a34fb.zip
Merge "Gallery2: revert filtershow panel layout to M style;" into android_ui.lnx.1.2-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java128
-rw-r--r--src/com/android/gallery3d/filtershow/category/MainPanel.java82
2 files changed, 52 insertions, 158 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 54b637e4e..32981f175 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -206,9 +206,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
private DialogInterface mCurrentDialog = null;
private PopupMenu mCurrentMenu = null;
private boolean mReleaseDualCamOnDestory = true;
- private FrameLayout mCategoryFragment;
- private View mEffectsContainer;
- private View mEffectsTextContainer;
private ImageButton imgComparison;
private String mPopUpText, mExit;
RelativeLayout rlImageContainer;
@@ -317,8 +314,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
if (findViewById(R.id.main_panel_container) == null) {
return;
}
- Fragment main = getSupportFragmentManager().findFragmentByTag(
- MainPanel.FRAGMENT_TAG);
MainPanel panel = new MainPanel();
Bundle bundle = new Bundle();
bundle.putBoolean(MainPanel.EDITOR_TAG, isComingFromEditorScreen);
@@ -453,9 +448,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
if (mMenu != null) {
mMenu.clear();
}
- final Fragment main = getSupportFragmentManager().findFragmentByTag(
- MainPanel.FRAGMENT_TAG);
-
actionBar.setCustomView(R.layout.filtershow_actionbar_new);
mCancelButton = actionBar.getCustomView().findViewById(
R.id.imgCancel);
@@ -463,8 +455,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
mCancelButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
- MainPanel mainPanel = (MainPanel) main;
- mainPanel.toggleEffectsTrayVisibility(true);
setActionBar(false);
HistoryManager adapter = mMasterImage.getHistory();
int position = adapter.undoCurrentFilter();
@@ -478,15 +468,12 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
@Override
public void onClick(View view) {
// saveImage();
- MainPanel mainPanel = (MainPanel) main;
- mainPanel.toggleEffectsTrayVisibility(true);
setActionBar(false);
HistoryManager adapter = mMasterImage
.getHistory();
adapter.resetActiveFilter();
}
});
- isEffectClicked = false;
}
}
@@ -545,18 +532,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
invalidateViews();
}
- private void toggleEffectsTrayVisibility(boolean isEffectTrayEnabled) {
- if (isEffectTrayEnabled) {
- mCategoryFragment.setVisibility(View.VISIBLE);
- mEffectsContainer.setVisibility(View.GONE);
- mEffectsTextContainer.setVisibility(View.GONE);
- } else {
- mCategoryFragment.setVisibility(View.GONE);
- mEffectsContainer.setVisibility(View.VISIBLE);
- mEffectsTextContainer.setVisibility(View.VISIBLE);
- }
- }
-
public void adjustCompareButton(boolean scaled) {
Resources r = getResources();
int marginTop, marginRight;
@@ -1178,7 +1153,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
public LoadBitmapTask() {
mBitmapSize = getScreenImageSize();
- Log.d(LOGTAG, "FilterShowActivity.LoadBtimapTask(): mBitmapSize is " + mBitmapSize);
+ Log.d(LOGTAG, "FilterShowActivity.LoadBitmapTask(): mBitmapSize is " + mBitmapSize);
}
@Override
@@ -1222,8 +1197,8 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
return;
}
- if (null == CachingPipeline.getRenderScriptContext()){
- Log.v(LOGTAG,"RenderScript context destroyed during load");
+ if (null == CachingPipeline.getRenderScriptContext()) {
+ Log.v(LOGTAG, "RenderScript context destroyed during load");
return;
}
final View imageShow = findViewById(R.id.imageShow);
@@ -1264,7 +1239,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
MasterImage.getImage().resetGeometryImages(true);
- if (mAction == TINY_PLANET_ACTION) {
+ if (mAction.equals(TINY_PLANET_ACTION)) {
showRepresentation(mCategoryFiltersAdapter.getTinyPlanet());
}
mHiResBitmapTask = new LoadHighresBitmapTask();
@@ -1433,7 +1408,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
if (mShareActionProvider != null) {
mShareActionProvider.setOnShareTargetSelectedListener(this);
}
- if(SimpleMakeupImageFilter.HAS_TS_MAKEUP) {
+ if (SimpleMakeupImageFilter.HAS_TS_MAKEUP) {
MakeupEngine.getMakeupObj();
}
@@ -1745,69 +1720,38 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
MainPanel.FRAGMENT_TAG);
if (currentPanel instanceof MainPanel) {
- MainPanel mainPanel = (MainPanel) currentPanel;
- if (mainPanel.isCategoryPanelVisible()) {
- if (mImageShow.hasModifications()) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(R.string.unsaved).setTitle(
- R.string.save_before_exit);
- builder.setPositiveButton(mPopUpText,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog,
- int id) {
- done();
- }
- });
- builder.setNegativeButton(mExit,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog,
- int id) {
- HistoryManager adapter = mMasterImage
- .getHistory();
- int position = adapter.undoCurrentFilter();
- mMasterImage.onHistoryItemClick(position);
- adapter.resetActiveFilter();
- backToMain();
- invalidateViews();
- }
- });
- builder.show();
- }
- setActionBar(false);
- mainPanel.toggleEffectsTrayVisibility(true);
- invalidateOptionsMenu();
- if (MasterImage.getImage().getScaleFactor() < 1)
- setScaleImage(false);
- adjustCompareButton(false);
-
+ if (mImageShow.hasModifications()) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage(R.string.unsaved).setTitle(
+ R.string.save_before_exit);
+ builder.setPositiveButton(mPopUpText,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ done();
+ }
+ });
+ builder.setNegativeButton(mExit,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ HistoryManager adapter = mMasterImage.getHistory();
+ int position = adapter.undoCurrentFilter();
+ mMasterImage.onHistoryItemClick(position);
+ adapter.resetActiveFilter();
+ backToMain();
+ invalidateViews();
+ }
+ });
+ builder.show();
} else {
- if (!mImageShow.hasModifications()) {
- done();
- } else {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(R.string.unsaved).setTitle(
- R.string.save_before_exit);
- builder.setPositiveButton(R.string.save_and_exit,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog,
- int id) {
- saveImage();
- }
- });
- builder.setNegativeButton(R.string.exit,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog,
- int id) {
- done();
- }
- });
- builder.show();
- }
+ done();
}
+ setActionBar(false);
+ invalidateOptionsMenu();
+ if (MasterImage.getImage().getScaleFactor() < 1)
+ setScaleImage(false);
+ adjustCompareButton(false);
} else {
isComingFromEditorScreen = true;
backToMain();
@@ -1985,6 +1929,6 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
}
public void setScaleImage(boolean isScaled) {
- mImageShow.scaleImage(isScaled,getBaseContext());
+ mImageShow.scaleImage(isScaled, getBaseContext());
}
}
diff --git a/src/com/android/gallery3d/filtershow/category/MainPanel.java b/src/com/android/gallery3d/filtershow/category/MainPanel.java
index c5f9c6e87..0f6b66116 100644
--- a/src/com/android/gallery3d/filtershow/category/MainPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java
@@ -22,11 +22,8 @@ import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.util.Log;
import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.FilterShowActivity;
@@ -36,7 +33,6 @@ import com.android.gallery3d.filtershow.filters.SimpleMakeupImageFilter;
import com.android.gallery3d.filtershow.filters.TrueScannerActs;
import com.android.gallery3d.filtershow.imageshow.MasterImage;
import com.android.gallery3d.filtershow.state.StatePanel;
-import com.android.gallery3d.filtershow.tools.DualCameraNativeEngine;
import com.android.gallery3d.filtershow.tools.DualCameraNativeEngine.DdmStatus;
public class MainPanel extends Fragment {
@@ -50,10 +46,6 @@ public class MainPanel extends Fragment {
private ImageButton filtersButton;
private ImageButton dualCamButton;
private ImageButton makeupButton;
- private View mEffectsContainer;
- private View mEffectsTextContainer;
- private FrameLayout mCategoryFragment;
- private View mBottomView;
private ImageButton trueScannerButton;
private ImageButton hazeBusterButton;
private ImageButton seeStraightButton;
@@ -142,21 +134,9 @@ public class MainPanel extends Fragment {
geometryButton = (ImageButton) mMainView.findViewById(R.id.geometryButton);
filtersButton = (ImageButton) mMainView.findViewById(R.id.colorsButton);
dualCamButton = (ImageButton) mMainView.findViewById(R.id.dualCamButton);
- mCategoryFragment = (FrameLayout) mMainView
- .findViewById(R.id.category_panel_container);
- mBottomView = mMainView.findViewById(R.id.bottom_panel);
- mEffectsContainer = mMainView.findViewById(R.id.effectsContainer);
- mEffectsTextContainer = mMainView.findViewById(R.id.effectsText);
if (SimpleMakeupImageFilter.HAS_TS_MAKEUP) {
makeupButton = (ImageButton) mMainView.findViewById(R.id.makeupButton);
makeupButton.setVisibility(View.VISIBLE);
- TextView beautify = (TextView) mEffectsTextContainer
- .findViewById(R.id.tvBeautify);
- beautify.setVisibility(View.VISIBLE);
- }
- boolean showPanel = false;
- if (getArguments() != null) {
- showPanel = getArguments().getBoolean(EDITOR_TAG);
}
if (makeupButton != null) {
@@ -167,25 +147,19 @@ public class MainPanel extends Fragment {
}
});
}
- TextView trueScannerTv = (TextView) mMainView.findViewById(R.id.tvTrueScanner);
trueScannerButton = (ImageButton) mMainView.findViewById(R.id.trueScannerButton);
if (!TrueScannerActs.isTrueScannerEnabled()) {
- trueScannerTv.setVisibility(View.GONE);
trueScannerButton.setVisibility(View.GONE);
}
hazeBusterButton = (ImageButton) mMainView.findViewById(R.id.hazeBusterButton);
- TextView hazeBusterTv = (TextView) mMainView.findViewById(R.id.tvHazeBuster);
if(!HazeBusterActs.isHazeBusterEnabled()) {
- hazeBusterTv.setVisibility(View.GONE);
hazeBusterButton.setVisibility(View.GONE);
}
seeStraightButton = (ImageButton) mMainView.findViewById(R.id.seeStraightButton);
- TextView seeStraightTv = (TextView) mMainView.findViewById(R.id.tvSeeStraight);
if(!SeeStraightActs.isSeeStraightEnabled()) {
seeStraightButton.setVisibility(View.GONE);
- seeStraightTv.setVisibility(View.GONE);
}
looksButton.setOnClickListener(new View.OnClickListener() {
@@ -243,10 +217,8 @@ public class MainPanel extends Fragment {
});
FilterShowActivity activity = (FilterShowActivity) getActivity();
- //showImageStatePanel(activity.isShowingImageStatePanel());
- if (showPanel) {
- showPanel(activity.getCurrentPanel());
- }
+ showImageStatePanel(activity.isShowingImageStatePanel());
+ showPanel(activity.getCurrentPanel());
return mMainView;
}
@@ -257,22 +229,6 @@ public class MainPanel extends Fragment {
return true;
}
- public boolean isCategoryPanelVisible() {
- return (View.VISIBLE == mCategoryFragment.getVisibility());
- }
-
- public void toggleEffectsTrayVisibility(boolean isCategoryTrayVisible) {
- if (isCategoryTrayVisible) {
- mCategoryFragment.setVisibility(View.GONE);
- mEffectsContainer.setVisibility(View.VISIBLE);
- mEffectsTextContainer.setVisibility(View.VISIBLE);
- } else {
- mCategoryFragment.setVisibility(View.VISIBLE);
- mEffectsContainer.setVisibility(View.GONE);
- mEffectsTextContainer.setVisibility(View.GONE);
- }
- }
-
private void setCategoryFragment(CategoryPanel category, boolean fromRight) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
FilterShowActivity activity = (FilterShowActivity) getActivity();
@@ -282,13 +238,10 @@ public class MainPanel extends Fragment {
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left);
}
if (isEffectClicked) {
- toggleEffectsTrayVisibility(false);
- activity.setActionBar(isEffectClicked);
+ activity.setActionBar(true);
isEffectClicked = false;
} else {
- toggleEffectsTrayVisibility(true);
- activity.setActionBar(isEffectClicked);
-
+ activity.setActionBar(false);
}
transaction.replace(R.id.category_panel_container, category, CategoryPanel.FRAGMENT_TAG);
transaction.commitAllowingStateLoss();
@@ -308,9 +261,9 @@ public class MainPanel extends Fragment {
}
public void loadCategoryBorderPanel() {
- /*if (mCurrentSelected == BORDERS) {
+ if (mCurrentSelected == BORDERS) {
return;
- }*/
+ }
boolean fromRight = isRightAnimation(BORDERS);
selection(mCurrentSelected, false);
CategoryPanel categoryPanel = new CategoryPanel();
@@ -334,9 +287,9 @@ public class MainPanel extends Fragment {
}
public void loadCategoryGeometryPanel() {
- /*if (mCurrentSelected == GEOMETRY) {
+ if (mCurrentSelected == GEOMETRY) {
return;
- }*/
+ }
if (MasterImage.getImage().hasTinyPlanet()) {
return;
}
@@ -380,9 +333,9 @@ public class MainPanel extends Fragment {
}
public void loadCategoryFiltersPanel() {
- /*if (mCurrentSelected == FILTERS) {
+ if (mCurrentSelected == FILTERS) {
return;
- }*/
+ }
boolean fromRight = isRightAnimation(FILTERS);
selection(mCurrentSelected, false);
CategoryPanel categoryPanel = new CategoryPanel();
@@ -393,9 +346,9 @@ public class MainPanel extends Fragment {
}
public void loadCategoryVersionsPanel() {
- /*if (mCurrentSelected == VERSIONS) {
+ if (mCurrentSelected == VERSIONS) {
return;
- }*/
+ }
FilterShowActivity activity = (FilterShowActivity) getActivity();
activity.updateVersions();
boolean fromRight = isRightAnimation(VERSIONS);
@@ -408,9 +361,9 @@ public class MainPanel extends Fragment {
}
public void loadCategoryDualCamPanel() {
- /*if (mCurrentSelected == DUALCAM) {
+ if (mCurrentSelected == DUALCAM) {
return;
- }*/
+ }
boolean fromRight = isRightAnimation(DUALCAM);
selection(mCurrentSelected, false);
CategoryPanel categoryPanel = new CategoryPanel();
@@ -431,7 +384,7 @@ public class MainPanel extends Fragment {
FilterShowActivity activity = (FilterShowActivity) getActivity();
switch (currentPanel) {
case LOOKS: {
- loadCategoryLookPanel(true);
+ loadCategoryLookPanel(false);
break;
}
case BORDERS: {
@@ -471,7 +424,7 @@ public class MainPanel extends Fragment {
break;
}
}
- if (currentPanel > 0) {
+ if (currentPanel > 0) {
activity.setScaleImage(true);
activity.adjustCompareButton(true);
} else {
@@ -540,9 +493,6 @@ public class MainPanel extends Fragment {
boolean enable = (status == DdmStatus.DDM_LOADING ||
status == DdmStatus.DDM_LOADED);
dualCamButton.setVisibility(enable?View.VISIBLE:View.GONE);
- TextView tvDualCam = (TextView) mEffectsTextContainer
- .findViewById(R.id.tvDualCam);
- tvDualCam.setVisibility(enable?View.VISIBLE:View.GONE);
}
}
}