mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Rename PlayerActivity and references to Fragment
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".player.PlayerActivity"
|
||||
android:name=".player.PlayerFragment"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:supportsPictureInPicture="true"
|
||||
|
||||
@@ -7,7 +7,7 @@ import kotlinx.coroutines.channels.Channel
|
||||
import org.jellyfin.mobile.AppPreferences
|
||||
import org.jellyfin.mobile.PLAYER_EVENT_CHANNEL
|
||||
import org.jellyfin.mobile.player.ExoPlayerFormats
|
||||
import org.jellyfin.mobile.player.PlayerActivity
|
||||
import org.jellyfin.mobile.player.PlayerFragment
|
||||
import org.jellyfin.mobile.player.PlayerEvent
|
||||
import org.jellyfin.mobile.settings.VideoPlayerType
|
||||
import org.jellyfin.mobile.utils.Constants
|
||||
@@ -28,7 +28,7 @@ class NativePlayer(private val context: Context) : KoinComponent {
|
||||
|
||||
@JavascriptInterface
|
||||
fun loadPlayer(args: String) {
|
||||
val playerIntent = Intent(context, PlayerActivity::class.java).apply {
|
||||
val playerIntent = Intent(context, PlayerFragment::class.java).apply {
|
||||
action = Constants.ACTION_PLAY_MEDIA
|
||||
putExtra(Constants.EXTRA_MEDIA_SOURCE_ITEM, args)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import androidx.core.view.get
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.size
|
||||
import org.jellyfin.mobile.R
|
||||
import org.jellyfin.mobile.databinding.ActivityPlayerBinding
|
||||
import org.jellyfin.mobile.databinding.FragmentPlayerBinding
|
||||
import org.jellyfin.mobile.databinding.ExoPlayerControlViewBinding
|
||||
import org.jellyfin.mobile.player.source.ExoPlayerTracksGroup
|
||||
import org.jellyfin.mobile.player.source.JellyfinMediaSource
|
||||
@@ -19,8 +19,8 @@ import org.jellyfin.mobile.player.source.JellyfinMediaSource
|
||||
* Provides a menu UI for audio, subtitle and video stream selection
|
||||
*/
|
||||
class PlaybackMenus(
|
||||
private val activity: PlayerActivity,
|
||||
private val playerBinding: ActivityPlayerBinding,
|
||||
private val activity: PlayerFragment,
|
||||
private val playerBinding: FragmentPlayerBinding,
|
||||
private val playerControlsBinding: ExoPlayerControlViewBinding
|
||||
) : PopupMenu.OnDismissListener {
|
||||
private val lockScreenButton: View by playerControlsBinding::lockScreenButton
|
||||
|
||||
+4
-4
@@ -23,8 +23,8 @@ import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
||||
import com.google.android.exoplayer2.ui.PlayerView
|
||||
import org.jellyfin.mobile.AppPreferences
|
||||
import org.jellyfin.mobile.R
|
||||
import org.jellyfin.mobile.databinding.ActivityPlayerBinding
|
||||
import org.jellyfin.mobile.databinding.ExoPlayerControlViewBinding
|
||||
import org.jellyfin.mobile.databinding.FragmentPlayerBinding
|
||||
import org.jellyfin.mobile.utils.*
|
||||
import org.jellyfin.mobile.utils.Constants.DEFAULT_CENTER_OVERLAY_TIMEOUT_MS
|
||||
import org.jellyfin.mobile.utils.Constants.DEFAULT_CONTROLS_TIMEOUT_MS
|
||||
@@ -32,11 +32,11 @@ import org.jellyfin.mobile.utils.Constants.DEFAULT_SEEK_TIME_MS
|
||||
import org.koin.android.ext.android.inject
|
||||
import kotlin.math.abs
|
||||
|
||||
class PlayerActivity : AppCompatActivity() {
|
||||
class PlayerFragment : AppCompatActivity() {
|
||||
|
||||
private val appPreferences: AppPreferences by inject()
|
||||
private val viewModel: PlayerViewModel by viewModels()
|
||||
private lateinit var playerBinding: ActivityPlayerBinding
|
||||
private lateinit var playerBinding: FragmentPlayerBinding
|
||||
private val playerView: PlayerView get() = playerBinding.playerView
|
||||
private val playerOverlay: View get() = playerBinding.playerOverlay
|
||||
private val loadingIndicator: View get() = playerBinding.loadingIndicator
|
||||
@@ -92,7 +92,7 @@ class PlayerActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
playerBinding = ActivityPlayerBinding.inflate(layoutInflater)
|
||||
playerBinding = FragmentPlayerBinding.inflate(layoutInflater)
|
||||
setContentView(playerBinding.root)
|
||||
playerControlsBinding = ExoPlayerControlViewBinding.bind(findViewById(R.id.player_controls))
|
||||
|
||||
@@ -124,7 +124,7 @@ class PlayerNotificationHelper(private val viewModel: PlayerViewModel) : KoinCom
|
||||
}
|
||||
|
||||
private fun buildContentIntent(): PendingIntent {
|
||||
val intent = Intent(context, PlayerActivity::class.java).apply {
|
||||
val intent = Intent(context, PlayerFragment::class.java).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
|
||||
}
|
||||
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
|
||||
Reference in New Issue
Block a user