OSDN Git Service

Importer: Full-screen viewing, UI refinement, refactoring
authorBobby Georgescu <georgescu@google.com>
Fri, 1 Feb 2013 20:57:14 +0000 (12:57 -0800)
committerBobby Georgescu <georgescu@google.com>
Wed, 13 Feb 2013 01:35:44 +0000 (17:35 -0800)
Bug: 7990333
Bug: 8151814
Bug: 8037411

This CL adds or changes the following things:
 - Full-screen image viewing and UI for switching modes
 - Moved general functionality from MtpThumbnailTileView
   to MtpImageView to allow for reuse in full-screen image
   use-case
 - MtpBitmapCache moved from ui to data package
 - Orientation now respected when set in image metadata
 - Miscellaneous UI consistency issues fixed
 - Miscellaneous instability issues fixed

Change-Id: I5f188b763617b693e32fedc03273d711d604922a

res/layout/ingest_activity_item_list.xml
res/layout/ingest_fullsize.xml [new file with mode: 0644]
res/menu/ingest_menu_item_list_selection.xml
res/values/strings.xml

index 23a95f6..f0e91e8 100644 (file)
      limitations under the License.
 -->
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
-    <GridView
+    <com.android.gallery3d.ingest.ui.IngestGridView
         android:id="@+id/ingest_gridview"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:columnWidth="200px"
+        android:columnWidth="120dip"
         android:numColumns="auto_fit"
         android:fastScrollEnabled="true"
         android:background="@android:color/background_dark"
         android:choiceMode="multipleChoiceModal"
         android:stretchMode="columnWidth"  />
 
+    <android.support.v4.view.ViewPager
+        android:id="@+id/ingest_view_pager"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@android:color/background_dark"
+        android:visibility="invisible" />
+
     <LinearLayout
-        android:id="@+id/ingest_warning_overlay"
+        android:id="@+id/ingest_warning_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="20dip"
         android:gravity="center"
         android:orientation="horizontal"
-        android:visibility="gone" >
+        android:visibility="invisible" >
 
         <ImageView
-            android:id="@+id/ingest_warning_overlay_icon"
+            android:id="@+id/ingest_warning_view_icon"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center"
             android:src="@android:drawable/ic_dialog_alert" />
 
         <TextView
-            android:id="@+id/ingest_warning_overlay_text"
+            android:id="@+id/ingest_warning_view_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginLeft="10dip"
diff --git a/res/layout/ingest_fullsize.xml b/res/layout/ingest_fullsize.xml
new file mode 100644 (file)
index 0000000..4100ca1
--- /dev/null
@@ -0,0 +1,36 @@
+<?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.
+-->
+<com.android.gallery3d.ingest.ui.MtpFullscreenView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" >
+
+    <com.android.gallery3d.ingest.ui.MtpImageView
+        android:id="@+id/ingest_fullsize_image"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true"
+        android:scaleType="centerInside" />
+
+    <CheckBox
+        android:id="@+id/ingest_fullsize_image_checkbox"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true"
+        android:text="@string/Import" />
+
+</com.android.gallery3d.ingest.ui.MtpFullscreenView>
\ No newline at end of file
index aaf3262..2f020b6 100644 (file)
@@ -14,6 +14,8 @@
      limitations under the License.
 -->
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/ingest_switch_view"
+          android:showAsAction="always" />
     <item android:id="@+id/import_items"
           android:showAsAction="always|withText"
           android:title="@string/Import" />
index d6b9815..fae3466 100644 (file)
     <!-- Label for album grid button -->
     <string name="switch_photo_grid">Grid view</string>
 
+    <!-- Label for fullscreen button. [CHAR LIMIT=20] -->
+    <string name="switch_photo_fullscreen">Fullscreen view</string>
+
     <!-- The tilte of a dialog showing trimming in progress. [CHAR LIMIT=20] -->
     <string name="trimming">Trimming</string>