diff options
35 files changed, 64 insertions, 54 deletions
diff --git a/res/drawable/frame_thumbnail_default.png b/res/drawable/frame_thumbnail_default.png Binary files differindex a7498db..a531790 100644 --- a/res/drawable/frame_thumbnail_default.png +++ b/res/drawable/frame_thumbnail_default.png diff --git a/res/drawable/frame_thumbnail_pressed.png b/res/drawable/frame_thumbnail_pressed.png Binary files differindex ebc6855..3be8138 100644 --- a/res/drawable/frame_thumbnail_pressed.png +++ b/res/drawable/frame_thumbnail_pressed.png diff --git a/res/drawable/frame_thumbnail_selected.png b/res/drawable/frame_thumbnail_selected.png Binary files differindex 429a318..5884f9c 100644 --- a/res/drawable/frame_thumbnail_selected.png +++ b/res/drawable/frame_thumbnail_selected.png diff --git a/res/drawable/ic_btn_actionmenu_attach_default.png b/res/drawable/ic_btn_actionmenu_attach_default.png Binary files differindex 043691d..c8f7ec7 100644 --- a/res/drawable/ic_btn_actionmenu_attach_default.png +++ b/res/drawable/ic_btn_actionmenu_attach_default.png diff --git a/res/drawable/ic_btn_actionmenu_attach_pressed.png b/res/drawable/ic_btn_actionmenu_attach_pressed.png Binary files differindex b092ac1..7753e5b 100644 --- a/res/drawable/ic_btn_actionmenu_attach_pressed.png +++ b/res/drawable/ic_btn_actionmenu_attach_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_attach_selected.png b/res/drawable/ic_btn_actionmenu_attach_selected.png Binary files differindex 52a2ef0..ca7e775 100644 --- a/res/drawable/ic_btn_actionmenu_attach_selected.png +++ b/res/drawable/ic_btn_actionmenu_attach_selected.png diff --git a/res/drawable/ic_btn_actionmenu_cancel_default.png b/res/drawable/ic_btn_actionmenu_cancel_default.png Binary files differindex cb8f7bc..ac7169a 100644 --- a/res/drawable/ic_btn_actionmenu_cancel_default.png +++ b/res/drawable/ic_btn_actionmenu_cancel_default.png diff --git a/res/drawable/ic_btn_actionmenu_cancel_pressed.png b/res/drawable/ic_btn_actionmenu_cancel_pressed.png Binary files differindex 02bdb49..ecb1a1f 100644 --- a/res/drawable/ic_btn_actionmenu_cancel_pressed.png +++ b/res/drawable/ic_btn_actionmenu_cancel_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_cancel_selected.png b/res/drawable/ic_btn_actionmenu_cancel_selected.png Binary files differindex a0b6017..235ee88 100644 --- a/res/drawable/ic_btn_actionmenu_cancel_selected.png +++ b/res/drawable/ic_btn_actionmenu_cancel_selected.png diff --git a/res/drawable/ic_btn_actionmenu_delete_default.png b/res/drawable/ic_btn_actionmenu_delete_default.png Binary files differindex 7e25f0d..f3f655e 100644 --- a/res/drawable/ic_btn_actionmenu_delete_default.png +++ b/res/drawable/ic_btn_actionmenu_delete_default.png diff --git a/res/drawable/ic_btn_actionmenu_delete_pressed.png b/res/drawable/ic_btn_actionmenu_delete_pressed.png Binary files differindex 94087f6..14a21a8 100644 --- a/res/drawable/ic_btn_actionmenu_delete_pressed.png +++ b/res/drawable/ic_btn_actionmenu_delete_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_delete_selected.png b/res/drawable/ic_btn_actionmenu_delete_selected.png Binary files differindex 780310b..2ddb0a6 100644 --- a/res/drawable/ic_btn_actionmenu_delete_selected.png +++ b/res/drawable/ic_btn_actionmenu_delete_selected.png diff --git a/res/drawable/ic_btn_actionmenu_gallery_default.png b/res/drawable/ic_btn_actionmenu_gallery_default.png Binary files differindex a2d38db..4d3456c 100644 --- a/res/drawable/ic_btn_actionmenu_gallery_default.png +++ b/res/drawable/ic_btn_actionmenu_gallery_default.png diff --git a/res/drawable/ic_btn_actionmenu_gallery_pressed.png b/res/drawable/ic_btn_actionmenu_gallery_pressed.png Binary files differindex a01b7f8..4c29587 100644 --- a/res/drawable/ic_btn_actionmenu_gallery_pressed.png +++ b/res/drawable/ic_btn_actionmenu_gallery_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_gallery_selected.png b/res/drawable/ic_btn_actionmenu_gallery_selected.png Binary files differindex 400a63b..27349d4 100644 --- a/res/drawable/ic_btn_actionmenu_gallery_selected.png +++ b/res/drawable/ic_btn_actionmenu_gallery_selected.png diff --git a/res/drawable/ic_btn_actionmenu_play_default.png b/res/drawable/ic_btn_actionmenu_play_default.png Binary files differindex 17e0748..eba780b 100644 --- a/res/drawable/ic_btn_actionmenu_play_default.png +++ b/res/drawable/ic_btn_actionmenu_play_default.png diff --git a/res/drawable/ic_btn_actionmenu_play_pressed.png b/res/drawable/ic_btn_actionmenu_play_pressed.png Binary files differindex c671669..1caa2c2 100644 --- a/res/drawable/ic_btn_actionmenu_play_pressed.png +++ b/res/drawable/ic_btn_actionmenu_play_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_play_selected.png b/res/drawable/ic_btn_actionmenu_play_selected.png Binary files differindex 35e1425..fea0ba0 100644 --- a/res/drawable/ic_btn_actionmenu_play_selected.png +++ b/res/drawable/ic_btn_actionmenu_play_selected.png diff --git a/res/drawable/ic_btn_actionmenu_set_as_default.png b/res/drawable/ic_btn_actionmenu_set_as_default.png Binary files differindex 0d341c7..048024f 100644 --- a/res/drawable/ic_btn_actionmenu_set_as_default.png +++ b/res/drawable/ic_btn_actionmenu_set_as_default.png diff --git a/res/drawable/ic_btn_actionmenu_set_as_pressed.png b/res/drawable/ic_btn_actionmenu_set_as_pressed.png Binary files differindex 58dc85c..67ae2aa 100644 --- a/res/drawable/ic_btn_actionmenu_set_as_pressed.png +++ b/res/drawable/ic_btn_actionmenu_set_as_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_set_as_selected.png b/res/drawable/ic_btn_actionmenu_set_as_selected.png Binary files differindex 6281229..f2e5fce 100644 --- a/res/drawable/ic_btn_actionmenu_set_as_selected.png +++ b/res/drawable/ic_btn_actionmenu_set_as_selected.png diff --git a/res/drawable/ic_btn_actionmenu_share_default.png b/res/drawable/ic_btn_actionmenu_share_default.png Binary files differindex 19f6ef4..8e66365 100644 --- a/res/drawable/ic_btn_actionmenu_share_default.png +++ b/res/drawable/ic_btn_actionmenu_share_default.png diff --git a/res/drawable/ic_btn_actionmenu_share_grayout.png b/res/drawable/ic_btn_actionmenu_share_grayout.png Binary files differindex f41db23..4b62023 100755 --- a/res/drawable/ic_btn_actionmenu_share_grayout.png +++ b/res/drawable/ic_btn_actionmenu_share_grayout.png diff --git a/res/drawable/ic_btn_actionmenu_share_pressed.png b/res/drawable/ic_btn_actionmenu_share_pressed.png Binary files differindex 8583114..be71235 100644 --- a/res/drawable/ic_btn_actionmenu_share_pressed.png +++ b/res/drawable/ic_btn_actionmenu_share_pressed.png diff --git a/res/drawable/ic_btn_actionmenu_share_selected.png b/res/drawable/ic_btn_actionmenu_share_selected.png Binary files differindex fc9679b..fd4f886 100644 --- a/res/drawable/ic_btn_actionmenu_share_selected.png +++ b/res/drawable/ic_btn_actionmenu_share_selected.png diff --git a/res/drawable/ic_btn_camera_default_background.png b/res/drawable/ic_btn_camera_default_background.png Binary files differindex 5dac9c1..d58e2d2 100644 --- a/res/drawable/ic_btn_camera_default_background.png +++ b/res/drawable/ic_btn_camera_default_background.png diff --git a/res/drawable/ic_btn_camera_pressed_background.png b/res/drawable/ic_btn_camera_pressed_background.png Binary files differindex ebc6855..e0f7e12 100644 --- a/res/drawable/ic_btn_camera_pressed_background.png +++ b/res/drawable/ic_btn_camera_pressed_background.png diff --git a/res/drawable/ic_btn_camera_selected_background.png b/res/drawable/ic_btn_camera_selected_background.png Binary files differindex 429a318..3d7549b 100644 --- a/res/drawable/ic_btn_camera_selected_background.png +++ b/res/drawable/ic_btn_camera_selected_background.png diff --git a/res/drawable/ic_camera_indicator_photo.png b/res/drawable/ic_camera_indicator_photo.png Binary files differindex 3b0483b..d6c02da 100644 --- a/res/drawable/ic_camera_indicator_photo.png +++ b/res/drawable/ic_camera_indicator_photo.png diff --git a/res/drawable/ic_camera_indicator_video.png b/res/drawable/ic_camera_indicator_video.png Binary files differindex a4cb8d0..c160c66 100644 --- a/res/drawable/ic_camera_indicator_video.png +++ b/res/drawable/ic_camera_indicator_video.png diff --git a/res/drawable/ic_gps_active_camera.png b/res/drawable/ic_gps_active_camera.png Binary files differnew file mode 100755 index 0000000..9814772 --- /dev/null +++ b/res/drawable/ic_gps_active_camera.png diff --git a/res/layout/camera.xml b/res/layout/camera.xml index 02d8430..767beaa 100644 --- a/res/layout/camera.xml +++ b/res/layout/camera.xml @@ -4,9 +4,9 @@ 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. @@ -25,7 +25,7 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerInParent="true" /> - + <com.android.camera.ShutterButton android:id="@+id/shutter_button" android:layout_width="wrap_content" @@ -36,11 +36,24 @@ android:focusable="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" - android:layout_marginRight="10dip" - android:layout_marginTop="10dip" + android:layout_marginRight="5dip" + android:layout_marginTop="5dip" android:scaleType="center" /> <ImageView + android:id="@+id/gps_indicator" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + android:clickable="false" + android:focusable="false" + android:layout_alignParentRight="true" + android:layout_alignParentTop="true" + android:layout_marginRight="18dip" + android:layout_marginTop="18dip" + android:src="@drawable/ic_gps_active_camera" /> + + <ImageView android:id="@+id/focus_indicator" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -51,7 +64,7 @@ android:layout_marginTop="16dip" android:scaleType="center" android:visibility="gone" /> - + <ImageView android:visibility="gone" android:id="@+id/last_picture_button" @@ -61,6 +74,6 @@ android:focusable="false" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" - android:layout_marginLeft="10dip" - android:layout_marginTop="10dip" /> + android:layout_marginLeft="5dip" + android:layout_marginTop="5dip" /> </RelativeLayout> diff --git a/res/layout/video_camera.xml b/res/layout/video_camera.xml index 3e8f911..b8981cc 100644 --- a/res/layout/video_camera.xml +++ b/res/layout/video_camera.xml @@ -4,9 +4,9 @@ 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. @@ -25,14 +25,14 @@ android:layout_height="fill_parent" android:layout_centerInParent="true" /> - + <ImageView android:id="@+id/video_frame" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:visibility="gone" + android:visibility="gone" /> - + <com.android.camera.ShutterButton android:id="@+id/shutter_button" android:layout_width="wrap_content" @@ -43,9 +43,9 @@ android:focusable="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" - android:layout_marginRight="10dip" - android:layout_marginTop="10dip" - android:scaleType="center"/> + android:layout_marginRight="5dip" + android:layout_marginTop="5dip" + android:scaleType="center" /> <!-- Note: In this TextView the paddingRight="2" attribute is required because otherwise the @@ -75,7 +75,7 @@ android:layout_alignTop="@id/shutter_button" android:layout_toLeftOf="@id/shutter_button" android:layout_marginRight="38dip" - android:layout_width="wrap_content" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> @@ -125,6 +125,6 @@ android:focusable="false" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" - android:layout_marginLeft="10dip" - android:layout_marginTop="10dip"/> + android:layout_marginLeft="5dip" + android:layout_marginTop="5dip"/> </RelativeLayout> diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 1e9a3a8..25d0d81 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -148,6 +148,7 @@ public class Camera extends Activity implements View.OnClickListener, private Animation mFocusBlinkAnimation; private View mFocusIndicator; + private ImageView mGpsIndicator; private ToneGenerator mFocusToneGenerator; @@ -160,6 +161,7 @@ public class Camera extends Activity implements View.OnClickListener, private long mShutterCallbackTime; private long mRawPictureCallbackTime; private int mPicturesRemaining; + private boolean mRecordLocation; private boolean mKeepAndRestartPreview; @@ -245,6 +247,12 @@ public class Camera extends Activity implements View.OnClickListener, // Hack to filter out 0.0,0.0 locations return; } + // If GPS is available before start camera, we won't get status + // update so update GPS indicator when we receive data. + if (mRecordLocation + && LocationManager.GPS_PROVIDER.equals(mProvider)) { + mGpsIndicator.setVisibility(View.VISIBLE); + } mLastLocation.set(newLocation); mValid = true; } @@ -257,8 +265,16 @@ public class Camera extends Activity implements View.OnClickListener, } public void onStatusChanged(String provider, int status, Bundle extras) { - if (status == LocationProvider.OUT_OF_SERVICE) { - mValid = false; + switch(status) { + case LocationProvider.OUT_OF_SERVICE: + case LocationProvider.TEMPORARILY_UNAVAILABLE: { + mValid = false; + if (mRecordLocation && + LocationManager.GPS_PROVIDER.equals(provider)) { + mGpsIndicator.setVisibility(View.INVISIBLE); + } + break; + } } } @@ -521,8 +537,7 @@ public class Camera extends Activity implements View.OnClickListener, final int latchedOrientation = ImageManager.roundOrientation(mLastOrientation + 90); - Boolean recordLocation = mPreferences.getBoolean("pref_camera_recordlocation_key", false); - Location loc = recordLocation ? getCurrentLocation() : null; + Location loc = mRecordLocation ? getCurrentLocation() : null; // Quality 75 has visible artifacts, and quality 90 looks great but the files begin to // get large. 85 is a good compromise between the two. mParameters.set("jpeg-quality", 85); @@ -684,6 +699,7 @@ public class Camera extends Activity implements View.OnClickListener, setContentView(R.layout.camera); mSurfaceView = (VideoPreview) findViewById(R.id.camera_preview); + mGpsIndicator = (ImageView) findViewById(R.id.gps_indicator); // don't set mSurfaceHolder here. We have it set ONLY within // surfaceCreated / surfaceDestroyed, other parts of the code @@ -949,6 +965,9 @@ public class Camera extends Activity implements View.OnClickListener, mPausing = false; mOrientationListener.enable(); + mRecordLocation = mPreferences.getBoolean( + "pref_camera_recordlocation_key", false); + mGpsIndicator.setVisibility(View.INVISIBLE); // install an intent filter to receive SD card related events. IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED); @@ -964,8 +983,7 @@ public class Camera extends Activity implements View.OnClickListener, restartPreview(); - if (mPreferences.getBoolean("pref_camera_recordlocation_key", false)) - startReceivingLocationUpdates(); + if (mRecordLocation) startReceivingLocationUpdates(); updateFocusIndicator(); @@ -1331,8 +1349,7 @@ public class Camera extends Activity implements View.OnClickListener, } catch (InterruptedException ex) { // } - if (mPreviewing) - break; + if (mPreviewing) break; int delay = (int) (SystemClock.elapsedRealtime() - wallTimeStart) / 1000; if (delay >= next_warning) { @@ -1476,16 +1493,12 @@ public class Camera extends Activity implements View.OnClickListener, } private Location getCurrentLocation() { - Location l = null; - // go in best to worst order for (int i = 0; i < mLocationListeners.length; i++) { - l = mLocationListeners[i].current(); - if (l != null) - break; + Location l = mLocationListeners[i].current(); + if (l != null) return l; } - - return l; + return null; } @Override diff --git a/src/com/android/camera/ThumbnailController.java b/src/com/android/camera/ThumbnailController.java index 7588c3d..c35c467 100644 --- a/src/com/android/camera/ThumbnailController.java +++ b/src/com/android/camera/ThumbnailController.java @@ -188,14 +188,13 @@ public class ThumbnailController { // Make the mini-thumb size smaller than the button size so that the image corners // don't peek out from the rounded corners of the frame_thumb graphic: - final int PADDING_WIDTH = 6; - final int PADDING_HEIGHT = 6; + final int PADDING_WIDTH = 12; + final int PADDING_HEIGHT = 12; LayoutParams layoutParams = mButton.getLayoutParams(); final int miniThumbWidth = layoutParams.width - 2 * PADDING_WIDTH; final int miniThumbHeight = layoutParams.height - 2 * PADDING_HEIGHT; - mThumb = ImageManager.extractMiniThumb(original, - miniThumbWidth, miniThumbHeight, false); - mThumb = makeRoundedCorner(mThumb, 3, 3); + mThumb = ImageManager.extractMiniThumb( + original, miniThumbWidth, miniThumbHeight, false); Drawable[] vignetteLayers = new Drawable[2]; vignetteLayers[0] = mFrame; @@ -222,21 +221,6 @@ public class ThumbnailController { } } - private static Bitmap makeRoundedCorner(Bitmap thumb, int rx, int ry) { - if (thumb == null) return null; - int width = thumb.getWidth(); - int height = thumb.getHeight(); - - Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(result); - Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); - paint.setStyle(Paint.Style.FILL); - canvas.drawRoundRect(new RectF(0, 0, width, height), rx, ry, paint); - paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); - canvas.drawBitmap(thumb, 0, 0, paint); - return result; - } - public boolean isUriValid() { if (mUri == null) return false; try { |