diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-10-30 06:30:52 -0400 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-10-30 06:30:52 -0400 |
commit | 1f5bc0cfa43fa7ee1b3e7eb75dd72d691df41379 (patch) | |
tree | a96ee0677f6748d36f5e5b8b14bbd50998f0287f /src/com | |
parent | b5e85f253778337896143f3436c39b4f5d617393 (diff) | |
parent | 9c57ded79ff3d986acfed935865a2fc2a7f0d14e (diff) | |
download | LegacyCamera-1f5bc0cfa43fa7ee1b3e7eb75dd72d691df41379.zip LegacyCamera-1f5bc0cfa43fa7ee1b3e7eb75dd72d691df41379.tar.gz LegacyCamera-1f5bc0cfa43fa7ee1b3e7eb75dd72d691df41379.tar.bz2 |
Merge change Ia4e7b972 into eclair-mr2
* changes:
remove unused resource files and elements
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/ActionMenuButton.java | 87 | ||||
-rw-r--r-- | src/com/android/camera/ReviewImage.java | 21 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 33 |
3 files changed, 1 insertions, 140 deletions
diff --git a/src/com/android/camera/ActionMenuButton.java b/src/com/android/camera/ActionMenuButton.java deleted file mode 100644 index e9033cc..0000000 --- a/src/com/android/camera/ActionMenuButton.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2008 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. - */ - -package com.android.camera; - -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.RectF; -import android.text.Layout; -import android.util.AttributeSet; -import android.widget.TextView; - -/** - * TextView that draws a bubble behind the text. We cannot use a - * LineBackgroundSpan because we want to make the bubble taller than the text - * and TextView's clip is too aggressive. - */ -public class ActionMenuButton extends TextView { - private static final int CORNER_RADIUS = 8; - private static final int PADDING_H = 5; - private static final int PADDING_V = 1; - - private final RectF mRect = new RectF(); - private Paint mPaint; - - public ActionMenuButton(Context context) { - super(context); - init(); - } - - public ActionMenuButton(Context context, AttributeSet attrs) { - super(context, attrs); - init(); - } - - public ActionMenuButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - init(); - } - - private void init() { - setFocusable(true); - // We need extra padding below to prevent the bubble being cut. - setPadding(PADDING_H, 0, PADDING_H, PADDING_V); - - mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - mPaint.setColor(getContext().getResources() - .getColor(R.color.bubble_dark_background)); - } - - @Override - protected void drawableStateChanged() { - invalidate(); - super.drawableStateChanged(); - } - - @Override - public void draw(Canvas canvas) { - final Layout layout = getLayout(); - final RectF rect = mRect; - final int left = getCompoundPaddingLeft(); - final int top = getExtendedPaddingTop(); - - rect.set(left + layout.getLineLeft(0) - PADDING_H, - top + layout.getLineTop(0) - PADDING_V, - Math.min(left + layout.getLineRight(0) + PADDING_H, - mScrollX + mRight - mLeft), - top + layout.getLineBottom(0) + PADDING_V); - canvas.drawRoundRect(rect, CORNER_RADIUS, CORNER_RADIUS, mPaint); - - super.draw(canvas); - } -} diff --git a/src/com/android/camera/ReviewImage.java b/src/com/android/camera/ReviewImage.java index fbb8f56..efab8c7 100644 --- a/src/com/android/camera/ReviewImage.java +++ b/src/com/android/camera/ReviewImage.java @@ -312,12 +312,6 @@ public class ReviewImage extends NoSearchActivity implements View.OnClickListene } } - boolean isPickIntent() { - String action = getIntent().getAction(); - return (Intent.ACTION_PICK.equals(action) - || Intent.ACTION_GET_CONTENT.equals(action)); - } - @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); @@ -507,11 +501,9 @@ public class ReviewImage extends NoSearchActivity implements View.OnClickListene mSavedUri = getIntent().getData(); } - int[] pickIds = {R.id.attach, R.id.cancel}; int[] reviewIds = {R.id.btn_delete, R.id.btn_share, R.id.btn_set_as, R.id.btn_play, R.id.btn_done}; - int[] connectIds = isPickIntent() ? pickIds : reviewIds; - for (int id : connectIds) { + for (int id : reviewIds) { View view = mControlBar.findViewById(id); view.setOnClickListener(this); // Set the LinearLayout of the given button to visible @@ -532,7 +524,6 @@ public class ReviewImage extends NoSearchActivity implements View.OnClickListene } private void updateActionIcons() { - if (isPickIntent()) return; IImage image = mAllImages.getImageAt(mCurrentPosition); if (image instanceof VideoObject) { @@ -790,16 +781,6 @@ class ImageViewTouch2 extends ImageViewTouchBase { int nextImagePos = -2; // default no next image try { switch (keyCode) { - case KeyEvent.KEYCODE_DPAD_CENTER: { - if (mViewImage.isPickIntent()) { - IImage img = mViewImage.mAllImages - .getImageAt(mViewImage.mCurrentPosition); - mViewImage.setResult(ReviewImage.RESULT_OK, - new Intent().setData(img.fullSizeImageUri())); - mViewImage.finish(); - } - break; - } case KeyEvent.KEYCODE_DPAD_LEFT: { if (getScale() <= 1F && event.getEventTime() >= mNextChangePositionTime) { diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 234fcff..ca53219 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -331,20 +331,6 @@ public class VideoCamera extends NoSearchActivity implements View.OnClickListene } } - private void startShareVideoActivity() { - Intent intent = new Intent(); - intent.setAction(Intent.ACTION_SEND); - intent.setType("video/3gpp"); - intent.putExtra(Intent.EXTRA_STREAM, mCurrentVideoUri); - try { - startActivity(Intent.createChooser(intent, - getText(R.string.sendVideo))); - } catch (android.content.ActivityNotFoundException ex) { - Toast.makeText(VideoCamera.this, R.string.no_way_to_share_video, - Toast.LENGTH_SHORT).show(); - } - } - private void startPlayVideoActivity() { Intent intent = new Intent(Intent.ACTION_VIEW, mCurrentVideoUri); try { @@ -354,7 +340,6 @@ public class VideoCamera extends NoSearchActivity implements View.OnClickListene } } - public void onClick(View v) { switch (v.getId()) { case R.id.btn_retake: @@ -379,14 +364,6 @@ public class VideoCamera extends NoSearchActivity implements View.OnClickListene MenuHelper.deleteVideo(this, deleteCallback); break; } - case R.id.share: { - startShareVideoActivity(); - break; - } - case R.id.play: { - doPlayCurrentVideo(); - break; - } case R.id.review_thumbnail: { stopVideoRecordingAndShowReview(); initializeRecorder(); @@ -420,16 +397,6 @@ public class VideoCamera extends NoSearchActivity implements View.OnClickListene } } - private void doPlayCurrentVideo() { - Log.v(TAG, "Playing current video: " + mCurrentVideoUri); - Intent intent = new Intent(Intent.ACTION_VIEW, mCurrentVideoUri); - try { - startActivity(intent); - } catch (android.content.ActivityNotFoundException ex) { - Log.e(TAG, "Couldn't view video " + mCurrentVideoUri, ex); - } - } - private void discardCurrentVideoAndInitRecorder() { deleteCurrentVideo(); hideAlertAndInitializeRecorder(); |