diff options
26 files changed, 105 insertions, 408 deletions
diff --git a/res/drawable-hdpi/btn_camera_review_highlight.9.png b/res/drawable-hdpi/btn_camera_review_highlight.9.png Binary files differdeleted file mode 100644 index 22d169b..0000000 --- a/res/drawable-hdpi/btn_camera_review_highlight.9.png +++ /dev/null diff --git a/res/drawable-hdpi/btn_camera_review_normal.9.png b/res/drawable-hdpi/btn_camera_review_normal.9.png Binary files differdeleted file mode 100644 index 2b582c5..0000000 --- a/res/drawable-hdpi/btn_camera_review_normal.9.png +++ /dev/null diff --git a/res/drawable-hdpi/btn_camera_review_pressed.9.png b/res/drawable-hdpi/btn_camera_review_pressed.9.png Binary files differdeleted file mode 100644 index 44ec07f..0000000 --- a/res/drawable-hdpi/btn_camera_review_pressed.9.png +++ /dev/null diff --git a/res/drawable-mdpi/btn_camera_review_highlight.9.png b/res/drawable-mdpi/btn_camera_review_highlight.9.png Binary files differdeleted file mode 100755 index 21ebe84..0000000 --- a/res/drawable-mdpi/btn_camera_review_highlight.9.png +++ /dev/null diff --git a/res/drawable-mdpi/btn_camera_review_normal.9.png b/res/drawable-mdpi/btn_camera_review_normal.9.png Binary files differdeleted file mode 100755 index b8f33e5..0000000 --- a/res/drawable-mdpi/btn_camera_review_normal.9.png +++ /dev/null diff --git a/res/drawable-mdpi/btn_camera_review_pressed.9.png b/res/drawable-mdpi/btn_camera_review_pressed.9.png Binary files differdeleted file mode 100755 index 74997c9..0000000 --- a/res/drawable-mdpi/btn_camera_review_pressed.9.png +++ /dev/null diff --git a/res/drawable-w1024dp-mdpi/btn_review_control.xml b/res/drawable-w1024dp-mdpi/btn_review_control.xml deleted file mode 100644 index 1dd81ca..0000000 --- a/res/drawable-w1024dp-mdpi/btn_review_control.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?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_pressed="true" android:drawable="@drawable/bg_text_on_preview_pressed" /> - <item android:drawable="@drawable/bg_text_on_preview_transparent" /> -</selector> - diff --git a/res/drawable/bg_text_on_preview_pressed.xml b/res/drawable/bg_text_on_preview_pressed.xml deleted file mode 100644 index 7d653d1..0000000 --- a/res/drawable/bg_text_on_preview_pressed.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?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. ---> - -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <solid android:color="@color/review_control_pressed_color"/> - <corners android:radius="3dp"/> -</shape> diff --git a/res/drawable/btn_camera_review.xml b/res/drawable/btn_camera_review.xml deleted file mode 100644 index 777cf40..0000000 --- a/res/drawable/btn_camera_review.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2009 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_pressed="true" android:drawable="@drawable/btn_camera_review_pressed" /> - <item android:state_window_focused="true" - android:state_focused="true" - android:drawable="@drawable/btn_camera_review_highlight" /> - <item android:drawable="@drawable/btn_camera_review_normal" /> -</selector> - - diff --git a/res/layout-w1024dp/camera_attach.xml b/res/layout-w1024dp/camera_attach.xml deleted file mode 100644 index 87ab2c7..0000000 --- a/res/layout-w1024dp/camera_attach.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?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. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:id="@+id/app_root" - android:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <include layout="@layout/preview_frame"/> - <include layout="@layout/camera_control"/> -</LinearLayout> diff --git a/res/layout-w1024dp/camera_control.xml b/res/layout-w1024dp/camera_control.xml index 0ba7d6c..63bb643 100644 --- a/res/layout-w1024dp/camera_control.xml +++ b/res/layout-w1024dp/camera_control.xml @@ -27,6 +27,7 @@ unfortunate that we have to hardcode the width here. --> <include layout="@layout/review_thumbnail" /> + <include layout="@layout/review_control" /> <com.android.camera.ui.IndicatorControlWheelContainer android:id="@+id/indicator_control" android:layout_width="wrap_content" diff --git a/res/layout-w1024dp/preview_frame.xml b/res/layout-w1024dp/preview_frame.xml index 6965aed..d7f00b1 100644 --- a/res/layout-w1024dp/preview_frame.xml +++ b/res/layout-w1024dp/preview_frame.xml @@ -31,7 +31,6 @@ android:visibility="gone"/> <include layout="@layout/focus_rect"/> <include layout="@layout/priority_indicators"/> - <include layout="@layout/review_control"/> <include layout="@layout/tap_to_focus_toast"/> </RelativeLayout> <!-- This is the border of preview and the corner is round. If it is the background, diff --git a/res/layout-w1024dp/preview_frame_video.xml b/res/layout-w1024dp/preview_frame_video.xml index 039a76d..8760ff0 100644 --- a/res/layout-w1024dp/preview_frame_video.xml +++ b/res/layout-w1024dp/preview_frame_video.xml @@ -41,20 +41,12 @@ android:drawablePadding="5dp" android:visibility="gone"/> </LinearLayout> - <include layout="@layout/review_control"/> - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" + <ImageButton android:id="@+id/btn_play" + style="@style/ReviewControlIcon" android:layout_centerInParent="true" - android:background="@drawable/bg_text_on_preview" - android:visibility="gone"> - <ImageView style="@style/ReviewControlIcon" - android:id="@+id/btn_play" - android:onClick="onPlayButtonClicked" - android:paddingTop="10dp" - android:paddingBottom="10dp" - android:src="@drawable/btn_ic_review_play"/> - </LinearLayout> + android:src="@drawable/btn_ic_review_play" + android:visibility="gone" + android:onClick="onPlayButtonClicked"/> <ImageView android:id="@+id/review_image" android:layout_width="match_parent" android:layout_height="match_parent" diff --git a/res/layout-w1024dp/review_control.xml b/res/layout-w1024dp/review_control.xml index 659670f..a973dc8 100644 --- a/res/layout-w1024dp/review_control.xml +++ b/res/layout-w1024dp/review_control.xml @@ -16,44 +16,25 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/review_control" - style="@style/ReviewControlGroup" - android:visibility="gone" + android:orientation="vertical" + android:layout_height="wrap_content" + android:layout_width="match_parent" android:layout_alignParentTop="true" - android:layout_alignParentRight="true" - android:layout_marginRight="20dp" - android:layout_marginTop="20dp" - android:background="@drawable/bg_text_on_preview"> - - <LinearLayout style="@style/ReviewControlGroup" - android:visibility="gone"> - <Button android:id="@+id/btn_done" - style="@style/ReviewControlIcon" - android:onClick="onDoneButtonClicked" - android:drawableLeft="@drawable/ic_menu_done_holo_light" - android:text="@string/review_ok"/> - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ic_menu_divider"/> - </LinearLayout> - <LinearLayout style="@style/ReviewControlGroup" - android:visibility="gone"> - <Button android:id="@+id/btn_retake" - style="@style/ReviewControlIcon" - android:scaleType="center" - android:clickable="true" - android:onClick="onRetakeButtonClicked" - android:drawableLeft="@drawable/ic_switch_camera_holo_dark"/> - <ImageView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ic_menu_divider"/> - </LinearLayout> - <LinearLayout style="@style/ReviewControlGroup"> - <Button android:id="@+id/btn_cancel" - android:onClick="onCancelButtonClicked" - style="@style/ReviewControlIcon" - android:drawableLeft="@drawable/ic_menu_cancel_holo_light" - android:text="@string/review_cancel"/> - </LinearLayout> + android:gravity="center_horizontal" + android:layout_marginTop="30dp"> + <Button android:id="@+id/btn_cancel" + android:text="@string/review_cancel" + style="@style/ReviewControlIcon" + android:visibility="gone" + android:onClick="onCancelButtonClicked" /> + <Button android:id="@+id/btn_retake" + android:text="@string/review_retake" + style="@style/ReviewControlIcon" + android:visibility="gone" + android:onClick="onRetakeButtonClicked" /> + <ImageButton android:id="@+id/btn_done" + android:src="@drawable/ic_menu_done_holo_light" + style="@style/ReviewControlIcon" + android:visibility="gone" + android:onClick="onDoneButtonClicked" /> </LinearLayout> diff --git a/res/layout-w1024dp/video_camera_attach.xml b/res/layout-w1024dp/video_camera_attach.xml deleted file mode 100644 index 94011a3..0000000 --- a/res/layout-w1024dp/video_camera_attach.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?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. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:id="@+id/app_root" - android:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <include layout="@layout/preview_frame_video"/> - <include layout="@layout/camera_control"/> -</LinearLayout> diff --git a/res/layout/attach_camera_control.xml b/res/layout/attach_camera_control.xml deleted file mode 100644 index f97b908..0000000 --- a/res/layout/attach_camera_control.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2009 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.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:id="@+id/control_panel" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:minWidth="76dp" - android:paddingTop="13dp" - android:paddingBottom="3dp" - android:background="@drawable/bg_camera_pattern"> - <LinearLayout android:orientation="vertical" - android:id="@+id/review_control" - android:gravity="top|center_horizontal" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" - android:layout_height="wrap_content" - android:layout_width="match_parent"> - <LinearLayout style="@style/ReviewControlGroup" - android:layout_marginBottom="15dp"> - <ImageView style="@style/ReviewControlIcon" - android:id="@+id/btn_cancel" - android:onClick="onCancelButtonClicked" - android:src="@drawable/btn_ic_review_cancel"/> - <TextView style="@style/ReviewControlText" - android:text="@string/review_cancel" /> - </LinearLayout> - <LinearLayout style="@style/ReviewControlGroup" - android:visibility="gone" - android:layout_marginBottom="15dp"> - <ImageView style="@style/ReviewControlIcon" - android:id="@+id/btn_retake" - android:onClick="onRetakeButtonClicked" - android:src="@drawable/btn_ic_review_retake_photo"/> - <TextView style="@style/ReviewControlText" - android:text="@string/review_retake" /> - </LinearLayout> - <LinearLayout style="@style/ReviewControlGroup" - android:visibility="gone" - android:layout_marginBottom="15dp"> - <ImageView style="@style/ReviewControlIcon" - android:id="@+id/btn_play" - android:onClick="onPlayButtonClicked" - android:src="@drawable/btn_ic_review_play"/> - <TextView style="@style/ReviewControlText" - android:text="@string/review_play" /> - </LinearLayout> - </LinearLayout> - - <com.android.camera.ShutterButton android:id="@+id/shutter_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerInParent="true" - android:clickable="true" - android:focusable="true" - android:background="@drawable/btn_shutter"/> - <LinearLayout style="@style/ReviewControlGroup" - android:visibility="invisible" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true"> - <ImageView style="@style/ReviewControlIcon" - android:id="@+id/btn_done" - android:onClick="onDoneButtonClicked" - android:src="@drawable/btn_ic_review_done"/> - <TextView style="@style/ReviewControlText" - android:text="@string/review_ok" /> - </LinearLayout> -</com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout/camera_attach.xml b/res/layout/camera_attach.xml deleted file mode 100644 index 9145e4b..0000000 --- a/res/layout/camera_attach.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?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. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:id="@+id/app_root" - android:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <include layout="@layout/preview_frame"/> - <include layout="@layout/attach_camera_control"/> -</LinearLayout> diff --git a/res/layout/camera_control.xml b/res/layout/camera_control.xml index 801b173..54f46c5 100644 --- a/res/layout/camera_control.xml +++ b/res/layout/camera_control.xml @@ -22,7 +22,14 @@ android:background="@drawable/bg_camera_pattern"> <include layout="@layout/review_thumbnail"/> - + <ImageButton android:id="@+id/btn_done" + style="@style/ReviewControlIcon" + android:layout_alignParentTop="true" + android:layout_centerHorizontal="true" + android:layout_marginTop="10dp" + android:src="@drawable/ic_menu_done_holo_light" + android:visibility="gone" + android:onClick="onDoneButtonClicked"/> <com.android.camera.ShutterButton android:id="@+id/shutter_button" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -33,5 +40,22 @@ android:background="@drawable/btn_shutter"/> <include layout="@layout/mode_picker"/> - + <LinearLayout + android:orientation="vertical" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_marginBottom="10dp"> + <Button android:id="@+id/btn_retake" + android:text="@string/review_retake" + style="@style/ReviewControlIcon" + android:visibility="gone" + android:onClick="onRetakeButtonClicked" /> + <Button android:id="@+id/btn_cancel" + android:text="@string/review_cancel" + style="@style/ReviewControlIcon" + android:visibility="gone" + android:onClick="onCancelButtonClicked" /> + </LinearLayout> </com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout/preview_frame_video.xml b/res/layout/preview_frame_video.xml index abfd026..baabe0a 100644 --- a/res/layout/preview_frame_video.xml +++ b/res/layout/preview_frame_video.xml @@ -13,6 +13,7 @@ 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" @@ -43,12 +44,18 @@ android:layout_marginBottom="13dp" android:layout_marginLeft="17dp" android:paddingRight="2dp" - android:visibility="gone" /> + android:visibility="gone"/> + <ImageButton android:id="@+id/btn_play" + style="@style/ReviewControlIcon" + android:layout_centerInParent="true" + android:src="@drawable/btn_ic_review_play" + android:visibility="gone" + android:onClick="onPlayButtonClicked"/> <ImageView android:id="@+id/review_image" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone" - android:background="@android:color/black" /> - <include layout="@layout/indicator_bar" /> + android:background="@android:color/black"/> + <include layout="@layout/indicator_bar"/> </RelativeLayout> </com.android.camera.PreviewFrameLayout> diff --git a/res/layout/video_camera_attach.xml b/res/layout/video_camera_attach.xml deleted file mode 100644 index c526ca8..0000000 --- a/res/layout/video_camera_attach.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 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. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" - android:id="@+id/app_root" - android:orientation="horizontal" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <include layout="@layout/preview_frame_video"/> - <include layout="@layout/attach_camera_control"/> -</LinearLayout> diff --git a/res/values-w1024dp/styles.xml b/res/values-w1024dp/styles.xml index f5dde15..57188f2 100644 --- a/res/values-w1024dp/styles.xml +++ b/res/values-w1024dp/styles.xml @@ -25,11 +25,10 @@ <item name="android:gravity">center</item> </style> <style name="ReviewControlIcon"> - <item name="android:layout_height">wrap_content</item> - <item name="android:layout_width">wrap_content</item> - <item name="android:paddingLeft">15dp</item> - <item name="android:paddingRight">15dp</item> - <item name="android:background">@drawable/btn_review_control</item> + <item name="android:layout_height">90dp</item> + <item name="android:layout_width">140dp</item> + <item name="android:gravity">center</item> + <item name="android:layout_marginBottom">10dp</item> </style> <style name="ReviewThumbnail"> <item name="android:layout_width">86dp</item> diff --git a/res/values/strings.xml b/res/values/strings.xml index aa83067..a385a97 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -68,13 +68,13 @@ <string name="review_play">Play</string> <!-- button in review mode indicating that the photo taking/video recording session should be canceled [CHAR LIMIT=10] --> - <string name="review_cancel">Cancel</string> + <string name="review_cancel">CANCEL</string> <!-- button in review mode indicating that the taken photo/video is OK to be attached/uploaded [CHAR LIMIT=10] --> - <string name="review_ok">Ok</string> + <string name="review_ok">OK</string> <!-- button in review mode indicate the user want to retake another photo/video for attachment [CHAR LIMIT=10] --> - <string name="review_retake">Retake</string> + <string name="review_retake">RETAKE</string> <!-- Button indicating to go to the image gallery --> <string name="camera_gallery_photos_text">Gallery</string> diff --git a/res/values/styles.xml b/res/values/styles.xml index 2f85377..5fe9581 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -37,21 +37,13 @@ <item name="android:windowEnterAnimation">@anim/on_screen_hint_enter</item> <item name="android:windowExitAnimation">@anim/on_screen_hint_exit</item> </style> - <style name="ReviewControlText"> - <item name="android:textSize">12sp</item> - <item name="android:gravity">center</item> - <item name="android:ellipsize">end</item> - <item name="android:maxLines">2</item> - <item name="android:layout_width">match_parent</item> - <item name="android:layout_height">wrap_content</item> - </style> <style name="ReviewControlIcon"> - <item name="android:layout_height">wrap_content</item> - <item name="android:layout_width">wrap_content</item> - <item name="android:scaleType">center</item> - <item name="android:clickable">true</item> - <item name="android:focusable">true</item> - <item name="android:background">@drawable/btn_camera_review</item> + <item name="android:layout_height">60dp</item> + <item name="android:layout_width">95dp</item> + <item name="android:gravity">center</item> + <item name="android:layout_marginBottom">10dp</item> + <item name="android:padding">2dp</item> + <item name="android:textSize">12sp</item> </style> <style name="ReviewControlGroup"> <item name="android:orientation">vertical</item> diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index c9fe858..1cc45fd 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -955,10 +955,10 @@ public class Camera extends ActivityBase implements FocusManager.Listener, super.onCreate(icicle); mIsImageCaptureIntent = isImageCaptureIntent(); + setContentView(R.layout.camera); if (mIsImageCaptureIntent) { - setContentView(R.layout.camera_attach); + findViewById(R.id.btn_cancel).setVisibility(View.VISIBLE); } else { - setContentView(R.layout.camera); mThumbnailView = (RotateImageView) findViewById(R.id.thumbnail); mThumbnailView.setVisibility(View.VISIBLE); } @@ -1014,7 +1014,6 @@ public class Camera extends ActivityBase implements FocusManager.Listener, if (mIsImageCaptureIntent) { setupCaptureParams(); - findViewById(R.id.review_control).setVisibility(View.VISIBLE); } else { mModePicker = (ModePicker) findViewById(R.id.mode_picker); mModePicker.setVisibility(View.VISIBLE); @@ -1954,42 +1953,27 @@ public class Camera extends ActivityBase implements FocusManager.Listener, private void showPostCaptureAlert() { if (mIsImageCaptureIntent) { - if (Util.isTabletUI()) { - mShutterButton.setEnabled(false); - } else { - mShutterButton.setVisibility(View.GONE); - } + mShutterButton.setVisibility(View.GONE); + mIndicatorControlContainer.setVisibility(View.GONE); + int[] pickIds = {R.id.btn_retake, R.id.btn_done}; for (int id : pickIds) { - View button = findViewById(id); - ((View) button.getParent()).setVisibility(View.VISIBLE); + Util.fadeIn(findViewById(id)); } - - // Remove the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) ((Button) view).setText(""); } } private void hidePostCaptureAlert() { if (mIsImageCaptureIntent) { - if (Util.isTabletUI()) { - mShutterButton.setEnabled(true); - } else { - mShutterButton.setVisibility(View.VISIBLE); - } + enableCameraControls(true); + int[] pickIds = {R.id.btn_retake, R.id.btn_done}; for (int id : pickIds) { - View button = findViewById(id); - ((View) button.getParent()).setVisibility(View.GONE); + (findViewById(id)).setVisibility(View.GONE); } - enableCameraControls(true); - // Restore the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) { - ((Button) view).setText(R.string.review_cancel); - } + Util.fadeIn(mShutterButton); + Util.fadeIn(mIndicatorControlContainer); } } diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index 900764b..a4aac7d 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -40,6 +40,8 @@ import android.view.Display; import android.view.Surface; import android.view.View; import android.view.WindowManager; +import android.view.animation.AlphaAnimation; +import android.view.animation.Animation; import java.io.Closeable; import java.io.IOException; @@ -510,4 +512,11 @@ public class Util { // Keep compatibility context.sendBroadcast(new Intent("com.android.camera.NEW_PICTURE", uri)); } + + public static void fadeIn(View view) { + view.setVisibility(View.VISIBLE); + Animation animation = new AlphaAnimation(0F, 1F); + animation.setDuration(500); + view.startAnimation(animation); + } } diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 132e48b..da25f9d 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -63,8 +63,6 @@ import android.view.SurfaceView; import android.view.View; import android.view.Window; import android.view.WindowManager; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; @@ -378,21 +376,10 @@ public class VideoCamera extends ActivityBase requestWindowFeature(Window.FEATURE_PROGRESS); mIsVideoCaptureIntent = isVideoCaptureIntent(); + setContentView(R.layout.video_camera); if (mIsVideoCaptureIntent) { - setContentView(R.layout.video_camera_attach); - - mReviewControl = findViewById(R.id.review_control); - mReviewControl.setVisibility(View.VISIBLE); - View retake = findViewById(R.id.btn_retake); - if (retake instanceof ImageView) { - ((ImageView) retake).setImageResource(R.drawable.btn_ic_review_retake_video); - } else { - ((Button) retake).setCompoundDrawablesWithIntrinsicBounds( - R.drawable.ic_switch_video_holo_dark, 0, 0, 0); - } + findViewById(R.id.btn_cancel).setVisibility(View.VISIBLE); } else { - setContentView(R.layout.video_camera); - initThumbnailButton(); mModePicker = (ModePicker) findViewById(R.id.mode_picker); mModePicker.setVisibility(View.VISIBLE); @@ -1421,9 +1408,6 @@ public class VideoCamera extends ActivityBase } private void showAlert() { - if (!Util.isTabletUI()) { - fadeOut(findViewById(R.id.shutter_button)); - } if (mCurrentVideoFilename != null) { Bitmap bitmap = Thumbnail.createVideoThumbnail(mCurrentVideoFilename, mPreviewFrameLayout.getWidth()); @@ -1440,54 +1424,32 @@ public class VideoCamera extends ActivityBase mReviewImage.setVisibility(View.VISIBLE); } } + + mShutterButton.setVisibility(View.GONE); + mIndicatorControlContainer.setVisibility(View.GONE); int[] pickIds = {R.id.btn_retake, R.id.btn_done, R.id.btn_play}; for (int id : pickIds) { - View button = findViewById(id); - fadeIn(((View) button.getParent())); + Util.fadeIn(findViewById(id)); } - - // Remove the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) ((Button) view).setText(""); - showTimeLapseUI(false); } private void hideAlert() { mReviewImage.setVisibility(View.INVISIBLE); - fadeIn(findViewById(R.id.shutter_button)); mShutterButton.setEnabled(true); enableCameraControls(true); - // Restore the text of the cancel button - View view = findViewById(R.id.btn_cancel); - if (view instanceof Button) { - ((Button) view).setText(R.string.review_cancel); - } - int[] pickIds = {R.id.btn_retake, R.id.btn_done, R.id.btn_play}; for (int id : pickIds) { - View button = findViewById(id); - ((View) button.getParent()).setVisibility(View.GONE); + (findViewById(id)).setVisibility(View.GONE); } + Util.fadeIn(mShutterButton); + Util.fadeIn(mIndicatorControlContainer); + if (mCaptureTimeLapse) { showTimeLapseUI(true); } } - private static void fadeIn(View view) { - view.setVisibility(View.VISIBLE); - Animation animation = new AlphaAnimation(0F, 1F); - animation.setDuration(500); - view.startAnimation(animation); - } - - private static void fadeOut(View view) { - view.setVisibility(View.INVISIBLE); - Animation animation = new AlphaAnimation(1F, 0F); - animation.setDuration(500); - view.startAnimation(animation); - } - private boolean isAlertVisible() { return this.mReviewImage.getVisibility() == View.VISIBLE; } |