Loading res/layout/filtershow_activity.xml +46 −45 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/mainView" android:background="@color/background_screen" > <LinearLayout Loading Loading @@ -47,51 +48,6 @@ </ListView> </LinearLayout> <LinearLayout android:id="@+id/historyPanel" android:layout_width="200dip" android:layout_height="match_parent" android:layout_gravity="right" android:orientation="vertical" android:visibility="invisible" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:gravity="center" android:padding="2dip" android:text="@string/history" android:textColor="@android:color/white" android:textSize="24sp" android:textStyle="bold" /> <ListView android:id="@+id/operationsList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" > </ListView> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/resetOperationsButton" style="@style/FilterShowHistoryButton" android:gravity="center" android:text="@string/reset" /> <Button android:id="@+id/saveOperationsButton" style="@style/FilterShowHistoryButton" android:text="@string/save" android:visibility="gone" /> </LinearLayout> </LinearLayout> <LinearLayout android:id="@+id/mainPanel" android:layout_width="match_parent" Loading Loading @@ -458,4 +414,49 @@ </com.android.gallery3d.filtershow.CenteredLinearLayout> </LinearLayout> <LinearLayout android:id="@+id/historyPanel" android:layout_width="200dip" android:layout_height="match_parent" android:layout_gravity="right" android:orientation="vertical" android:visibility="invisible" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:gravity="center" android:padding="2dip" android:text="@string/history" android:textColor="@android:color/white" android:textSize="24sp" android:textStyle="bold" /> <ListView android:id="@+id/operationsList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" > </ListView> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/resetOperationsButton" style="@style/FilterShowHistoryButton" android:gravity="center" android:text="@string/reset" /> <Button android:id="@+id/saveOperationsButton" style="@style/FilterShowHistoryButton" android:text="@string/save" android:visibility="gone" /> </LinearLayout> </LinearLayout> </FrameLayout> src/com/android/gallery3d/filtershow/FilterShowActivity.java +15 −2 Original line number Diff line number Diff line Loading @@ -353,6 +353,17 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, } } private int translateMainPanel(View viewPanel) { int accessoryPanelWidth = viewPanel.getWidth(); int mainViewWidth = findViewById(R.id.mainView).getWidth(); int mainPanelWidth = mImageShow.getDisplayedImageBounds().width(); int leftOver = mainViewWidth - mainPanelWidth - accessoryPanelWidth; if (leftOver < 0) { return -accessoryPanelWidth; } return 0; } private int getScreenImageSize() { DisplayMetrics metrics = new DisplayMetrics(); Display display = getWindowManager().getDefaultDisplay(); Loading Loading @@ -666,9 +677,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mShowingHistoryPanel = false; } int translate = translateMainPanel(viewList); if (!mShowingImageStatePanel) { mShowingImageStatePanel = true; view.animate().setDuration(200).x(-viewList.getWidth()) view.animate().setDuration(200).x(translate) .withLayer().withEndAction(new Runnable() { @Override public void run() { Loading Loading @@ -699,9 +711,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mShowingImageStatePanel = false; } int translate = translateMainPanel(viewList); if (!mShowingHistoryPanel) { mShowingHistoryPanel = true; view.animate().setDuration(200).x(-viewList.getWidth()) view.animate().setDuration(200).x(translate) .withLayer().withEndAction(new Runnable() { @Override public void run() { Loading src/com/android/gallery3d/filtershow/imageshow/ImageShow.java +4 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,10 @@ public class ImageShow extends View implements OnGestureListener, return dst; } public Rect getDisplayedImageBounds() { return mImageBounds; } public ImagePreset getImagePreset() { return mImagePreset; } Loading src/com/android/gallery3d/filtershow/imageshow/ImageSlave.java +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.gallery3d.filtershow.imageshow; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import com.android.gallery3d.filtershow.HistoryAdapter; Loading Loading @@ -54,6 +55,11 @@ public class ImageSlave extends ImageShow { return mMasterImageShow.getImagePreset(); } @Override public Rect getDisplayedImageBounds() { return mMasterImageShow.getDisplayedImageBounds(); } @Override public void setImagePreset(ImagePreset preset, boolean addToHistory) { mMasterImageShow.setImagePreset(preset, addToHistory); Loading Loading
res/layout/filtershow_activity.xml +46 −45 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/mainView" android:background="@color/background_screen" > <LinearLayout Loading Loading @@ -47,51 +48,6 @@ </ListView> </LinearLayout> <LinearLayout android:id="@+id/historyPanel" android:layout_width="200dip" android:layout_height="match_parent" android:layout_gravity="right" android:orientation="vertical" android:visibility="invisible" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:gravity="center" android:padding="2dip" android:text="@string/history" android:textColor="@android:color/white" android:textSize="24sp" android:textStyle="bold" /> <ListView android:id="@+id/operationsList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" > </ListView> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/resetOperationsButton" style="@style/FilterShowHistoryButton" android:gravity="center" android:text="@string/reset" /> <Button android:id="@+id/saveOperationsButton" style="@style/FilterShowHistoryButton" android:text="@string/save" android:visibility="gone" /> </LinearLayout> </LinearLayout> <LinearLayout android:id="@+id/mainPanel" android:layout_width="match_parent" Loading Loading @@ -458,4 +414,49 @@ </com.android.gallery3d.filtershow.CenteredLinearLayout> </LinearLayout> <LinearLayout android:id="@+id/historyPanel" android:layout_width="200dip" android:layout_height="match_parent" android:layout_gravity="right" android:orientation="vertical" android:visibility="invisible" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:gravity="center" android:padding="2dip" android:text="@string/history" android:textColor="@android:color/white" android:textSize="24sp" android:textStyle="bold" /> <ListView android:id="@+id/operationsList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" > </ListView> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/resetOperationsButton" style="@style/FilterShowHistoryButton" android:gravity="center" android:text="@string/reset" /> <Button android:id="@+id/saveOperationsButton" style="@style/FilterShowHistoryButton" android:text="@string/save" android:visibility="gone" /> </LinearLayout> </LinearLayout> </FrameLayout>
src/com/android/gallery3d/filtershow/FilterShowActivity.java +15 −2 Original line number Diff line number Diff line Loading @@ -353,6 +353,17 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, } } private int translateMainPanel(View viewPanel) { int accessoryPanelWidth = viewPanel.getWidth(); int mainViewWidth = findViewById(R.id.mainView).getWidth(); int mainPanelWidth = mImageShow.getDisplayedImageBounds().width(); int leftOver = mainViewWidth - mainPanelWidth - accessoryPanelWidth; if (leftOver < 0) { return -accessoryPanelWidth; } return 0; } private int getScreenImageSize() { DisplayMetrics metrics = new DisplayMetrics(); Display display = getWindowManager().getDefaultDisplay(); Loading Loading @@ -666,9 +677,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mShowingHistoryPanel = false; } int translate = translateMainPanel(viewList); if (!mShowingImageStatePanel) { mShowingImageStatePanel = true; view.animate().setDuration(200).x(-viewList.getWidth()) view.animate().setDuration(200).x(translate) .withLayer().withEndAction(new Runnable() { @Override public void run() { Loading Loading @@ -699,9 +711,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mShowingImageStatePanel = false; } int translate = translateMainPanel(viewList); if (!mShowingHistoryPanel) { mShowingHistoryPanel = true; view.animate().setDuration(200).x(-viewList.getWidth()) view.animate().setDuration(200).x(translate) .withLayer().withEndAction(new Runnable() { @Override public void run() { Loading
src/com/android/gallery3d/filtershow/imageshow/ImageShow.java +4 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,10 @@ public class ImageShow extends View implements OnGestureListener, return dst; } public Rect getDisplayedImageBounds() { return mImageBounds; } public ImagePreset getImagePreset() { return mImagePreset; } Loading
src/com/android/gallery3d/filtershow/imageshow/ImageSlave.java +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.gallery3d.filtershow.imageshow; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import com.android.gallery3d.filtershow.HistoryAdapter; Loading Loading @@ -54,6 +55,11 @@ public class ImageSlave extends ImageShow { return mMasterImageShow.getImagePreset(); } @Override public Rect getDisplayedImageBounds() { return mMasterImageShow.getDisplayedImageBounds(); } @Override public void setImagePreset(ImagePreset preset, boolean addToHistory) { mMasterImageShow.setImagePreset(preset, addToHistory); Loading