summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@gmail.com>2015-09-20 02:31:09 +0300
committerMichael Bestas <mikeioannina@gmail.com>2015-09-20 20:02:05 +0300
commit71f4fae6ca8c12c467b5afa8a6d325fc10b77f45 (patch)
treec42a36b91e5236cffc1a6a35fddcb67a4c7d60f9
parentde3e756185977708f1fdd6eb7fe669173d3d8316 (diff)
downloadandroid_packages_apps_Snap-71f4fae6ca8c12c467b5afa8a6d325fc10b77f45.zip
android_packages_apps_Snap-71f4fae6ca8c12c467b5afa8a6d325fc10b77f45.tar.gz
android_packages_apps_Snap-71f4fae6ca8c12c467b5afa8a6d325fc10b77f45.tar.bz2
Snap: Remove CAF beautification feature
Revert "SnapdragonCamera: Move the files to the correct location" This reverts commit c25b2d510285512dbb60547353190433f1dbb984. Revert "SnapdragonCamera: Add beautification feature to SnapdragonCamera." This reverts commit c1cea7c15b2e463f37c17f2a4ce61ce689ec7088. Change-Id: If01e4f438a58e4210a3eddf090d426895ecbae87
-rw-r--r--res/drawable/ic_ts_makeup_clean_selector.xml22
-rw-r--r--res/drawable/ic_ts_makeup_custom_selector.xml22
-rw-r--r--res/drawable/ic_ts_makeup_level_1_selector.xml22
-rw-r--r--res/drawable/ic_ts_makeup_level_2_selector.xml22
-rw-r--r--res/drawable/ic_ts_makeup_level_3_selector.xml22
-rw-r--r--res/drawable/ic_ts_makeup_level_off_selector.xml22
-rw-r--r--res/drawable/ic_ts_makeup_whiten_selector.xml22
-rw-r--r--res/layout-port/camera_controls.xml4
-rw-r--r--res/layout/photo_module.xml6
-rw-r--r--res/layout/ts_makeup_item_view.xml52
-rw-r--r--res/layout/ts_makeup_level_view_land.xml29
-rw-r--r--res/layout/ts_makeup_level_view_port.xml29
-rw-r--r--res/layout/ts_makeup_single_level_view_port.xml154
-rw-r--r--res/values-zh-rCN/strings.xml11
-rw-r--r--res/values/dimens.xml2
-rw-r--r--res/values/qcomarrays.xml40
-rw-r--r--res/values/qcomstrings.xml13
-rw-r--r--res/xml/camera_preferences.xml25
-rw-r--r--src/com/android/camera/CameraSettings.java8
-rw-r--r--src/com/android/camera/ListPreference.java5
-rw-r--r--src/com/android/camera/PhotoMenu.java208
-rw-r--r--src/com/android/camera/PhotoModule.java94
-rw-r--r--src/com/android/camera/PhotoUI.java31
-rw-r--r--src/com/android/camera/TsMakeupManager.java476
-rw-r--r--src/com/android/camera/ui/CameraControls.java123
25 files changed, 41 insertions, 1423 deletions
diff --git a/res/drawable/ic_ts_makeup_clean_selector.xml b/res/drawable/ic_ts_makeup_clean_selector.xml
deleted file mode 100644
index 791658d..0000000
--- a/res/drawable/ic_ts_makeup_clean_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_clean_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_clean" />
-</selector>
diff --git a/res/drawable/ic_ts_makeup_custom_selector.xml b/res/drawable/ic_ts_makeup_custom_selector.xml
deleted file mode 100644
index eecc2c7..0000000
--- a/res/drawable/ic_ts_makeup_custom_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_custom_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_custom" />
-</selector>
diff --git a/res/drawable/ic_ts_makeup_level_1_selector.xml b/res/drawable/ic_ts_makeup_level_1_selector.xml
deleted file mode 100644
index 38e9193..0000000
--- a/res/drawable/ic_ts_makeup_level_1_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_level_1_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_level_1" />
-</selector>
diff --git a/res/drawable/ic_ts_makeup_level_2_selector.xml b/res/drawable/ic_ts_makeup_level_2_selector.xml
deleted file mode 100644
index 76d40bd..0000000
--- a/res/drawable/ic_ts_makeup_level_2_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_level_2_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_level_2" />
-</selector>
diff --git a/res/drawable/ic_ts_makeup_level_3_selector.xml b/res/drawable/ic_ts_makeup_level_3_selector.xml
deleted file mode 100644
index e26ecdf..0000000
--- a/res/drawable/ic_ts_makeup_level_3_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_level_3_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_level_3" />
-</selector>
diff --git a/res/drawable/ic_ts_makeup_level_off_selector.xml b/res/drawable/ic_ts_makeup_level_off_selector.xml
deleted file mode 100644
index e193967..0000000
--- a/res/drawable/ic_ts_makeup_level_off_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_level_off_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_level_off" />
-</selector>
diff --git a/res/drawable/ic_ts_makeup_whiten_selector.xml b/res/drawable/ic_ts_makeup_whiten_selector.xml
deleted file mode 100644
index f1284b6..0000000
--- a/res/drawable/ic_ts_makeup_whiten_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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_selected="true" android:drawable="@drawable/ic_ts_makeup_whiten_selected" />
- <item android:drawable="@drawable/ic_ts_makeup_whiten" />
-</selector>
diff --git a/res/layout-port/camera_controls.xml b/res/layout-port/camera_controls.xml
index af47a13..bc85432 100644
--- a/res/layout-port/camera_controls.xml
+++ b/res/layout-port/camera_controls.xml
@@ -83,10 +83,6 @@
android:id="@+id/filter_mode_switcher"
style="@style/ToggleButton" />
- <com.android.camera.ui.RotateImageView
- android:id="@+id/ts_makeup_switcher"
- style="@style/ToggleButton" />
-
<LinearLayout
android:id="@+id/remaining_photos"
android:layout_width="wrap_content"
diff --git a/res/layout/photo_module.xml b/res/layout/photo_module.xml
index 105a8c9..1783592 100644
--- a/res/layout/photo_module.xml
+++ b/res/layout/photo_module.xml
@@ -89,10 +89,4 @@
<include layout="@layout/camera_controls"
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" />
</merge>
diff --git a/res/layout/ts_makeup_item_view.xml b/res/layout/ts_makeup_item_view.xml
deleted file mode 100644
index 4b5a050..0000000
--- a/res/layout/ts_makeup_item_view.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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.RotateLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/border"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:id="@+id/image"
- android:layout_width="48dip"
- android:layout_height="48dip"
- android:layout_gravity="center"
- android:gravity="center" />
-
- <TextView
- android:id="@+id/label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="center"
- android:singleLine="true"
- android:textColor="@android:color/white"
- android:textSize="13sp"
- android:textStyle="bold" />
- </LinearLayout>
-
-</com.android.camera.ui.RotateLayout> \ No newline at end of file
diff --git a/res/layout/ts_makeup_level_view_land.xml b/res/layout/ts_makeup_level_view_land.xml
deleted file mode 100644
index 0d02562..0000000
--- a/res/layout/ts_makeup_level_view_land.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/id_makeup_level_root"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="right"
- android:layout_alignParentRight="true"
- android:alpha="0.85"
- android:orientation="vertical" >
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout/ts_makeup_level_view_port.xml b/res/layout/ts_makeup_level_view_port.xml
deleted file mode 100644
index 4ffaba5..0000000
--- a/res/layout/ts_makeup_level_view_port.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/id_makeup_level_root"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_alignParentBottom="true"
- android:alpha="0.85"
- android:orientation="horizontal" >
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/layout/ts_makeup_single_level_view_port.xml b/res/layout/ts_makeup_single_level_view_port.xml
deleted file mode 100644
index fbfafee..0000000
--- a/res/layout/ts_makeup_single_level_view_port.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014,2015 Thundersoft Corporation
- All rights Reserved
-
- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/id_makeup_single_level_root"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_gravity="bottom"
- android:orientation="vertical" >
-
- <SeekBar
- android:id="@+id/seekbar_makeup_level"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="8dip"
- android:visibility="gone" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="@dimen/tsmakeup_mode_level_size"
- android:layout_gravity="center"
- android:gravity="center" >
-
- <LinearLayout
- android:id="@+id/id_layout_makeup_back"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="2.0"
- android:gravity="center" >
-
- <ImageView
- android:id="@+id/id_iv_makeup_back"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:src="@drawable/ic_ts_makeup_back" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="1.0"
- android:gravity="center" >
-
- <View
- android:layout_width="1dip"
- android:layout_height="36dip"
- android:layout_gravity="center"
- android:background="@drawable/ic_ts_makeup_vline" />
- </LinearLayout>
-
- <com.android.camera.ui.RotateLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="3.5"
- android:gravity="center"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/id_layout_makeup_clean"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:orientation="vertical"
- android:padding="2dip" >
-
- <ImageView
- android:id="@+id/id_iv_makeup_clean"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:src="@drawable/ic_ts_makeup_clean_selector" />
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="center"
- android:shadowColor="@android:color/black"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="2"
- android:singleLine="true"
- android:text="@string/pref_camera_tsmakeup_level_clean"
- android:textColor="@android:color/white"
- android:textSize="13sp"
- android:textStyle="bold" />
- </LinearLayout>
- </com.android.camera.ui.RotateLayout>
-
- <com.android.camera.ui.RotateLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="3.5"
- android:gravity="center"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/id_layout_makeup_whiten"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:orientation="vertical"
- android:padding="2dp" >
-
- <ImageView
- android:id="@+id/id_iv_makeup_whiten"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:src="@drawable/ic_ts_makeup_whiten_selector" />
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="center"
- android:shadowColor="@android:color/black"
- android:shadowDx="1"
- android:shadowDy="1"
- android:shadowRadius="2"
- android:singleLine="true"
- android:text="@string/pref_camera_tsmakeup_level_whiten"
- android:textColor="@android:color/white"
- android:textSize="13sp"
- android:textStyle="bold" />
- </LinearLayout>
- </com.android.camera.ui.RotateLayout>
- </LinearLayout>
-
-</LinearLayout> \ No newline at end of file
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 47bc62f..ba9a5ec 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -529,15 +529,4 @@
<string name="camera_gesture_title">打开相机</string>
<string name="remaining_photos_format">剩余 %d 张</string>
- <string name="pref_camera_tsmakeup_title">美颜</string>
- <string name="pref_camera_tsmakeup_entry_on">开</string>
- <string name="pref_camera_tsmakeup_entry_off">关</string>
- <string name="pref_camera_tsmakeup_custom">自定义</string>
- <string name="pref_camera_tsmakeup_level_whiten">美白</string>
- <string name="pref_camera_tsmakeup_level_clean">磨皮</string>
- <string name="text_tsmakeup_alert_title">警告</string>
- <string name="text_tsmakeup_alert_msg">实时美颜需要开启人脸检测功能,是否开启?</string>
- <string name="text_tsmakeup_alert_continue">继续</string>
- <string name="text_tsmakeup_alert_quit">退出</string>
-
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1ba60c8..64e55ad 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -167,8 +167,6 @@
<dimen name="filter_mode_padding">10dp</dimen>
<dimen name="remaining_photos_margin">67dp</dimen>
- <dimen name="tsmakeup_mode_paddingBottom">96dp</dimen>
- <dimen name="tsmakeup_mode_level_size">96dp</dimen>
<!-- Margins for 4:3 preview on 16:9 screen with 640dp height -->
<dimen name="preview_top_margin">57dp</dimen>
diff --git a/res/values/qcomarrays.xml b/res/values/qcomarrays.xml
index 821250c..265be96 100644
--- a/res/values/qcomarrays.xml
+++ b/res/values/qcomarrays.xml
@@ -818,44 +818,4 @@
<item>0</item>
<item>1</item>
</string-array>
-
- <!-- Beautification -->
- <string-array name="pref_camera_tsmakeup_entries" translatable="false">
- <item>@string/setting_off</item>
- <item>@string/setting_on</item>
- </string-array>
-
- <string-array name="pref_camera_tsmakeup_entryvalues" translatable="false">
- <item>Off</item>
- <item>On</item>
- </string-array>
-
- <string-array name="pref_ts_makeup_icons" translatable="false">
- <item>@drawable/ic_ts_makeup_off</item>
- <item>@drawable/ic_ts_makeup_on</item>
- </string-array>
-
- <string-array name="pref_camera_tsmakeup_level_entries" translatable="false">
- <item>@string/setting_off</item>
- <item>1</item>
- <item>2</item>
- <item>3</item>
- <item>@string/pref_camera_tsmakeup_custom</item>
- </string-array>
-
- <array name="tsmakeup_level_thumbnails" translatable="false">
- <item>@drawable/ic_ts_makeup_level_off_selector</item>
- <item>@drawable/ic_ts_makeup_level_1_selector</item>
- <item>@drawable/ic_ts_makeup_level_2_selector</item>
- <item>@drawable/ic_ts_makeup_level_3_selector</item>
- <item>@drawable/ic_ts_makeup_custom_selector</item>
- </array>
-
- <string-array name="pref_camera_tsmakeup_level_entryvalues" translatable="false">
- <item>@string/pref_camera_tsmakeup_default</item>
- <item>20</item>
- <item>60</item>
- <item>100</item>
- <item>none</item>
- </string-array>
</resources>
diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml
index 61628a4..25a9cdc 100644
--- a/res/values/qcomstrings.xml
+++ b/res/values/qcomstrings.xml
@@ -442,19 +442,6 @@
<string name="pref_camera_savepath_entry_0">Internal storage</string>
<string name="pref_camera_savepath_entry_1">SD card</string>
- <!-- Beautification -->
- <string name="pref_camera_tsmakeup_title">Beautification</string>
- <string name="pref_camera_tsmakeup_default" translatable="false">Off</string>
- <string name="pref_camera_tsmakeup_level_default" translatable="false">60</string>
-
- <string name="pref_camera_tsmakeup_custom">Custom</string>
- <string name="pref_camera_tsmakeup_level_whiten">Whiten</string>
- <string name="pref_camera_tsmakeup_level_clean">Soften</string>
-
- <string name="text_tsmakeup_alert_msg">To use beautification, face detection must be disabled</string>
- <string name="text_tsmakeup_alert_continue">Continue</string>
- <string name="text_tsmakeup_alert_quit">Cancel</string>
-
<!-- Misc -->
<!-- The alias of CameraActivity for gesture operation -->
diff --git a/res/xml/camera_preferences.xml b/res/xml/camera_preferences.xml
index 32fd0a4..54d7242 100644
--- a/res/xml/camera_preferences.xml
+++ b/res/xml/camera_preferences.xml
@@ -231,31 +231,6 @@
camera:singleIcon="@drawable/ic_settings_facerec"
camera:entryValues="@array/pref_camera_facedetection_entryvalues" />
<IconListPreference
- camera:key="pref_camera_tsmakeup_key"
- camera:defaultValue="@string/pref_camera_tsmakeup_default"
- camera:title="@string/pref_camera_tsmakeup_title"
- camera:entries="@array/pref_camera_tsmakeup_entries"
- camera:singleIcon="@drawable/ic_ts_makeup_off"
- camera:icons="@array/pref_ts_makeup_icons"
- camera:largeIcons="@array/pref_ts_makeup_icons"
- camera:entryValues="@array/pref_camera_tsmakeup_entryvalues" />
- <IconListPreference
- camera:key="pref_camera_tsmakeup_level_key"
- camera:defaultValue="@string/pref_camera_tsmakeup_default"
- camera:title="@string/pref_camera_tsmakeup_title"
- camera:entries="@array/pref_camera_tsmakeup_level_entries"
- camera:thumbnails="@array/tsmakeup_level_thumbnails"
- camera:singleIcon="@drawable/ic_ts_makeup_off"
- camera:entryValues="@array/pref_camera_tsmakeup_level_entryvalues" />
- <ListPreference
- camera:key="pref_camera_tsmakeup_whiten"
- camera:defaultValue="@string/pref_camera_tsmakeup_level_default"
- camera:title="@string/pref_camera_tsmakeup_title" />
- <ListPreference
- camera:key="pref_camera_tsmakeup_clean"
- camera:defaultValue="@string/pref_camera_tsmakeup_level_default"
- camera:title="@string/pref_camera_tsmakeup_title" />
- <IconListPreference
camera:key="pref_camera_redeyereduction_key"
camera:defaultValue="@string/pref_camera_redeyereduction_default"
camera:title="@string/pref_camera_redeyereduction_title"
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 7761fa1..a877455 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -230,14 +230,6 @@ public class CameraSettings {
public static final String KEY_QC_SUPPORTED_MANUAL_EXPOSURE_MODES = "manual-exposure-modes";
public static final String KEY_QC_SUPPORTED_MANUAL_WB_MODES = "manual-wb-modes";
- public static final String KEY_TS_MAKEUP_UILABLE = "pref_camera_tsmakeup_key";
- public static final String KEY_TS_MAKEUP_PARAM = "tsmakeup"; // on/of
- public static final String KEY_TS_MAKEUP_PARAM_WHITEN = "tsmakeup_whiten"; // 0~100
- public static final String KEY_TS_MAKEUP_PARAM_CLEAN = "tsmakeup_clean"; // 0~100
- public static final String KEY_TS_MAKEUP_LEVEL = "pref_camera_tsmakeup_level_key";
- public static final String KEY_TS_MAKEUP_LEVEL_WHITEN = "pref_camera_tsmakeup_whiten";
- public static final String KEY_TS_MAKEUP_LEVEL_CLEAN = "pref_camera_tsmakeup_clean";
-
public static final String EXPOSURE_DEFAULT_VALUE = "0";
public static final String VALUE_ON = "on";
public static final String VALUE_OFF = "off";
diff --git a/src/com/android/camera/ListPreference.java b/src/com/android/camera/ListPreference.java
index c79d18c..b856d46 100644
--- a/src/com/android/camera/ListPreference.java
+++ b/src/com/android/camera/ListPreference.java
@@ -135,11 +135,6 @@ public class ListPreference extends CameraPreference {
persistStringValue(value);
}
- public void setMakeupSeekBarValue(String value) {
- mValue = value;
- persistStringValue(value);
- }
-
public void setValueIndex(int index) {
setValue(mEntryValues[index].toString());
}
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index 46ca5cb..ab4c446 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -21,16 +21,11 @@ import java.util.Locale;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
-import android.app.Activity;
-import android.app.AlertDialog;
import android.content.Context;
-import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.hardware.Camera.Parameters;
import android.graphics.Rect;
-import android.os.Handler;
-import android.os.Message;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
@@ -49,7 +44,6 @@ import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import com.android.camera.CameraPreference.OnPreferenceChangedListener;
-import com.android.camera.TsMakeupManager.MakeupLevelListener;
import com.android.camera.ui.CameraControls;
import com.android.camera.ui.CountdownTimerPopup;
import com.android.camera.ui.ListSubMenu;
@@ -83,17 +77,14 @@ public class PhotoMenu extends MenuController
private static final int POPUP_SECOND_LEVEL = 2;
private static final int POPUP_IN_ANIMATION_SLIDE = 3;
private static final int POPUP_IN_ANIMATION_FADE = 4;
- private static final int POPUP_IN_MAKEUP = 5;
private static final int PREVIEW_MENU_NONE = 0;
private static final int PREVIEW_MENU_IN_ANIMATION = 1;
private static final int PREVIEW_MENU_ON = 2;
private static final int MODE_SCENE = 0;
private static final int MODE_FILTER = 1;
- private static final int MODE_MAKEUP = 2;
private static final int DEVELOPER_MENU_TOUCH_COUNT = 10;
private int mSceneStatus;
private View mHdrSwitcher;
- private View mTsMakeupSwitcher;
private View mFrontBackSwitcher;
private View mSceneModeSwitcher;
private View mFilterModeSwitcher;
@@ -109,12 +100,8 @@ public class PhotoMenu extends MenuController
private static final int ANIMATION_DURATION = 300;
private static final int CLICK_THRESHOLD = 200;
private int previewMenuSize;
- private TsMakeupManager mTsMakeupManager;
- private MakeupLevelListener mMakeupListener;
- private MakeupHandler mHandler = new MakeupHandler();
- private static final int MAKEUP_MESSAGE_ID = 0;
- public PhotoMenu(CameraActivity activity, PhotoUI ui, MakeupLevelListener makeupListener) {
+ public PhotoMenu(CameraActivity activity, PhotoUI ui) {
super(activity);
mUI = ui;
mSettingOff = activity.getString(R.string.setting_off_value);
@@ -122,10 +109,8 @@ public class PhotoMenu extends MenuController
mActivity = activity;
mFrontBackSwitcher = ui.getRootView().findViewById(R.id.front_back_switcher);
mHdrSwitcher = ui.getRootView().findViewById(R.id.hdr_switcher);
- mTsMakeupSwitcher = ui.getRootView().findViewById(R.id.ts_makeup_switcher);
mSceneModeSwitcher = ui.getRootView().findViewById(R.id.scene_mode_switcher);
mFilterModeSwitcher = ui.getRootView().findViewById(R.id.filter_mode_switcher);
- mMakeupListener = makeupListener;
}
public void initialize(PreferenceGroup group) {
@@ -138,34 +123,17 @@ public class PhotoMenu extends MenuController
Locale locale = res.getConfiguration().locale;
// The order is from left to right in the menu.
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- if(mTsMakeupManager != null) {
- mTsMakeupManager.removeAllViews();
- mTsMakeupManager = null;
- }
- if(mTsMakeupManager == null) {
- mTsMakeupManager = new TsMakeupManager(mActivity, this, mUI, mPreferenceGroup, mTsMakeupSwitcher);
- mTsMakeupManager.setMakeupLevelListener(mMakeupListener);
- }
- }
-
initSceneModeButton(mSceneModeSwitcher);
initFilterModeButton(mFilterModeSwitcher);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- initMakeupModeButton(mTsMakeupSwitcher);
- } else {
- mHdrSwitcher.setVisibility(View.INVISIBLE);
- }
+ mHdrSwitcher.setVisibility(View.INVISIBLE);
mFrontBackSwitcher.setVisibility(View.INVISIBLE);
- if(!TsMakeupManager.HAS_TS_MAKEUP) {
- // HDR.
- if (group.findPreference(CameraSettings.KEY_CAMERA_HDR) != null) {
- mHdrSwitcher.setVisibility(View.VISIBLE);
- initSwitchItem(CameraSettings.KEY_CAMERA_HDR, mHdrSwitcher);
- } else {
- mHdrSwitcher.setVisibility(View.INVISIBLE);
- }
+ // HDR.
+ if (group.findPreference(CameraSettings.KEY_CAMERA_HDR) != null) {
+ mHdrSwitcher.setVisibility(View.VISIBLE);
+ initSwitchItem(CameraSettings.KEY_CAMERA_HDR, mHdrSwitcher);
+ } else {
+ mHdrSwitcher.setVisibility(View.INVISIBLE);
}
mOtherKeys1 = new String[] {
@@ -230,18 +198,6 @@ public class PhotoMenu extends MenuController
initSwitchItem(CameraSettings.KEY_CAMERA_ID, mFrontBackSwitcher);
}
- protected class MakeupHandler extends Handler {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MAKEUP_MESSAGE_ID:
- mTsMakeupManager.showMakeupView();
- mUI.adjustOrientation();
- break;
- }
- }
- }
-
@Override
// Hit when an item in a popup gets selected
public void onListPrefChanged(ListPreference pref) {
@@ -251,14 +207,6 @@ public class PhotoMenu extends MenuController
}
public boolean handleBackKey() {
- if(TsMakeupManager.HAS_TS_MAKEUP && mTsMakeupManager.isShowMakeup()) {
- mTsMakeupManager.dismissMakeupUI();
- closeMakeupMode(true);
- mTsMakeupManager.resetMakeupUIStatus();
- mPopupStatus = POPUP_NONE;
- mPreviewMenuStatus = PREVIEW_MENU_NONE;
- return true;
- }
if (mPreviewMenuStatus == PREVIEW_MENU_ON) {
animateSlideOut(mPreviewMenu);
return true;
@@ -278,10 +226,6 @@ public class PhotoMenu extends MenuController
mUI.removeSceneModeMenu();
}
- public void closeMakeupMode(boolean isMakeup) {
- mUI.removeSceneModeMenu();
- }
-
public void tryToCloseSubList() {
if (mListMenu != null)
((ListMenu) mListMenu).resetHighlight();
@@ -486,13 +430,6 @@ public class PhotoMenu extends MenuController
}
public void animateSlideOutPreviewMenu() {
- if(TsMakeupManager.HAS_TS_MAKEUP && mTsMakeupManager.isShowMakeup()) {
- mPreviewMenuStatus = PREVIEW_MENU_NONE;
- mTsMakeupManager.dismissMakeupUI();
- closeMakeupMode(true);
- mTsMakeupManager.resetMakeupUIStatus();
- }
-
if (mPreviewMenu == null)
return;
animateSlideOut(mPreviewMenu);
@@ -720,10 +657,8 @@ public class PhotoMenu extends MenuController
mActivity.getString(R.string.pref_camera_advanced_feature_default));
popup1.setPreferenceEnabled(CameraSettings.KEY_ADVANCED_FEATURES, false);
- if(!TsMakeupManager.HAS_TS_MAKEUP) {
- if (mHdrSwitcher.getVisibility() == View.VISIBLE) {
- buttonSetEnabled(mHdrSwitcher, true);
- }
+ if (mHdrSwitcher.getVisibility() == View.VISIBLE) {
+ buttonSetEnabled(mHdrSwitcher, true);
}
} else {
if ((advancedFeatures != null) && (advancedFeatures.equals(ubiFocusOn) ||
@@ -743,16 +678,12 @@ public class PhotoMenu extends MenuController
popup1.setPreferenceEnabled(CameraSettings.KEY_SCENE_MODE, false);
setPreference(CameraSettings.KEY_CAMERA_HDR, mSettingOff);
- if(!TsMakeupManager.HAS_TS_MAKEUP) {
- if (mHdrSwitcher.getVisibility() == View.VISIBLE) {
- buttonSetEnabled(mHdrSwitcher, false);
- }
+ if (mHdrSwitcher.getVisibility() == View.VISIBLE) {
+ buttonSetEnabled(mHdrSwitcher, false);
}
} else {
- if(!TsMakeupManager.HAS_TS_MAKEUP) {
- if (mHdrSwitcher.getVisibility() == View.VISIBLE) {
- buttonSetEnabled(mHdrSwitcher, true);
- }
+ if (mHdrSwitcher.getVisibility() == View.VISIBLE) {
+ buttonSetEnabled(mHdrSwitcher, true);
}
}
}
@@ -813,101 +744,6 @@ public class PhotoMenu extends MenuController
});
}
- public void initMakeupModeButton(View button) {
- if(!TsMakeupManager.HAS_TS_MAKEUP) {
- return;
- }
- button.setVisibility(View.INVISIBLE);
- final IconListPreference pref = (IconListPreference) mPreferenceGroup
- .findPreference(CameraSettings.KEY_TS_MAKEUP_UILABLE);
- if (pref == null)
- return;
-
- int[] iconIds = pref.getLargeIconIds();
- int resid = -1;
- int index = pref.findIndexOfValue(pref.getValue());
- if (!pref.getUseSingleIcon() && iconIds != null) {
- // Each entry has a corresponding icon.
- resid = iconIds[index];
- } else {
- // The preference only has a single icon to represent it.
- resid = pref.getSingleIcon();
- }
- ImageView iv = (ImageView) mTsMakeupSwitcher;
- iv.setImageResource(resid);
-
- button.setVisibility(View.VISIBLE);
-
- String makeupOn = pref.getValue();
- Log.d(TAG, "PhotoMenu.initMakeupModeButton():current init makeupOn is " + makeupOn);
-
- button.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- ListPreference faceDetectPref = mPreferenceGroup.findPreference(CameraSettings.KEY_FACE_DETECTION);
- String faceDetection = (faceDetectPref != null) ? faceDetectPref.getValue() : null;
- Log.d(TAG, "initMakeupModeButton().onClick(): faceDetection is " + faceDetection);
- if ((faceDetection != null) && Parameters.FACE_DETECTION_OFF.equals(faceDetection)) {
- showAlertDialog(faceDetectPref);
- } else {
- toggleMakeupSettings();
- }
- }
- });
- }
-
- private void initMakeupMenu() {
- if(!TsMakeupManager.HAS_TS_MAKEUP) {
- return;
- }
- mPopupStatus = POPUP_NONE;
- mHandler.removeMessages(MAKEUP_MESSAGE_ID);
- mSceneStatus = MODE_MAKEUP;
- mPreviewMenuStatus = PREVIEW_MENU_ON;
- mHandler.sendEmptyMessageDelayed(MAKEUP_MESSAGE_ID, ANIMATION_DURATION);
- }
-
- private void showAlertDialog(final ListPreference faceDetectPref) {
- if(mActivity.isFinishing()) {
- return;
- }
- new AlertDialog.Builder(mActivity)
- .setIcon(android.R.drawable.ic_dialog_alert)
- .setMessage(R.string.text_tsmakeup_alert_msg)
- .setPositiveButton(R.string.text_tsmakeup_alert_continue, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- toggleMakeupSettings();
-
- faceDetectPref.setValue(Parameters.FACE_DETECTION_ON);
- onSettingChanged(faceDetectPref);
- }
- })
- .setNegativeButton(R.string.text_tsmakeup_alert_quit, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- }
- })
- .show();
- }
-
- private void toggleMakeupSettings() {
- mUI.hideUI();
- initMakeupMenu();
- }
-
- private void closeMakeup() {
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- if(mTsMakeupManager.isShowMakeup()) {
- mTsMakeupManager.hideMakeupUI();
- closeMakeupMode(false);
- mPreviewMenuStatus = PREVIEW_MENU_NONE;
- } else {
- mTsMakeupManager.hideMakeupUI();
- }
- }
- }
-
public void initSceneModeButton(View button) {
button.setVisibility(View.INVISIBLE);
final IconListPreference pref = (IconListPreference) mPreferenceGroup
@@ -1070,8 +906,6 @@ public class PhotoMenu extends MenuController
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- closeMakeup();
-
addFilterMode();
ViewGroup menuLayout = mUI.getPreviewMenuLayout();
if (menuLayout != null) {
@@ -1185,24 +1019,14 @@ public class PhotoMenu extends MenuController
}
public void openFirstLevel() {
- if (isMenuBeingShown() || CameraControls.isAnimating()) {
+ if (isMenuBeingShown() || CameraControls.isAnimating())
return;
- }
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- if(mTsMakeupManager.isShowMakeup()) {
- mTsMakeupManager.dismissMakeupUI();
- closeMakeupMode(false);
- mPreviewMenuStatus = PREVIEW_MENU_NONE;
- } else {
- mTsMakeupManager.dismissMakeupUI();
- }
- mTsMakeupManager.resetMakeupUIStatus();
- }
if (mListMenu == null || mPopupStatus != POPUP_FIRST_LEVEL) {
initializePopup();
mPopupStatus = POPUP_FIRST_LEVEL;
}
mUI.showPopup(mListMenu, 1, true);
+
}
public void popupDismissed(boolean dismissAll) {
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 122add1..6e2838f 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -67,7 +67,6 @@ import com.android.camera.CameraManager.CameraPictureCallback;
import com.android.camera.CameraManager.CameraProxy;
import com.android.camera.CameraManager.CameraShutterCallback;
import com.android.camera.PhotoModule.NamedImages.NamedEntity;
-import com.android.camera.TsMakeupManager.MakeupLevelListener;
import com.android.camera.exif.ExifInterface;
import com.android.camera.exif.ExifTag;
import com.android.camera.exif.Rational;
@@ -84,7 +83,6 @@ import android.widget.EditText;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.text.InputType;
-import android.text.TextUtils;
import com.android.internal.util.MemInfoReader;
import android.app.ActivityManager;
@@ -111,7 +109,7 @@ public class PhotoModule
ShutterButton.OnShutterButtonListener,
MediaSaveService.Listener,
OnCountDownFinishedListener,
- SensorEventListener, MakeupLevelListener {
+ SensorEventListener {
private static final String TAG = "CAM_PhotoModule";
@@ -688,7 +686,7 @@ public class PhotoModule
private void openCameraCommon() {
loadCameraPreferences();
- mUI.onCameraOpened(mPreferenceGroup, mPreferences, mParameters, this, this);
+ mUI.onCameraOpened(mPreferenceGroup, mPreferences, mParameters, this);
if (mIsImageCaptureIntent) {
mUI.overrideSettings(CameraSettings.KEY_CAMERA_HDR_PLUS,
mActivity.getString(R.string.setting_off_value));
@@ -3599,21 +3597,6 @@ public class PhotoModule
if (mContinuousFocusSupported && ApiHelper.HAS_AUTO_FOCUS_MOVE_CALLBACK) {
updateAutoFocusMoveCallback();
}
-
- String makeupParamValue = mPreferences.getString(CameraSettings.KEY_TS_MAKEUP_UILABLE,
- mActivity.getString(R.string.pref_camera_tsmakeup_default));
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM, makeupParamValue);
- Log.v(TAG,"updateCameraParametersPreference(): TSMakeup " + CameraSettings.KEY_TS_MAKEUP_PARAM +" value = " + makeupParamValue);
-
- if(TsMakeupManager.MAKEUP_ON.equals(makeupParamValue)) {
- String makeupWhitenValue = mPreferences.getString(CameraSettings.KEY_TS_MAKEUP_LEVEL_WHITEN,
- mActivity.getString(R.string.pref_camera_tsmakeup_level_default));
- String makeupCleanValue = mPreferences.getString(CameraSettings.KEY_TS_MAKEUP_LEVEL_CLEAN,
- mActivity.getString(R.string.pref_camera_tsmakeup_level_default));
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_WHITEN, makeupWhitenValue);
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_CLEAN, makeupCleanValue);
- }
-
//QCom related parameters updated here.
qcomUpdateCameraParametersPreference();
return doGcamModeSwitch;
@@ -4423,79 +4406,6 @@ public class PhotoModule
}
}
- @Override
- public void onMakeupLevel(String key, String value) {
- synchronized (mCameraDevice) {
- onMakeupLevelSync(key, value);
- }
- }
-
- public void onMakeupLevelSync(String key, String value) {
- Log.d(TAG, "PhotoModule.onMakeupLevel(): key is " + key + ", value is " + value);
-
- if(TextUtils.isEmpty(value)) {
- return;
- }
-
- String prefValue = TsMakeupManager.MAKEUP_ON;
- if(TsMakeupManager.MAKEUP_OFF.equals(value)) {
- prefValue = TsMakeupManager.MAKEUP_OFF;
- }
-
- Log.d(TAG, "onMakeupLevel(): prefValue is " + prefValue);
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM, prefValue);
-
- if(!TextUtils.isDigitsOnly(value)) {
- if(TsMakeupManager.MAKEUP_NONE.equals(value)) {
- ListPreference pref = mPreferenceGroup.findPreference(CameraSettings.KEY_TS_MAKEUP_LEVEL_WHITEN);
- if(pref != null) {
- String whitenValue = pref.getValue();
- if(TextUtils.isEmpty(whitenValue)) {
- whitenValue = mActivity.getString(R.string.pref_camera_tsmakeup_level_default);
- }
- pref.setMakeupSeekBarValue(whitenValue);
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_WHITEN, Integer.parseInt(whitenValue));
- }
-
- pref = mPreferenceGroup.findPreference(CameraSettings.KEY_TS_MAKEUP_LEVEL_CLEAN);
- if(pref != null) {
- String cleanValue = pref.getValue();
- if(TextUtils.isEmpty(cleanValue)) {
- cleanValue = mActivity.getString(R.string.pref_camera_tsmakeup_level_default);
- }
- pref.setMakeupSeekBarValue(cleanValue);
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_CLEAN, Integer.parseInt(cleanValue));
- }
- }
- } else {
- if(CameraSettings.KEY_TS_MAKEUP_LEVEL.equals(key)) {
- if(mParameters != null) {
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_WHITEN, Integer.parseInt(value));
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_CLEAN, Integer.parseInt(value));
- }
- ListPreference pref = mPreferenceGroup.findPreference(CameraSettings.KEY_TS_MAKEUP_LEVEL_WHITEN);
- if(pref != null) {
- pref.setMakeupSeekBarValue(value);
- }
- pref = mPreferenceGroup.findPreference(CameraSettings.KEY_TS_MAKEUP_LEVEL_CLEAN);
- if(pref != null) {
- pref.setMakeupSeekBarValue(value);
- }
- } else if(CameraSettings.KEY_TS_MAKEUP_LEVEL_WHITEN.equals(key)) {
- if(mParameters != null) {
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_WHITEN, Integer.parseInt(value));
- }
- } else if(CameraSettings.KEY_TS_MAKEUP_LEVEL_CLEAN.equals(key)) {
- if(mParameters != null) {
- mParameters.set(CameraSettings.KEY_TS_MAKEUP_PARAM_CLEAN, Integer.parseInt(value));
- }
- }
- }
-
- mCameraDevice.setParameters(mParameters);
- mParameters = mCameraDevice.getParameters();
- }
-
public boolean isLongshotDone() {
return ((mCameraState == LONGSHOT) && (mLongshotSnapNum == mReceivedSnapNum) &&
!mLongshotActive);
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 6e116f9..fdc0ec3 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -56,7 +56,6 @@ import android.widget.Toast;
import com.android.camera.CameraPreference.OnPreferenceChangedListener;
import com.android.camera.FocusOverlayManager.FocusUI;
-import com.android.camera.TsMakeupManager.MakeupLevelListener;
import com.android.camera.ui.AbstractSettingPopup;
import com.android.camera.ui.CameraControls;
import com.android.camera.ui.CameraRootView;
@@ -141,7 +140,6 @@ public class PhotoUI implements PieListener,
private RotateLayout mMenuLayout;
private RotateLayout mSubMenuLayout;
private LinearLayout mPreviewMenuLayout;
- private LinearLayout mMakeupMenuLayout;
private boolean mUIhidden = false;
private int mPreviewOrientation = -1;
@@ -471,7 +469,7 @@ public class PhotoUI implements PieListener,
}
public void onCameraOpened(PreferenceGroup prefGroup, ComboPreferences prefs,
- Camera.Parameters params, OnPreferenceChangedListener listener, MakeupLevelListener makeupListener) {
+ Camera.Parameters params, OnPreferenceChangedListener listener) {
if (mPieRenderer == null) {
mPieRenderer = new PieRenderer(mActivity);
mPieRenderer.setPieListener(this);
@@ -479,7 +477,7 @@ public class PhotoUI implements PieListener,
}
if (mMenu == null) {
- mMenu = new PhotoMenu(mActivity, this, makeupListener);
+ mMenu = new PhotoMenu(mActivity, this);
mMenu.setListener(listener);
}
mMenu.initialize(prefGroup);
@@ -805,10 +803,6 @@ public class PhotoUI implements PieListener,
return mPreviewMenuLayout;
}
- public void setMakeupMenuLayout(LinearLayout layout) {
- mMakeupMenuLayout = layout;
- }
-
public void showPopup(ListView popup, int level, boolean animate) {
FrameLayout.LayoutParams params;
hideUI();
@@ -1288,27 +1282,6 @@ public class PhotoUI implements PieListener,
}
}
}
- if(mMakeupMenuLayout != null) {
- View view = mMakeupMenuLayout.getChildAt(0);
- if(view instanceof RotateLayout) {
- for(int i = mMakeupMenuLayout.getChildCount() -1; i >= 0; --i) {
- RotateLayout l = (RotateLayout) mMakeupMenuLayout.getChildAt(i);
- l.setOrientation(orientation, animation);
- }
- } else {
- ViewGroup vg = (ViewGroup) mMakeupMenuLayout.getChildAt(1);
- if(vg != null) {
- for (int i = vg.getChildCount() - 1; i >= 0; --i) {
- ViewGroup vewiGroup = (ViewGroup) vg.getChildAt(i);
- if(vewiGroup instanceof RotateLayout) {
- RotateLayout l = (RotateLayout) vewiGroup;
- l.setOrientation(orientation, animation);
- }
- }
- }
- }
-
- }
if (mCountDownView != null)
mCountDownView.setOrientation(orientation);
RotateTextToast.setOrientation(orientation);
diff --git a/src/com/android/camera/TsMakeupManager.java b/src/com/android/camera/TsMakeupManager.java
deleted file mode 100644
index db3505b..0000000
--- a/src/com/android/camera/TsMakeupManager.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
-* Copyright (C) 2014,2015 Thundersoft Corporation
-* All rights Reserved
-*
-* 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.
-*/
-
-package com.android.camera;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.Display;
-import android.view.Gravity;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.WindowManager;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.RelativeLayout;
-import android.widget.SeekBar;
-import android.widget.TextView;
-import android.widget.LinearLayout.LayoutParams;
-import android.widget.SeekBar.OnSeekBarChangeListener;
-
-import com.android.camera.ui.RotateLayout;
-import com.android.camera.util.CameraUtil;
-
-import org.codeaurora.snapcam.R;
-
-public class TsMakeupManager implements OnSeekBarChangeListener {
- private static final String TAG = "TsMakeupManager";
- private PhotoUI mUI;
- private PhotoMenu mMenu;
- private CameraActivity mActivity;
- private PreferenceGroup mPreferenceGroup;
- private View mTsMakeupSwitcher;
-
- private RelativeLayout mMakeupLayoutRoot;
- private LinearLayout mMakeupLevelRoot;
- private LinearLayout mMakeupSingleRoot;
-
- public static final String MAKEUP_ON = "On";
- public static final String MAKEUP_OFF = "Off";
- public static final String MAKEUP_NONE = "none";
-
- private static final int MODE_NONE = 0;
- private static final int MODE_WHITEN = 1;
- private static final int MODE_CLEAN = 2;
- private int mMode = MODE_NONE;
- private int mSingleSelectedIndex = MODE_NONE;
-
- private static final int MAKEUP_UI_STATUS_NONE = 0;
- private static final int MAKEUP_UI_STATUS_ON = 1;
- private static final int MAKEUP_UI_STATUS_OFF = 2;
- private static final int MAKEUP_UI_STATUS_DISMISS = 3;
- private int mMakeupUIStatus = MAKEUP_UI_STATUS_NONE;
-
- private static final int CLICK_THRESHOLD = 200;
-
- public static final boolean HAS_TS_MAKEUP = android.os.SystemProperties.getBoolean("persist.ts.rtmakeup", false);
-
- private MakeupLevelListener mMakeupLevelListener;
- interface MakeupLevelListener {
- void onMakeupLevel(String key, String value);
- }
-
- public void setMakeupLevelListener(MakeupLevelListener l) {
- mMakeupLevelListener = l;
- }
-
- public TsMakeupManager(CameraActivity activity, PhotoMenu menu, PhotoUI ui, PreferenceGroup preferenceGroup, View makeupSwitcher) {
- mActivity = activity;
- mUI = ui;
- mMenu = menu;
- mPreferenceGroup = preferenceGroup;
- mTsMakeupSwitcher = makeupSwitcher;
-
- mMakeupLayoutRoot = (RelativeLayout) mUI.getRootView().findViewById(R.id.id_tsmakeup_level_layout_root);
-
- mMakeupUIStatus = MAKEUP_UI_STATUS_NONE;
- }
-
- public View getMakeupLayoutRoot() {
- return mMakeupLayoutRoot;
- }
-
- public boolean isShowMakeup() {
- return mMakeupLayoutRoot != null && mMakeupLayoutRoot.isShown();
- }
-
- public void removeAllViews() {
- if(mMakeupSingleRoot != null) {
- mMakeupSingleRoot.removeAllViews();
- mMakeupSingleRoot = null;
- }
- if(mMakeupLevelRoot != null) {
- mMakeupLevelRoot.removeAllViews();
- mMakeupLevelRoot = null;
- }
- if(mMakeupLayoutRoot != null) {
- mMakeupLayoutRoot.removeAllViews();
- }
- }
-
- public void dismissMakeupUI() {
- mMakeupUIStatus = MAKEUP_UI_STATUS_DISMISS;
- removeAllViews();
- if(mMakeupLayoutRoot != null) {
- mMakeupLayoutRoot.setVisibility(View.GONE);
- }
- }
-
- public void resetMakeupUIStatus() {
- mMakeupUIStatus = MAKEUP_UI_STATUS_NONE;
- }
-
- private void changeMakeupIcon(String value) {
- if( !TextUtils.isEmpty(value) ) {
- String prefValue = MAKEUP_ON;
- if(MAKEUP_OFF.equals(value)) {
- prefValue = MAKEUP_OFF;
- }
- final IconListPreference pref = (IconListPreference) mPreferenceGroup
- .findPreference(CameraSettings.KEY_TS_MAKEUP_UILABLE);
- if(pref == null)
- return;
- pref.setValue(prefValue);
- int index = pref.getCurrentIndex();
- ImageView iv = (ImageView) mTsMakeupSwitcher;
- iv.setImageResource(((IconListPreference) pref).getLargeIconIds()[index]);
- pref.setMakeupSeekBarValue(prefValue);
- }
- }
-
- public void hideMakeupUI() {
- final IconListPreference pref = (IconListPreference) mPreferenceGroup
- .findPreference(CameraSettings.KEY_TS_MAKEUP_UILABLE);
- if(pref == null)
- return;
- mMakeupUIStatus = MAKEUP_UI_STATUS_NONE;
- String tsMakeupOn = pref.getValue();
- Log.d(TAG, "TsMakeupManager.hideMakeupUI(): tsMakeupOn is " + tsMakeupOn);
- if(MAKEUP_ON.equals(tsMakeupOn)) {
- int index = pref.findIndexOfValue(pref.getValue());
- CharSequence[] values = pref.getEntryValues();
- index = (index + 1) % values.length;
- pref.setMakeupSeekBarValue((String)values[index]);
- ImageView iv = (ImageView) mTsMakeupSwitcher;
- iv.setImageResource(((IconListPreference) pref).getLargeIconIds()[index]);
- mMakeupLevelListener.onMakeupLevel(CameraSettings.KEY_TS_MAKEUP_LEVEL, pref.getValue());
-
- IconListPreference levelPref = (IconListPreference) mPreferenceGroup
- .findPreference(CameraSettings.KEY_TS_MAKEUP_LEVEL);
- levelPref.setValueIndex(0); //Turn Off the Makeup feature;
-
-
- mMakeupLayoutRoot.setVisibility(View.GONE);
- mMakeupLayoutRoot.removeAllViews();
- if(mMakeupSingleRoot != null) {
- mMakeupSingleRoot.removeAllViews();
- mMakeupSingleRoot = null;
- }
- if(mMakeupLevelRoot != null) {
- mMakeupLevelRoot.removeAllViews();
- mMakeupLevelRoot = null;
- }
- }
- }
-
- public void showMakeupView() {
- mMakeupUIStatus = MAKEUP_UI_STATUS_OFF;
- mMakeupLayoutRoot.setVisibility(View.GONE);
- mMakeupLayoutRoot.removeAllViews();
- if(mMakeupSingleRoot != null) {
- mMakeupSingleRoot.removeAllViews();
- mMakeupSingleRoot = null;
- }
- if(mMakeupLevelRoot != null) {
- mMakeupLevelRoot.removeAllViews();
- mMakeupLevelRoot = null;
- }
-
- if(mMakeupSingleRoot != null && mMakeupSingleRoot.getVisibility() == View.VISIBLE) {
- showSingleView(MAKEUP_NONE);
- return;
- }
-
- if(mMakeupUIStatus == MAKEUP_UI_STATUS_DISMISS)
- return;
-
- mMakeupLayoutRoot.setVisibility(View.VISIBLE);
- final IconListPreference pref = (IconListPreference) mPreferenceGroup
- .findPreference(CameraSettings.KEY_TS_MAKEUP_LEVEL);
- if (pref == null)
- return;
-
- if(mMakeupLevelRoot != null) {
- mMakeupLevelRoot.removeAllViews();
- mMakeupLevelRoot = null;
- }
- mMakeupLayoutRoot.removeAllViews();
-
- mMakeupUIStatus = MAKEUP_UI_STATUS_ON;
-
- int rotation = CameraUtil.getDisplayRotation(mActivity);
- boolean mIsDefaultToPortrait = CameraUtil.isDefaultToPortrait(mActivity);
- if (!mIsDefaultToPortrait) {
- rotation = (rotation + 90) % 360;
- }
- CharSequence[] entries = pref.getEntries();
- int[] thumbnails = pref.getThumbnailIds();
-
- WindowManager wm = (WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE);
- Display display = wm.getDefaultDisplay();
- int width = display.getWidth();
- int height = display.getHeight();
- Resources r = mActivity.getResources();
- int margin = (int) (r.getDimension(R.dimen.tsmakeup_mode_paddingBottom));
- int levelBgSize = (int) (r.getDimension(R.dimen.tsmakeup_mode_level_size));
-
- Log.d(TAG, "TsMakeupManager.showMakeupView(): rotation is " + rotation + ", WH is (" + width + ", " + height + "), margin is "
- + margin + ", levelBgSize is " + levelBgSize);
-
- int gridRes = 0;
- boolean portrait = (rotation == 0) || (rotation == 180);
- int size = height;
- if (portrait) {
- gridRes = R.layout.ts_makeup_level_view_port;
- size = width;
- } else {
- gridRes = R.layout.ts_makeup_level_view_land;
- size = height;
- }
- int itemWidth = size / entries.length;
-
- LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
- LinearLayout layout = (LinearLayout) inflater.inflate(gridRes, null, false);
- mMakeupLevelRoot = layout;
- mUI.setMakeupMenuLayout(layout);
-
- LinearLayout.LayoutParams params = null;
- if(portrait) {
- params = new LayoutParams(itemWidth, itemWidth);
- params.gravity = Gravity.CENTER_VERTICAL;
- } else {
- params = new LayoutParams(itemWidth, itemWidth);
- params.gravity = Gravity.CENTER_HORIZONTAL;
- }
-
- RelativeLayout.LayoutParams rootParams = null;
- if(rotation == 0) {
- rootParams = new RelativeLayout.LayoutParams(size, levelBgSize);
-// rootParams.bottomMargin = margin;
- rootParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
- } else if(rotation == 90) {
- rootParams = new RelativeLayout.LayoutParams(levelBgSize, size);
-// rootParams.rightMargin = margin;
- rootParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
- } else if(rotation == 180) {
- rootParams = new RelativeLayout.LayoutParams(size, levelBgSize);
-// rootParams.topMargin = margin;
- rootParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
- } else if(rotation == 270) {
- rootParams = new RelativeLayout.LayoutParams(levelBgSize, size);
-// rootParams.leftMargin = margin;
- rootParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
- }
-
- final View[] views = new View[entries.length];
- int init = pref.getCurrentIndex();
- for (int i = 0; i < entries.length; i++) {
- RotateLayout layout2 = (RotateLayout) inflater.inflate(
- R.layout.ts_makeup_item_view, null, false);
-
- ImageView imageView = (ImageView) layout2.findViewById(R.id.image);
- TextView label = (TextView) layout2.findViewById(R.id.label);
- final int j = i;
-
- layout2.setOnTouchListener(new View.OnTouchListener() {
- private long startTime;
-
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- if (event.getAction() == MotionEvent.ACTION_DOWN) {
- startTime = System.currentTimeMillis();
- } else if (event.getAction() == MotionEvent.ACTION_UP) {
- if (System.currentTimeMillis() - startTime < CLICK_THRESHOLD) {
- pref.setValueIndex(j);
- changeMakeupIcon(pref.getValue());
- mMakeupLevelListener.onMakeupLevel(pref.getKey(), pref.getValue());
- for (View v1 : views) {
- v1.setSelected(false);
- }
- View border = v.findViewById(R.id.image);
- border.setSelected(true);
-
- showSingleView(pref.getValue());
- mUI.adjustOrientation();
- }
- }
- return true;
- }
- });
-
- View border = layout2.findViewById(R.id.image);
- views[j] = border;
- if (i == init) {
- border.setSelected(true);
- }
- imageView.setImageResource(thumbnails[i]);
- label.setText(entries[i]);
- layout.addView(layout2, params);
- }
- mMakeupLayoutRoot.addView(layout, rootParams);
- }
-
- private void showSingleView(String value) {
- if(MAKEUP_NONE.equals(value)) {
- if(mMakeupSingleRoot != null) {
- mMakeupSingleRoot.removeAllViews();
- mMakeupSingleRoot = null;
- }
- mMakeupLayoutRoot.removeAllViews();
- int rotation = CameraUtil.getDisplayRotation(mActivity);
- boolean mIsDefaultToPortrait = CameraUtil.isDefaultToPortrait(mActivity);
- if (!mIsDefaultToPortrait) {
- rotation = (rotation + 90) % 360;
- }
-
- WindowManager wm = (WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE);
- Display display = wm.getDefaultDisplay();
- int width = display.getWidth();
- int height = display.getHeight();
- Resources r = mActivity.getResources();
- int margin = (int) (r.getDimension(R.dimen.tsmakeup_mode_paddingBottom));
- int levelBgSize = (int) (r.getDimension(R.dimen.tsmakeup_mode_level_size));
-
- Log.d(TAG, "TsMakeupManager.showSingleView(): rotation is " + rotation + ", WH is (" + width + ", " + height + "), margin is "
- + margin + ", levelBgSize is " + levelBgSize);
-
- int gridRes = R.layout.ts_makeup_single_level_view_port;
- int size = width;
-
- LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
- final LinearLayout layout = (LinearLayout) inflater.inflate(gridRes, null, false);
- mMakeupSingleRoot = layout;
- mUI.setMakeupMenuLayout(layout);
-
- RelativeLayout.LayoutParams rootParams = new RelativeLayout.LayoutParams(size, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
- rootParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
-
- mMakeupLayoutRoot.addView(layout, rootParams);
- final SeekBar seekBar = (SeekBar) layout.findViewById(R.id.seekbar_makeup_level);
- seekBar.setOnSeekBarChangeListener(this);
- setSingleView(layout);
-
- mMode = MODE_NONE;
-
- layout.findViewById(R.id.id_layout_makeup_back).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- mMakeupSingleRoot.removeAllViews();
- mMakeupLayoutRoot.removeView(mMakeupSingleRoot);
- mMakeupSingleRoot = null;
-
- mSingleSelectedIndex = MODE_NONE;
- mMode = MODE_NONE;
-
- showMakeupView();
- mUI.adjustOrientation();
- }
- });
-
- layout.findViewById(R.id.id_layout_makeup_whiten).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if(mMode == MODE_WHITEN) {
- seekBar.setVisibility(View.GONE);
- mMode = MODE_NONE;
- return;
- }
- mSingleSelectedIndex = MODE_WHITEN;
- seekBar.setVisibility(View.VISIBLE);
- seekBar.setProgress(getPrefValue(CameraSettings.KEY_TS_MAKEUP_LEVEL_WHITEN));
- mMode = MODE_WHITEN;
- setSingleView(layout);
- }
- });
-
- layout.findViewById(R.id.id_layout_makeup_clean).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if(mMode == MODE_CLEAN) {
- seekBar.setVisibility(View.GONE);
- mMode = MODE_NONE;
- return;
- }
- mSingleSelectedIndex = MODE_CLEAN;
- seekBar.setVisibility(View.VISIBLE);
- seekBar.setProgress(getPrefValue(CameraSettings.KEY_TS_MAKEUP_LEVEL_CLEAN));
- mMode = MODE_CLEAN;
- setSingleView(layout);
- }
- });
- }
- }
-
- private void setSingleView(LinearLayout layout) {
- if(mSingleSelectedIndex == MODE_WHITEN) {
- layout.findViewById(R.id.id_iv_makeup_whiten).setSelected(true);
- layout.findViewById(R.id.id_iv_makeup_clean).setSelected(false);
- } else if(mSingleSelectedIndex == MODE_CLEAN) {
- layout.findViewById(R.id.id_iv_makeup_whiten).setSelected(false);
- layout.findViewById(R.id.id_iv_makeup_clean).setSelected(true);
- }
- }
-
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
-
- }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- setSeekbarValue(seekBar.getProgress());
- }
-
- private void setSeekbarValue(int value) {
- String key = CameraSettings.KEY_TS_MAKEUP_LEVEL_WHITEN;
- if(mMode == MODE_CLEAN) {
- key = CameraSettings.KEY_TS_MAKEUP_LEVEL_CLEAN;
- }
- Log.d(TAG, "TsMakeupManager.onStopTrackingTouch(): value is " + value + ", key is " + key);
- setEffectValue(key, String.valueOf(value));
- }
-
- private void setEffectValue(String key, String value) {
- final ListPreference pref = (ListPreference) mPreferenceGroup.findPreference(key);
- if (pref == null)
- return;
-
- pref.setMakeupSeekBarValue(value);
- mMakeupLevelListener.onMakeupLevel(key, value);
- }
-
- private int getPrefValue(String key) {
- ListPreference pref = mPreferenceGroup.findPreference(key);
- String value = pref.getValue();
- Log.d(TAG, "TsMakeupManager.getPrefValue(): value is " + value + ", key is " + key);
- if(TextUtils.isEmpty(value)) {
- value = mActivity.getString(R.string.pref_camera_tsmakeup_level_default);
- }
- return Integer.parseInt(value);
- }
-}
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index c0defea..59222b9 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -42,7 +42,6 @@ import com.android.camera.ui.ModuleSwitcher;
import com.android.camera.ui.RotateImageView;
import com.android.camera.ShutterButton;
import com.android.camera.util.CameraUtil;
-import com.android.camera.TsMakeupManager;
public class CameraControls extends RotatableLayout {
@@ -54,7 +53,6 @@ public class CameraControls extends RotatableLayout {
private View mMenu;
private View mFrontBackSwitcher;
private View mHdrSwitcher;
- private View mTsMakeupSwitcher;
private View mIndicators;
private View mPreview;
private View mSceneModeSwitcher;
@@ -68,7 +66,6 @@ public class CameraControls extends RotatableLayout {
private ArrayList<View> mViewList;
private static final int FRONT_BACK_INDEX = 0;
private static final int HDR_INDEX = 1;
- private static final int TS_MAKEUP_INDEX = 1;
private static final int SCENE_MODE_INDEX = 2;
private static final int FILTER_MODE_INDEX = 3;
private static final int MENU_INDEX = 4;
@@ -107,11 +104,7 @@ public class CameraControls extends RotatableLayout {
resetLocation(0, 0);
mFrontBackSwitcher.setVisibility(View.INVISIBLE);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.setVisibility(View.INVISIBLE);
- } else {
- mHdrSwitcher.setVisibility(View.INVISIBLE);
- }
+ mHdrSwitcher.setVisibility(View.INVISIBLE);
mSceneModeSwitcher.setVisibility(View.INVISIBLE);
mFilterModeSwitcher.setVisibility(View.INVISIBLE);
@@ -129,11 +122,7 @@ public class CameraControls extends RotatableLayout {
resetLocation(0, 0);
mFrontBackSwitcher.setVisibility(View.INVISIBLE);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.setVisibility(View.INVISIBLE);
- } else {
- mHdrSwitcher.setVisibility(View.INVISIBLE);
- }
+ mHdrSwitcher.setVisibility(View.INVISIBLE);
mSceneModeSwitcher.setVisibility(View.INVISIBLE);
mFilterModeSwitcher.setVisibility(View.INVISIBLE);
@@ -199,11 +188,7 @@ public class CameraControls extends RotatableLayout {
mSwitcher.setPressed(false);
mMenu.setPressed(false);
mFrontBackSwitcher.setPressed(false);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.setPressed(false);
- } else {
- mHdrSwitcher.setPressed(false);
- }
+ mHdrSwitcher.setPressed(false);
mSceneModeSwitcher.setPressed(false);
mFilterModeSwitcher.setPressed(false);
} else {
@@ -213,11 +198,7 @@ public class CameraControls extends RotatableLayout {
((ModuleSwitcher) mSwitcher).enableTouch(enable);
mMenu.setEnabled(enable);
mFrontBackSwitcher.setEnabled(enable);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.setEnabled(enable);
- } else {
- mHdrSwitcher.setEnabled(enable);
- }
+ mHdrSwitcher.setEnabled(enable);
mSceneModeSwitcher.setEnabled(enable);
mPreview.setEnabled(enable);
mFilterModeSwitcher.setEnabled(enable && mTempEnabled[FILTER_MODE_INDEX]);
@@ -227,13 +208,8 @@ public class CameraControls extends RotatableLayout {
mViewList = new ArrayList<View>();
if (mFrontBackSwitcher.getVisibility() == View.VISIBLE)
mViewList.add(mFrontBackSwitcher);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- if (mTsMakeupSwitcher.getVisibility() == View.VISIBLE)
- mViewList.add(mTsMakeupSwitcher);
- } else {
- if (mHdrSwitcher.getVisibility() == View.VISIBLE)
- mViewList.add(mHdrSwitcher);
- }
+ if (mHdrSwitcher.getVisibility() == View.VISIBLE)
+ mViewList.add(mHdrSwitcher);
if (mSceneModeSwitcher.getVisibility() == View.VISIBLE)
mViewList.add(mSceneModeSwitcher);
if (mFilterModeSwitcher.getVisibility() == View.VISIBLE)
@@ -253,11 +229,7 @@ public class CameraControls extends RotatableLayout {
mSwitcher = findViewById(R.id.camera_switcher);
mShutter = findViewById(R.id.shutter_button);
mFrontBackSwitcher = findViewById(R.id.front_back_switcher);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher = findViewById(R.id.ts_makeup_switcher);
- } else {
- mHdrSwitcher = findViewById(R.id.hdr_switcher);
- }
+ mHdrSwitcher = findViewById(R.id.hdr_switcher);
mMenu = findViewById(R.id.menu);
mIndicators = findViewById(R.id.on_screen_indicators);
mPreview = findViewById(R.id.preview_thumb);
@@ -335,11 +307,7 @@ public class CameraControls extends RotatableLayout {
toIndex(mIndicators, w, h, rotation, 0, 6, INDICATOR_INDEX);
toIndex(mFrontBackSwitcher, w, h, rotation, 2, 0, FRONT_BACK_INDEX);
toIndex(mPreview, w, h, rotation, 0, 6, PREVIEW_INDEX);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- toIndex(mTsMakeupSwitcher, w, h, rotation, 3, 0, TS_MAKEUP_INDEX);
- } else {
- toIndex(mHdrSwitcher, w, h, rotation, 3, 0, HDR_INDEX);
- }
+ toIndex(mHdrSwitcher, w, h, rotation, 3, 0, HDR_INDEX);
toIndex(mFilterModeSwitcher, w, h, rotation, 1, 0, FILTER_MODE_INDEX);
toIndex(mSceneModeSwitcher, w, h, rotation, 0, 0, SCENE_MODE_INDEX);
layoutToast(mRefocusToast, w, h, rotation);
@@ -433,11 +401,7 @@ public class CameraControls extends RotatableLayout {
int idx1 = rotation / 90;
mFrontBackSwitcher.setX(mLocX[idx1][FRONT_BACK_INDEX] + x);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.setX(mLocX[idx1][TS_MAKEUP_INDEX] + x);
- } else {
- mHdrSwitcher.setX(mLocX[idx1][HDR_INDEX] + x);
- }
+ mHdrSwitcher.setX(mLocX[idx1][HDR_INDEX] + x);
mSceneModeSwitcher.setX(mLocX[idx1][SCENE_MODE_INDEX] + x);
mFilterModeSwitcher.setX(mLocX[idx1][FILTER_MODE_INDEX] + x);
mMenu.setX(mLocX[idx1][MENU_INDEX] + x);
@@ -447,11 +411,7 @@ public class CameraControls extends RotatableLayout {
mPreview.setX(mLocX[idx1][PREVIEW_INDEX] - x);
mFrontBackSwitcher.setY(mLocY[idx1][FRONT_BACK_INDEX] + y);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.setY(mLocY[idx1][TS_MAKEUP_INDEX] + y);
- } else {
- mHdrSwitcher.setY(mLocY[idx1][HDR_INDEX] + y);
- }
+ mHdrSwitcher.setY(mLocY[idx1][HDR_INDEX] + y);
mSceneModeSwitcher.setY(mLocY[idx1][SCENE_MODE_INDEX] + y);
mFilterModeSwitcher.setY(mLocY[idx1][FILTER_MODE_INDEX] + y);
mMenu.setY(mLocY[idx1][MENU_INDEX] + y);
@@ -466,11 +426,7 @@ public class CameraControls extends RotatableLayout {
enableTouch(false);
int rotation = getUnifiedRotation();
mFrontBackSwitcher.animate().cancel();
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().cancel();
- } else {
- mHdrSwitcher.animate().cancel();
- }
+ mHdrSwitcher.animate().cancel();
mSceneModeSwitcher.animate().cancel();
mFilterModeSwitcher.animate().cancel();
mSwitcher.animate().cancel();
@@ -485,11 +441,7 @@ public class CameraControls extends RotatableLayout {
switch (rotation) {
case 0:
mFrontBackSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
@@ -501,11 +453,7 @@ public class CameraControls extends RotatableLayout {
break;
case 90:
mFrontBackSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
@@ -517,11 +465,7 @@ public class CameraControls extends RotatableLayout {
break;
case 180:
mFrontBackSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
@@ -533,11 +477,7 @@ public class CameraControls extends RotatableLayout {
break;
case 270:
mFrontBackSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
@@ -557,11 +497,7 @@ public class CameraControls extends RotatableLayout {
enableTouch(false);
int rotation = getUnifiedRotation();
mFrontBackSwitcher.animate().cancel();
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().cancel();
- } else {
- mHdrSwitcher.animate().cancel();
- }
+ mHdrSwitcher.animate().cancel();
mSceneModeSwitcher.animate().cancel();
mFilterModeSwitcher.animate().cancel();
mSwitcher.animate().cancel();
@@ -588,11 +524,7 @@ public class CameraControls extends RotatableLayout {
resetLocation(0, -mSize);
mFrontBackSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationYBy(mSize).setDuration(ANIME_DURATION);
@@ -606,11 +538,7 @@ public class CameraControls extends RotatableLayout {
resetLocation(-mSize, 0);
mFrontBackSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationXBy(mSize).setDuration(ANIME_DURATION);
@@ -624,11 +552,7 @@ public class CameraControls extends RotatableLayout {
resetLocation(0, mSize);
mFrontBackSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationYBy(-mSize).setDuration(ANIME_DURATION);
@@ -642,11 +566,7 @@ public class CameraControls extends RotatableLayout {
resetLocation(mSize, 0);
mFrontBackSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
- if(TsMakeupManager.HAS_TS_MAKEUP) {
- mTsMakeupSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
- } else {
- mHdrSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
- }
+ mHdrSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
mSceneModeSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
mFilterModeSwitcher.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
mMenu.animate().translationXBy(-mSize).setDuration(ANIME_DURATION);
@@ -907,8 +827,7 @@ public class CameraControls extends RotatableLayout {
mOrientation = orientation;
View[] views = {
mSceneModeSwitcher, mFilterModeSwitcher, mFrontBackSwitcher,
- TsMakeupManager.HAS_TS_MAKEUP ? mTsMakeupSwitcher : mHdrSwitcher,
- mMenu, mShutter, mPreview, mSwitcher
+ mHdrSwitcher, mMenu, mShutter, mPreview, mSwitcher
};
for (View v : views) {
((RotateImageView) v).setOrientation(orientation, animation);