Skip to content

Add MediaPlayerSample composable and update MainActivity - #46

Open
ClementBobin wants to merge 2 commits into
mainfrom
feat/mediaPlayer
Open

Add MediaPlayerSample composable and update MainActivity#46
ClementBobin wants to merge 2 commits into
mainfrom
feat/mediaPlayer

Conversation

@ClementBobin

Copy link
Copy Markdown
Owner

This pull request updates the sample app to showcase a new media player component and improves the structure and configuration of the sample module. The most important changes include adding a new MediaPlayerSample composable, updating the main activity to use it, and refining the sample app's namespace and configuration.

Sample app improvements:

  • Added a new MediaPlayerSample composable in MediaPlayerSample.kt, which demonstrates the usage of KMediaPlayer with mock data for episodes, playback state, tracks, and quality options. It also simulates playback and provides handlers for player actions.
  • Updated MainActivity.kt to use enableEdgeToEdge, apply the KindlingTheme, and display the new MediaPlayerSample instead of the previous catalog/toaster structure.

Project configuration:

  • Changed the namespace for the sample module to dev.kindling.sample and set minSdk to 23 in build.gradle.kts for better clarity and compatibility.

Copilot AI review requested due to automatic review settings July 31, 2026 13:19
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ClementBobin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c28faec5-1c99-44cf-96a4-22aab3955bf7

📥 Commits

Reviewing files that changed from the base of the PR and between 330cbb3 and 99751ae.

📒 Files selected for processing (4)
  • core/src/androidMain/kotlin/dev/kindling/core/components/prefab/KMediaPlayer.kt
  • sample/build.gradle.kts
  • sample/src/main/kotlin/dev/kindling/sample/MainActivity.kt
  • sample/src/main/kotlin/dev/kindling/sample/MediaPlayerSample.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the :sample Android app to demonstrate a new KMediaPlayer prefab UI by adding a MediaPlayerSample composable, switching MainActivity to render it, and refining the sample module’s Android configuration (namespace/minSdk). It also introduces the new KMediaPlayer implementation and related data models in core’s androidMain source set.

Changes:

  • Added MediaPlayerSample with mock episodes/player state and simulated playback progress.
  • Updated MainActivity to use edge-to-edge + KindlingTheme and show the new sample.
  • Updated the sample module’s namespace and set minSdk = 23; added KMediaPlayer prefab implementation in core.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
sample/src/main/kotlin/dev/kindling/sample/MediaPlayerSample.kt New sample screen wiring KMediaPlayer with mock state and callbacks.
sample/src/main/kotlin/dev/kindling/sample/MainActivity.kt Swaps the sample app entry point to the new media player demo and edge-to-edge setup.
sample/build.gradle.kts Updates sample module namespace and minSdk configuration.
core/src/androidMain/kotlin/dev/kindling/core/components/prefab/KMediaPlayer.kt Adds the new KMediaPlayer prefab UI and associated models/state.
Suppressed comments (1)

core/src/androidMain/kotlin/dev/kindling/core/components/prefab/KMediaPlayer.kt:190

  • val scope = rememberCoroutineScope() is declared but never used. This is dead code and may trigger unused-variable lint rules.
    var showFilterDialog by remember { mutableStateOf(false) }
    val scope = rememberCoroutineScope()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +25
KindlingTheme(colorScheme = lightColorScheme()) {
MediaPlayerSample()
// Toaster must wrap (or sit alongside) the androidMain content
// so it can receive and display toasts from anywhere in the tree.
Surface(modifier = Modifier.fillMaxSize()) {
Box(modifier = Modifier.fillMaxSize()) {
KindlingCatalog()
Toaster() // ← renders toasts on top of everything
}
}
//Surface(modifier = Modifier.fillMaxSize()) {
Comment on lines 9 to 13
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.lightColorScheme
import androidx.compose.ui.Modifier
import dev.kindling.core.components.Toaster
*
* Simulates:
* - a 23m42s episode with a fake playback clock (advances when `isPlaying`)
* - 5 episodes in the list (mirrors the screenshots)
* onBack = { navController.popBackStack() },
* onStateChange = { newState -> viewModel.update(newState) },
* onSeek = { ms -> player.seekTo(ms) },
* onSkip = { ms -> player.seekTo(player.currentPosition + ms * 1000L) },
Comment on lines +28 to +29
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
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.

2 participants