summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-11-13 23:27:35 -0800
committerSteve Kondik <steve@cyngn.com>2016-11-13 23:33:37 -0800
commit302dfef488297152978788c2341cd3460727b251 (patch)
treee505947a46b291f22f1ee625ff82ebbec528353b /res
parent7f040079cb93d6b5180147cd369e73d43078c91a (diff)
downloadandroid_packages_apps_Snap-302dfef488297152978788c2341cd3460727b251.zip
android_packages_apps_Snap-302dfef488297152978788c2341cd3460727b251.tar.gz
android_packages_apps_Snap-302dfef488297152978788c2341cd3460727b251.tar.bz2
snap: UI checkpoint #2
* Fix bugs from previous commit * Factor out recording controls * Clean up layouts * Asynchronous control for video module * Performance improvements Change-Id: I9d5833cecbd9280845b740ee8a3c47f023470625
Diffstat (limited to 'res')
-rw-r--r--res/layout/camera_controls.xml71
-rw-r--r--res/layout/capture_module.xml8
-rw-r--r--res/layout/panorama_module.xml5
-rw-r--r--res/layout/photo_module.xml59
-rw-r--r--res/layout/recording_time.xml61
-rw-r--r--res/layout/video_module.xml65
-rw-r--r--res/values/colors.xml2
-rw-r--r--res/values/dimens.xml2
-rw-r--r--res/values/styles.xml2
9 files changed, 168 insertions, 107 deletions
diff --git a/res/layout/camera_controls.xml b/res/layout/camera_controls.xml
index 5241987..1f12514 100644
--- a/res/layout/camera_controls.xml
+++ b/res/layout/camera_controls.xml
@@ -20,8 +20,9 @@
<LinearLayout
android:id="@+id/top_bar"
+ android:background="@drawable/camera_controls_bg_translucent"
android:layout_width="match_parent"
- android:layout_height="0dp"
+ android:layout_height="@dimen/preview_top_margin"
android:gravity="center_vertical"
android:orientation="horizontal">
@@ -66,26 +67,18 @@
</LinearLayout>
- <include
- android:layout_width="64dip"
- android:layout_height="64dip"
- android:layout_gravity="bottom|right"
- android:layout_marginBottom="8dip"
- android:layout_marginRight="-8dip"
- layout="@layout/menu_indicators" />
-
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
- android:layout_height="0dp"
+ android:layout_height="@dimen/preview_bottom_margin"
android:gravity="center_vertical"
- android:weightSum="3"
+ android:background="@drawable/camera_controls_bg_translucent"
android:orientation="horizontal">
<com.android.camera.ui.RotateImageView
android:id="@+id/preview_thumb"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_height="@dimen/thumbnail_size"
android:layout_weight="1"
android:layout_gravity="center"
android:background="@android:color/transparent"
@@ -93,32 +86,32 @@
android:elevation="1dp"
android:scaleType="fitCenter" />
- <com.android.camera.ShutterButton
- android:id="@+id/shutter_button"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
+ <com.android.camera.ShutterButton
+ android:id="@+id/shutter_button"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
android:layout_gravity="center"
- android:clickable="true"
- android:contentDescription="@string/accessibility_shutter_button"
- android:focusable="true"
- android:scaleType="fitCenter"
- android:layout_weight="1"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:contentDescription="@string/accessibility_shutter_button"
+ android:focusable="true"
+ android:scaleType="fitCenter"
android:elevation="1dp"
- android:src="@drawable/btn_new_shutter" />
-
- <ImageView
- android:id="@+id/video_button"
- android:visibility="gone"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:clickable="true"
- android:contentDescription="@string/accessibility_shutter_button"
- android:focusable="true"
- android:scaleType="fitCenter"
- android:layout_weight="1"
+ android:src="@drawable/btn_new_shutter" />
+
+ <ImageView
+ android:id="@+id/video_button"
+ android:visibility="gone"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
android:layout_gravity="center"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:contentDescription="@string/accessibility_shutter_button"
+ android:focusable="true"
+ android:scaleType="fitCenter"
android:elevation="1dp"
- android:src="@drawable/btn_new_shutter_video" />
+ android:src="@drawable/btn_new_shutter_video" />
<com.android.camera.ui.ModuleSwitcher
android:id="@+id/camera_switcher"
@@ -132,6 +125,14 @@
android:contentDescription="@string/accessibility_mode_picker" />
</LinearLayout>
+ <include
+ android:layout_width="64dip"
+ android:layout_height="64dip"
+ android:layout_gravity="bottom|right"
+ android:layout_marginBottom="8dip"
+ android:layout_marginRight="-8dip"
+ layout="@layout/menu_indicators" />
+
<LinearLayout
android:id="@+id/remaining_photos"
android:layout_width="wrap_content"
diff --git a/res/layout/capture_module.xml b/res/layout/capture_module.xml
index dba8de9..eee33f5 100644
--- a/res/layout/capture_module.xml
+++ b/res/layout/capture_module.xml
@@ -103,8 +103,8 @@
</LinearLayout>
</com.android.camera.ui.RotateLayout>
- <include
- style="@style/CameraControls"
- layout="@layout/camera_controls"
- android:layout_gravity="center" />
+ <include layout="@layout/camera_controls"
+ android:layout_gravity="center"
+ style="@style/CameraControls"/>
+
</merge>
diff --git a/res/layout/panorama_module.xml b/res/layout/panorama_module.xml
index 5ae3002..b1d0ded 100644
--- a/res/layout/panorama_module.xml
+++ b/res/layout/panorama_module.xml
@@ -129,6 +129,7 @@
</com.android.camera.ui.RotateLayout>
<include layout="@layout/camera_controls"
- android:layout_gravity="center"
- style="@style/CameraControls"/>
+ android:layout_gravity="center"
+ style="@style/CameraControls"/>
+
</merge>
diff --git a/res/layout/photo_module.xml b/res/layout/photo_module.xml
index 794a968..d972989 100644
--- a/res/layout/photo_module.xml
+++ b/res/layout/photo_module.xml
@@ -21,6 +21,7 @@
layout. -->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ android:background="@android:color/black"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" >
@@ -31,25 +32,43 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical|center_horizontal" >
- <SurfaceView
+ <com.android.camera.ui.AutoFitSurfaceView
android:id="@+id/mdp_preview_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
+
<View
android:id="@+id/preview_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black" />
- <com.android.camera.ui.focus.FocusRingView
- android:id="@+id/focus_ring"
+
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <com.android.camera.ui.CaptureAnimationOverlay
- android:id="@+id/capture_overlay"
+ android:layout_height="match_parent">
+ <ViewStub android:id="@+id/face_view_stub"
+ android:inflatedId="@+id/face_view"
+ android:layout="@layout/face_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone"/>
+ <com.android.camera.ui.focus.FocusRingView
+ android:id="@+id/focus_ring"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ <com.android.camera.ui.CaptureAnimationOverlay
+ android:id="@+id/capture_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
+ </FrameLayout>
+
+ <com.android.camera.ui.RenderOverlay
+ android:id="@+id/render_overlay"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
+ android:layout_height="match_parent" />
+
<com.android.camera.ui.RotateImageView
android:id="@+id/review_image"
android:layout_width="match_parent"
@@ -58,29 +77,19 @@
android:clickable="true"
android:background="@android:color/black"
android:scaleType="fitCenter"/>
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <ViewStub android:id="@+id/face_view_stub"
- android:inflatedId="@+id/face_view"
- android:layout="@layout/face_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone"/>
- </FrameLayout>
- <com.android.camera.ui.RenderOverlay
- android:id="@+id/render_overlay"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <include layout="@layout/camera_controls"
- android:layout_gravity="center"
- style="@style/CameraControls"/>
+
<include layout="@layout/menu_help"
android:layout_gravity="center"
style="@style/CameraControls"/>
+
<RelativeLayout
android:id="@+id/id_tsmakeup_level_layout_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
+
+ <include layout="@layout/camera_controls"
+ android:layout_gravity="center"
+ style="@style/CameraControls"/>
+
</merge>
diff --git a/res/layout/recording_time.xml b/res/layout/recording_time.xml
new file mode 100644
index 0000000..4a7adee
--- /dev/null
+++ b/res/layout/recording_time.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The CyanogenMod 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.
+-->
+<!-- This layout is shared by phone and tablet in landscape orientation. -->
+<com.android.camera.ui.RecordingTime
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:visibility="gone"
+ android:layout_gravity="left|top"
+ android:layout_marginTop="@dimen/preview_top_margin"
+ android:padding="16dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
+
+ <com.android.camera.ui.ReversibleLinearLayout
+ android:id="@+id/recording_time_container"
+ android:orientation="horizontal"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content">
+
+ <com.android.camera.PauseButton android:id="@+id/video_pause"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:gravity="center"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:src="@drawable/btn_pause_recording"/>
+
+ <TextView android:id="@+id/recording_time_text"
+ style="@style/OnViewfinderLabel"
+ android:gravity="center"
+ android:text="@string/initial_recording_seconds"
+ android:drawableLeft="@drawable/ic_recording_indicator"
+ android:drawablePadding="5dp"/>
+
+ </com.android.camera.ui.ReversibleLinearLayout>
+
+ <TextView android:id="@+id/time_lapse_label"
+ android:text="@string/time_lapse_title"
+ android:visibility="gone"
+ style="@style/OnViewfinderLabel"/>
+
+ </LinearLayout>
+
+</com.android.camera.ui.RecordingTime>
diff --git a/res/layout/video_module.xml b/res/layout/video_module.xml
index f12f06c..a6024d5 100644
--- a/res/layout/video_module.xml
+++ b/res/layout/video_module.xml
@@ -15,6 +15,7 @@
-->
<!-- This layout is shared by phone and tablet in landscape orientation. -->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
+ android:background="@android:color/black"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" >
@@ -23,11 +24,18 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical|center_horizontal" >
- <SurfaceView
+ <com.android.camera.ui.AutoFitSurfaceView
android:id="@+id/mdp_preview_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
+
+ <View
+ android:id="@+id/preview_cover"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black" />
+
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -37,53 +45,32 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
+ <com.android.camera.ui.focus.FocusRingView
+ android:id="@+id/focus_ring"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ <com.android.camera.ui.CaptureAnimationOverlay
+ android:id="@+id/capture_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone" />
</FrameLayout>
- <View
- android:id="@+id/preview_cover"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@android:color/black" />
- <FrameLayout android:id="@+id/preview_border"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone"
- android:background="@drawable/ic_snapshot_border" />
+
<com.android.camera.ui.RenderOverlay
android:id="@+id/render_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
- <com.android.camera.ui.RotateLayout
- android:id="@+id/recording_time_rect"
- android:layout_height="match_parent"
- android:layout_width="match_parent">
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_height="match_parent"
- android:layout_width="match_parent">
- <com.android.camera.PauseButton android:id="@+id/video_pause"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_marginLeft="50dp"
- android:padding="38dp"
- android:src="@drawable/btn_pause_recording"/>
- <include layout="@layout/viewfinder_labels_video"
- android:id="@+id/labels" />
- </LinearLayout>
- </com.android.camera.ui.RotateLayout>
- <com.android.camera.ui.focus.FocusRingView
- android:id="@+id/focus_ring"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <com.android.camera.ui.CaptureAnimationOverlay
- android:id="@+id/capture_overlay"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone" />
+
+
+ <include layout="@layout/recording_time"
+ android:id="@+id/recording_time" />
+
<ImageView android:id="@+id/review_image"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"
android:background="@android:color/black"/>
+
<ImageView
android:id="@+id/btn_play"
style="@style/ReviewControlIcon"
@@ -92,7 +79,9 @@
android:scaleType="center"
android:visibility="gone"
android:onClick="onReviewPlayClicked"/>
+
<include layout="@layout/camera_controls"
android:layout_gravity="center"
style="@style/CameraControls"/>
+
</merge>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 05c7834..518a88c 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -48,7 +48,7 @@
<color name="recording_time_elapsed_text">@color/white</color>
<color name="recording_time_remaining_text">@color/red</color>
- <color name="on_viewfinder_label_background_color">@color/black</color>
+ <color name="on_viewfinder_label_background_color">#401b1b1b</color>
<color name="review_control_pressed_color">@color/blue</color>
<color name="review_control_pressed_fan_color">@color/blue</color>
<color name="review_background">@color/black</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index c8c1896..c6dde51 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -151,7 +151,7 @@
<dimen name="manage_cache_bottom_height">48dp</dimen>
<!-- configuration for filtershow UI -->
- <dimen name="thumbnail_size">96dip</dimen>
+ <dimen name="thumbnail_size">64dip</dimen>
<dimen name="thumbnail_margin">3dip</dimen>
<dimen name="action_item_height">175dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 2528546..3e3ef16 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -125,11 +125,11 @@
<item name="android:background">@drawable/setting_list_item_bg</item>
</style>
<style name="OnViewfinderLabel">
+ <item name="android:layout_gravity">left</item>
<item name="android:gravity">center</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
- <item name="android:layout_marginTop">38dp</item>
<item name="android:paddingLeft">15dp</item>
<item name="android:paddingRight">15dp</item>
<item name="android:paddingTop">3dp</item>