Loading src/com/android/gallery3d/app/MovieActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ import android.bluetooth.BluetoothProfile; public class MovieActivity extends AbstractPermissionActivity { @SuppressWarnings("unused") private static final String TAG = "MovieActivity"; private static final boolean LOG = true; private static final boolean LOG = false; public static final String KEY_LOGO_BITMAP = "logo-bitmap"; public static final String KEY_TREAT_UP_AS_BACK = "treat-up-as-back"; private static final String VIDEO_SDP_MIME_TYPE = "application/sdp"; Loading src/com/android/gallery3d/app/MovieControllerOverlay.java +49 −17 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements AnimationListener { private static final String TAG = "Gallery3D/MovieControllerOverlay"; private static final boolean LOG = true; private static final boolean LOG = false; private ScreenModeManager mScreenModeManager; protected ScreenModeExt mScreenModeExt = new ScreenModeExt(); Loading Loading @@ -274,7 +274,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void setViewEnabled(boolean isEnabled) { if (mListener.onIsRTSP()) { if (LOG) { Log.v(TAG, "setViewEnabled is " + isEnabled); } mOverlayExt.setCanScrubbing(isEnabled); mPlayPauseReplayView.setEnabled(isEnabled); if (enableRewindAndForward) { Loading @@ -292,7 +294,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void setPlayPauseReplayResume() { if (mListener.onIsRTSP()) { if (LOG) { Log.v(TAG, "setPlayPauseReplayResume is enabled is true"); } mPlayPauseReplayView.setEnabled(true); } } Loading Loading @@ -680,7 +684,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements addView(mScreenView, wrapContent); if (enableRewindAndForward) { if (LOG) { Log.v(TAG, "ScreenModeExt enableRewindAndForward"); } mSeprator = new ImageView(context); // default next screen mode mSeprator.setImageResource(R.drawable.ic_separator_line); Loading @@ -691,8 +697,10 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements addView(mSeprator, wrapContent); } else { if (LOG) { Log.v(TAG, "ScreenModeExt unenableRewindAndForward"); } } // for screen layout Drawable screenButton = context.getResources() Loading Loading @@ -784,7 +792,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements } void init(Context context) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt init"); } mTimeBarHeight = mTimeBar.getPreferredHeight(); Drawable forwardMenu = context.getResources(). Loading Loading @@ -837,10 +847,14 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void onClick(View v) { if (v == mStop) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onClick mStop"); } mListenerForRewind.onStopVideo(); } else if (v == mRewind) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onClick mRewind"); } if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL) { mListenerForRewind.onForward(); Loading @@ -848,7 +862,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements mListenerForRewind.onRewind(); } } else if (v == mForward) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onClick mForward"); } if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL) { mListenerForRewind.onRewind(); Loading @@ -859,28 +875,38 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements } public void onStartHiding() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onStartHiding"); } startHideAnimation(mContollerButtons); } public void onCancelHiding() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onCancelHiding"); } mContollerButtons.setAnimation(null); } public void onHide() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onHide"); } mContollerButtons.setVisibility(View.INVISIBLE); } public void onShow() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onShow: " + mState); } mContollerButtons.setVisibility(View.VISIBLE); updateBackgroundColor(); } public void onLayout(int l, int r, int b) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onLayout"); } int cl = (r - l - getAddedRightPadding()) / 2; int cr = cl + getAddedRightPadding(); mContollerButtons.layout(cl, b - mTimeBar.getPreferredHeight(), cr, b); Loading @@ -892,14 +918,18 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void setIListener(IRewindAndForwardListener listener) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt setIListener " + listener); } mListenerForRewind = listener; } @Override public void showControllerButtonsView(boolean canStop, boolean canRewind, boolean canForward) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt showControllerButtonsView " + canStop + canRewind + canForward); } // show ui mStop.setEnabled(canStop); mRewind.setEnabled(canRewind); Loading Loading @@ -970,7 +1000,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements public void setViewEnabled(boolean isEnabled) { // TODO Auto-generated method stub if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt setViewEnabled is " + isEnabled); } mRewind.setEnabled(isEnabled); mForward.setEnabled(isEnabled); } Loading src/com/android/gallery3d/app/MoviePlayer.java +30 −12 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class MoviePlayer implements MediaPlayer.OnBufferingUpdateListener { @SuppressWarnings("unused") private static final String TAG = "MoviePlayer"; private static final boolean LOG = true; private static final boolean LOG = false; private static final String KEY_VIDEO_POSITION = "video-position"; private static final String KEY_RESUMEABLE_TIME = "resumeable-timeout"; Loading Loading @@ -219,7 +219,9 @@ public class MoviePlayer implements mKeyguardLocked = false; mCanResumed = false; } else if (Intent.ACTION_SHUTDOWN.equals(intent.getAction())) { if (LOG) { Log.v(TAG, "Intent.ACTION_SHUTDOWN received"); } mActivityContext.finish(); } } Loading Loading @@ -821,10 +823,14 @@ public class MoviePlayer implements public boolean onIsRTSP() { if (MovieUtils.isRtspStreaming(mMovieItem.getUri(), mMovieItem .getMimeType())) { if (LOG) { Log.v(TAG, "onIsRTSP() is RTSP"); } return true; } if (LOG) { Log.v(TAG, "onIsRTSP() is not RTSP"); } return false; } Loading Loading @@ -882,9 +888,11 @@ public class MoviePlayer implements } public void updateRewindAndForwardUI() { Log.v(TAG, "updateRewindAndForwardUI"); Log.v(TAG, "updateRewindAndForwardUI== getCurrentPosition = " + mVideoView.getCurrentPosition()); Log.v(TAG, "updateRewindAndForwardUI==getDuration =" + mVideoView.getDuration()); if (LOG) { Log.v(TAG, "updateRewindAndForwardUI: " + "getCurrentPosition = " + mVideoView.getCurrentPosition() + ", " + "getDuration = " + mVideoView.getDuration()); } if (mControllerRewindAndForwardExt != null) { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt .canStop(), mVideoView.canSeekBackward() Loading Loading @@ -1529,7 +1537,9 @@ public class MoviePlayer implements @Override public void onStopVideo() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onStopVideo()"); } if (mPlayerExt.canStop()) { mPlayerExt.stopVideo(); mControllerRewindAndForwardExt.showControllerButtonsView(false, Loading @@ -1539,7 +1549,9 @@ public class MoviePlayer implements @Override public void onRewind() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onRewind()"); } if (mVideoView != null && mVideoView.canSeekBackward()) { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt .canStop(), Loading @@ -1548,7 +1560,9 @@ public class MoviePlayer implements int targetDuration = mVideoView.getCurrentPosition() - stepValue < 0 ? 0 : mVideoView.getCurrentPosition() - stepValue; if (LOG) { Log.v(TAG, "onRewind targetDuration " + targetDuration); } mVideoView.seekTo(targetDuration); } else { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt Loading @@ -1559,7 +1573,9 @@ public class MoviePlayer implements @Override public void onForward() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onForward()"); } if (mVideoView != null && mVideoView.canSeekForward()) { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt .canStop(), Loading @@ -1569,7 +1585,9 @@ public class MoviePlayer implements + stepValue > mVideoView.getDuration() ? mVideoView .getDuration() : mVideoView.getCurrentPosition() + stepValue; if (LOG) { Log.v(TAG, "onForward targetDuration " + targetDuration); } mVideoView.seekTo(targetDuration); } else { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt Loading src/com/android/gallery3d/app/TimeBar.java +4 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public class TimeBar extends View { private static final int TEXT_SIZE_IN_DP = 14; private static final String TAG = "Gallery3D/TimeBar"; private static final boolean LOG = true; private static final boolean LOG = false; public static final int UNKNOWN = -1; protected final Listener mListener; Loading Loading @@ -439,7 +439,7 @@ interface ITimeBarLayoutExt { class TimeBarInfoExtImpl implements ITimeBarInfoExt { private static final String TAG = "TimeBarInfoExtensionImpl"; private static final boolean LOG = true; private static final boolean LOG = false; private static final String ELLIPSE = "..."; private Paint mInfoPaint; Loading Loading @@ -504,7 +504,7 @@ class TimeBarInfoExtImpl implements ITimeBarInfoExt { class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt { private static final String TAG = "TimeBarSecondaryProgressExtensionImpl"; private static final boolean LOG = true; private static final boolean LOG = false; private int mBufferPercent; private Rect mSecondaryBar; Loading Loading @@ -539,7 +539,7 @@ class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt { class TimeBarLayoutExtImpl implements ITimeBarLayoutExt { private static final String TAG = "TimeBarLayoutExtensionImpl"; private static final boolean LOG = true; private static final boolean LOG = false; private int mTextPadding; private int mVPaddingInPx; Loading src/org/codeaurora/gallery3d/ext/MovieItem.java +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import android.provider.MediaStore; public class MovieItem implements IMovieItem { private static final String TAG = "MovieItem"; private static final boolean LOG = true; private static final boolean LOG = false; private Uri mUri; private String mMimeType; Loading Loading
src/com/android/gallery3d/app/MovieActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ import android.bluetooth.BluetoothProfile; public class MovieActivity extends AbstractPermissionActivity { @SuppressWarnings("unused") private static final String TAG = "MovieActivity"; private static final boolean LOG = true; private static final boolean LOG = false; public static final String KEY_LOGO_BITMAP = "logo-bitmap"; public static final String KEY_TREAT_UP_AS_BACK = "treat-up-as-back"; private static final String VIDEO_SDP_MIME_TYPE = "application/sdp"; Loading
src/com/android/gallery3d/app/MovieControllerOverlay.java +49 −17 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements AnimationListener { private static final String TAG = "Gallery3D/MovieControllerOverlay"; private static final boolean LOG = true; private static final boolean LOG = false; private ScreenModeManager mScreenModeManager; protected ScreenModeExt mScreenModeExt = new ScreenModeExt(); Loading Loading @@ -274,7 +274,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void setViewEnabled(boolean isEnabled) { if (mListener.onIsRTSP()) { if (LOG) { Log.v(TAG, "setViewEnabled is " + isEnabled); } mOverlayExt.setCanScrubbing(isEnabled); mPlayPauseReplayView.setEnabled(isEnabled); if (enableRewindAndForward) { Loading @@ -292,7 +294,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void setPlayPauseReplayResume() { if (mListener.onIsRTSP()) { if (LOG) { Log.v(TAG, "setPlayPauseReplayResume is enabled is true"); } mPlayPauseReplayView.setEnabled(true); } } Loading Loading @@ -680,7 +684,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements addView(mScreenView, wrapContent); if (enableRewindAndForward) { if (LOG) { Log.v(TAG, "ScreenModeExt enableRewindAndForward"); } mSeprator = new ImageView(context); // default next screen mode mSeprator.setImageResource(R.drawable.ic_separator_line); Loading @@ -691,8 +697,10 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements addView(mSeprator, wrapContent); } else { if (LOG) { Log.v(TAG, "ScreenModeExt unenableRewindAndForward"); } } // for screen layout Drawable screenButton = context.getResources() Loading Loading @@ -784,7 +792,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements } void init(Context context) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt init"); } mTimeBarHeight = mTimeBar.getPreferredHeight(); Drawable forwardMenu = context.getResources(). Loading Loading @@ -837,10 +847,14 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void onClick(View v) { if (v == mStop) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onClick mStop"); } mListenerForRewind.onStopVideo(); } else if (v == mRewind) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onClick mRewind"); } if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL) { mListenerForRewind.onForward(); Loading @@ -848,7 +862,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements mListenerForRewind.onRewind(); } } else if (v == mForward) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onClick mForward"); } if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL) { mListenerForRewind.onRewind(); Loading @@ -859,28 +875,38 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements } public void onStartHiding() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onStartHiding"); } startHideAnimation(mContollerButtons); } public void onCancelHiding() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onCancelHiding"); } mContollerButtons.setAnimation(null); } public void onHide() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onHide"); } mContollerButtons.setVisibility(View.INVISIBLE); } public void onShow() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onShow: " + mState); } mContollerButtons.setVisibility(View.VISIBLE); updateBackgroundColor(); } public void onLayout(int l, int r, int b) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onLayout"); } int cl = (r - l - getAddedRightPadding()) / 2; int cr = cl + getAddedRightPadding(); mContollerButtons.layout(cl, b - mTimeBar.getPreferredHeight(), cr, b); Loading @@ -892,14 +918,18 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements @Override public void setIListener(IRewindAndForwardListener listener) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt setIListener " + listener); } mListenerForRewind = listener; } @Override public void showControllerButtonsView(boolean canStop, boolean canRewind, boolean canForward) { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt showControllerButtonsView " + canStop + canRewind + canForward); } // show ui mStop.setEnabled(canStop); mRewind.setEnabled(canRewind); Loading Loading @@ -970,7 +1000,9 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements public void setViewEnabled(boolean isEnabled) { // TODO Auto-generated method stub if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt setViewEnabled is " + isEnabled); } mRewind.setEnabled(isEnabled); mForward.setEnabled(isEnabled); } Loading
src/com/android/gallery3d/app/MoviePlayer.java +30 −12 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class MoviePlayer implements MediaPlayer.OnBufferingUpdateListener { @SuppressWarnings("unused") private static final String TAG = "MoviePlayer"; private static final boolean LOG = true; private static final boolean LOG = false; private static final String KEY_VIDEO_POSITION = "video-position"; private static final String KEY_RESUMEABLE_TIME = "resumeable-timeout"; Loading Loading @@ -219,7 +219,9 @@ public class MoviePlayer implements mKeyguardLocked = false; mCanResumed = false; } else if (Intent.ACTION_SHUTDOWN.equals(intent.getAction())) { if (LOG) { Log.v(TAG, "Intent.ACTION_SHUTDOWN received"); } mActivityContext.finish(); } } Loading Loading @@ -821,10 +823,14 @@ public class MoviePlayer implements public boolean onIsRTSP() { if (MovieUtils.isRtspStreaming(mMovieItem.getUri(), mMovieItem .getMimeType())) { if (LOG) { Log.v(TAG, "onIsRTSP() is RTSP"); } return true; } if (LOG) { Log.v(TAG, "onIsRTSP() is not RTSP"); } return false; } Loading Loading @@ -882,9 +888,11 @@ public class MoviePlayer implements } public void updateRewindAndForwardUI() { Log.v(TAG, "updateRewindAndForwardUI"); Log.v(TAG, "updateRewindAndForwardUI== getCurrentPosition = " + mVideoView.getCurrentPosition()); Log.v(TAG, "updateRewindAndForwardUI==getDuration =" + mVideoView.getDuration()); if (LOG) { Log.v(TAG, "updateRewindAndForwardUI: " + "getCurrentPosition = " + mVideoView.getCurrentPosition() + ", " + "getDuration = " + mVideoView.getDuration()); } if (mControllerRewindAndForwardExt != null) { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt .canStop(), mVideoView.canSeekBackward() Loading Loading @@ -1529,7 +1537,9 @@ public class MoviePlayer implements @Override public void onStopVideo() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onStopVideo()"); } if (mPlayerExt.canStop()) { mPlayerExt.stopVideo(); mControllerRewindAndForwardExt.showControllerButtonsView(false, Loading @@ -1539,7 +1549,9 @@ public class MoviePlayer implements @Override public void onRewind() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onRewind()"); } if (mVideoView != null && mVideoView.canSeekBackward()) { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt .canStop(), Loading @@ -1548,7 +1560,9 @@ public class MoviePlayer implements int targetDuration = mVideoView.getCurrentPosition() - stepValue < 0 ? 0 : mVideoView.getCurrentPosition() - stepValue; if (LOG) { Log.v(TAG, "onRewind targetDuration " + targetDuration); } mVideoView.seekTo(targetDuration); } else { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt Loading @@ -1559,7 +1573,9 @@ public class MoviePlayer implements @Override public void onForward() { if (LOG) { Log.v(TAG, "ControllerRewindAndForwardExt onForward()"); } if (mVideoView != null && mVideoView.canSeekForward()) { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt .canStop(), Loading @@ -1569,7 +1585,9 @@ public class MoviePlayer implements + stepValue > mVideoView.getDuration() ? mVideoView .getDuration() : mVideoView.getCurrentPosition() + stepValue; if (LOG) { Log.v(TAG, "onForward targetDuration " + targetDuration); } mVideoView.seekTo(targetDuration); } else { mControllerRewindAndForwardExt.showControllerButtonsView(mPlayerExt Loading
src/com/android/gallery3d/app/TimeBar.java +4 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public class TimeBar extends View { private static final int TEXT_SIZE_IN_DP = 14; private static final String TAG = "Gallery3D/TimeBar"; private static final boolean LOG = true; private static final boolean LOG = false; public static final int UNKNOWN = -1; protected final Listener mListener; Loading Loading @@ -439,7 +439,7 @@ interface ITimeBarLayoutExt { class TimeBarInfoExtImpl implements ITimeBarInfoExt { private static final String TAG = "TimeBarInfoExtensionImpl"; private static final boolean LOG = true; private static final boolean LOG = false; private static final String ELLIPSE = "..."; private Paint mInfoPaint; Loading Loading @@ -504,7 +504,7 @@ class TimeBarInfoExtImpl implements ITimeBarInfoExt { class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt { private static final String TAG = "TimeBarSecondaryProgressExtensionImpl"; private static final boolean LOG = true; private static final boolean LOG = false; private int mBufferPercent; private Rect mSecondaryBar; Loading Loading @@ -539,7 +539,7 @@ class TimeBarSecondaryProgressExtImpl implements ITimeBarSecondaryProgressExt { class TimeBarLayoutExtImpl implements ITimeBarLayoutExt { private static final String TAG = "TimeBarLayoutExtensionImpl"; private static final boolean LOG = true; private static final boolean LOG = false; private int mTextPadding; private int mVPaddingInPx; Loading
src/org/codeaurora/gallery3d/ext/MovieItem.java +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import android.provider.MediaStore; public class MovieItem implements IMovieItem { private static final String TAG = "MovieItem"; private static final boolean LOG = true; private static final boolean LOG = false; private Uri mUri; private String mMimeType; Loading