add missing play button functionality for highlight media in HomeFragment

This commit is contained in:
2022-09-20 19:47:42 +02:00
parent 34c7f9d081
commit d3fe81224b
3 changed files with 56 additions and 38 deletions

View File

@ -9,6 +9,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.commit
import org.mosad.teapod.R
import org.mosad.teapod.ui.activity.player.PlayerActivity
import kotlin.system.exitProcess
/**
@ -24,6 +25,20 @@ fun FragmentActivity.showFragment(fragment: Fragment) {
}
}
/**
* Start the player as new activity.
*
* @param seasonId The ID of the season the episode to be played is in
* @param episodeId The ID of the episode to play
*/
fun Activity.startPlayer(seasonId: String, episodeId: String) {
val intent = Intent(this, PlayerActivity::class.java).apply {
putExtra(getString(R.string.intent_season_id), seasonId)
putExtra(getString(R.string.intent_episode_id), episodeId)
}
startActivity(intent)
}
/**
* hide the status and navigation bar
*/