diff options
author | Chung-yih Wang <cywang@google.com> | 2010-11-22 13:46:30 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2010-11-25 19:07:04 +0800 |
commit | 59ddc8c1add2fcffe523e3877baad1b6cc5ba2fb (patch) | |
tree | 9ef281563deca6c36963757340a33df46b0449bc /res | |
parent | 623fc04dd6194559a22b8cc9305473bf9205eb58 (diff) | |
download | packages_apps_LegacyCamera-59ddc8c1add2fcffe523e3877baad1b6cc5ba2fb.zip packages_apps_LegacyCamera-59ddc8c1add2fcffe523e3877baad1b6cc5ba2fb.tar.gz packages_apps_LegacyCamera-59ddc8c1add2fcffe523e3877baad1b6cc5ba2fb.tar.bz2 |
Add front/back camera switch
bug:3156676
Change-Id: I8a5394aefa068cb099b89c5739abf0cfd78591a9
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/btn_camera_picker.xml | 20 | ||||
-rw-r--r-- | res/layout-xlarge/camera_picker.xml | 53 | ||||
-rw-r--r-- | res/layout-xlarge/preview_frame.xml | 2 | ||||
-rw-r--r-- | res/layout-xlarge/preview_frame_video.xml | 3 | ||||
-rw-r--r-- | res/values/arrays.xml | 5 | ||||
-rw-r--r-- | res/xml/camera_preferences.xml | 1 |
6 files changed, 82 insertions, 2 deletions
diff --git a/res/drawable/btn_camera_picker.xml b/res/drawable/btn_camera_picker.xml new file mode 100644 index 0000000..109d57f --- /dev/null +++ b/res/drawable/btn_camera_picker.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_checked="true" android:color="@android:color/white" /> + <item android:color="@android:color/darker_gray" /> +</selector> diff --git a/res/layout-xlarge/camera_picker.xml b/res/layout-xlarge/camera_picker.xml new file mode 100644 index 0000000..eb0bcd0 --- /dev/null +++ b/res/layout-xlarge/camera_picker.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 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.camera.ui.CameraPicker xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/camera_picker" + android:visibility="gone" + android:orientation="horizontal" + android:layout_width="260dp" + android:layout_height="54dp" + android:layout_marginTop="10dp" + android:gravity="center" + android:layout_gravity="center_horizontal" + android:background="@drawable/mode_switch_bg_v2"> + <RadioButton android:text="@string/pref_camera_id_entry_back" + android:id="@+id/camera_switch_to_back" + android:layout_width="100dp" + android:layout_height="fill_parent" + android:layout_gravity="center" + android:gravity="center" + android:textSize="16sp" + android:textColor="@drawable/btn_camera_picker" + android:button="@android:color/transparent" + android:background="@android:color/transparent" + android:textStyle="bold"/> + <ImageView android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:src="@drawable/btn_ic_mode_switch_video"/> + <RadioButton android:text="@string/pref_camera_id_entry_front" + android:id="@+id/camera_switch_to_front" + android:layout_width="100dp" + android:layout_height="fill_parent" + android:layout_gravity="center" + android:gravity="center" + android:textSize="16sp" + android:textColor="@drawable/btn_camera_picker" + android:button="@android:color/transparent" + android:background="@android:color/transparent" + android:textStyle="bold"/> +</com.android.camera.ui.CameraPicker> diff --git a/res/layout-xlarge/preview_frame.xml b/res/layout-xlarge/preview_frame.xml index 416fa15..cba64ce 100644 --- a/res/layout-xlarge/preview_frame.xml +++ b/res/layout-xlarge/preview_frame.xml @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and limitations under the License. --> - <com.android.camera.PreviewFrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/frame_layout" android:layout_width="match_parent" @@ -45,4 +44,5 @@ android:layout_margin="10dp" android:visibility="invisible"/> </RelativeLayout> + <include layout="@layout/camera_picker" /> </com.android.camera.PreviewFrameLayout> diff --git a/res/layout-xlarge/preview_frame_video.xml b/res/layout-xlarge/preview_frame_video.xml index db44788..99bae1f 100644 --- a/res/layout-xlarge/preview_frame_video.xml +++ b/res/layout-xlarge/preview_frame_video.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 The Android Open Source Project +<!-- Copyright (C) 2010 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. @@ -31,4 +31,5 @@ android:layout_height="match_parent" android:visibility="gone" /> </RelativeLayout> + <include layout="@layout/camera_picker"/> </com.android.camera.PreviewFrameLayout> diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 9d7caab..d50cebc 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -336,6 +336,11 @@ <item>candlelight</item> </string-array> + <array name="camera_id_entries" translatable="false"> + <item>@string/pref_camera_id_entry_back</item> + <item>@string/pref_camera_id_entry_front</item> + </array> + <array name="camera_id_icons" translatable="false"> <item>@drawable/ic_menuselect_camera_facing_back</item> <item>@drawable/ic_menuselect_camera_facing_front</item> diff --git a/res/xml/camera_preferences.xml b/res/xml/camera_preferences.xml index cb67840..1b3bcee 100644 --- a/res/xml/camera_preferences.xml +++ b/res/xml/camera_preferences.xml @@ -82,6 +82,7 @@ camera:defaultValue="@string/pref_camera_id_default" camera:title="@string/pref_camera_id_title" camera:icons="@array/camera_id_icons" + camera:entries="@array/camera_id_entries" camera:largeIcons="@array/camera_id_largeicons" /> </PreferenceGroup> </PreferenceGroup> |