summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-04-15 14:41:00 -0700
committernicolasroard <nicolasroard@google.com>2013-04-15 23:13:37 -0700
commit673f7408a381705db18e87243755e5ec19247290 (patch)
tree62baa14b71702bfd84540dc4759213b99a3214bf
parentc646b996bd327995a4219ea4e103db620eb8d1f8 (diff)
downloadandroid_packages_apps_Snap-673f7408a381705db18e87243755e5ec19247290.tar.gz
android_packages_apps_Snap-673f7408a381705db18e87243755e5ec19247290.tar.bz2
android_packages_apps_Snap-673f7408a381705db18e87243755e5ec19247290.zip
New state panel
bug:8620913 bug:8503386 Change-Id: I35c95103e3b5097df93fa3f48e5562a479915f06
-rw-r--r--res/layout-land/filtershow_activity.xml112
-rw-r--r--res/layout/filtershow_state_panel_new.xml47
-rw-r--r--res/values/filtershow_strings.xml6
-rw-r--r--src/com/android/gallery3d/filtershow/presets/ImagePreset.java8
4 files changed, 110 insertions, 63 deletions
diff --git a/res/layout-land/filtershow_activity.xml b/res/layout-land/filtershow_activity.xml
index f1294f525..311a3e639 100644
--- a/res/layout-land/filtershow_activity.xml
+++ b/res/layout-land/filtershow_activity.xml
@@ -28,56 +28,55 @@
android:orientation="horizontal"
android:animateLayoutChanges="true">
- <LinearLayout
- android:layout_weight="1"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:orientation="horizontal">
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
- <FrameLayout
- android:id="@+id/editorContainer"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1" />
+ <FrameLayout
+ android:id="@+id/editorContainer"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"/>
- <com.android.gallery3d.filtershow.imageshow.ImageShow
- android:id="@+id/imageShow"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ <com.android.gallery3d.filtershow.imageshow.ImageShow
+ android:id="@+id/imageShow"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1" />
- <com.android.gallery3d.filtershow.imageshow.ImageTinyPlanet
- android:id="@+id/imageTinyPlanet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
+ <com.android.gallery3d.filtershow.imageshow.ImageTinyPlanet
+ android:id="@+id/imageTinyPlanet"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/mainPanel"
- android:layout_width="650dip"
+ android:layout_width="350dip"
android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="vertical" >
+ android:orientation="vertical">
- <ViewStub android:id="@+id/statePanelStub"
- android:inflatedId="@+id/imageStatePanel"
- android:layout="@layout/filtershow_state_panel"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="visible" />
+ <FrameLayout android:id="@+id/state_panel_container"
+ android:layout_width="350dip"
+ android:layout_height="0dip"
+ android:layout_weight="1" />
<ViewStub android:id="@+id/historyPanelStub"
android:inflatedId="@+id/historyPanel"
android:layout="@layout/filtershow_history_panel"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
+ android:layout_height="0dip"
+ android:visibility="gone"/>
<FrameLayout
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1" >
+ android:visibility="gone">
<ProgressBar
@@ -88,7 +87,7 @@
android:layout_gravity="center"
android:indeterminate="true"
android:indeterminateOnly="true"
- android:background="@color/background_screen" />
+ android:background="@color/background_screen"/>
</FrameLayout>
@@ -96,29 +95,29 @@
xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d"
android:id="@+id/filtersPanel"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
+ android:layout_height="177dip"
+ android:layout_gravity="center|bottom"
custom:max_width="600dip"
android:orientation="vertical">
<FrameLayout
android:id="@+id/secondRowPanel"
android:layout_width="fill_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="128dip">
<LinearLayout
android:id="@+id/filterButtonsList"
android:layout_width="fill_parent"
android:layout_height="@dimen/thumbnail_size"
android:orientation="horizontal"
- android:visibility="gone" >
+ android:visibility="gone">
<ViewStub android:id="@+id/editorPanelStub"
- android:inflatedId="@+id/editorPanel"
- android:layout="@layout/filtershow_editor_panel"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="visible" />
+ android:inflatedId="@+id/editorPanel"
+ android:layout="@layout/filtershow_editor_panel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="visible"/>
</LinearLayout>
@@ -127,14 +126,14 @@
android:layout_width="match_parent"
android:layout_height="@dimen/thumbnail_size"
android:background="@color/background_main_toolbar"
- android:scrollbars="none" >
+ android:scrollbars="none">
<LinearLayout
android:id="@+id/listFilters"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/thumbnail_margin"
- android:orientation="horizontal" >
+ android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
@@ -144,14 +143,14 @@
android:layout_height="@dimen/thumbnail_size"
android:background="@color/background_main_toolbar"
android:visibility="gone"
- android:scrollbars="none" >
+ android:scrollbars="none">
<LinearLayout
android:id="@+id/listBorders"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/thumbnail_margin"
- android:orientation="horizontal" >
+ android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
@@ -161,14 +160,14 @@
android:layout_height="@dimen/thumbnail_size"
android:background="@color/background_main_toolbar"
android:visibility="gone"
- android:scrollbars="none" >
+ android:scrollbars="none">
<LinearLayout
android:id="@+id/listGeometry"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="left"
- android:orientation="horizontal" />
+ android:orientation="horizontal"/>
</HorizontalScrollView>
@@ -178,7 +177,7 @@
android:layout_height="wrap_content"
android:background="@color/background_main_toolbar"
android:visibility="gone"
- android:scrollbars="none" >
+ android:scrollbars="none">
<LinearLayout
android:id="@+id/listColorsFx"
@@ -186,7 +185,7 @@
android:layout_height="@dimen/thumbnail_size"
android:background="@color/background_main_toolbar"
android:layout_marginLeft="@dimen/thumbnail_margin"
- android:orientation="horizontal" >
+ android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
@@ -195,22 +194,21 @@
<View
android:background="@color/toolbar_separation_line"
android:layout_height="1dip"
- android:layout_width="match_parent" />
+ android:layout_width="match_parent"/>
<com.android.gallery3d.filtershow.CenteredLinearLayout
- xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="48dip"
android:layout_gravity="center"
custom:max_width="400dip"
android:orientation="vertical">
- <ViewStub android:id="@+id/stateCategoryStub"
- android:inflatedId="@+id/imageCategoryPanel"
- android:layout="@layout/filtershow_category_panel"
- android:layout_width="match_parent"
- android:layout_height="48dip"
- android:visibility="visible" />
+ <ViewStub android:id="@+id/stateCategoryStub"
+ android:inflatedId="@+id/imageCategoryPanel"
+ android:layout="@layout/filtershow_category_panel"
+ android:layout_width="match_parent"
+ android:layout_height="48dip"
+ android:visibility="visible"/>
</com.android.gallery3d.filtershow.CenteredLinearLayout>
diff --git a/res/layout/filtershow_state_panel_new.xml b/res/layout/filtershow_state_panel_new.xml
new file mode 100644
index 000000000..771122192
--- /dev/null
+++ b/res/layout/filtershow_state_panel_new.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <!--
+ <com.example.StatePanel.VerticalStatePanelTrack
+ android:id="@+id/listStates"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_margin="8dip"
+ android:background="@android:color/holo_red_dark" />
+ -->
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scrollbars="none">
+
+ <com.android.gallery3d.filtershow.state.StatePanelTrack
+ android:id="@+id/listStates"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_margin="8dip"
+ android:animateLayoutChanges="true" />
+
+ </ScrollView>
+
+ <!--
+ <HorizontalScrollView
+ android:layout_width="match_parent"
+ android:layout_height="128dip"
+ android:scrollbars="none">
+
+ <com.example.StatePanel.StatePanelTrack
+ android:id="@+id/listStates"
+ android:layout_width="match_parent"
+ android:layout_height="128dip"
+ android:animateLayoutChanges="true" />
+
+ </HorizontalScrollView>
+ -->
+
+</LinearLayout>
diff --git a/res/values/filtershow_strings.xml b/res/values/filtershow_strings.xml
index a7bc92dcc..11f27cf1b 100644
--- a/res/values/filtershow_strings.xml
+++ b/res/values/filtershow_strings.xml
@@ -193,4 +193,10 @@
<!-- The accept the draw size [CHAR LIMIT=20] -->
<string name="draw_size_accept">OK</string>
+ <!-- Name used to indicate the original image in the state panel [CHAR LIMIT=20] -->
+ <string name="state_panel_original">Original</string>
+
+ <!-- Name used to indicate the final image in the state panel [CHAR LIMIT=20] -->
+ <string name="state_panel_result">Result</string>
+
</resources>
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
index 00f5977d1..bd2f494cd 100644
--- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
@@ -21,15 +21,14 @@ import android.graphics.Rect;
import android.support.v8.renderscript.Allocation;
import android.util.Log;
-import com.android.gallery3d.filtershow.ImageStateAdapter;
import com.android.gallery3d.filtershow.cache.CachingPipeline;
import com.android.gallery3d.filtershow.cache.ImageLoader;
import com.android.gallery3d.filtershow.filters.BaseFiltersManager;
import com.android.gallery3d.filtershow.filters.FilterRepresentation;
-import com.android.gallery3d.filtershow.filters.FiltersManager;
import com.android.gallery3d.filtershow.filters.ImageFilter;
import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
import com.android.gallery3d.filtershow.imageshow.MasterImage;
+import com.android.gallery3d.filtershow.state.StateAdapter;
import java.util.Vector;
@@ -533,14 +532,11 @@ public class ImagePreset {
return true;
}
- public void fillImageStateAdapter(ImageStateAdapter imageStateAdapter) {
+ public void fillImageStateAdapter(StateAdapter imageStateAdapter) {
if (imageStateAdapter == null) {
return;
}
- imageStateAdapter.clear();
- // TODO: re-enable the state panel
imageStateAdapter.addAll(mFilters);
- imageStateAdapter.notifyDataSetChanged();
}
public void setPartialRendering(boolean partialRendering, Rect bounds) {