SeekOverlay: Switch to merge for SecondsView and other adjustments
This commit is contained in:
parent
72eb3b4415
commit
3aebfa22e9
6 changed files with 24 additions and 22 deletions
|
|
@ -54,7 +54,7 @@ fun View.animate(
|
|||
)
|
||||
Log.d(TAG, "animate(): $msg")
|
||||
}
|
||||
if (isVisible && enterOrExit && alpha == 1f && animationType == AnimationType.ALPHA) {
|
||||
if (isVisible && enterOrExit) {
|
||||
if (MainActivity.DEBUG) {
|
||||
Log.d(TAG, "animate(): view was already visible > view = [$this]")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ public final class Player implements
|
|||
public static final int DEFAULT_CONTROLS_DURATION = 300; // 300 millis
|
||||
public static final int DEFAULT_CONTROLS_HIDE_TIME = 2000; // 2 Seconds
|
||||
public static final int DPAD_CONTROLS_HIDE_TIME = 7000; // 7 Seconds
|
||||
public static final int SEEK_OVERLAY_DURATION = 450; // 450 millis
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////
|
||||
// Other constants
|
||||
|
|
@ -586,10 +587,9 @@ public final class Player implements
|
|||
}
|
||||
|
||||
private void setupPlayerSeekOverlay() {
|
||||
final int fadeDurations = 450;
|
||||
binding.seekOverlay.showCircle(true)
|
||||
.circleBackgroundColorInt(CircleClipTapView.COLOR_DARK_TRANSPARENT)
|
||||
.seekSeconds(retrieveSeekDurationFromPreferences(this) / 1000)
|
||||
.seekSeconds((int) (retrieveSeekDurationFromPreferences(this) / 1000.0f))
|
||||
.performListener(new PlayerSeekOverlay.PerformListener() {
|
||||
|
||||
@Override
|
||||
|
|
@ -605,22 +605,22 @@ public final class Player implements
|
|||
|
||||
@Override
|
||||
public void onAnimationStart() {
|
||||
animate(binding.seekOverlay, true, fadeDurations);
|
||||
animate(binding.seekOverlay, true, SEEK_OVERLAY_DURATION);
|
||||
animate(binding.playbackControlsShadow,
|
||||
!simpleExoPlayer.getPlayWhenReady(), fadeDurations);
|
||||
animate(binding.playerTopShadow, false, fadeDurations);
|
||||
animate(binding.playerBottomShadow, false, fadeDurations);
|
||||
animate(binding.playbackControlRoot, false, fadeDurations);
|
||||
!simpleExoPlayer.getPlayWhenReady(), SEEK_OVERLAY_DURATION);
|
||||
animate(binding.playerTopShadow, false, SEEK_OVERLAY_DURATION);
|
||||
animate(binding.playerBottomShadow, false, SEEK_OVERLAY_DURATION);
|
||||
animate(binding.playbackControlRoot, false, SEEK_OVERLAY_DURATION);
|
||||
hideSystemUIIfNeeded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd() {
|
||||
animate(binding.seekOverlay, false, fadeDurations);
|
||||
animate(binding.seekOverlay, false, SEEK_OVERLAY_DURATION);
|
||||
if (!simpleExoPlayer.getPlayWhenReady()) {
|
||||
showControls(fadeDurations);
|
||||
showControls(SEEK_OVERLAY_DURATION);
|
||||
} else {
|
||||
showHideShadow(false, fadeDurations);
|
||||
showHideShadow(false, SEEK_OVERLAY_DURATION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@ import android.animation.ValueAnimator
|
|||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import kotlinx.android.synthetic.main.player_seek_seconds_view.view.*
|
||||
import org.schabi.newpipe.R
|
||||
|
||||
class SecondsView(context: Context, attrs: AttributeSet?) :
|
||||
ConstraintLayout(context, attrs) {
|
||||
class SecondsView(context: Context, attrs: AttributeSet?) : LinearLayout(context, attrs) {
|
||||
|
||||
companion object {
|
||||
const val ICON_ANIMATION_DURATION = 750L
|
||||
|
|
@ -58,6 +57,8 @@ class SecondsView(context: Context, attrs: AttributeSet?) :
|
|||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.player_seek_seconds_view, this, true)
|
||||
orientation = VERTICAL
|
||||
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
fun start() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue