diff options
33 files changed, 343 insertions, 13 deletions
diff --git a/res/drawable-hdpi/ic_media_bigscreen.png b/res/drawable-hdpi/ic_media_bigscreen.png Binary files differdeleted file mode 100644 index b68002df8..000000000 --- a/res/drawable-hdpi/ic_media_bigscreen.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_media_cropscreen.png b/res/drawable-hdpi/ic_media_cropscreen.png Binary files differdeleted file mode 100644 index d6e4e7009..000000000 --- a/res/drawable-hdpi/ic_media_cropscreen.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_media_fullscreen.png b/res/drawable-hdpi/ic_media_fullscreen.png Binary files differdeleted file mode 100644 index a4569fb6e..000000000 --- a/res/drawable-hdpi/ic_media_fullscreen.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_vidcontrol_pause.png b/res/drawable-hdpi/ic_vidcontrol_pause.png Binary files differdeleted file mode 100644 index 3d1a8bf5c..000000000 --- a/res/drawable-hdpi/ic_vidcontrol_pause.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_vidcontrol_play.png b/res/drawable-hdpi/ic_vidcontrol_play.png Binary files differdeleted file mode 100644 index cc021667a..000000000 --- a/res/drawable-hdpi/ic_vidcontrol_play.png +++ /dev/null diff --git a/res/drawable-hdpi/scrubber_knob.png b/res/drawable-hdpi/scrubber_knob.png Binary files differindex 426e3daff..817fd3aa4 100644 --- a/res/drawable-hdpi/scrubber_knob.png +++ b/res/drawable-hdpi/scrubber_knob.png diff --git a/res/drawable-mdpi/ic_media_bigscreen.png b/res/drawable-mdpi/ic_media_bigscreen.png Binary files differdeleted file mode 100644 index f04026ead..000000000 --- a/res/drawable-mdpi/ic_media_bigscreen.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_media_cropscreen.png b/res/drawable-mdpi/ic_media_cropscreen.png Binary files differdeleted file mode 100644 index a2517bd3d..000000000 --- a/res/drawable-mdpi/ic_media_cropscreen.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_media_fullscreen.png b/res/drawable-mdpi/ic_media_fullscreen.png Binary files differdeleted file mode 100644 index a53cb3ddd..000000000 --- a/res/drawable-mdpi/ic_media_fullscreen.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_vidcontrol_pause.png b/res/drawable-mdpi/ic_vidcontrol_pause.png Binary files differdeleted file mode 100644 index 931907929..000000000 --- a/res/drawable-mdpi/ic_vidcontrol_pause.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_vidcontrol_play.png b/res/drawable-mdpi/ic_vidcontrol_play.png Binary files differdeleted file mode 100644 index 8d7cd837b..000000000 --- a/res/drawable-mdpi/ic_vidcontrol_play.png +++ /dev/null diff --git a/res/drawable-mdpi/scrubber_knob.png b/res/drawable-mdpi/scrubber_knob.png Binary files differindex 9205d9c21..43d1b3fe7 100644 --- a/res/drawable-mdpi/scrubber_knob.png +++ b/res/drawable-mdpi/scrubber_knob.png diff --git a/res/drawable-sw600dp/ic_vidcontrol_pause.png b/res/drawable-sw600dp/ic_vidcontrol_pause.png Binary files differdeleted file mode 100644 index 3d1a8bf5c..000000000 --- a/res/drawable-sw600dp/ic_vidcontrol_pause.png +++ /dev/null diff --git a/res/drawable-sw600dp/ic_vidcontrol_play.png b/res/drawable-sw600dp/ic_vidcontrol_play.png Binary files differdeleted file mode 100644 index cc021667a..000000000 --- a/res/drawable-sw600dp/ic_vidcontrol_play.png +++ /dev/null diff --git a/res/drawable-sw600dp/scrubber_knob.png b/res/drawable-sw600dp/scrubber_knob.png Binary files differindex 426e3daff..817fd3aa4 100644 --- a/res/drawable-sw600dp/scrubber_knob.png +++ b/res/drawable-sw600dp/scrubber_knob.png diff --git a/res/drawable-xhdpi/ic_media_bigscreen.png b/res/drawable-xhdpi/ic_media_bigscreen.png Binary files differdeleted file mode 100644 index ba367097e..000000000 --- a/res/drawable-xhdpi/ic_media_bigscreen.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_media_cropscreen.png b/res/drawable-xhdpi/ic_media_cropscreen.png Binary files differdeleted file mode 100644 index e08c1db60..000000000 --- a/res/drawable-xhdpi/ic_media_cropscreen.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_media_fullscreen.png b/res/drawable-xhdpi/ic_media_fullscreen.png Binary files differdeleted file mode 100644 index ffcb4de7c..000000000 --- a/res/drawable-xhdpi/ic_media_fullscreen.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_vidcontrol_pause.png b/res/drawable-xhdpi/ic_vidcontrol_pause.png Binary files differdeleted file mode 100644 index 4d274c058..000000000 --- a/res/drawable-xhdpi/ic_vidcontrol_pause.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_vidcontrol_play.png b/res/drawable-xhdpi/ic_vidcontrol_play.png Binary files differdeleted file mode 100644 index 6f97a6407..000000000 --- a/res/drawable-xhdpi/ic_vidcontrol_play.png +++ /dev/null diff --git a/res/drawable-xhdpi/scrubber_knob.png b/res/drawable-xhdpi/scrubber_knob.png Binary files differindex 4e415a2a7..225488e55 100644 --- a/res/drawable-xhdpi/scrubber_knob.png +++ b/res/drawable-xhdpi/scrubber_knob.png diff --git a/res/drawable/ic_media_bigscreen.xml b/res/drawable/ic_media_bigscreen.xml new file mode 100644 index 000000000..5413f8599 --- /dev/null +++ b/res/drawable/ic_media_bigscreen.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) 2016, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="60dp" + android:height="60dp" + android:viewportHeight="180.0" + android:viewportWidth="180.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M112.9,72.9l7.1,-7.1l-5.8,-5.8l-7.1,7.1L100,60v20h20L112.9,72.9zM67.1,107.1l-7.1,7.1l5.8,5.8l7.1,-7.1L80,120v-20H60L67.1,107.1zM120,100h-20v20l7.1,-7.1l7.1,7.1l5.8,-5.8l-7.1,-7.1L120,100zM65.8,60L60,65.8l7.1,7.1L60,80h20V60l-7.1,7.1L65.8,60z" /> +</vector> diff --git a/res/drawable/ic_media_cropscreen.xml b/res/drawable/ic_media_cropscreen.xml new file mode 100644 index 000000000..66a24e335 --- /dev/null +++ b/res/drawable/ic_media_cropscreen.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) 2016, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="60dp" + android:height="60dp" + android:viewportHeight="180.0" + android:viewportWidth="180.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M60,76h6V66h10v-6H60V76zM66,104h-6v16h16v-6H66V104zM104,60v6h10v10h6V60H104zM114,114h-10v6h16v-16h-6V114zM70,80L60,90l10,10V80zM110,100l10,-10l-10,-10V100zM90,120l10,-10H80L90,120zM80,70h20L90,60L80,70z" /> +</vector> diff --git a/res/drawable/ic_media_fullscreen.xml b/res/drawable/ic_media_fullscreen.xml new file mode 100644 index 000000000..104a8b68b --- /dev/null +++ b/res/drawable/ic_media_fullscreen.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) 2016, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="60dp" + android:height="60dp" + android:viewportHeight="180.0" + android:viewportWidth="180.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M80,60H60v20l7.1,-7.1l7.1,7.1l5.8,-5.8l-7.1,-7.1L80,60zM100,60l7.1,7.1l-7.1,7.1l5.8,5.8l7.1,-7.1L120,80V60H100zM74.2,100l-7.1,7.1L60,100v20h20l-7.1,-7.1l7.1,-7.1L74.2,100zM105.8,100l-5.8,5.8l7.1,7.1L100,120h20v-20l-7.1,7.1L105.8,100z" /> +</vector> diff --git a/res/drawable/ic_vidcontrol_pause.xml b/res/drawable/ic_vidcontrol_pause.xml new file mode 100644 index 000000000..f3b6d0111 --- /dev/null +++ b/res/drawable/ic_vidcontrol_pause.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) 2016, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="60dp" + android:height="60dp" + android:viewportHeight="180.0" + android:viewportWidth="180.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M66,58h16v64H66V58zM98,58h16v64H98V58z" /> +</vector> diff --git a/res/drawable/ic_vidcontrol_play.xml b/res/drawable/ic_vidcontrol_play.xml new file mode 100644 index 000000000..e58e93283 --- /dev/null +++ b/res/drawable/ic_vidcontrol_play.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (c) 2016, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="60dp" + android:height="60dp" + android:viewportHeight="180.0" + android:viewportWidth="180.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M70,58v64l50,-32L70,58z" /> +</vector> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index d636a9aac..ee181e939 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -207,4 +207,6 @@ <dimen name="timeline_port_margin">3dp</dimen> <dimen name="timeline_title_height">48dp</dimen> <dimen name="timeline_title_font_size">14sp</dimen> + + <dimen name="timebar_height">60dp</dimen> </resources> diff --git a/src/com/android/gallery3d/app/CommonControllerOverlay.java b/src/com/android/gallery3d/app/CommonControllerOverlay.java index 7a553e906..28b6988f5 100644 --- a/src/com/android/gallery3d/app/CommonControllerOverlay.java +++ b/src/com/android/gallery3d/app/CommonControllerOverlay.java @@ -104,7 +104,6 @@ public abstract class CommonControllerOverlay extends FrameLayout implements mPlayPauseReplayView = new ImageView(context); mPlayPauseReplayView.setContentDescription( context.getResources().getString(R.string.accessibility_play_video)); - mPlayPauseReplayView.setBackgroundResource(R.drawable.bg_vidcontrol); mPlayPauseReplayView.setScaleType(ScaleType.CENTER); mPlayPauseReplayView.setFocusable(true); mPlayPauseReplayView.setClickable(true); diff --git a/src/com/android/gallery3d/app/MovieControllerOverlay.java b/src/com/android/gallery3d/app/MovieControllerOverlay.java index de68a4579..b2851e020 100644 --- a/src/com/android/gallery3d/app/MovieControllerOverlay.java +++ b/src/com/android/gallery3d/app/MovieControllerOverlay.java @@ -21,6 +21,7 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.Rect; +import android.graphics.drawable.VectorDrawable; import android.os.Handler; import android.text.TextUtils; import android.util.DisplayMetrics; @@ -63,7 +64,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements private static final boolean LOG = true; private ScreenModeManager mScreenModeManager; - private ScreenModeExt mScreenModeExt = new ScreenModeExt(); + protected ScreenModeExt mScreenModeExt = new ScreenModeExt(); private ControllerRewindAndForwardExt mControllerRewindAndForwardExt = new ControllerRewindAndForwardExt(); private OverlayExtension mOverlayExt = new OverlayExtension(); private boolean hidden; @@ -73,7 +74,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements private final Animation hideAnimation; private boolean enableRewindAndForward = false; - private Context mContext; + protected Context mContext; public MovieControllerOverlay(Context context) { super(context); @@ -89,8 +90,6 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements hideAnimation = AnimationUtils.loadAnimation(context, R.anim.player_out); hideAnimation.setAnimationListener(this); - enableRewindAndForward = true; - Log.v(TAG, "enableRewindAndForward is " + enableRewindAndForward); mControllerRewindAndForwardExt.init(context); mScreenModeExt.init(context, mTimeBar); mBackground.setClickable(true); @@ -200,7 +199,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements public void maybeStartHiding() { cancelHiding(); - if (mState == State.PLAYING) { + if (mState == State.PLAYING || mState == State.PAUSED) { handler.postDelayed(startHidingRunnable, 2500); } } @@ -706,11 +705,10 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements } // for screen layout - Bitmap screenButton = BitmapFactory.decodeResource(context.getResources(), + VectorDrawable screenButton = VectorDrawable.create(context.getResources(), R.drawable.ic_media_bigscreen); - mScreenWidth = screenButton.getWidth(); + mScreenWidth = screenButton.getIntrinsicWidth(); mScreenPadding = (int) (metrics.density * MARGIN); - screenButton.recycle(); } private void updateScreenModeDrawable() { @@ -769,7 +767,7 @@ public class MovieControllerOverlay extends CommonControllerOverlay implements } public int getAddedRightPadding() { - return mScreenPadding * 2 + mScreenWidth; + return mScreenWidth; } @Override diff --git a/src/com/android/gallery3d/app/MovieControllerOverlayNew.java b/src/com/android/gallery3d/app/MovieControllerOverlayNew.java new file mode 100644 index 000000000..a11a74a51 --- /dev/null +++ b/src/com/android/gallery3d/app/MovieControllerOverlayNew.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.android.gallery3d.app; + +import android.content.Context; +import android.graphics.Rect; +import android.view.MotionEvent; +import android.view.View; + +public class MovieControllerOverlayNew extends MovieControllerOverlay { + + public MovieControllerOverlayNew(Context context) { + super(context); + } + + @Override + protected void createTimeBar(Context context) { + mTimeBar = new TimeBarNew(context, this); + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + cancelHiding(); + return true; + } else if (event.getAction() == MotionEvent.ACTION_UP) { + maybeStartHiding(); + return true; + } else { + return super.onTouchEvent(event); + } + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + int width = ((MovieActivity) mContext).getWindowManager().getDefaultDisplay().getWidth(); + Rect insets = mWindowInsets; + int pr = insets.right; + int pb = insets.bottom; + + int h = bottom - top; + int w = right - left; + + int y = h - pb; + + mBackground.layout(0, y - mTimeBar.getPreferredHeight(), w, y); + mScreenModeExt.onLayout(w, pr, y); + + mPlayPauseReplayView.layout(0, y - mTimeBar.getPreferredHeight(), + mTimeBar.getPreferredHeight(), y); + mTimeBar.layout(mTimeBar.getPreferredHeight(), y - mTimeBar.getPreferredHeight(), + width - mScreenModeExt.getAddedRightPadding(), y); + } + +} diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java index c5aa61095..e1b8709b3 100755 --- a/src/com/android/gallery3d/app/MoviePlayer.java +++ b/src/com/android/gallery3d/app/MoviePlayer.java @@ -262,7 +262,7 @@ public class MoviePlayer implements mVideoView = (CodeauroraVideoView) rootView.findViewById(R.id.surface_view); mBookmarker = new Bookmarker(movieActivity); - mController = new MovieControllerOverlay(movieActivity); + mController = new MovieControllerOverlayNew(movieActivity); ((ViewGroup)rootView).addView(mController.getView()); mController.setListener(this); mController.setCanReplay(canReplay); diff --git a/src/com/android/gallery3d/app/TimeBar.java b/src/com/android/gallery3d/app/TimeBar.java index 7bd37b1cd..aed8eeccc 100755 --- a/src/com/android/gallery3d/app/TimeBar.java +++ b/src/com/android/gallery3d/app/TimeBar.java @@ -48,7 +48,7 @@ public class TimeBar extends View { } // Padding around the scrubber to increase its touch target - private static final int SCRUBBER_PADDING_IN_DP = 10; + private static final int SCRUBBER_PADDING_IN_DP = 3; // The total padding, top plus bottom private static final int V_PADDING_IN_DP = 30; @@ -106,7 +106,7 @@ public class TimeBar extends View { mProgressPaint = new Paint(); mProgressPaint.setColor(0xFF808080); mPlayedPaint = new Paint(); - mPlayedPaint.setColor(0xFFFFFFFF); + mPlayedPaint.setColor(0xFF4F92E9); DisplayMetrics metrics = context.getResources().getDisplayMetrics(); float textSizeInPx = metrics.density * TEXT_SIZE_IN_DP; diff --git a/src/com/android/gallery3d/app/TimeBarNew.java b/src/com/android/gallery3d/app/TimeBarNew.java new file mode 100644 index 000000000..9f57ef692 --- /dev/null +++ b/src/com/android/gallery3d/app/TimeBarNew.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.android.gallery3d.app; + +import android.content.Context; + +import com.android.gallery3d.R; + +public class TimeBarNew extends TimeBar { + + private int mTimeBarHeight; + + public TimeBarNew(Context context, Listener listener) { + super(context, listener); + mTimeBarHeight = context.getResources().getDimensionPixelSize(R.dimen.timebar_height); + } + + @Override + public int getPreferredHeight() { + return mTimeBarHeight; + } + + @Override + public void setInfo(String info) { + // Do nothing here, show nothing in timeBar's info. + } +}
\ No newline at end of file |