diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-06-01 19:33:32 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-06-02 13:03:16 +0800 |
commit | b653f90f33c6f9e6b48dfab018dece9dd021a476 (patch) | |
tree | a9001c78ac9fb1bcffa30952b67284cae586c191 | |
parent | 565664f274abbe19b3a04962711d33868541a3da (diff) | |
download | LegacyCamera-b653f90f33c6f9e6b48dfab018dece9dd021a476.zip LegacyCamera-b653f90f33c6f9e6b48dfab018dece9dd021a476.tar.gz LegacyCamera-b653f90f33c6f9e6b48dfab018dece9dd021a476.tar.bz2 |
Issue 1860338: Remove the video size check for "share".
So the receiving end applications can queue the video to MediaUploader.
This is basically a revert of perforce CL 137817.
-rw-r--r-- | res/drawable/ic_btn_actionmenu_share_grayout.png | bin | 1956 -> 0 bytes | |||
-rw-r--r-- | res/drawable/ic_menu_share.xml | 4 | ||||
-rw-r--r-- | res/values/attrs.xml | 6 | ||||
-rw-r--r-- | src/com/android/camera/ActionMenuButton.java | 25 | ||||
-rw-r--r-- | src/com/android/camera/MenuHelper.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 19 |
6 files changed, 2 insertions, 61 deletions
diff --git a/res/drawable/ic_btn_actionmenu_share_grayout.png b/res/drawable/ic_btn_actionmenu_share_grayout.png Binary files differdeleted file mode 100644 index 4b62023..0000000 --- a/res/drawable/ic_btn_actionmenu_share_grayout.png +++ /dev/null diff --git a/res/drawable/ic_menu_share.xml b/res/drawable/ic_menu_share.xml index f054c11..cf376ac 100644 --- a/res/drawable/ic_menu_share.xml +++ b/res/drawable/ic_menu_share.xml @@ -17,10 +17,8 @@ ** limitations under the License. */ --> -<selector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res/com.android.camera"> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/ic_btn_actionmenu_share_pressed" /> <item android:state_window_focused="true" android:state_focused="true" android:drawable="@drawable/ic_btn_actionmenu_share_selected" /> - <item app:state_restricted="true" android:drawable="@drawable/ic_btn_actionmenu_share_grayout" /> <item android:drawable="@drawable/ic_btn_actionmenu_share_default" /> </selector> diff --git a/res/values/attrs.xml b/res/values/attrs.xml deleted file mode 100644 index 3b4fc91..0000000 --- a/res/values/attrs.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <declare-styleable name="CameraState"> - <attr name="state_restricted" format="boolean" /> - </declare-styleable> -</resources> diff --git a/src/com/android/camera/ActionMenuButton.java b/src/com/android/camera/ActionMenuButton.java index f0a8f09..e9033cc 100644 --- a/src/com/android/camera/ActionMenuButton.java +++ b/src/com/android/camera/ActionMenuButton.java @@ -34,13 +34,8 @@ public class ActionMenuButton extends TextView { private static final int PADDING_H = 5; private static final int PADDING_V = 1; - private static final int[] RESTRICTED_STATE_SET = { - R.attr.state_restricted - }; - private final RectF mRect = new RectF(); private Paint mPaint; - private boolean mRestricted = false; public ActionMenuButton(Context context) { super(context); @@ -67,26 +62,6 @@ public class ActionMenuButton extends TextView { .getColor(R.color.bubble_dark_background)); } - public void setRestricted(boolean restricted) { - if (restricted != mRestricted) { - mRestricted = restricted; - refreshDrawableState(); - } - } - - public boolean isRestricted() { - return mRestricted; - } - - @Override - protected int[] onCreateDrawableState(int extraSpace) { - int[] drawableState = super.onCreateDrawableState(extraSpace + 1); - if (isRestricted()) { - mergeDrawableStates(drawableState, RESTRICTED_STATE_SET); - } - return drawableState; - } - @Override protected void drawableStateChanged() { invalidate(); diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java index 81c9404..2a9254f 100644 --- a/src/com/android/camera/MenuHelper.java +++ b/src/com/android/camera/MenuHelper.java @@ -88,8 +88,6 @@ public class MenuHelper { public static final int MENU_VIDEO_PLAY = 23; public static final int MENU_VIDEO_SHARE = 24; - private static final long SHARE_FILE_LENGTH_LIMIT = 3L * 1024L * 1024L; - public static final int NO_STORAGE_ERROR = -1; public static final int CANNOT_STAT_ERROR = -2; public static final String EMPTY_STRING = ""; @@ -595,13 +593,6 @@ public class MenuHelper { onInvoke.run(new MenuCallback() { public void run(Uri u, IImage image) { if (image == null) return; - if (!isImage && getImageFileSize(image) - > SHARE_FILE_LENGTH_LIMIT) { - Toast.makeText(activity, - R.string.too_large_to_attach, - Toast.LENGTH_LONG).show(); - return; - } Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index eb0e050..751015b 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -82,7 +82,6 @@ public class VideoCamera extends Activity implements View.OnClickListener, private static final long NO_STORAGE_ERROR = -1L; private static final long CANNOT_STAT_ERROR = -2L; private static final long LOW_STORAGE_THRESHOLD = 512L * 1024L; - private static final long SHARE_FILE_LENGTH_LIMIT = 3L * 1024L * 1024L; private static final int STORAGE_STATUS_OK = 0; private static final int STORAGE_STATUS_LOW = 1; @@ -122,7 +121,6 @@ public class VideoCamera extends Activity implements View.OnClickListener, // The video file that has already been recorded, and that is being // examined by the user. private String mCurrentVideoFilename; - private long mCurrentVideoFileLength = 0L; private Uri mCurrentVideoUri; private ContentValues mCurrentVideoValues; @@ -277,11 +275,6 @@ public class VideoCamera extends Activity implements View.OnClickListener, } private void startShareVideoActivity() { - if (mCurrentVideoFileLength > SHARE_FILE_LENGTH_LIMIT) { - Toast.makeText(VideoCamera.this, - R.string.too_large_to_attach, Toast.LENGTH_LONG).show(); - return; - } Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.setType("video/3gpp"); @@ -1090,10 +1083,7 @@ public class VideoCamera extends Activity implements View.OnClickListener, for (int id : hideIds) { mPostPictureAlert.findViewById(id).setVisibility(View.GONE); } - ActionMenuButton shareButton = - (ActionMenuButton) mPostPictureAlert.findViewById(R.id.share); - shareButton.setRestricted( - mCurrentVideoFileLength > SHARE_FILE_LENGTH_LIMIT); + connectAndFadeIn(connectIds); connectAndFadeIn(alwaysOnIds); mPostPictureAlert.setVisibility(View.VISIBLE); @@ -1160,13 +1150,6 @@ public class VideoCamera extends Activity implements View.OnClickListener, } mCurrentVideoFilename = mCameraVideoFilename; - try { - mCurrentVideoFileLength = - new File(mCurrentVideoFilename).length(); - } catch (RuntimeException e) { - Log.e(TAG, "get file length fail: " + e.getMessage()); - mCurrentVideoFileLength = 0; - } Log.v(TAG, "Setting current video filename: " + mCurrentVideoFilename); needToRegisterRecording = true; |