Skip to content

Commit

Permalink
feat: make SpeedIcon and CheckIcon change color according to theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardodalarme committed Jun 8, 2023
1 parent 263f949 commit 1057ca4
Showing 1 changed file with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,96 +1,108 @@
package com.profusion.androidenhancedvideoplayer.components.playerOverlay

import androidx.compose.foundation.Image
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import com.profusion.androidenhancedvideoplayer.R

@Composable
fun PreviousIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_skip_previous),
contentDescription = stringResource(id = R.string.controls_previous_description),
tint = Color.White,
modifier = Modifier.testTag("PreviousIcon")
)
}

@Composable
fun PlayIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_play),
contentDescription = stringResource(id = R.string.controls_play_description),
tint = Color.White,
modifier = Modifier.testTag("PlayIcon")
)
}

@Composable
fun PauseIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_pause),
contentDescription = stringResource(id = R.string.controls_pause_description),
tint = Color.White,
modifier = Modifier.testTag("PauseIcon")
)
}

@Composable
fun NextIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_skip_next),
contentDescription = stringResource(R.string.controls_next_description),
tint = Color.White,
modifier = Modifier.testTag("NextIcon")
)
}

@Composable
fun ReplayIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_replay),
contentDescription = stringResource(id = R.string.controls_replay_description),
tint = Color.White,
modifier = Modifier.testTag("ReplayIcon")
)
}

@Composable
fun FullScreenIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_fullscreen),
contentDescription = stringResource(R.string.controls_fullscreen_description),
tint = Color.White,
modifier = Modifier.testTag("FullScreenIcon")
)
}

@Composable
fun ExitFullScreenIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_exit_fullscreen),
contentDescription = stringResource(R.string.controls_exit_fullscreen_description),
tint = Color.White,
modifier = Modifier.testTag("ExitFullScreenIcon")
)
}

@Composable
fun SettingsIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_settings),
tint = Color.White,
contentDescription = stringResource(R.string.controls_settings_description)
)
}

@Composable
fun SpeedIcon() {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_speed),
tint = MaterialTheme.colorScheme.onPrimaryContainer,
contentDescription = stringResource(R.string.settings_speed_description)
)
}

@Composable
fun CheckIcon(modifier: Modifier = Modifier) {
Image(
Icon(
painter = painterResource(id = R.drawable.ic_check),
tint = MaterialTheme.colorScheme.onPrimaryContainer,
contentDescription = stringResource(R.string.settings_check_description),
modifier = modifier
)
Expand Down

0 comments on commit 1057ca4

Please sign in to comment.