diff options
author | Byunghun Jeon <bjeon@codeaurora.org> | 2015-11-17 14:20:30 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-08-25 21:55:20 -0700 |
commit | 075630e6a853d472cb35e31cb7454596da1bfa0b (patch) | |
tree | 42df9f8a368c216c6ef4923a2ec8f9af43f0fb4f /res | |
parent | 39b3dfdfc54fdcdf2ca8a65c4351043b9bb0f9d1 (diff) | |
download | android_packages_apps_Snap-075630e6a853d472cb35e31cb7454596da1bfa0b.tar.gz android_packages_apps_Snap-075630e6a853d472cb35e31cb7454596da1bfa0b.tar.bz2 android_packages_apps_Snap-075630e6a853d472cb35e31cb7454596da1bfa0b.zip |
SnapdragonCamera: Add Camera2 mode
Use camera2 API to show preview and take snapshot
CRs-Fixed: 989750
Change-Id: I07e2d6743529b3d3d5acecf667e9493465a094c9
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/camera.xml | 9 | ||||
-rw-r--r-- | res/layout/capture_module.xml | 89 | ||||
-rw-r--r-- | res/values/qcomarrays.xml | 22 | ||||
-rw-r--r-- | res/values/qcomstrings.xml | 19 | ||||
-rw-r--r-- | res/xml/camera_preferences.xml | 12 |
5 files changed, 80 insertions, 71 deletions
diff --git a/res/layout/camera.xml b/res/layout/camera.xml index 98b3a1013..a71460066 100644 --- a/res/layout/camera.xml +++ b/res/layout/camera.xml @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<com.android.camera.ui.CameraRootFrame xmlns:android="http://schemas.android.com/apk/res/android" +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/camera_root_frame" android:layout_width="match_parent" android:layout_height="match_parent" > @@ -32,4 +32,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" > </com.android.camera.ui.CameraRootView> -</com.android.camera.ui.CameraRootFrame> + <com.android.camera.ui.CameraRootView + android:id="@+id/camera_capture_root" + android:layout_width="match_parent" + android:layout_height="match_parent" > + </com.android.camera.ui.CameraRootView> +</FrameLayout> diff --git a/res/layout/capture_module.xml b/res/layout/capture_module.xml index 10017192b..2715dcbe2 100644 --- a/res/layout/capture_module.xml +++ b/res/layout/capture_module.xml @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2013 The Android Open Source Project +<!-- Copyright (c) 2016, The Linux Foundation. All rights reserved. + Not a Contribution. + + 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. @@ -23,89 +26,37 @@ <merge xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center" > - <include layout="@layout/count_down_to_capture" /> - <include layout="@layout/selfie_flash_view" /> + android:layout_gravity="center"> + <FrameLayout - android:id="@+id/preview_container" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center_vertical|center_horizontal" > + android:layout_gravity="center_vertical|center_horizontal"> + <SurfaceView android:id="@+id/mdp_preview_content" android:layout_width="match_parent" android:layout_height="match_parent" /> + + <SurfaceView + android:id="@+id/mdp_preview_content2" + android:layout_width="100dp" + android:layout_height="100dp" /> </FrameLayout> + <View android:id="@+id/preview_cover" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" /> - <RelativeLayout android:id="@+id/linear" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent"> - <ProgressBar - style="?android:attr/progressBarStyleHorizontal" - android:id="@+id/progress" - android:orientation="vertical" - android:layout_width="200dip" - android:layout_height="wrap_content" - android:layout_marginTop="14dip" - android:layout_marginBottom="14dip" - android:layout_marginLeft="30dip" - android:layout_marginRight="30dip" /> - <com.android.camera.GraphView - android:id="@+id/graph_view" - android:layout_width="200dip" - android:layout_height="200dip" - android:layout_marginTop="60dip" - android:layout_marginLeft="90dip" /> - <com.android.camera.DrawAutoHDR - android:id="@+id/autohdr_view" - android:layout_width="200dip" - android:layout_height="200dip" - android:layout_marginTop="15dip" - android:layout_marginLeft="15dip" /> - </RelativeLayout> - <ImageView - android:id="@+id/review_image" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" - android:clickable="true" - android:background="@android:color/black" - android:scaleType="fitCenter"/> - <View - android:id="@+id/flash_overlay" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@android:color/white" - android:visibility="gone" - android:alpha="0" /> - <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 + style="@style/CameraControls" + layout="@layout/camera_controls" + android:layout_gravity="center" /> </merge> diff --git a/res/values/qcomarrays.xml b/res/values/qcomarrays.xml index 2b565fd56..5417195f2 100644 --- a/res/values/qcomarrays.xml +++ b/res/values/qcomarrays.xml @@ -823,4 +823,26 @@ <item>0</item> <item>1</item> </string-array> + + <string-array name="pref_camera_camera2_entries" translatable="true"> + <item>@string/pref_camera_camera2_entry_enable</item> + <item>@string/pref_camera_camera2_entry_disable</item> + </string-array> + + <string-array name="pref_camera_camera2_entryvalues" translatable="false"> + <item>@string/pref_camera_camera2_value_enable</item> + <item>@string/pref_camera_camera2_value_disable</item> + </string-array> + + <string-array name="pref_camera_dual_camera_entries" translatable="true"> + <item>@string/pref_camera_dual_camera_entry_dual</item> + <item>@string/pref_camera_dual_camera_entry_bayer</item> + <item>@string/pref_camera_dual_camera_entry_mono</item> + </string-array> + + <string-array name="pref_camera_dual_camera_entryvalues" translatable="false"> + <item>@string/pref_camera_dual_camera_value_dual</item> + <item>@string/pref_camera_dual_camera_value_bayer</item> + <item>@string/pref_camera_dual_camera_value_mono</item> + </string-array> </resources> diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml index 1753e42eb..b1c9b4177 100644 --- a/res/values/qcomstrings.xml +++ b/res/values/qcomstrings.xml @@ -512,6 +512,25 @@ <!-- Toast after SeeMore has been enabled to show TNR is disabled --> <string name="disable_TNR_during_SeeMore">Enabling SeeMore will disable TNR</string> + <string name="pref_camera_camera2_title">Camera2 Mode</string> + <string name="pref_camera_camera2_default">disable</string> + <string name="pref_camera_camera2_entry_enable">Enable</string> + <string name="pref_camera_camera2_entry_disable">Disable</string> + + <string name="pref_camera_camera2_value_enable">enable</string> + <string name="pref_camera_camera2_value_disable">disable</string> + + + <string name="pref_camera_dual_camera_title">Dual Camera Mode</string> + <string name="pref_camera_dual_camera_default">bayer</string> + <string name="pref_camera_dual_camera_entry_dual">Dual-camera Linked</string> + <string name="pref_camera_dual_camera_entry_bayer">Single Bayer Camera</string> + <string name="pref_camera_dual_camera_entry_mono">Single Mono Camera</string> + + <string name="pref_camera_dual_camera_value_dual">dual</string> + <string name="pref_camera_dual_camera_value_bayer">bayer</string> + <string name="pref_camera_dual_camera_value_mono">mono</string> + <!-- TODO: Remove these? --> <string name="pref_camera_redeyereduction_entry_disable" translatable="false">disable</string> diff --git a/res/xml/camera_preferences.xml b/res/xml/camera_preferences.xml index bde5a52d0..4920ef1f5 100644 --- a/res/xml/camera_preferences.xml +++ b/res/xml/camera_preferences.xml @@ -365,4 +365,16 @@ camera:entries="@array/pref_switch_entries" camera:singleIcon="@drawable/ic_settings_bright_screen" camera:entryValues="@array/pref_switch_entryvalues" /> + <ListPreference + camera:key="pref_camera_camera2_key" + camera:defaultValue="@string/pref_camera_camera2_default" + camera:title="@string/pref_camera_camera2_title" + camera:entries="@array/pref_camera_camera2_entries" + camera:entryValues="@array/pref_camera_camera2_entryvalues" /> + <ListPreference + camera:key="pref_camera_dual_camera_key" + camera:defaultValue="@string/pref_camera_dual_camera_default" + camera:title="@string/pref_camera_dual_camera_title" + camera:entries="@array/pref_camera_dual_camera_entries" + camera:entryValues="@array/pref_camera_dual_camera_entryvalues" /> </PreferenceGroup> |