diff options
Diffstat (limited to 'src/com/android/gallery3d')
6 files changed, 31 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java index 480bc90ab..e6702b583 100755 --- a/src/com/android/gallery3d/app/MoviePlayer.java +++ b/src/com/android/gallery3d/app/MoviePlayer.java @@ -306,6 +306,9 @@ public class MoviePlayer implements mResumeableTime = savedInstance.getLong(KEY_RESUMEABLE_TIME, Long.MAX_VALUE); onRestoreInstanceState(savedInstance); mHasPaused = true; + doStartVideo(true, mVideoPosition, mVideoLastDuration,false); + mVideoView.start(); + mActivityContext.initEffects(mVideoView.getAudioSessionId()); } else { mTState = TState.PLAYING; mFirstBePlayed = true; diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index fb2b4ae1f..07a07508d 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -25,6 +25,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.graphics.Rect; +import android.media.MediaFile; import android.net.Uri; import android.nfc.NfcAdapter; import android.nfc.NfcAdapter.CreateBeamUrisCallback; @@ -818,7 +819,7 @@ public abstract class PhotoPage extends ActivityState implements int supportedOperations = mCurrentPhoto.getSupportedOperations(); if (mReadOnlyView) { - supportedOperations ^= MediaObject.SUPPORT_EDIT; + supportedOperations &= ~MediaObject.SUPPORT_EDIT; } if (mSecureAlbum != null) { supportedOperations &= MediaObject.SUPPORT_DELETE; @@ -1108,8 +1109,15 @@ public abstract class PhotoPage extends ActivityState implements Intent intent = new Intent(mActivity, TrimVideo.class); intent.setData(manager.getContentUri(path)); // We need the file path to wrap this into a RandomAccessFile. - intent.putExtra(KEY_MEDIA_ITEM_PATH, current.getFilePath()); - mActivity.startActivityForResult(intent, REQUEST_TRIM); + String str = android.media.MediaFile.getMimeTypeForFile(current.getFilePath()); + if("video/mp4".equals(str) || "video/mpeg4".equals(str) + || "video/3gpp".equals(str) || "video/3gpp2".equals(str)) { + intent.putExtra(KEY_MEDIA_ITEM_PATH, current.getFilePath()); + mActivity.startActivityForResult(intent, REQUEST_TRIM); + } else { + Toast.makeText(mActivity,mActivity.getString(R.string.can_not_trim), + Toast.LENGTH_SHORT).show(); + } return true; } case R.id.action_mute: { diff --git a/src/com/android/gallery3d/filtershow/controller/ColorChooser.java b/src/com/android/gallery3d/filtershow/controller/ColorChooser.java index f9f29bccc..82ce80bbf 100644 --- a/src/com/android/gallery3d/filtershow/controller/ColorChooser.java +++ b/src/com/android/gallery3d/filtershow/controller/ColorChooser.java @@ -68,9 +68,16 @@ public class ColorChooser implements Control { Color.colorToHSV(palette[i], hsvo); hsvo[OPACITY_OFFSET] = (0xFF & (palette[i] >> 24)) / (float) 255; button.setTag(hsvo); + + String colorString = "(" + Integer.toHexString(palette[i]) + ")"; + boolean colorSelect = false; + if (parameter.getValueString().equals(colorString)) { + mSelectedButton = i; + colorSelect = true; + } GradientDrawable sd = ((GradientDrawable) button.getBackground()); sd.setColor(palette[i]); - sd.setStroke(3, (mSelectedButton == i) ? mSelected : mTransparent); + sd.setStroke(3, colorSelect? mSelected : mTransparent); final int buttonNo = i; button.setOnClickListener(new View.OnClickListener() { diff --git a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java index 48d3d9077..275a40409 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java @@ -166,6 +166,11 @@ public class FilterDrawRepresentation extends FilterRepresentation { setEditorId(EditorDraw.ID); setOverlayId(R.drawable.filtershow_drawing); setOverlayOnly(true); + setDefaultColor(); + } + + private void setDefaultColor() { + mParamColor.setValue(DEFAULT_MENU_COLOR1); } @Override diff --git a/src/com/android/gallery3d/filtershow/state/StatePanel.java b/src/com/android/gallery3d/filtershow/state/StatePanel.java index 95c2df991..192400315 100644 --- a/src/com/android/gallery3d/filtershow/state/StatePanel.java +++ b/src/com/android/gallery3d/filtershow/state/StatePanel.java @@ -48,7 +48,9 @@ public class StatePanel extends Fragment { View panel = mMainView.findViewById(R.id.listStates); track = (StatePanelTrack) panel; - track.setAdapter(MasterImage.getImage().getState()); + StateAdapter imageStateAdapter = MasterImage.getImage().getState(); + if (imageStateAdapter == null) return null; + track.setAdapter(imageStateAdapter); mToggleVersionsPanel = (ImageButton) mMainView.findViewById(R.id.toggleVersionsPanel); if (FilterShowHelper.shouldUseVersions()) { if (mToggleVersionsPanel.getVisibility() == View.GONE diff --git a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java index 7fdd36d0f..001e07589 100644 --- a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java +++ b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java @@ -107,6 +107,7 @@ public class ExportDialog extends DialogFragment implements View.OnClickListener mOriginalBounds = MasterImage.getImage().getOriginalBounds(); ImagePreset preset = MasterImage.getImage().getPreset(); + if (mOriginalBounds == null || preset == null) return null; mOriginalBounds = preset.finalGeometryRect(mOriginalBounds.width(), mOriginalBounds.height()); if (preset != null) { |