diff options
| author | John Hoford <hoford@google.com> | 2013-04-20 08:12:48 -0700 |
|---|---|---|
| committer | John Hoford <hoford@google.com> | 2013-04-23 19:19:09 -0700 |
| commit | 7112720bc6100049d24845cfbf3de69cdbd4fdeb (patch) | |
| tree | 631fffb310acf47c9eb4092bdecad1cee7d1ee77 | |
| parent | 0c71308c9d2a72d4a3faf00242707de773d5beba (diff) | |
| download | android_packages_apps_Gallery2-7112720bc6100049d24845cfbf3de69cdbd4fdeb.tar.gz android_packages_apps_Gallery2-7112720bc6100049d24845cfbf3de69cdbd4fdeb.tar.bz2 android_packages_apps_Gallery2-7112720bc6100049d24845cfbf3de69cdbd4fdeb.zip | |
Fix local adjust
bug:8655977
Change-Id: I0aa4ac30de077663f52418528757a842372e0fc2
19 files changed, 48 insertions, 21 deletions
diff --git a/res/drawable-hdpi/ic_localadjust_add.png b/res/drawable-hdpi/ic_localadjust_add.png Binary files differnew file mode 100644 index 000000000..4e0dc2b7b --- /dev/null +++ b/res/drawable-hdpi/ic_localadjust_add.png diff --git a/res/drawable-hdpi/ic_localadjust_delete.png b/res/drawable-hdpi/ic_localadjust_delete.png Binary files differnew file mode 100644 index 000000000..521541f49 --- /dev/null +++ b/res/drawable-hdpi/ic_localadjust_delete.png diff --git a/res/drawable-hdpi/localadjust_defocused.png b/res/drawable-hdpi/localadjust_defocused.png Binary files differnew file mode 100644 index 000000000..20677a034 --- /dev/null +++ b/res/drawable-hdpi/localadjust_defocused.png diff --git a/res/drawable-hdpi/localadjust_focused.png b/res/drawable-hdpi/localadjust_focused.png Binary files differnew file mode 100644 index 000000000..5f6b856c5 --- /dev/null +++ b/res/drawable-hdpi/localadjust_focused.png diff --git a/res/drawable-mdpi/ic_localadjust_add.png b/res/drawable-mdpi/ic_localadjust_add.png Binary files differnew file mode 100644 index 000000000..94657346e --- /dev/null +++ b/res/drawable-mdpi/ic_localadjust_add.png diff --git a/res/drawable-mdpi/ic_localadjust_delete.png b/res/drawable-mdpi/ic_localadjust_delete.png Binary files differnew file mode 100644 index 000000000..b6221e608 --- /dev/null +++ b/res/drawable-mdpi/ic_localadjust_delete.png diff --git a/res/drawable-mdpi/localadjust_defocused.png b/res/drawable-mdpi/localadjust_defocused.png Binary files differnew file mode 100644 index 000000000..7abcbba06 --- /dev/null +++ b/res/drawable-mdpi/localadjust_defocused.png diff --git a/res/drawable-mdpi/localadjust_focused.png b/res/drawable-mdpi/localadjust_focused.png Binary files differnew file mode 100644 index 000000000..d2a992542 --- /dev/null +++ b/res/drawable-mdpi/localadjust_focused.png diff --git a/res/drawable-xhdpi/ic_localadjust_add.png b/res/drawable-xhdpi/ic_localadjust_add.png Binary files differnew file mode 100644 index 000000000..ca7b654b3 --- /dev/null +++ b/res/drawable-xhdpi/ic_localadjust_add.png diff --git a/res/drawable-xhdpi/ic_localadjust_delete.png b/res/drawable-xhdpi/ic_localadjust_delete.png Binary files differnew file mode 100644 index 000000000..9dfb392c8 --- /dev/null +++ b/res/drawable-xhdpi/ic_localadjust_delete.png diff --git a/res/drawable-xhdpi/localadjust_defocused.png b/res/drawable-xhdpi/localadjust_defocused.png Binary files differnew file mode 100644 index 000000000..8ece12294 --- /dev/null +++ b/res/drawable-xhdpi/localadjust_defocused.png diff --git a/res/drawable-xhdpi/localadjust_focused.png b/res/drawable-xhdpi/localadjust_focused.png Binary files differnew file mode 100644 index 000000000..76aef60bb --- /dev/null +++ b/res/drawable-xhdpi/localadjust_focused.png diff --git a/res/drawable/filtershow_addpoint.png b/res/drawable/filtershow_addpoint.png Binary files differindex 483d8eebe..5abfc7464 100644 --- a/res/drawable/filtershow_addpoint.png +++ b/res/drawable/filtershow_addpoint.png diff --git a/res/layout/filtershow_control_action_slider.xml b/res/layout/filtershow_control_action_slider.xml index 734d7500b..a3ef3ed5d 100644 --- a/res/layout/filtershow_control_action_slider.xml +++ b/res/layout/filtershow_control_action_slider.xml @@ -22,7 +22,7 @@ android:orientation="horizontal" > <ImageButton - android:id="@+id/actionButton" + android:id="@+id/leftActionButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" @@ -39,5 +39,17 @@ android:layout_gravity="center_vertical" android:layout_weight="1" style="@style/FilterShowSlider" /> + + <ImageButton + android:id="@+id/rightActionButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left|center_vertical" + android:scaleType="centerInside" + android:layout_weight="0" + android:background="@drawable/filtershow_button_background" + android:src="@drawable/ic_menu_trash_holo_light" + android:paddingBottom="8dp" /> + </LinearLayout> diff --git a/src/com/android/gallery3d/filtershow/controller/ActionSlider.java b/src/com/android/gallery3d/filtershow/controller/ActionSlider.java index 6ed2467de..f80a1cacb 100644 --- a/src/com/android/gallery3d/filtershow/controller/ActionSlider.java +++ b/src/com/android/gallery3d/filtershow/controller/ActionSlider.java @@ -27,7 +27,8 @@ import com.android.gallery3d.filtershow.editors.Editor; public class ActionSlider extends TitledSlider { private static final String LOGTAG = "ActionSlider"; - ImageButton mActionButton; + ImageButton mLeftButton; + ImageButton mRightButton; public ActionSlider() { mLayoutID = R.layout.filtershow_control_action_slider; } @@ -35,22 +36,36 @@ public class ActionSlider extends TitledSlider { @Override public void setUp(ViewGroup container, Parameter parameter, Editor editor) { super.setUp(container, parameter, editor); - mActionButton = (ImageButton) mTopView.findViewById(R.id.actionButton); - mActionButton.setOnClickListener(new OnClickListener() { + mLeftButton = (ImageButton) mTopView.findViewById(R.id.leftActionButton); + mLeftButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - ((ParameterActionAndInt) mParameter).fireAction(); + ((ParameterActionAndInt) mParameter).fireLeftAction(); } }); + + mRightButton = (ImageButton) mTopView.findViewById(R.id.rightActionButton); + mRightButton.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + ((ParameterActionAndInt) mParameter).fireRightAction(); + } + }); + updateUI(); } @Override public void updateUI() { super.updateUI(); - if (mActionButton != null) { - int iconId = ((ParameterActionAndInt) mParameter).getActionIcon(); - mActionButton.setImageResource(iconId); + if (mLeftButton != null) { + int iconId = ((ParameterActionAndInt) mParameter).getLeftIcon(); + mLeftButton.setImageResource(iconId); + } + if (mRightButton != null) { + int iconId = ((ParameterActionAndInt) mParameter).getRightIcon(); + mRightButton.setImageResource(iconId); } } } diff --git a/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java b/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java index 633e41ff6..072edd72a 100644 --- a/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java +++ b/src/com/android/gallery3d/filtershow/controller/BasicParameterStyle.java @@ -92,8 +92,6 @@ public class BasicParameterStyle implements ParameterStyles { @Override public void getIcon(int index, RenderingRequestCaller caller) { - Log.v(LOGTAG, "############ " + ID + " getIcon " + index); - mEditor.computeIcon(index, caller); } diff --git a/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java b/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java index 04567e28c..8a05c3aa6 100644 --- a/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java +++ b/src/com/android/gallery3d/filtershow/controller/ParameterActionAndInt.java @@ -19,7 +19,11 @@ package com.android.gallery3d.filtershow.controller; public interface ParameterActionAndInt extends ParameterInteger { static String sParameterType = "ParameterActionAndInt"; - public void fireAction(); + public void fireLeftAction(); - public int getActionIcon(); + public int getLeftIcon(); + + public void fireRightAction(); + + public int getRightIcon(); } diff --git a/src/com/android/gallery3d/filtershow/editors/Editor.java b/src/com/android/gallery3d/filtershow/editors/Editor.java index 1e239e632..dc13b3e37 100644 --- a/src/com/android/gallery3d/filtershow/editors/Editor.java +++ b/src/com/android/gallery3d/filtershow/editors/Editor.java @@ -64,13 +64,7 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis } public String calculateUserMessage(Context context, String effectName, Object parameterValue) { - String apply = ""; - if (mShowParameter == SHOW_VALUE_INT) { - apply += " " + effectName + " " + parameterValue; - } else { - apply += " " + effectName; - } - return apply; + return effectName + " " + parameterValue; } protected Editor(int id) { @@ -214,7 +208,9 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis public void commitLocalRepresentation() { ImagePreset preset = MasterImage.getImage().getPreset(); preset.updateFilterRepresentation(getLocalRepresentation()); - mPanelController.onNewValue(-1); + if (mPanelController != null) { + mPanelController.onNewValue(-1); + } } /** diff --git a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java index e49f6cd15..33ed143bd 100644 --- a/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java +++ b/src/com/android/gallery3d/filtershow/editors/ParametricEditor.java @@ -198,7 +198,9 @@ public class ParametricEditor extends Editor { public void commitLocalRepresentation() { super.commitLocalRepresentation(); FilterRepresentation rep = getLocalRepresentation(); - mPanelController.onNewValue(-1); + if (mPanelController != null) { + mPanelController.onNewValue(-1); + } } @Override |
