Skip to content

Conversation

@aricodeine
Copy link
Contributor

@aricodeine aricodeine commented Dec 19, 2025

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Added long press gesture to 2x speed in the separate video player

Tests performed

  • Tested on Nothing Phone 2A

Before & after preview

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • All checks are passing.

@naveensingh naveensingh changed the title Gallery issue 830 feat: add long press gesture to 2x speed in separate video player Dec 19, 2025
@naveensingh
Copy link
Member

You may ignore the LargeClass check. I'll update the baselines after the merge.

@aricodeine
Copy link
Contributor Author

aricodeine commented Dec 20, 2025

Sure @naveensingh . It seems to be working fine on a physical device. But when run on emulator, the screen is turning black
ignoreImageMinify

I analyzed the apk and found this:
image

@naveensingh
Copy link
Member

If it's working properly on physical devices, it's okay.

APK does not support 16KB devices

Please ignore that warning. I'll be adding support for 16KB page size in affected apps soon-ish.

Copy link
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found two bugs:

  • When panning after zooming in, the speed is increased even though I was panning. It seems more easily reproducible when panning vertically than horizontally. This does not happen in the normal player, so it shouldn't be about the 500ms delay. If you are unable to reproduce this, try panning the video vertically for a few centimeters and then stop without releasing the touch.
  • Long press ➜ speed is increased ➜ release touch ➜ player unnecessary exits/enters full-screen mode.

mExoPlayer?.setVideoSurface(Surface(binding.videoSurface.surfaceTexture))
}

@RequiresApi(Build.VERSION_CODES.R)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both onSurfaceTextureAvailable() and onSurfaceTextureSizeChanged() were added in API 14.

Suggested change
@RequiresApi(Build.VERSION_CODES.R)


override fun onSurfaceTextureDestroyed(surface: SurfaceTexture) = false

@RequiresApi(Build.VERSION_CODES.R)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@RequiresApi(Build.VERSION_CODES.R)

import android.graphics.SurfaceTexture
import android.graphics.drawable.ColorDrawable
import android.net.Uri
import android.os.Build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import android.os.Build

Comment on lines 854 to 866
/*@RequiresApi(Build.VERSION_CODES.R)
fun setPillHeight() {
val system = WindowInsets.CONSUMED.getInsetsIgnoringVisibility(Type.systemBars())
val pillTopMargin = system.top + resources.getActionBarHeight(this) +
resources.getDimension(org.fossify.commons.R.dimen.normal_margin).toInt()
(mPlaybackSpeedPill.layoutParams as? RelativeLayout.LayoutParams)?.apply {
setMargins(
0, pillTopMargin, 0, 0
)
}
}*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well remove it if we don't need it.

Suggested change
/*@RequiresApi(Build.VERSION_CODES.R)
fun setPillHeight() {
val system = WindowInsets.CONSUMED.getInsetsIgnoringVisibility(Type.systemBars())
val pillTopMargin = system.top + resources.getActionBarHeight(this) +
resources.getDimension(org.fossify.commons.R.dimen.normal_margin).toInt()
(mPlaybackSpeedPill.layoutParams as? RelativeLayout.LayoutParams)?.apply {
setMargins(
0, pillTopMargin, 0, 0
)
}
}*/

import android.widget.RelativeLayout
import android.widget.SeekBar
import android.widget.TextView
import androidx.annotation.RequiresApi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import androidx.annotation.RequiresApi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add long press gesture to 2x speed in the separate video player

2 participants