Skip to content

Commit

Permalink
chore(agp): fix nonTransitiveRClass
Browse files Browse the repository at this point in the history
  • Loading branch information
mcatta committed Oct 14, 2023
1 parent 6c66124 commit 963273a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.media.app.NotificationCompat.MediaStyle
import dagger.hilt.android.qualifiers.ApplicationContext
import dev.marcocattaneo.sleep.R
import dev.marcocattaneo.sleep.player.presentation.R as PlayerR
import dev.marcocattaneo.sleep.R as AppR
import dev.marcocattaneo.sleep.player.presentation.AudioPlayer
import javax.inject.Inject

Expand Down Expand Up @@ -62,7 +63,7 @@ class PlayerNotificationManager @Inject constructor(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(
CHANNEL_ID,
context.getString(R.string.app_name),
context.getString(AppR.string.app_name),
NotificationManager.IMPORTANCE_LOW
).apply {
description = "Audio Player"
Expand All @@ -82,22 +83,22 @@ class PlayerNotificationManager @Inject constructor(
cancelable: Boolean
) = NotificationCompat.Builder(context, CHANNEL_ID)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentTitle(context.getString(R.string.app_name))
.setContentTitle(context.getString(AppR.string.app_name))
.setContentIntent(audioPlayer.controller.sessionActivity)
.setDeleteIntent(createPendingIntent(PlayerNotificationService.Action.STOP))
.setSmallIcon(R.mipmap.ic_launcher)
.setSmallIcon(AppR.mipmap.ic_launcher)
.setAutoCancel(cancelable)


fun updateNotification(
isPlaying: Boolean,
) = baseNotification(cancelable = !isPlaying)
.apply {
addAction(NotificationCompat.Action.Builder(R.drawable.ic_baseline_close_24, "Stop", stopPendingIntent).build())
addAction(NotificationCompat.Action.Builder(PlayerR.drawable.ic_baseline_close_24, "Stop", stopPendingIntent).build())
if (isPlaying) {
addAction(NotificationCompat.Action.Builder(R.drawable.ic_baseline_pause_24, "Pause", pausePendingIntent).build())
addAction(NotificationCompat.Action.Builder(PlayerR.drawable.ic_baseline_pause_24, "Pause", pausePendingIntent).build())
} else {
addAction(NotificationCompat.Action.Builder(R.drawable.ic_baseline_play_arrow_24, "Play", playPendingIntent).build())
addAction(NotificationCompat.Action.Builder(PlayerR.drawable.ic_baseline_play_arrow_24, "Play", playPendingIntent).build())
}
}
.setStyle(MediaStyle().setShowActionsInCompactView(1).setMediaSession(audioPlayer.sessionToken))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import dev.marcocattaneo.sleep.catalog.presentation.composables.Illustration
import dev.marcocattaneo.sleep.catalog.presentation.composables.InfoBox
import dev.marcocattaneo.sleep.domain.model.MediaFileEntity
import dev.marcocattaneo.sleep.catalog.presentation.R
import dev.marcocattaneo.sleep.core.design.R as DesignR

/**
* Register the composable function into the NavGraphBuilder
Expand Down Expand Up @@ -137,7 +138,7 @@ private fun MediaItem(
val selected = mediaFile?.selected == true
Icon(
modifier = modifierBaseOnMedia(mediaFile),
painter = painterResource(id = if (selected) R.drawable.ic_baseline_play_circle_filled_24 else R.drawable.ic_baseline_play_circle_outline_24),
painter = painterResource(id = if (selected) R.drawable.ic_baseline_play_circle_filled_24 else DesignR.drawable.ic_baseline_play_circle_outline_24),
contentDescription = mediaFile?.name ?: "Undefined",
tint = if (selected) MaterialTheme.colors.primary else MaterialTheme.colors.secondary
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import dev.marcocattaneo.core.design.composables.*
import dev.marcocattaneo.core.design.theme.Dimen.Margin16
import dev.marcocattaneo.core.design.theme.Dimen.Margin32
import dev.marcocattaneo.core.design.theme.Dimen.Margin8
import dev.marcocattaneo.sleep.player.presentation.R
import dev.marcocattaneo.sleep.player.presentation.R as PlayerR
import dev.marcocattaneo.sleep.core.design.R as DesignR
import kotlin.math.max
import kotlin.time.Duration
import kotlin.time.Duration.Companion.minutes
Expand Down Expand Up @@ -85,7 +86,7 @@ fun BottomPlayerBar(
if (description.isNotEmpty()) {
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
Icon(
painter = painterResource(id = R.drawable.ic_baseline_play_circle_outline_24),
painter = painterResource(id = DesignR.drawable.ic_baseline_play_circle_outline_24),
contentDescription = description,
modifier = Modifier.size(Margin16),
tint = MaterialTheme.colors.primary
Expand All @@ -108,7 +109,7 @@ fun BottomPlayerBar(
verticalAlignment = Alignment.CenterVertically
) {
ActionButton(
painter = painterResource(id = R.drawable.ic_baseline_replay_30_24),
painter = painterResource(id = PlayerR.drawable.ic_baseline_replay_30_24),
internalMargin = 4.dp,
onClick = onClickReplay
)
Expand All @@ -119,7 +120,7 @@ fun BottomPlayerBar(
)
Spacer8()
ActionButton(
painter = painterResource(id = R.drawable.ic_baseline_forward_30_24),
painter = painterResource(id = PlayerR.drawable.ic_baseline_forward_30_24),
internalMargin = 4.dp,
onClick = onClickForward
)
Expand All @@ -139,7 +140,7 @@ fun BottomPlayerBar(
)
}
ActionButton(
painter = painterResource(id = R.drawable.ic_baseline_access_alarm_24),
painter = painterResource(id = PlayerR.drawable.ic_baseline_access_alarm_24),
modifier = Modifier.semantics { contentDescription = "Change timer" },
onClick = { timerVisible = !timerVisible }
)
Expand All @@ -150,7 +151,7 @@ fun BottomPlayerBar(
.align(Alignment.CenterStart)
) {
ActionButton(
painter = painterResource(id = R.drawable.ic_baseline_close_24),
painter = painterResource(id = PlayerR.drawable.ic_baseline_close_24),
onClick = onClickStop
)
}
Expand Down Expand Up @@ -206,7 +207,7 @@ private fun PlayButton(
.size(48.dp)
.padding(Margin8),
tint = MaterialTheme.colors.background,
painter = painterResource(id = if (isPlaying) R.drawable.ic_baseline_pause_24 else R.drawable.ic_baseline_play_arrow_24),
painter = painterResource(id = if (isPlaying) PlayerR.drawable.ic_baseline_pause_24 else PlayerR.drawable.ic_baseline_play_arrow_24),
contentDescription = null
)
}
Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.caching=true
# Config
sleep.jvm.version=11
sleep.jvm.warning-as-error=false
android.nonTransitiveRClass=false
sleep.jvm.version=17
sleep.jvm.warning-as-error=false

0 comments on commit 963273a

Please sign in to comment.