summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2012-09-28 18:26:53 -0700
committernicolasroard <nicolasroard@google.com>2012-09-28 18:31:51 -0700
commitdacc688e9237890bd1698ccfa1e6402dc9f24f15 (patch)
tree98d17226fa5ad1f506313befa593ba375cb43866
parentfc275d4e972304a8c4935d6161c74cbbbdf600ae (diff)
downloadandroid_packages_apps_Snap-dacc688e9237890bd1698ccfa1e6402dc9f24f15.zip
android_packages_apps_Snap-dacc688e9237890bd1698ccfa1e6402dc9f24f15.tar.gz
android_packages_apps_Snap-dacc688e9237890bd1698ccfa1e6402dc9f24f15.tar.bz2
Remove the individual Curves channel filters
Reorder the filters bug:7234317 Change-Id: Ia726fa8ea82580c97784eb03d4c6740cf4a603c4
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java280
1 files changed, 109 insertions, 171 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 589d573..e807e35 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -61,9 +61,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
private ImageButton mVignetteButton = null;
private ImageButton mCurvesButtonRGB = null;
- private ImageButton mCurvesButtonRed = null;
- private ImageButton mCurvesButtonGreen = null;
- private ImageButton mCurvesButtonBlue = null;
private ImageButton mSharpenButton = null;
private ImageButton mContrastButton = null;
@@ -135,9 +132,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
mVignetteButton = (ImageButton) findViewById(R.id.vignetteButton);
mCurvesButtonRGB = (ImageButton) findViewById(R.id.curvesButtonRGB);
- mCurvesButtonRed = (ImageButton) findViewById(R.id.curvesButtonRed);
- mCurvesButtonGreen = (ImageButton) findViewById(R.id.curvesButtonGreen);
- mCurvesButtonBlue = (ImageButton) findViewById(R.id.curvesButtonBlue);
mSharpenButton = (ImageButton) findViewById(R.id.sharpenButton);
mVibranceButton = (ImageButton) findViewById(R.id.vibranceButton);
mContrastButton = (ImageButton) findViewById(R.id.contrastButton);
@@ -148,9 +142,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
mColorsPanelButtons.add(mVignetteButton);
mColorsPanelButtons.add(mCurvesButtonRGB);
- mColorsPanelButtons.add(mCurvesButtonRed);
- mColorsPanelButtons.add(mCurvesButtonGreen);
- mColorsPanelButtons.add(mCurvesButtonBlue);
mColorsPanelButtons.add(mSharpenButton);
mColorsPanelButtons.add(mContrastButton);
mColorsPanelButtons.add(mSaturationButton);
@@ -159,8 +150,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
mColorsPanelButtons.add(mExposureButton);
mColorsPanelButtons.add(mShadowRecoveryButton);
- mCurvesButtonRGB.setSelected(true);
-
// TODO: instead of click listeners, make the activity the single
// listener and do a dispatch in the listener callback method.
findViewById(R.id.showOriginalButton).setOnTouchListener(createOnTouchShowOriginalButton());
@@ -171,9 +160,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
mVignetteButton.setOnClickListener(createOnClickVignetteButton());
mCurvesButtonRGB.setOnClickListener(createOnClickCurvesRGBButton());
- mCurvesButtonRed.setOnClickListener(createOnClickCurvesRedButton());
- mCurvesButtonGreen.setOnClickListener(createOnClickCurvesGreenButton());
- mCurvesButtonBlue.setOnClickListener(createOnClickCurvesBlueButton());
mSharpenButton.setOnClickListener(createOnClickSharpenButton());
mContrastButton.setOnClickListener(createOnClickContrastButton());
@@ -499,7 +485,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
hideListViews();
unselectBottomPanelButtons();
mListColors.setVisibility(View.VISIBLE);
- mImageCurves.setVisibility(View.VISIBLE);
+ mImageShow.setVisibility(View.VISIBLE);
mColorsButton.setSelected(true);
if (ANIMATE_PANELS) {
@@ -603,69 +589,99 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
};
}
- private OnClickListener createOnClickCurvesRedButton() {
+ private OnClickListener createOnClickSharpenButton() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
hideImageViews();
- mImageCurves.setVisibility(View.VISIBLE);
+ mImageShow.setVisibility(View.VISIBLE);
unselectPanelButtons(mColorsPanelButtons);
- mCurvesButtonRed.setSelected(true);
- mImageCurves.setUseRed(true);
- mImageCurves.setUseGreen(false);
- mImageCurves.setUseBlue(false);
- mImageCurves.reloadCurve();
+ mSharpenButton.setSelected(true);
+ mImageShow.showToast("Sharpen", true);
+ mImageShow.setCurrentFilter(null);
}
};
}
- private OnClickListener createOnClickCurvesGreenButton() {
+ private OnClickListener createOnClickContrastButton() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
hideImageViews();
- mImageCurves.setVisibility(View.VISIBLE);
+ mImageShow.setVisibility(View.VISIBLE);
+ mImageShow.setShowControls(true);
+ ImagePreset preset = mImageShow.getImagePreset();
+ ImageFilter filter = preset.getFilter("Contrast");
+ if (filter == null) {
+ ImageFilterContrast contrast = new ImageFilterContrast();
+ ImagePreset copy = new ImagePreset(preset);
+ copy.add(contrast);
+ copy.setHistoryName(contrast.name());
+ copy.setIsFx(false);
+ filter = copy.getFilter("Contrast");
+ mImageShow.setImagePreset(copy);
+ }
+ mImageShow.setCurrentFilter(filter);
unselectPanelButtons(mColorsPanelButtons);
- mCurvesButtonGreen.setSelected(true);
- mImageCurves.setUseRed(false);
- mImageCurves.setUseGreen(true);
- mImageCurves.setUseBlue(false);
- mImageCurves.reloadCurve();
+ mContrastButton.setSelected(true);
+ invalidateViews();
}
};
}
- private OnClickListener createOnClickCurvesBlueButton() {
+ private OnClickListener createOnClickSaturationButton() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
hideImageViews();
- mImageCurves.setVisibility(View.VISIBLE);
+ mImageShow.setVisibility(View.VISIBLE);
+ mImageShow.setShowControls(true);
+ ImagePreset preset = mImageShow.getImagePreset();
+ ImageFilter filter = preset.getFilter("Saturated");
+ if (filter == null) {
+ ImageFilterSaturated sat = new ImageFilterSaturated();
+ ImagePreset copy = new ImagePreset(preset);
+ copy.add(sat);
+ copy.setHistoryName(sat.name());
+ copy.setIsFx(false);
+ filter = copy.getFilter("Saturated");
+ mImageShow.setImagePreset(copy);
+ }
+ mImageShow.setCurrentFilter(filter);
unselectPanelButtons(mColorsPanelButtons);
- mCurvesButtonBlue.setSelected(true);
- mImageCurves.setUseRed(false);
- mImageCurves.setUseGreen(false);
- mImageCurves.setUseBlue(true);
- mImageCurves.reloadCurve();
+ mSaturationButton.setSelected(true);
+ invalidateViews();
}
};
}
- private OnClickListener createOnClickSharpenButton() {
+ private OnClickListener createOnClickTintButton() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
hideImageViews();
mImageShow.setVisibility(View.VISIBLE);
+ mImageShow.setShowControls(true);
+ ImagePreset preset = mImageShow.getImagePreset();
+ ImageFilter filter = preset.getFilter("Hue");
+ if (filter == null) {
+ ImageFilterHue contrast = new ImageFilterHue();
+ ImagePreset copy = new ImagePreset(preset);
+ copy.add(contrast);
+ copy.setHistoryName(contrast.name());
+ copy.setIsFx(false);
+ filter = copy.getFilter("Hue");
+ mImageShow.setImagePreset(copy);
+ }
+ mImageShow.setCurrentFilter(filter);
unselectPanelButtons(mColorsPanelButtons);
- mSharpenButton.setSelected(true);
- mImageShow.showToast("Sharpen", true);
- mImageShow.setCurrentFilter(null);
+ mTintButton.setSelected(true);
+ invalidateViews();
}
};
}
- private OnClickListener createOnClickContrastButton() {
+ private OnClickListener createOnClickVibranceButton() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -673,153 +689,75 @@ public class FilterShowActivity extends Activity implements OnItemClickListener
mImageShow.setVisibility(View.VISIBLE);
mImageShow.setShowControls(true);
ImagePreset preset = mImageShow.getImagePreset();
- ImageFilter filter = preset.getFilter("Contrast");
+ ImageFilter filter = preset.getFilter("Hue");
if (filter == null) {
- ImageFilterContrast contrast = new ImageFilterContrast();
+ ImageFilterHue contrast = new ImageFilterHue();
ImagePreset copy = new ImagePreset(preset);
copy.add(contrast);
copy.setHistoryName(contrast.name());
copy.setIsFx(false);
- filter = copy.getFilter("Contrast");
+ filter = copy.getFilter("Hue");
mImageShow.setImagePreset(copy);
}
mImageShow.setCurrentFilter(filter);
unselectPanelButtons(mColorsPanelButtons);
- mContrastButton.setSelected(true);
+ mVibranceButton.setSelected(true);
invalidateViews();
}
};
}
- private OnClickListener createOnClickSaturationButton() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- hideImageViews();
- mImageShow.setVisibility(View.VISIBLE);
- mImageShow.setShowControls(true);
- ImagePreset preset = mImageShow.getImagePreset();
- ImageFilter filter = preset.getFilter("Saturated");
- if (filter == null) {
- ImageFilterSaturated sat = new ImageFilterSaturated();
- ImagePreset copy = new ImagePreset(preset);
- copy.add(sat);
- copy.setHistoryName(sat.name());
- copy.setIsFx(false);
- filter = copy.getFilter("Saturated");
- mImageShow.setImagePreset(copy);
- }
- mImageShow.setCurrentFilter(filter);
- unselectPanelButtons(mColorsPanelButtons);
- mSaturationButton.setSelected(true);
- invalidateViews();
- }
- };
- }
-
- private OnClickListener createOnClickTintButton() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- hideImageViews();
- mImageShow.setVisibility(View.VISIBLE);
- mImageShow.setShowControls(true);
- ImagePreset preset = mImageShow.getImagePreset();
- ImageFilter filter = preset.getFilter("Hue");
- if (filter == null) {
- ImageFilterHue contrast = new ImageFilterHue();
- ImagePreset copy = new ImagePreset(preset);
- copy.add(contrast);
- copy.setHistoryName(contrast.name());
- copy.setIsFx(false);
- filter = copy.getFilter("Hue");
- mImageShow.setImagePreset(copy);
- }
- mImageShow.setCurrentFilter(filter);
- unselectPanelButtons(mColorsPanelButtons);
- mTintButton.setSelected(true);
- invalidateViews();
- }
- };
- }
-
- private OnClickListener createOnClickVibranceButton() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- hideImageViews();
- mImageShow.setVisibility(View.VISIBLE);
- mImageShow.setShowControls(true);
- ImagePreset preset = mImageShow.getImagePreset();
- ImageFilter filter = preset.getFilter("Hue");
- if (filter == null) {
- ImageFilterHue contrast = new ImageFilterHue();
- ImagePreset copy = new ImagePreset(preset);
- copy.add(contrast);
- copy.setHistoryName(contrast.name());
- copy.setIsFx(false);
- filter = copy.getFilter("Hue");
- mImageShow.setImagePreset(copy);
- }
- mImageShow.setCurrentFilter(filter);
- unselectPanelButtons(mColorsPanelButtons);
- mVibranceButton.setSelected(true);
- invalidateViews();
- }
- };
- }
-
private OnClickListener createOnClickExposureButton() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- hideImageViews();
- mImageShow.setVisibility(View.VISIBLE);
- mImageShow.setShowControls(true);
- ImagePreset preset = mImageShow.getImagePreset();
- ImageFilter filter = preset.getFilter("Brightness");
- if (filter == null) {
- ImageFilterBrightness bright = new ImageFilterBrightness();
- ImagePreset copy = new ImagePreset(preset);
- copy.add(bright);
- copy.setHistoryName(bright.name());
- copy.setIsFx(false);
- filter = copy.getFilter("Brightness");
- mImageShow.setImagePreset(copy);
- }
- mImageShow.setCurrentFilter(filter);
- unselectPanelButtons(mColorsPanelButtons);
- mExposureButton.setSelected(true);
- invalidateViews();
- }
- };
- }
+ return new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ hideImageViews();
+ mImageShow.setVisibility(View.VISIBLE);
+ mImageShow.setShowControls(true);
+ ImagePreset preset = mImageShow.getImagePreset();
+ ImageFilter filter = preset.getFilter("Brightness");
+ if (filter == null) {
+ ImageFilterBrightness bright = new ImageFilterBrightness();
+ ImagePreset copy = new ImagePreset(preset);
+ copy.add(bright);
+ copy.setHistoryName(bright.name());
+ copy.setIsFx(false);
+ filter = copy.getFilter("Brightness");
+ mImageShow.setImagePreset(copy);
+ }
+ mImageShow.setCurrentFilter(filter);
+ unselectPanelButtons(mColorsPanelButtons);
+ mExposureButton.setSelected(true);
+ invalidateViews();
+ }
+ };
+ }
private OnClickListener createOnClickShadowRecoveryButton() {
- return new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- hideImageViews();
- mImageShow.setVisibility(View.VISIBLE);
- mImageShow.setShowControls(true);
- ImagePreset preset = mImageShow.getImagePreset();
- ImageFilter filter = preset.getFilter("Hue");
- if (filter == null) {
- ImageFilterHue contrast = new ImageFilterHue();
- ImagePreset copy = new ImagePreset(preset);
- copy.add(contrast);
- copy.setHistoryName(contrast.name());
- copy.setIsFx(false);
- filter = copy.getFilter("Hue");
- mImageShow.setImagePreset(copy);
- }
- mImageShow.setCurrentFilter(filter);
- unselectPanelButtons(mColorsPanelButtons);
- mShadowRecoveryButton.setSelected(true);
- invalidateViews();
- }
- };
- }
+ return new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ hideImageViews();
+ mImageShow.setVisibility(View.VISIBLE);
+ mImageShow.setShowControls(true);
+ ImagePreset preset = mImageShow.getImagePreset();
+ ImageFilter filter = preset.getFilter("Hue");
+ if (filter == null) {
+ ImageFilterHue contrast = new ImageFilterHue();
+ ImagePreset copy = new ImagePreset(preset);
+ copy.add(contrast);
+ copy.setHistoryName(contrast.name());
+ copy.setIsFx(false);
+ filter = copy.getFilter("Hue");
+ mImageShow.setImagePreset(copy);
+ }
+ mImageShow.setCurrentFilter(filter);
+ unselectPanelButtons(mColorsPanelButtons);
+ mShadowRecoveryButton.setSelected(true);
+ invalidateViews();
+ }
+ };
+ }
// //////////////////////////////////////////////////////////////////////////////