Restore upstream video player controls & Update dependencies
This commit is contained in:
parent
4b002c7b24
commit
d44601f69f
@ -118,14 +118,14 @@ dependencies {
|
|||||||
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||||
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
||||||
|
|
||||||
def media3_version = "1.1.1"
|
def media3_version = "1.3.1"
|
||||||
implementation "androidx.media3:media3-exoplayer:$media3_version"
|
implementation "androidx.media3:media3-exoplayer:$media3_version"
|
||||||
implementation 'androidx.media3:media3-ui:1.1.1'
|
implementation "androidx.media3:media3-ui:$media3_version"
|
||||||
implementation "androidx.media3:media3-datasource:$media3_version"
|
implementation "androidx.media3:media3-datasource:$media3_version"
|
||||||
|
|
||||||
implementation "androidx.concurrent:concurrent-futures:1.1.0"
|
implementation "androidx.concurrent:concurrent-futures:1.1.0"
|
||||||
|
|
||||||
def camerax_version = "1.3.0-rc02"
|
def camerax_version = "1.3.3"
|
||||||
implementation "androidx.camera:camera-camera2:$camerax_version"
|
implementation "androidx.camera:camera-camera2:$camerax_version"
|
||||||
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
||||||
implementation "androidx.camera:camera-view:$camerax_version"
|
implementation "androidx.camera:camera-view:$camerax_version"
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 6388eaf433a4196f10389921d5e346c90ee3d793
|
Subproject commit 0398d48b0963c01092976c5c7012b02327e564f0
|
@ -5,7 +5,7 @@ Create the `new` folder if needed:
|
|||||||
mkdir -p new
|
mkdir -p new
|
||||||
```
|
```
|
||||||
|
|
||||||
Put new CameraX files from upstream in the `new` folder.
|
Put the new CameraX files from upstream (`androidx.camera.video.Recorder`, `androidx.camera.video.Recording`, `androidx.camera.video.PendingRecording` and `androidx.camera.video.internal.encoder.EncoderImpl`) in the `new` folder.
|
||||||
|
|
||||||
Perform the 3 way merge:
|
Perform the 3 way merge:
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package sushi.hardcore.droidfs
|
package sushi.hardcore.droidfs
|
||||||
|
|
||||||
|
import android.app.ActivityOptions
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
@ -90,9 +91,15 @@ class SettingsActivity : BaseActivity() {
|
|||||||
|
|
||||||
private fun refreshTheme() {
|
private fun refreshTheme() {
|
||||||
with(requireActivity()) {
|
with(requireActivity()) {
|
||||||
startActivity(Intent(this, SettingsActivity::class.java))
|
startActivity(
|
||||||
|
Intent(this, SettingsActivity::class.java),
|
||||||
|
ActivityOptions.makeCustomAnimation(
|
||||||
|
this,
|
||||||
|
android.R.anim.fade_in,
|
||||||
|
android.R.anim.fade_out
|
||||||
|
).toBundle()
|
||||||
|
)
|
||||||
finish()
|
finish()
|
||||||
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,23 +2,13 @@ package sushi.hardcore.droidfs.widgets
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Configuration
|
|
||||||
import android.media.session.PlaybackState
|
import android.media.session.PlaybackState
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.GestureDetector
|
import android.view.GestureDetector
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.Button
|
|
||||||
import android.widget.FrameLayout
|
|
||||||
import android.widget.LinearLayout
|
|
||||||
import androidx.core.view.GestureDetectorCompat
|
|
||||||
import androidx.core.view.updateLayoutParams
|
|
||||||
import androidx.core.view.updatePadding
|
|
||||||
import androidx.media3.ui.PlayerView
|
import androidx.media3.ui.PlayerView
|
||||||
import sushi.hardcore.droidfs.R
|
|
||||||
|
|
||||||
class DoubleTapPlayerView @JvmOverloads constructor(
|
class DoubleTapPlayerView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
@ -75,22 +65,7 @@ class DoubleTapPlayerView @JvmOverloads constructor(
|
|||||||
handler.postDelayed(stopDoubleTap, 700)
|
handler.postDelayed(stopDoubleTap, 700)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val gestureDetector = GestureDetectorCompat(context, gestureListener)
|
private val gestureDetector = GestureDetector(context, gestureListener)
|
||||||
private val density by lazy {
|
|
||||||
context.resources.displayMetrics.density
|
|
||||||
}
|
|
||||||
private val originalExoIconPaddingBottom by lazy {
|
|
||||||
resources.getDimension(R.dimen.exo_icon_padding_bottom)
|
|
||||||
}
|
|
||||||
private val originalExoIconSize by lazy {
|
|
||||||
resources.getDimension(R.dimen.exo_icon_size)
|
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
|
||||||
if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
|
||||||
handleOrientationChange(Configuration.ORIENTATION_LANDSCAPE)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||||
@ -135,35 +110,4 @@ class DoubleTapPlayerView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateButtonSize(orientation: Int) {
|
|
||||||
val size = (if (orientation == Configuration.ORIENTATION_LANDSCAPE) 45*density else originalExoIconSize).toInt()
|
|
||||||
listOf(R.id.exo_prev, R.id.exo_rew_with_amount, R.id.exo_play_pause, R.id.exo_ffwd_with_amount, R.id.exo_next).forEach {
|
|
||||||
findViewById<View>(it).updateLayoutParams {
|
|
||||||
width = size
|
|
||||||
height = size
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// fix text vertical alignment inside icons
|
|
||||||
val paddingBottom = (if (orientation == Configuration.ORIENTATION_LANDSCAPE) 15*density else originalExoIconPaddingBottom).toInt()
|
|
||||||
listOf(R.id.exo_rew_with_amount, R.id.exo_ffwd_with_amount).forEach {
|
|
||||||
findViewById<Button>(it).updatePadding(bottom = paddingBottom)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleOrientationChange(orientation: Int) {
|
|
||||||
val centerControls = findViewById<LinearLayout>(R.id.exo_center_controls)
|
|
||||||
(centerControls.parent as ViewGroup).removeView(centerControls)
|
|
||||||
findViewById<FrameLayout>(if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
|
||||||
R.id.center_controls_bar
|
|
||||||
} else {
|
|
||||||
R.id.center_controls_external
|
|
||||||
}).addView(centerControls)
|
|
||||||
updateButtonSize(orientation)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
|
||||||
super.onConfigurationChanged(newConfig)
|
|
||||||
handleOrientationChange(newConfig.orientation)
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@id/exo_center_controls"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:background="@android:color/transparent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:padding="@dimen/exo_styled_controls_padding"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:layoutDirection="ltr">
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_prev"
|
|
||||||
style="@style/ExoStyledControls.Button.Center.Previous"/>
|
|
||||||
|
|
||||||
<include layout="@layout/exo_player_control_rewind_button" />
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_play_pause"
|
|
||||||
style="@style/ExoStyledControls.Button.Center.PlayPause"/>
|
|
||||||
|
|
||||||
<include layout="@layout/exo_player_control_ffwd_button" />
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_next"
|
|
||||||
style="@style/ExoStyledControls.Button.Center.Next"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</merge>
|
|
@ -1,148 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright 2020 The Android Open Source Project
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!-- 0dp dimensions are used to prevent this view from influencing the size of
|
|
||||||
the parent view if it uses "wrap_content". It is expanded to occupy the
|
|
||||||
entirety of the parent in code, after the parent's size has been
|
|
||||||
determined. See: https://github.com/google/ExoPlayer/issues/8726.
|
|
||||||
-->
|
|
||||||
<View android:id="@id/exo_controls_background"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:background="@color/exo_black_opacity_60"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/center_controls_external"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|center_horizontal">
|
|
||||||
|
|
||||||
<include layout="@layout/exo_center_controls"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<FrameLayout android:id="@id/exo_bottom_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/exo_styled_bottom_bar_height"
|
|
||||||
android:background="@color/exo_bottom_bar_background"
|
|
||||||
android:layoutDirection="ltr">
|
|
||||||
|
|
||||||
<LinearLayout android:id="@id/exo_time"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="@dimen/exo_styled_bottom_bar_time_padding"
|
|
||||||
android:paddingEnd="@dimen/exo_styled_bottom_bar_time_padding"
|
|
||||||
android:paddingLeft="@dimen/exo_styled_bottom_bar_time_padding"
|
|
||||||
android:paddingRight="@dimen/exo_styled_bottom_bar_time_padding"
|
|
||||||
android:layout_gravity="center_vertical|start"
|
|
||||||
android:layoutDirection="ltr">
|
|
||||||
|
|
||||||
<TextView android:id="@id/exo_position"
|
|
||||||
style="@style/ExoStyledControls.TimeText.Position"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@style/ExoStyledControls.TimeText.Separator"/>
|
|
||||||
|
|
||||||
<TextView android:id="@id/exo_duration"
|
|
||||||
style="@style/ExoStyledControls.TimeText.Duration"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/center_controls_bar"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@id/exo_basic_controls"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical|end"
|
|
||||||
android:layoutDirection="ltr">
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_vr"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.VR"/>
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_shuffle"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.Shuffle"/>
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_repeat_toggle"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.RepeatToggle"/>
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_subtitle"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.CC"/>
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_settings"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.Settings"/>
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_fullscreen"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.FullScreen"/>
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_overflow_show"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.OverflowShow"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<HorizontalScrollView android:id="@id/exo_extra_controls_scroll_view"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical|end"
|
|
||||||
android:visibility="invisible">
|
|
||||||
|
|
||||||
<LinearLayout android:id="@id/exo_extra_controls"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layoutDirection="ltr">
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_overflow_hide"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.OverflowHide"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</HorizontalScrollView>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View android:id="@id/exo_progress_placeholder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/exo_styled_progress_layout_height"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:layout_marginBottom="@dimen/exo_styled_progress_margin_bottom"/>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@id/exo_minimal_controls"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_marginBottom="@dimen/exo_styled_minimal_controls_margin_bottom"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layoutDirection="ltr">
|
|
||||||
|
|
||||||
<ImageButton android:id="@id/exo_minimal_fullscreen"
|
|
||||||
style="@style/ExoStyledControls.Button.Bottom.FullScreen"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</merge>
|
|
Loading…
Reference in New Issue
Block a user