diff options
-rw-r--r-- | res/drawable/filtershow_addpoint.png | bin | 0 -> 5069 bytes | |||
-rw-r--r-- | res/drawable/filtershow_delpoint.png | bin | 0 -> 4657 bytes | |||
-rw-r--r-- | res/drawable/filtershow_vertical_bar.png | bin | 0 -> 148 bytes | |||
-rw-r--r-- | res/layout/filtershow_control_action_slider.xml | 40 | ||||
-rw-r--r-- | res/layout/filtershow_control_title_slider.xml | 41 | ||||
-rw-r--r-- | res/layout/filtershow_editor_panel.xml | 18 | ||||
-rw-r--r-- | res/layout/filtershow_seekbar.xml | 33 | ||||
-rw-r--r-- | res/values/filtershow_ids.xml | 3 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java | 31 |
9 files changed, 156 insertions, 10 deletions
diff --git a/res/drawable/filtershow_addpoint.png b/res/drawable/filtershow_addpoint.png Binary files differnew file mode 100644 index 000000000..483d8eebe --- /dev/null +++ b/res/drawable/filtershow_addpoint.png diff --git a/res/drawable/filtershow_delpoint.png b/res/drawable/filtershow_delpoint.png Binary files differnew file mode 100644 index 000000000..84f2e5b5d --- /dev/null +++ b/res/drawable/filtershow_delpoint.png diff --git a/res/drawable/filtershow_vertical_bar.png b/res/drawable/filtershow_vertical_bar.png Binary files differnew file mode 100644 index 000000000..5ac0a9f61 --- /dev/null +++ b/res/drawable/filtershow_vertical_bar.png diff --git a/res/layout/filtershow_control_action_slider.xml b/res/layout/filtershow_control_action_slider.xml new file mode 100644 index 000000000..7caf96dca --- /dev/null +++ b/res/layout/filtershow_control_action_slider.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res/com.example.imagefilterharness" + android:layout_width="match_parent" + android:layout_height="150dp" + android:orientation="horizontal" > + + <ImageButton + android:id="@+id/actionButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:scaleType="centerInside" + android:background="@drawable/filtershow_button_background" + android:src="@drawable/filtershow_addpoint" + android:paddingBottom="8dp" /> + + <SeekBar + android:id="@+id/controlValueSeekBar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="fill_horizontal" + style="@style/FilterShowSlider" /> +</LinearLayout> + diff --git a/res/layout/filtershow_control_title_slider.xml b/res/layout/filtershow_control_title_slider.xml new file mode 100644 index 000000000..a2c65cf66 --- /dev/null +++ b/res/layout/filtershow_control_title_slider.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res/com.example.imagefilterharness" + android:layout_width="match_parent" + android:layout_height="150dp" + android:columnCount="2" + android:orientation="horizontal" > + + <TextView + android:id="@+id/controlName" + android:layout_gravity="left" /> + + <TextView + android:id="@+id/controlValue" + android:layout_gravity="right" /> + + <SeekBar + android:id="@+id/controlValueSeekBar" + android:layout_width="match_parent" + android:layout_column="0" + android:layout_columnSpan="2" + android:layout_gravity="fill_horizontal" + style="@style/FilterShowSlider" /> +</GridLayout> + diff --git a/res/layout/filtershow_editor_panel.xml b/res/layout/filtershow_editor_panel.xml index ffe5d48b8..2d085a802 100644 --- a/res/layout/filtershow_editor_panel.xml +++ b/res/layout/filtershow_editor_panel.xml @@ -54,15 +54,16 @@ android:layout_height="94dip" android:layout_gravity="left|center_vertical" android:layout_weight=".1" - android:background="@android:color/transparent" + android:background="@drawable/filtershow_button_background" android:gravity="center" android:src="@drawable/ic_menu_cancel_holo_light" - android:textSize="18dip" /> + android:textSize="18dip" + style="@style/FilterShowBottomButton" /> <ImageView android:layout_width="2dp" android:layout_height="fill_parent" - android:src="@drawable/filtershow_vertical_line" /> + android:src="@drawable/filtershow_vertical_bar" /> <LinearLayout android:id="@+id/panelAccessoryViewList" @@ -77,7 +78,7 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" - android:background="@android:color/transparent" + android:background="@drawable/filtershow_button_background" android:gravity="center" android:text="@string/apply_effect" android:textSize="18dip" @@ -87,7 +88,7 @@ <ImageView android:layout_width="2dp" android:layout_height="fill_parent" - android:src="@drawable/filtershow_vertical_line" /> + android:src="@drawable/filtershow_vertical_bar" /> <ImageButton android:id="@+id/applyFilter" @@ -95,10 +96,11 @@ android:layout_height="94dip" android:layout_gravity="right|center_vertical" android:layout_weight=".1" - android:background="@android:color/transparent" + android:background="@drawable/filtershow_button_background" android:gravity="center" android:src="@drawable/ic_menu_done_holo_light" - android:textSize="18dip" /> + android:textSize="18dip" + style="@style/FilterShowBottomButton" /> </LinearLayout> -</LinearLayout>
\ No newline at end of file +</LinearLayout> diff --git a/res/layout/filtershow_seekbar.xml b/res/layout/filtershow_seekbar.xml new file mode 100644 index 000000000..53f59801e --- /dev/null +++ b/res/layout/filtershow_seekbar.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2013 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/top" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="0" + android:orientation="vertical" + android:visibility="visible" > + + <SeekBar + android:id="@+id/primarySeekBar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + style="@style/FilterShowSlider" /> + +</LinearLayout> diff --git a/res/values/filtershow_ids.xml b/res/values/filtershow_ids.xml index 9380740ce..8ac294136 100644 --- a/res/values/filtershow_ids.xml +++ b/res/values/filtershow_ids.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- /* -* Copyright (C) 2012 The Android Open Source Project +* Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,4 +46,5 @@ <item type="id" name="editorFlip" /> <item type="id" name="editorRotate" /> <item type="id" name="editorStraighten" /> + <item type="id" name="editorParametric" /> </resources> diff --git a/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java index 2410ebe72..34323c4bd 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterBasicRepresentation.java @@ -17,8 +17,10 @@ package com.android.gallery3d.filtershow.filters; import com.android.gallery3d.app.Log; +import com.android.gallery3d.filtershow.controller.Control; +import com.android.gallery3d.filtershow.controller.ParameterInteger; -public class FilterBasicRepresentation extends FilterRepresentation { +public class FilterBasicRepresentation extends FilterRepresentation implements ParameterInteger { private static final String LOGTAG = "FilterBasicRepresentation"; private int mMinimum; private int mValue; @@ -33,6 +35,7 @@ public class FilterBasicRepresentation extends FilterRepresentation { setValue(value); } + @Override public String toString() { return getName() + " : " + mMinimum + " < " + mValue + " < " + mMaximum; } @@ -47,6 +50,7 @@ public class FilterBasicRepresentation extends FilterRepresentation { return representation; } + @Override public void useParametersFrom(FilterRepresentation a) { if (a instanceof FilterBasicRepresentation) { FilterBasicRepresentation representation = (FilterBasicRepresentation) a; @@ -76,6 +80,7 @@ public class FilterBasicRepresentation extends FilterRepresentation { return false; } + @Override public int getMinimum() { return mMinimum; } @@ -84,10 +89,12 @@ public class FilterBasicRepresentation extends FilterRepresentation { mMinimum = minimum; } + @Override public int getValue() { return mValue; } + @Override public void setValue(int value) { mValue = value; if (mValue < mMinimum) { @@ -98,6 +105,7 @@ public class FilterBasicRepresentation extends FilterRepresentation { } } + @Override public int getMaximum() { return mMaximum; } @@ -110,6 +118,7 @@ public class FilterBasicRepresentation extends FilterRepresentation { mDefaultValue = defaultValue; } + @Override public int getDefaultValue() { return mDefaultValue; } @@ -122,7 +131,27 @@ public class FilterBasicRepresentation extends FilterRepresentation { mPreviewValue = previewValue; } + @Override public String getStateRepresentation() { return "" + getValue(); } + + @Override + public String getParameterType(){ + return sParameterType; + } + + @Override + public void setController(Control control) { + } + + @Override + public String getValueString() { + return getStateRepresentation(); + } + + @Override + public String getParameterName() { + return getName(); + } } |