调整整体 UI, 整洁深/浅色主题切换
This commit is contained in:
parent
13b3a50223
commit
5b04b62753
@ -4,6 +4,7 @@ import android.os.Bundle
|
|||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
@ -20,20 +21,24 @@ import androidx.navigation.compose.composable
|
|||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
import androidx.navigation.navArgument
|
import androidx.navigation.navArgument
|
||||||
import com.audio.vibe.data.local.LanguagePreferences
|
import com.audio.vibe.data.local.LanguagePreferences
|
||||||
|
import com.audio.vibe.data.local.ThemePreferences
|
||||||
import com.audio.vibe.ui.cutter.AudioCutterScreen
|
import com.audio.vibe.ui.cutter.AudioCutterScreen
|
||||||
import com.audio.vibe.ui.editor.TagEditorScreen
|
import com.audio.vibe.ui.editor.TagEditorScreen
|
||||||
import com.audio.vibe.ui.home.HomeScreen
|
import com.audio.vibe.ui.components.currentVibeToastStyle
|
||||||
|
import com.audio.vibe.ui.components.showVibeToast
|
||||||
import com.audio.vibe.ui.i18n.AppLanguage
|
import com.audio.vibe.ui.i18n.AppLanguage
|
||||||
import com.audio.vibe.ui.i18n.LocalAppStrings
|
import com.audio.vibe.ui.i18n.LocalAppStrings
|
||||||
import com.audio.vibe.ui.i18n.LocalResolvedLanguage
|
import com.audio.vibe.ui.i18n.LocalResolvedLanguage
|
||||||
import com.audio.vibe.ui.i18n.LocalSelectedLanguage
|
import com.audio.vibe.ui.i18n.LocalSelectedLanguage
|
||||||
import com.audio.vibe.ui.i18n.resolveLanguage
|
import com.audio.vibe.ui.i18n.resolveLanguage
|
||||||
import com.audio.vibe.ui.i18n.stringsFor
|
import com.audio.vibe.ui.i18n.stringsFor
|
||||||
import com.audio.vibe.ui.musicmanager.MusicManagerScreen
|
import com.audio.vibe.ui.home.MusicManagerScreen
|
||||||
import com.audio.vibe.ui.player.PlayerScreen
|
import com.audio.vibe.ui.player.PlayerScreen
|
||||||
import com.audio.vibe.ui.premium.PremiumScreen
|
import com.audio.vibe.ui.premium.PremiumScreen
|
||||||
import com.audio.vibe.ui.settings.SettingsScreen
|
import com.audio.vibe.ui.settings.SettingsScreen
|
||||||
|
import com.audio.vibe.ui.theme.AppThemeMode
|
||||||
import com.audio.vibe.ui.theme.AudioVibeTheme
|
import com.audio.vibe.ui.theme.AudioVibeTheme
|
||||||
|
import com.audio.vibe.ui.theme.resolveDarkTheme
|
||||||
import com.audio.vibe.ui.soundeffects.SoundEffectsScreen
|
import com.audio.vibe.ui.soundeffects.SoundEffectsScreen
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@ -42,12 +47,10 @@ class MainActivity : ComponentActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
setContent {
|
setContent {
|
||||||
AudioVibeTheme {
|
|
||||||
AudioVibeAppRoot()
|
AudioVibeAppRoot()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun AudioVibeAppRoot() {
|
private fun AudioVibeAppRoot() {
|
||||||
@ -55,15 +58,22 @@ private fun AudioVibeAppRoot() {
|
|||||||
val languagePreferences = remember(context) {
|
val languagePreferences = remember(context) {
|
||||||
LanguagePreferences(context.applicationContext)
|
LanguagePreferences(context.applicationContext)
|
||||||
}
|
}
|
||||||
|
val themePreferences = remember(context) {
|
||||||
|
ThemePreferences(context.applicationContext)
|
||||||
|
}
|
||||||
val selectedLanguage by languagePreferences.selectedLanguage.collectAsState(initial = AppLanguage.System)
|
val selectedLanguage by languagePreferences.selectedLanguage.collectAsState(initial = AppLanguage.System)
|
||||||
|
val selectedThemeMode by themePreferences.selectedThemeMode.collectAsState(initial = AppThemeMode.Light)
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val configuration = LocalConfiguration.current
|
val configuration = LocalConfiguration.current
|
||||||
val systemLocale = configuration.locales[0]
|
val systemLocale = configuration.locales[0]
|
||||||
val resolvedLanguage = resolveLanguage(selectedLanguage, systemLocale)
|
val resolvedLanguage = resolveLanguage(selectedLanguage, systemLocale)
|
||||||
|
val systemDark = isSystemInDarkTheme()
|
||||||
|
val darkTheme = selectedThemeMode.resolveDarkTheme(systemDark)
|
||||||
val strings = remember(context, resolvedLanguage) {
|
val strings = remember(context, resolvedLanguage) {
|
||||||
stringsFor(context, resolvedLanguage)
|
stringsFor(context, resolvedLanguage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioVibeTheme(darkTheme = darkTheme) {
|
||||||
CompositionLocalProvider(
|
CompositionLocalProvider(
|
||||||
LocalSelectedLanguage provides selectedLanguage,
|
LocalSelectedLanguage provides selectedLanguage,
|
||||||
LocalResolvedLanguage provides resolvedLanguage,
|
LocalResolvedLanguage provides resolvedLanguage,
|
||||||
@ -75,30 +85,32 @@ private fun AudioVibeAppRoot() {
|
|||||||
scope.launch {
|
scope.launch {
|
||||||
languagePreferences.setSelectedLanguage(language)
|
languagePreferences.setSelectedLanguage(language)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
selectedThemeMode = selectedThemeMode,
|
||||||
|
onThemeModeSelected = { themeMode ->
|
||||||
|
scope.launch {
|
||||||
|
themePreferences.setSelectedThemeMode(themeMode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AppNavHost(
|
fun AppNavHost(
|
||||||
navController: NavHostController = rememberNavController(),
|
navController: NavHostController = rememberNavController(),
|
||||||
selectedLanguage: AppLanguage = AppLanguage.System,
|
selectedLanguage: AppLanguage = AppLanguage.System,
|
||||||
onLanguageSelected: (AppLanguage) -> Unit = {}
|
onLanguageSelected: (AppLanguage) -> Unit = {},
|
||||||
|
selectedThemeMode: AppThemeMode = AppThemeMode.Light,
|
||||||
|
onThemeModeSelected: (AppThemeMode) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val toastStyle = currentVibeToastStyle()
|
||||||
NavHost(
|
NavHost(
|
||||||
navController = navController,
|
navController = navController,
|
||||||
startDestination = "home"
|
startDestination = "music"
|
||||||
) {
|
) {
|
||||||
composable("home") {
|
|
||||||
HomeScreen(
|
|
||||||
toSoundEffects = { navController.navigate("effects") },
|
|
||||||
toCutter = { navController.navigate("cutter") },
|
|
||||||
toMusicManager = { navController.navigate("music") },
|
|
||||||
toSettings = { navController.navigate("settings") },
|
|
||||||
toPremium = { navController.navigate("premium") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
composable(
|
composable(
|
||||||
route = "editor/{trackId}",
|
route = "editor/{trackId}",
|
||||||
arguments = listOf(navArgument("trackId") { type = NavType.LongType })
|
arguments = listOf(navArgument("trackId") { type = NavType.LongType })
|
||||||
@ -111,14 +123,22 @@ fun AppNavHost(
|
|||||||
composable("effects") {
|
composable("effects") {
|
||||||
SoundEffectsScreen(
|
SoundEffectsScreen(
|
||||||
onBack = { navController.popBackStack() },
|
onBack = { navController.popBackStack() },
|
||||||
toHome = { navController.navigate("home") },
|
toHome = { navController.navigate("music") },
|
||||||
toTags = { navController.navigate("music") }
|
toTags = { navController.navigate("music") }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable("cutter") { AudioCutterScreen(onBack = { navController.popBackStack() }) }
|
composable("cutter") { AudioCutterScreen(onBack = { navController.popBackStack() }) }
|
||||||
composable("music") {
|
composable("music") {
|
||||||
MusicManagerScreen(
|
MusicManagerScreen(
|
||||||
onBack = { navController.popBackStack() },
|
onBack = null,
|
||||||
|
toSoundEffects = {
|
||||||
|
showVibeToast(
|
||||||
|
context = context,
|
||||||
|
message = context.getString(R.string.temporarily_unavailable),
|
||||||
|
style = toastStyle
|
||||||
|
)
|
||||||
|
},
|
||||||
|
toSettings = { navController.navigate("settings") },
|
||||||
toEditor = { trackId -> navController.navigate("editor/$trackId") },
|
toEditor = { trackId -> navController.navigate("editor/$trackId") },
|
||||||
toPlayer = { navController.navigate("player") }
|
toPlayer = { navController.navigate("player") }
|
||||||
)
|
)
|
||||||
@ -131,7 +151,9 @@ fun AppNavHost(
|
|||||||
onBack = { navController.popBackStack() },
|
onBack = { navController.popBackStack() },
|
||||||
toPremium = { navController.navigate("premium") },
|
toPremium = { navController.navigate("premium") },
|
||||||
selectedLanguage = selectedLanguage,
|
selectedLanguage = selectedLanguage,
|
||||||
onLanguageSelected = onLanguageSelected
|
onLanguageSelected = onLanguageSelected,
|
||||||
|
selectedThemeMode = selectedThemeMode,
|
||||||
|
onThemeModeSelected = onThemeModeSelected
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable("premium") { PremiumScreen(onBack = { navController.popBackStack() }) }
|
composable("premium") { PremiumScreen(onBack = { navController.popBackStack() }) }
|
||||||
|
|||||||
@ -0,0 +1,45 @@
|
|||||||
|
package com.audio.vibe.data.local
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.datastore.core.DataStore
|
||||||
|
import androidx.datastore.preferences.core.Preferences
|
||||||
|
import androidx.datastore.preferences.core.edit
|
||||||
|
import androidx.datastore.preferences.core.emptyPreferences
|
||||||
|
import androidx.datastore.preferences.core.stringPreferencesKey
|
||||||
|
import androidx.datastore.preferences.preferencesDataStore
|
||||||
|
import com.audio.vibe.ui.theme.AppThemeMode
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.catch
|
||||||
|
import kotlinx.coroutines.flow.map
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
|
private val Context.themeDataStore: DataStore<Preferences> by preferencesDataStore(
|
||||||
|
name = "theme_preferences"
|
||||||
|
)
|
||||||
|
|
||||||
|
class ThemePreferences(
|
||||||
|
private val context: Context
|
||||||
|
) {
|
||||||
|
val selectedThemeMode: Flow<AppThemeMode> = context.themeDataStore.data
|
||||||
|
.catch { error ->
|
||||||
|
if (error is IOException) {
|
||||||
|
emit(emptyPreferences())
|
||||||
|
} else {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.map { preferences ->
|
||||||
|
val storedValue = preferences[SelectedThemeModeKey]
|
||||||
|
AppThemeMode.entries.firstOrNull { it.name == storedValue } ?: AppThemeMode.Light
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun setSelectedThemeMode(themeMode: AppThemeMode) {
|
||||||
|
context.themeDataStore.edit { preferences ->
|
||||||
|
preferences[SelectedThemeModeKey] = themeMode.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
val SelectedThemeModeKey = stringPreferencesKey("selected_theme_mode")
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,6 +17,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@ -35,6 +36,9 @@ import androidx.compose.material3.Icon
|
|||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.Immutable
|
||||||
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
|
import androidx.compose.runtime.staticCompositionLocalOf
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
@ -57,19 +61,85 @@ import com.audio.vibe.ui.i18n.LocalAppStrings
|
|||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
@Immutable
|
||||||
|
data class AudioVibePalette(
|
||||||
|
val primary: Color,
|
||||||
|
val primarySoft: Color,
|
||||||
|
val background: Color,
|
||||||
|
val surface: Color,
|
||||||
|
val ink: Color,
|
||||||
|
val muted: Color,
|
||||||
|
val line: Color,
|
||||||
|
val success: Color,
|
||||||
|
val warning: Color
|
||||||
|
)
|
||||||
|
|
||||||
|
val LightAudioVibePalette = AudioVibePalette(
|
||||||
|
primary = Color(0xFF0F68D8),
|
||||||
|
primarySoft = Color(0xFFEAF2FF),
|
||||||
|
background = Color(0xFFF6F8FB),
|
||||||
|
surface = Color.White,
|
||||||
|
ink = Color(0xFF111827),
|
||||||
|
muted = Color(0xFF737D8C),
|
||||||
|
line = Color(0xFFDDE5F0),
|
||||||
|
success = Color(0xFF20B868),
|
||||||
|
warning = Color(0xFFF3A333)
|
||||||
|
)
|
||||||
|
|
||||||
|
val DarkAudioVibePalette = AudioVibePalette(
|
||||||
|
primary = Color(0xFF6EA8FF),
|
||||||
|
primarySoft = Color(0xFF182B49),
|
||||||
|
background = Color(0xFF101827),
|
||||||
|
surface = Color(0xFF1D263A),
|
||||||
|
ink = Color(0xFFF6F8FB),
|
||||||
|
muted = Color(0xFFAAB4C3),
|
||||||
|
line = Color(0xFF344056),
|
||||||
|
success = Color(0xFF35D37F),
|
||||||
|
warning = Color(0xFFFFC164)
|
||||||
|
)
|
||||||
|
|
||||||
|
val LocalAudioVibePalette = staticCompositionLocalOf { LightAudioVibePalette }
|
||||||
|
|
||||||
object AudioVibeColors {
|
object AudioVibeColors {
|
||||||
val Primary = Color(0xFF356EF5)
|
val Primary: Color
|
||||||
val PrimarySoft = Color(0xFFE8F0FF)
|
@Composable
|
||||||
val Background = Color(0xFFF7FAFF)
|
@ReadOnlyComposable
|
||||||
val Surface = Color.White
|
get() = LocalAudioVibePalette.current.primary
|
||||||
val Ink = Color(0xFF101521)
|
val PrimarySoft: Color
|
||||||
val Muted = Color(0xFF748095)
|
@Composable
|
||||||
val Line = Color(0xFFE3E9F2)
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.primarySoft
|
||||||
|
val Background: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.background
|
||||||
|
val Surface: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.surface
|
||||||
|
val Ink: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.ink
|
||||||
|
val Muted: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.muted
|
||||||
|
val Line: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.line
|
||||||
val Dark = Color(0xFF101827)
|
val Dark = Color(0xFF101827)
|
||||||
val DarkPanel = Color(0xFF1D263A)
|
val DarkPanel = Color(0xFF1D263A)
|
||||||
val Success = Color(0xFF20B868)
|
val Success: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.success
|
||||||
val Purple = Color(0xFF7B61FF)
|
val Purple = Color(0xFF7B61FF)
|
||||||
val Warning = Color(0xFFF3A333)
|
val Warning: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = LocalAudioVibePalette.current.warning
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@ -91,7 +161,11 @@ fun VibeScreen(
|
|||||||
.background(bg)
|
.background(bg)
|
||||||
|
|
||||||
) {
|
) {
|
||||||
Spacer(Modifier.height(10.dp))
|
Spacer(
|
||||||
|
Modifier
|
||||||
|
.statusBarsPadding()
|
||||||
|
|
||||||
|
)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@ -344,17 +418,20 @@ fun VoiceDial(
|
|||||||
dark: Boolean = false,
|
dark: Boolean = false,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
) {
|
) {
|
||||||
|
val dialFill = if (dark) AudioVibeColors.DarkPanel else AudioVibeColors.PrimarySoft
|
||||||
|
val dialTrack = AudioVibeColors.Line.copy(alpha = if (dark) .22f else 1f)
|
||||||
|
val dialPrimary = AudioVibeColors.Primary
|
||||||
Box(modifier, contentAlignment = Alignment.Center) {
|
Box(modifier, contentAlignment = Alignment.Center) {
|
||||||
Canvas(Modifier.fillMaxSize()) {
|
Canvas(Modifier.fillMaxSize()) {
|
||||||
val strokeWidth = 24.dp.toPx()
|
val strokeWidth = 24.dp.toPx()
|
||||||
val inset = strokeWidth / 2
|
val inset = strokeWidth / 2
|
||||||
val arcSize = Size(size.width - strokeWidth, size.height - strokeWidth)
|
val arcSize = Size(size.width - strokeWidth, size.height - strokeWidth)
|
||||||
drawCircle(
|
drawCircle(
|
||||||
color = if (dark) AudioVibeColors.DarkPanel else AudioVibeColors.PrimarySoft,
|
color = dialFill,
|
||||||
radius = size.minDimension / 2
|
radius = size.minDimension / 2
|
||||||
)
|
)
|
||||||
drawArc(
|
drawArc(
|
||||||
color = AudioVibeColors.Line.copy(alpha = if (dark) .22f else 1f),
|
color = dialTrack,
|
||||||
startAngle = 130f,
|
startAngle = 130f,
|
||||||
sweepAngle = 280f,
|
sweepAngle = 280f,
|
||||||
useCenter = false,
|
useCenter = false,
|
||||||
@ -365,9 +442,9 @@ fun VoiceDial(
|
|||||||
drawArc(
|
drawArc(
|
||||||
brush = Brush.sweepGradient(
|
brush = Brush.sweepGradient(
|
||||||
listOf(
|
listOf(
|
||||||
AudioVibeColors.Primary,
|
dialPrimary,
|
||||||
AudioVibeColors.Primary.copy(alpha = .5f),
|
dialPrimary.copy(alpha = .5f),
|
||||||
AudioVibeColors.Primary
|
dialPrimary
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
startAngle = 130f,
|
startAngle = 130f,
|
||||||
|
|||||||
@ -1,19 +1,71 @@
|
|||||||
package com.audio.vibe.ui.components
|
package com.audio.vibe.ui.components
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.graphics.Typeface
|
||||||
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.FrameLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.toArgb
|
||||||
|
|
||||||
|
data class VibeToastStyle(
|
||||||
|
val background: Color,
|
||||||
|
val content: Color,
|
||||||
|
val border: Color
|
||||||
|
)
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
fun currentVibeToastStyle(): VibeToastStyle {
|
||||||
|
return VibeToastStyle(
|
||||||
|
background = AudioVibeColors.Surface,
|
||||||
|
content = AudioVibeColors.Ink,
|
||||||
|
border = AudioVibeColors.Line
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun showPlaybackToast(
|
fun showPlaybackToast(
|
||||||
context: Context,
|
context: Context,
|
||||||
message: String,
|
message: String,
|
||||||
maxLines: Int = 10
|
maxLines: Int = 10,
|
||||||
|
style: VibeToastStyle? = null
|
||||||
|
) {
|
||||||
|
showVibeToast(
|
||||||
|
context = context,
|
||||||
|
message = message,
|
||||||
|
duration = Toast.LENGTH_SHORT,
|
||||||
|
maxLines = maxLines,
|
||||||
|
style = style
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showVibeToast(
|
||||||
|
context: Context,
|
||||||
|
message: String,
|
||||||
|
duration: Int = Toast.LENGTH_SHORT,
|
||||||
|
maxLines: Int = 3,
|
||||||
|
style: VibeToastStyle? = null
|
||||||
) {
|
) {
|
||||||
val text = message.limitLogicalLines(maxLines)
|
val text = message.limitLogicalLines(maxLines)
|
||||||
Toast.makeText(context, text, Toast.LENGTH_SHORT).apply {
|
if (style == null) {
|
||||||
|
Toast.makeText(context, text, duration).apply {
|
||||||
limitTextLines(maxLines)
|
limitTextLines(maxLines)
|
||||||
}.show()
|
}.show()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
Toast(context.applicationContext).apply {
|
||||||
|
this.duration = duration
|
||||||
|
setGravity(Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL, 0, 88.dp(context))
|
||||||
|
view = createToastView(context, text, maxLines, style)
|
||||||
|
}.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
@ -24,6 +76,45 @@ private fun Toast.limitTextLines(maxLines: Int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun createToastView(
|
||||||
|
context: Context,
|
||||||
|
text: String,
|
||||||
|
maxLines: Int,
|
||||||
|
style: VibeToastStyle
|
||||||
|
): TextView {
|
||||||
|
val horizontalPadding = 18.dp(context)
|
||||||
|
val verticalPadding = 12.dp(context)
|
||||||
|
val background = GradientDrawable().apply {
|
||||||
|
shape = GradientDrawable.RECTANGLE
|
||||||
|
cornerRadius = 14.dp(context).toFloat()
|
||||||
|
setColor(style.background.toArgb())
|
||||||
|
setStroke(1.dp(context), style.border.toArgb())
|
||||||
|
}
|
||||||
|
return TextView(context).apply {
|
||||||
|
this.text = text
|
||||||
|
setTextColor(style.content.toArgb())
|
||||||
|
textSize = 14f
|
||||||
|
typeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)
|
||||||
|
this.maxLines = maxLines
|
||||||
|
ellipsize = TextUtils.TruncateAt.END
|
||||||
|
gravity = Gravity.CENTER
|
||||||
|
includeFontPadding = false
|
||||||
|
setPadding(horizontalPadding, verticalPadding, horizontalPadding, verticalPadding)
|
||||||
|
this.background = background
|
||||||
|
layoutParams = FrameLayout.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
|
Gravity.CENTER
|
||||||
|
)
|
||||||
|
maxWidth = context.resources.displayMetrics.widthPixels - 48.dp(context)
|
||||||
|
elevation = 10.dp(context).toFloat()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Int.dp(context: Context): Int {
|
||||||
|
return (this * context.resources.displayMetrics.density + 0.5f).toInt()
|
||||||
|
}
|
||||||
|
|
||||||
private fun String.limitLogicalLines(maxLines: Int): String {
|
private fun String.limitLogicalLines(maxLines: Int): String {
|
||||||
if (maxLines <= 0) return ""
|
if (maxLines <= 0) return ""
|
||||||
val lines = lines()
|
val lines = lines()
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import android.content.pm.PackageManager
|
|||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.result.IntentSenderRequest
|
import androidx.activity.result.IntentSenderRequest
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
@ -84,6 +83,8 @@ import com.audio.vibe.ui.components.AudioVibeColors
|
|||||||
import com.audio.vibe.ui.components.SecondaryButton
|
import com.audio.vibe.ui.components.SecondaryButton
|
||||||
import com.audio.vibe.ui.components.VibeCard
|
import com.audio.vibe.ui.components.VibeCard
|
||||||
import com.audio.vibe.ui.components.VibeScreen
|
import com.audio.vibe.ui.components.VibeScreen
|
||||||
|
import com.audio.vibe.ui.components.currentVibeToastStyle
|
||||||
|
import com.audio.vibe.ui.components.showVibeToast
|
||||||
import com.audio.vibe.ui.i18n.LocalAppStrings
|
import com.audio.vibe.ui.i18n.LocalAppStrings
|
||||||
import com.audio.vibe.ui.player.CoverImage
|
import com.audio.vibe.ui.player.CoverImage
|
||||||
import com.audio.vibe.ui.player.invalidateAudioCoverCache
|
import com.audio.vibe.ui.player.invalidateAudioCoverCache
|
||||||
@ -106,6 +107,7 @@ fun TagEditorScreen(trackId: Long, onBack: () -> Unit = {}) {
|
|||||||
)
|
)
|
||||||
val uiState by viewModel.uiState.collectAsState()
|
val uiState by viewModel.uiState.collectAsState()
|
||||||
val strings = LocalAppStrings.current
|
val strings = LocalAppStrings.current
|
||||||
|
val toastStyle = currentVibeToastStyle()
|
||||||
val writePermissionLauncher = rememberLauncherForActivityResult(
|
val writePermissionLauncher = rememberLauncherForActivityResult(
|
||||||
contract = ActivityResultContracts.StartIntentSenderForResult(),
|
contract = ActivityResultContracts.StartIntentSenderForResult(),
|
||||||
onResult = {
|
onResult = {
|
||||||
@ -137,7 +139,12 @@ fun TagEditorScreen(trackId: Long, onBack: () -> Unit = {}) {
|
|||||||
|
|
||||||
LaunchedEffect(uiState.message) {
|
LaunchedEffect(uiState.message) {
|
||||||
val message = uiState.message ?: return@LaunchedEffect
|
val message = uiState.message ?: return@LaunchedEffect
|
||||||
Toast.makeText(context, message, Toast.LENGTH_LONG).show()
|
showVibeToast(
|
||||||
|
context = context,
|
||||||
|
message = message,
|
||||||
|
duration = android.widget.Toast.LENGTH_LONG,
|
||||||
|
style = toastStyle
|
||||||
|
)
|
||||||
viewModel.consumeMessage()
|
viewModel.consumeMessage()
|
||||||
}
|
}
|
||||||
LaunchedEffect(uiState.writePermissionIntentSender) {
|
LaunchedEffect(uiState.writePermissionIntentSender) {
|
||||||
@ -560,7 +567,7 @@ private fun CoverTargetOption(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.height(44.dp)
|
.height(44.dp)
|
||||||
.clip(shape)
|
.clip(shape)
|
||||||
.background(if (selected) AudioVibeColors.PrimarySoft else Color.White)
|
.background(if (selected) AudioVibeColors.PrimarySoft else AudioVibeColors.Surface)
|
||||||
.border(
|
.border(
|
||||||
1.dp,
|
1.dp,
|
||||||
if (selected) AudioVibeColors.Primary.copy(alpha = 0.36f) else AudioVibeColors.Line,
|
if (selected) AudioVibeColors.Primary.copy(alpha = 0.36f) else AudioVibeColors.Line,
|
||||||
@ -631,7 +638,8 @@ private fun InfoRow(label: String, value: String) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(12.dp))
|
.clip(RoundedCornerShape(12.dp))
|
||||||
.background(Color.White.copy(alpha = 0.72f))
|
.background(AudioVibeColors.Surface)
|
||||||
|
.border(1.dp, AudioVibeColors.Line, RoundedCornerShape(12.dp))
|
||||||
.padding(horizontal = 12.dp, vertical = 10.dp),
|
.padding(horizontal = 12.dp, vertical = 10.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
@ -662,7 +670,12 @@ private fun SaveBar(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
.clip(RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp))
|
||||||
.background(Color.White.copy(alpha = 0.94f))
|
.background(AudioVibeColors.Surface)
|
||||||
|
.border(
|
||||||
|
1.dp,
|
||||||
|
AudioVibeColors.Line,
|
||||||
|
RoundedCornerShape(topStart = 22.dp, topEnd = 22.dp)
|
||||||
|
)
|
||||||
.padding(14.dp),
|
.padding(14.dp),
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
|||||||
@ -1,247 +0,0 @@
|
|||||||
package com.audio.vibe.ui.home
|
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.clickable
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.Row
|
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.foundation.layout.size
|
|
||||||
import androidx.compose.foundation.rememberScrollState
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.foundation.verticalScroll
|
|
||||||
import androidx.compose.material.icons.Icons
|
|
||||||
import androidx.compose.material.icons.filled.HelpOutline
|
|
||||||
import androidx.compose.material.icons.filled.Person
|
|
||||||
import androidx.compose.material.icons.filled.Settings
|
|
||||||
import androidx.compose.material3.Icon
|
|
||||||
import androidx.compose.material3.IconButton
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.Immutable
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.draw.clip
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
|
||||||
import androidx.compose.ui.res.stringResource
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import com.audio.vibe.BuildConfig
|
|
||||||
import com.audio.vibe.R
|
|
||||||
import com.audio.vibe.ui.components.AudioVibeColors
|
|
||||||
import com.audio.vibe.ui.components.BannerAdView
|
|
||||||
import com.audio.vibe.ui.components.HomeFeatureIcons
|
|
||||||
import com.audio.vibe.ui.components.PrimaryButton
|
|
||||||
import com.audio.vibe.ui.components.RoundIcon
|
|
||||||
import com.audio.vibe.ui.components.VibeCard
|
|
||||||
import com.audio.vibe.ui.components.VibeScreen
|
|
||||||
import com.audio.vibe.ui.i18n.LocalAppStrings
|
|
||||||
import com.audio.vibe.ui.theme.AudioVibeTheme
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun HomeScreen(
|
|
||||||
toSoundEffects: () -> Unit,
|
|
||||||
toCutter: () -> Unit,
|
|
||||||
toMusicManager: () -> Unit,
|
|
||||||
toSettings: () -> Unit,
|
|
||||||
toPremium: () -> Unit
|
|
||||||
) {
|
|
||||||
val strings = LocalAppStrings.current
|
|
||||||
val uiState = rememberHomeUiState(
|
|
||||||
toSoundEffects = toSoundEffects,
|
|
||||||
toCutter = toCutter,
|
|
||||||
toMusicManager = toMusicManager
|
|
||||||
)
|
|
||||||
|
|
||||||
VibeScreen(
|
|
||||||
title = strings.appName,
|
|
||||||
actions = {
|
|
||||||
IconButton(onClick = toSettings) {
|
|
||||||
Icon(
|
|
||||||
Icons.Default.Settings,
|
|
||||||
contentDescription = strings.settings,
|
|
||||||
tint = Color.White
|
|
||||||
)
|
|
||||||
}
|
|
||||||
// IconButton(onClick = toPremium) {
|
|
||||||
// Icon(Icons.Default.Person, contentDescription = strings.premium, tint = Color.White)
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
dark = true,
|
|
||||||
titleCentered = false
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxSize()
|
|
||||||
.padding(horizontal = 20.dp)
|
|
||||||
.verticalScroll(rememberScrollState()),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(18.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = uiState.tagline,
|
|
||||||
color = Color(0xFFADB8CC),
|
|
||||||
fontSize = 14.sp
|
|
||||||
)
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
modifier = Modifier.fillMaxWidth()
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = strings.coreTools,
|
|
||||||
color = Color.White,
|
|
||||||
fontSize = 20.sp,
|
|
||||||
fontWeight = FontWeight.Bold
|
|
||||||
)
|
|
||||||
Spacer(Modifier.weight(1f))
|
|
||||||
}
|
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
|
|
||||||
uiState.features.chunked(2).forEachIndexed { rowIndex, row ->
|
|
||||||
Row(
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
|
||||||
modifier = Modifier.fillMaxWidth()
|
|
||||||
) {
|
|
||||||
row.forEachIndexed { index, feature ->
|
|
||||||
CoreFeatureCard(
|
|
||||||
feature = feature,
|
|
||||||
icon = HomeFeatureIcons[rowIndex * 2 + index],
|
|
||||||
selected = false,
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (BuildConfig.GOOGLE_PLAY) {
|
|
||||||
// Spacer(modifier = Modifier.height(24.dp))
|
|
||||||
// BannerAdView(modifier = Modifier.fillMaxWidth())
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun rememberHomeUiState(
|
|
||||||
toSoundEffects: () -> Unit,
|
|
||||||
toCutter: () -> Unit,
|
|
||||||
toMusicManager: () -> Unit
|
|
||||||
): HomeUiState {
|
|
||||||
val strings = LocalAppStrings.current
|
|
||||||
return remember(strings, toSoundEffects, toCutter, toMusicManager) {
|
|
||||||
HomeUiState(
|
|
||||||
tagline = strings.homeTagline,
|
|
||||||
features = listOf(
|
|
||||||
HomeFeature(strings.soundEffects, strings.soundEffectsSubtitle, toSoundEffects, enabled = false),
|
|
||||||
// HomeFeature(strings.audioCutter, strings.audioCutterSubtitle, toCutter),
|
|
||||||
HomeFeature(strings.musicManager, strings.musicManagerSubtitle, toMusicManager)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun CoreFeatureCard(
|
|
||||||
feature: HomeFeature,
|
|
||||||
icon: ImageVector,
|
|
||||||
selected: Boolean,
|
|
||||||
modifier: Modifier = Modifier
|
|
||||||
) {
|
|
||||||
val unavailableText = stringResource(R.string.temporarily_unavailable)
|
|
||||||
val fill = when {
|
|
||||||
!feature.enabled -> Color(0xFFE8E8E8)
|
|
||||||
selected -> AudioVibeColors.Primary
|
|
||||||
else -> AudioVibeColors.Surface
|
|
||||||
}
|
|
||||||
val titleColor = when {
|
|
||||||
!feature.enabled -> Color(0xFFBBBBBB)
|
|
||||||
selected -> Color.White
|
|
||||||
else -> AudioVibeColors.Ink
|
|
||||||
}
|
|
||||||
val subtitleColor = when {
|
|
||||||
!feature.enabled -> Color(0xFFCCCCCC)
|
|
||||||
selected -> Color(0xFFDCE7FF)
|
|
||||||
else -> AudioVibeColors.Muted
|
|
||||||
}
|
|
||||||
val iconTint = if (!feature.enabled) Color(0xFFCCCCCC) else AudioVibeColors.Primary
|
|
||||||
val iconBg = if (!feature.enabled) Color(0xFFF0F0F0) else if (selected) Color.White else AudioVibeColors.PrimarySoft
|
|
||||||
VibeCard(
|
|
||||||
selected = selected,
|
|
||||||
onClick = if (feature.enabled) feature.onClick else null,
|
|
||||||
modifier = modifier
|
|
||||||
.height(132.dp)
|
|
||||||
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
verticalArrangement = Arrangement.SpaceBetween,
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxSize()
|
|
||||||
.clip(RoundedCornerShape(14.dp))
|
|
||||||
.background(fill)
|
|
||||||
.padding(14.dp)
|
|
||||||
) {
|
|
||||||
RoundIcon(
|
|
||||||
icon = icon,
|
|
||||||
contentDescription = feature.title,
|
|
||||||
tint = iconTint,
|
|
||||||
background = iconBg
|
|
||||||
)
|
|
||||||
Column {
|
|
||||||
Text(
|
|
||||||
feature.title,
|
|
||||||
color = titleColor,
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
fontSize = 16.sp,
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
if (feature.enabled) feature.subtitle else unavailableText,
|
|
||||||
color = subtitleColor,
|
|
||||||
fontWeight = if (feature.enabled) FontWeight.Normal else FontWeight.SemiBold,
|
|
||||||
fontSize = 12.sp,
|
|
||||||
maxLines = 2,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Immutable
|
|
||||||
private data class HomeUiState(
|
|
||||||
val tagline: String,
|
|
||||||
val features: List<HomeFeature>
|
|
||||||
)
|
|
||||||
|
|
||||||
@Immutable
|
|
||||||
private data class HomeFeature(
|
|
||||||
val title: String,
|
|
||||||
val subtitle: String,
|
|
||||||
val onClick: () -> Unit,
|
|
||||||
val enabled: Boolean = true
|
|
||||||
)
|
|
||||||
|
|
||||||
@Preview(showBackground = true)
|
|
||||||
@Composable
|
|
||||||
private fun HomeScreenPreview() {
|
|
||||||
AudioVibeTheme {
|
|
||||||
HomeScreen(
|
|
||||||
toSoundEffects = {},
|
|
||||||
toCutter = {},
|
|
||||||
toMusicManager = {},
|
|
||||||
toSettings = {},
|
|
||||||
toPremium = {}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.audio.vibe.ui.musicmanager
|
package com.audio.vibe.ui.home
|
||||||
|
|
||||||
class LazyPlaybackControllerProvider<T>(
|
class LazyPlaybackControllerProvider<T>(
|
||||||
private val create: suspend () -> T?,
|
private val create: suspend () -> T?,
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
package com.audio.vibe.ui.musicmanager
|
package com.audio.vibe.ui.home
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
@ -25,7 +25,6 @@ import kotlinx.coroutines.flow.map
|
|||||||
import kotlinx.coroutines.flow.update
|
import kotlinx.coroutines.flow.update
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import kotlin.coroutines.coroutineContext
|
|
||||||
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
class MusicManagerViewModel(
|
class MusicManagerViewModel(
|
||||||
@ -96,6 +96,9 @@ data class AppStrings(
|
|||||||
val done: String,
|
val done: String,
|
||||||
val cancel: String,
|
val cancel: String,
|
||||||
val themeSystem: String,
|
val themeSystem: String,
|
||||||
|
val themeLight: String,
|
||||||
|
val themeDark: String,
|
||||||
|
val themeDialogText: String,
|
||||||
val editMetadata: String,
|
val editMetadata: String,
|
||||||
val songTitle: String,
|
val songTitle: String,
|
||||||
val artist: String,
|
val artist: String,
|
||||||
@ -153,6 +156,9 @@ data class AppStrings(
|
|||||||
val scanAgain: String,
|
val scanAgain: String,
|
||||||
val scanFolder: String,
|
val scanFolder: String,
|
||||||
val resetLibrary: String,
|
val resetLibrary: String,
|
||||||
|
val resetLibraryConfirmTitle: String,
|
||||||
|
val resetLibraryConfirmText: String,
|
||||||
|
val resetLibraryConfirmAction: String,
|
||||||
val loadingLibrary: String,
|
val loadingLibrary: String,
|
||||||
val scanning: String,
|
val scanning: String,
|
||||||
val scannedCount: String,
|
val scannedCount: String,
|
||||||
@ -272,6 +278,9 @@ private fun android.content.res.Resources.toAppStrings(): AppStrings = AppString
|
|||||||
done = getString(R.string.done),
|
done = getString(R.string.done),
|
||||||
cancel = getString(R.string.cancel),
|
cancel = getString(R.string.cancel),
|
||||||
themeSystem = getString(R.string.theme_system),
|
themeSystem = getString(R.string.theme_system),
|
||||||
|
themeLight = getString(R.string.theme_light),
|
||||||
|
themeDark = getString(R.string.theme_dark),
|
||||||
|
themeDialogText = getString(R.string.theme_dialog_text),
|
||||||
editMetadata = getString(R.string.edit_metadata),
|
editMetadata = getString(R.string.edit_metadata),
|
||||||
songTitle = getString(R.string.song_title),
|
songTitle = getString(R.string.song_title),
|
||||||
artist = getString(R.string.artist),
|
artist = getString(R.string.artist),
|
||||||
@ -329,6 +338,9 @@ private fun android.content.res.Resources.toAppStrings(): AppStrings = AppString
|
|||||||
scanAgain = getString(R.string.scan_again),
|
scanAgain = getString(R.string.scan_again),
|
||||||
scanFolder = getString(R.string.scan_folder),
|
scanFolder = getString(R.string.scan_folder),
|
||||||
resetLibrary = getString(R.string.reset_library),
|
resetLibrary = getString(R.string.reset_library),
|
||||||
|
resetLibraryConfirmTitle = getString(R.string.reset_library_confirm_title),
|
||||||
|
resetLibraryConfirmText = getString(R.string.reset_library_confirm_text),
|
||||||
|
resetLibraryConfirmAction = getString(R.string.reset_library_confirm_action),
|
||||||
loadingLibrary = getString(R.string.loading_library),
|
loadingLibrary = getString(R.string.loading_library),
|
||||||
scanning = getString(R.string.scanning),
|
scanning = getString(R.string.scanning),
|
||||||
scannedCount = getString(R.string.scanned_count),
|
scannedCount = getString(R.string.scanned_count),
|
||||||
@ -404,6 +416,9 @@ private val fallbackStrings = AppStrings(
|
|||||||
done = "",
|
done = "",
|
||||||
cancel = "",
|
cancel = "",
|
||||||
themeSystem = "",
|
themeSystem = "",
|
||||||
|
themeLight = "Light",
|
||||||
|
themeDark = "Dark",
|
||||||
|
themeDialogText = "",
|
||||||
editMetadata = "",
|
editMetadata = "",
|
||||||
songTitle = "",
|
songTitle = "",
|
||||||
artist = "",
|
artist = "",
|
||||||
@ -461,6 +476,9 @@ private val fallbackStrings = AppStrings(
|
|||||||
scanAgain = "",
|
scanAgain = "",
|
||||||
scanFolder = "",
|
scanFolder = "",
|
||||||
resetLibrary = "",
|
resetLibrary = "",
|
||||||
|
resetLibraryConfirmTitle = "",
|
||||||
|
resetLibraryConfirmText = "",
|
||||||
|
resetLibraryConfirmAction = "",
|
||||||
loadingLibrary = "",
|
loadingLibrary = "",
|
||||||
scanning = "",
|
scanning = "",
|
||||||
scannedCount = "",
|
scannedCount = "",
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import androidx.compose.foundation.basicMarquee
|
|||||||
import androidx.compose.animation.core.animateFloatAsState
|
import androidx.compose.animation.core.animateFloatAsState
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@ -16,6 +17,7 @@ import androidx.compose.foundation.layout.height
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Pause
|
import androidx.compose.material.icons.filled.Pause
|
||||||
@ -30,7 +32,6 @@ import androidx.compose.runtime.getValue
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.shadow
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
@ -50,7 +51,7 @@ fun MiniPlayerBar(
|
|||||||
if (!state.isVisible) return
|
if (!state.isVisible) return
|
||||||
|
|
||||||
val strings = LocalAppStrings.current
|
val strings = LocalAppStrings.current
|
||||||
val topShape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp)
|
val shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp)
|
||||||
val animatedProgress by animateFloatAsState(
|
val animatedProgress by animateFloatAsState(
|
||||||
targetValue = state.progressFraction,
|
targetValue = state.progressFraction,
|
||||||
animationSpec = tween(durationMillis = 300),
|
animationSpec = tween(durationMillis = 300),
|
||||||
@ -61,21 +62,22 @@ fun MiniPlayerBar(
|
|||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.shadow(8.dp, topShape)
|
//.padding(horizontal = 16.dp)
|
||||||
.clip(topShape)
|
.clip(shape)
|
||||||
|
.border(width = 1.dp, color = AudioVibeColors.Line, shape = shape)
|
||||||
.background(AudioVibeColors.Surface)
|
.background(AudioVibeColors.Surface)
|
||||||
.clickable(onClick = onNavigateToPlayer)
|
.clickable(onClick = onNavigateToPlayer)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(64.dp)
|
.height(76.dp)
|
||||||
.padding(horizontal = 12.dp),
|
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(44.dp)
|
.size(52.dp)
|
||||||
.clip(RoundedCornerShape(10.dp))
|
.clip(RoundedCornerShape(10.dp))
|
||||||
) {
|
) {
|
||||||
CoverImage(
|
CoverImage(
|
||||||
@ -85,7 +87,7 @@ fun MiniPlayerBar(
|
|||||||
isCoverEdited = state.isCoverEdited,
|
isCoverEdited = state.isCoverEdited,
|
||||||
cornerRadius = 10.dp,
|
cornerRadius = 10.dp,
|
||||||
placeholderIconSize = 22.dp,
|
placeholderIconSize = 22.dp,
|
||||||
decodeSize = 56.dp,
|
decodeSize = 64.dp,
|
||||||
animateChanges = false,
|
animateChanges = false,
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize()
|
||||||
)
|
)
|
||||||
@ -109,10 +111,7 @@ fun MiniPlayerBar(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
IconButton(
|
IconButton(onClick = onSkipPrevious, modifier = Modifier.size(40.dp)) {
|
||||||
onClick = onSkipPrevious,
|
|
||||||
modifier = Modifier.size(40.dp)
|
|
||||||
) {
|
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.SkipPrevious,
|
Icons.Default.SkipPrevious,
|
||||||
contentDescription = strings.previousTrack,
|
contentDescription = strings.previousTrack,
|
||||||
@ -123,20 +122,20 @@ fun MiniPlayerBar(
|
|||||||
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = onPlayPause,
|
onClick = onPlayPause,
|
||||||
modifier = Modifier.size(44.dp)
|
modifier = Modifier
|
||||||
|
.size(44.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(AudioVibeColors.Ink)
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = if (showPause) Icons.Default.Pause else Icons.Default.PlayArrow,
|
imageVector = if (showPause) Icons.Default.Pause else Icons.Default.PlayArrow,
|
||||||
contentDescription = if (showPause) strings.pause else strings.play,
|
contentDescription = if (showPause) strings.pause else strings.play,
|
||||||
tint = AudioVibeColors.Primary,
|
tint = AudioVibeColors.Surface,
|
||||||
modifier = Modifier.size(32.dp)
|
modifier = Modifier.size(25.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
IconButton(
|
IconButton(onClick = onSkipNext, modifier = Modifier.size(40.dp)) {
|
||||||
onClick = onSkipNext,
|
|
||||||
modifier = Modifier.size(40.dp)
|
|
||||||
) {
|
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.SkipNext,
|
Icons.Default.SkipNext,
|
||||||
contentDescription = strings.nextTrack,
|
contentDescription = strings.nextTrack,
|
||||||
@ -149,21 +148,48 @@ fun MiniPlayerBar(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(3.dp)
|
.height(2.dp)
|
||||||
|
.padding(start = 16.dp, end = 16.dp)
|
||||||
.background(AudioVibeColors.Line)
|
.background(AudioVibeColors.Line)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth(fraction = animatedProgress)
|
.fillMaxWidth(fraction = animatedProgress)
|
||||||
.height(3.dp)
|
.height(2.dp)
|
||||||
.background(
|
.background(
|
||||||
if (state.hasError) AudioVibeColors.Warning
|
if (state.hasError) AudioVibeColors.Warning
|
||||||
else AudioVibeColors.Primary
|
else AudioVibeColors.Primary
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(20.dp)
|
||||||
|
.padding(horizontal = 20.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = state.progressMs.formatMiniTime(),
|
||||||
|
color = AudioVibeColors.Muted,
|
||||||
|
fontSize = 10.sp
|
||||||
|
)
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
Text(
|
||||||
|
text = state.durationMs?.formatMiniTime() ?: "--:--",
|
||||||
|
color = AudioVibeColors.Muted,
|
||||||
|
fontSize = 10.sp
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Long.formatMiniTime(): String {
|
||||||
|
val totalSeconds = (this / 1000L).coerceAtLeast(0L)
|
||||||
|
val minutes = totalSeconds / 60L
|
||||||
|
val seconds = totalSeconds % 60L
|
||||||
|
return "%02d:%02d".format(minutes, seconds)
|
||||||
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
@ -14,6 +14,8 @@ data class MiniPlayerState(
|
|||||||
val isCoverEdited: Boolean = false,
|
val isCoverEdited: Boolean = false,
|
||||||
val isPlaying: Boolean = false,
|
val isPlaying: Boolean = false,
|
||||||
val progressFraction: Float = 0f,
|
val progressFraction: Float = 0f,
|
||||||
|
val progressMs: Long = 0L,
|
||||||
|
val durationMs: Long? = null,
|
||||||
val errorMessage: String? = null
|
val errorMessage: String? = null
|
||||||
) {
|
) {
|
||||||
val hasError: Boolean
|
val hasError: Boolean
|
||||||
@ -38,6 +40,8 @@ data class MiniPlayerState(
|
|||||||
progressFraction = if (state.durationMs != null && state.durationMs > 0) {
|
progressFraction = if (state.durationMs != null && state.durationMs > 0) {
|
||||||
(state.progressMs.toFloat() / state.durationMs).coerceIn(0f, 1f)
|
(state.progressMs.toFloat() / state.durationMs).coerceIn(0f, 1f)
|
||||||
} else 0f,
|
} else 0f,
|
||||||
|
progressMs = state.progressMs,
|
||||||
|
durationMs = state.durationMs,
|
||||||
errorMessage = state.errorMessage
|
errorMessage = state.errorMessage
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import androidx.compose.material3.ModalBottomSheet
|
|||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.rememberModalBottomSheetState
|
import androidx.compose.material3.rememberModalBottomSheetState
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
@ -41,7 +42,7 @@ fun PlayerBottomSheet(
|
|||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
sheetState = sheetState,
|
sheetState = sheetState,
|
||||||
containerColor = PlayerSheetColors.Surface,
|
containerColor = PlayerSheetColors.Surface,
|
||||||
contentColor = Color.White,
|
contentColor = PlayerSheetColors.PrimaryText,
|
||||||
shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp),
|
shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp),
|
||||||
dragHandle = { SheetHandle() },
|
dragHandle = { SheetHandle() },
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
@ -57,7 +58,7 @@ fun PlayerBottomSheet(
|
|||||||
"播放信息",
|
"播放信息",
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
color = Color.White,
|
color = PlayerSheetColors.PrimaryText,
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -149,13 +150,29 @@ private fun ParamChip(label: String) {
|
|||||||
Text(
|
Text(
|
||||||
text = label,
|
text = label,
|
||||||
fontSize = 13.sp,
|
fontSize = 13.sp,
|
||||||
color = Color.White.copy(alpha = 0.86f)
|
color = PlayerSheetColors.PrimaryText.copy(alpha = 0.86f)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private object PlayerSheetColors {
|
private object PlayerSheetColors {
|
||||||
val Surface = Color(0xFF1D1D1F)
|
val Surface: Color
|
||||||
val Divider = Color.White.copy(alpha = 0.10f)
|
@Composable
|
||||||
val Handle = Color.White.copy(alpha = 0.28f)
|
@ReadOnlyComposable
|
||||||
val Muted = Color.White.copy(alpha = 0.52f)
|
get() = AudioVibeColors.Surface
|
||||||
|
val PrimaryText: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Ink
|
||||||
|
val Divider: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Line
|
||||||
|
val Handle: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Muted.copy(alpha = 0.28f)
|
||||||
|
val Muted: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Muted
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.material3.rememberModalBottomSheetState
|
import androidx.compose.material3.rememberModalBottomSheetState
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
import androidx.compose.runtime.derivedStateOf
|
import androidx.compose.runtime.derivedStateOf
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@ -42,6 +43,7 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.audio.vibe.ui.components.AudioVibeColors
|
||||||
import com.audio.vibe.ui.components.LocateCurrentTrackButton
|
import com.audio.vibe.ui.components.LocateCurrentTrackButton
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@ -77,7 +79,7 @@ fun PlayerQueueSheet(
|
|||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
sheetState = sheetState,
|
sheetState = sheetState,
|
||||||
containerColor = QueueSheetColors.Surface,
|
containerColor = QueueSheetColors.Surface,
|
||||||
contentColor = Color.White,
|
contentColor = QueueSheetColors.PrimaryText,
|
||||||
shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp),
|
shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp),
|
||||||
dragHandle = { QueueSheetHandle() },
|
dragHandle = { QueueSheetHandle() },
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
@ -91,7 +93,7 @@ fun PlayerQueueSheet(
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "当前列表",
|
text = "当前列表",
|
||||||
color = Color.White,
|
color = QueueSheetColors.PrimaryText,
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
@ -186,7 +188,7 @@ private fun QueueTrackRow(
|
|||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
color = if (selected) Color.White else QueueSheetColors.PrimaryText,
|
color = if (selected) QueueSheetColors.Action else QueueSheetColors.PrimaryText,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = if (selected) FontWeight.Bold else FontWeight.SemiBold,
|
fontWeight = if (selected) FontWeight.Bold else FontWeight.SemiBold,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
@ -216,12 +218,36 @@ private fun QueueSheetHandle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private object QueueSheetColors {
|
private object QueueSheetColors {
|
||||||
val Surface = Color(0xFF1D1D1F)
|
val Surface: Color
|
||||||
val Selected = Color(0x1F2997FF)
|
@Composable
|
||||||
val Action = Color(0xFF2997FF)
|
@ReadOnlyComposable
|
||||||
val PrimaryText = Color.White.copy(alpha = 0.88f)
|
get() = AudioVibeColors.Surface
|
||||||
val Muted = Color.White.copy(alpha = 0.52f)
|
val Selected: Color
|
||||||
val Divider = Color.White.copy(alpha = 0.08f)
|
@Composable
|
||||||
val Handle = Color.White.copy(alpha = 0.28f)
|
@ReadOnlyComposable
|
||||||
val IconChrome = Color.White.copy(alpha = 0.10f)
|
get() = AudioVibeColors.PrimarySoft
|
||||||
|
val Action: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Primary
|
||||||
|
val PrimaryText: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Ink
|
||||||
|
val Muted: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Muted
|
||||||
|
val Divider: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Line
|
||||||
|
val Handle: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Muted.copy(alpha = 0.28f)
|
||||||
|
val IconChrome: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Line.copy(alpha = 0.62f)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,7 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.DisposableEffect
|
import androidx.compose.runtime.DisposableEffect
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
import androidx.compose.runtime.collectAsState
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableFloatStateOf
|
import androidx.compose.runtime.mutableFloatStateOf
|
||||||
@ -67,6 +68,7 @@ import com.audio.vibe.data.playback.AudioPlaybackService
|
|||||||
import com.audio.vibe.data.playback.PlaybackServiceController
|
import com.audio.vibe.data.playback.PlaybackServiceController
|
||||||
import com.audio.vibe.domain.model.PlayMode
|
import com.audio.vibe.domain.model.PlayMode
|
||||||
import com.audio.vibe.ui.components.AudioVibeColors
|
import com.audio.vibe.ui.components.AudioVibeColors
|
||||||
|
import com.audio.vibe.ui.components.currentVibeToastStyle
|
||||||
import com.audio.vibe.ui.components.showPlaybackToast
|
import com.audio.vibe.ui.components.showPlaybackToast
|
||||||
import com.audio.vibe.ui.i18n.LocalResolvedLanguage
|
import com.audio.vibe.ui.i18n.LocalResolvedLanguage
|
||||||
import com.audio.vibe.ui.i18n.resourceLocale
|
import com.audio.vibe.ui.i18n.resourceLocale
|
||||||
@ -110,6 +112,7 @@ private fun PlayerContent(
|
|||||||
factory = PlayerViewModelFactory(controller, lyricLoader)
|
factory = PlayerViewModelFactory(controller, lyricLoader)
|
||||||
)
|
)
|
||||||
val uiState by viewModel.uiState.collectAsState()
|
val uiState by viewModel.uiState.collectAsState()
|
||||||
|
val toastStyle = currentVibeToastStyle()
|
||||||
var scrubStartedButtonState by remember { mutableStateOf<Boolean?>(null) }
|
var scrubStartedButtonState by remember { mutableStateOf<Boolean?>(null) }
|
||||||
var heldSeekButtonState by remember { mutableStateOf<Boolean?>(null) }
|
var heldSeekButtonState by remember { mutableStateOf<Boolean?>(null) }
|
||||||
var heldSeekTargetMs by remember { mutableStateOf<Long?>(null) }
|
var heldSeekTargetMs by remember { mutableStateOf<Long?>(null) }
|
||||||
@ -124,7 +127,7 @@ private fun PlayerContent(
|
|||||||
|
|
||||||
LaunchedEffect(uiState.errorMessage) {
|
LaunchedEffect(uiState.errorMessage) {
|
||||||
uiState.errorMessage?.takeIf { it.isNotBlank() }?.let { message ->
|
uiState.errorMessage?.takeIf { it.isNotBlank() }?.let { message ->
|
||||||
showPlaybackToast(context, message)
|
showPlaybackToast(context, message, style = toastStyle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -878,12 +881,27 @@ private fun AudioChainInfoBar(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private object PlayerColors {
|
private object PlayerColors {
|
||||||
val canvas = Color(0xFF050506)
|
val canvas: Color
|
||||||
val canvasTop = Color(0xFF1D1D1F)
|
@Composable
|
||||||
val chrome = Color.White.copy(alpha = 0.10f)
|
@ReadOnlyComposable
|
||||||
val modeChrome = Color.White.copy(alpha = 0.08f)
|
get() = AudioVibeColors.Dark
|
||||||
val action = Color(0xFF2997FF)
|
val canvasTop = Color(0xFF172033)
|
||||||
val track = Color.White.copy(alpha = 0.16f)
|
val chrome: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Surface.copy(alpha = 0.10f)
|
||||||
|
val modeChrome: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Surface.copy(alpha = 0.08f)
|
||||||
|
val action: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Primary
|
||||||
|
val track: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Line.copy(alpha = 0.22f)
|
||||||
val secondaryText = Color.White.copy(alpha = 0.72f)
|
val secondaryText = Color.White.copy(alpha = 0.72f)
|
||||||
val tertiaryText = Color.White.copy(alpha = 0.48f)
|
val tertiaryText = Color.White.copy(alpha = 0.48f)
|
||||||
val disabled = Color.White.copy(alpha = 0.25f)
|
val disabled = Color.White.copy(alpha = 0.25f)
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
|||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
import androidx.compose.runtime.derivedStateOf
|
import androidx.compose.runtime.derivedStateOf
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@ -28,6 +29,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.drawWithContent
|
import androidx.compose.ui.draw.drawWithContent
|
||||||
import androidx.compose.ui.graphics.Brush
|
import androidx.compose.ui.graphics.Brush
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import com.audio.vibe.ui.components.AudioVibeColors
|
||||||
import androidx.compose.ui.graphics.drawscope.clipRect
|
import androidx.compose.ui.graphics.drawscope.clipRect
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
@ -463,8 +465,14 @@ private fun EmptyLyricPlaceholder(modifier: Modifier = Modifier) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal object LyricColors {
|
internal object LyricColors {
|
||||||
val actionBlue = Color(0xFF2997FF).copy(alpha = 0.92f)
|
val actionBlue: Color
|
||||||
val compactAccent = Color(0xFF2997FF).copy(alpha = 0.78f)
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Primary.copy(alpha = 0.92f)
|
||||||
|
val compactAccent: Color
|
||||||
|
@Composable
|
||||||
|
@ReadOnlyComposable
|
||||||
|
get() = AudioVibeColors.Primary.copy(alpha = 0.78f)
|
||||||
val compactText = Color.White.copy(alpha = 0.70f)
|
val compactText = Color.White.copy(alpha = 0.70f)
|
||||||
val compactChromeCenter = Color.White.copy(alpha = 0.065f)
|
val compactChromeCenter = Color.White.copy(alpha = 0.065f)
|
||||||
val compactChromeEdge = Color.White.copy(alpha = 0.018f)
|
val compactChromeEdge = Color.White.copy(alpha = 0.018f)
|
||||||
|
|||||||
@ -42,7 +42,6 @@ import androidx.compose.ui.platform.LocalContext
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
@ -54,23 +53,28 @@ import com.audio.vibe.ui.components.AudioVibeColors
|
|||||||
import com.audio.vibe.ui.components.VibeCard
|
import com.audio.vibe.ui.components.VibeCard
|
||||||
import com.audio.vibe.ui.components.VibeScreen
|
import com.audio.vibe.ui.components.VibeScreen
|
||||||
import com.audio.vibe.ui.components.RoundIcon
|
import com.audio.vibe.ui.components.RoundIcon
|
||||||
|
import com.audio.vibe.ui.components.currentVibeToastStyle
|
||||||
|
import com.audio.vibe.ui.components.showVibeToast
|
||||||
import com.audio.vibe.ui.i18n.AppLanguage
|
import com.audio.vibe.ui.i18n.AppLanguage
|
||||||
import com.audio.vibe.ui.i18n.LocalAppStrings
|
import com.audio.vibe.ui.i18n.LocalAppStrings
|
||||||
import com.audio.vibe.ui.i18n.displayName
|
import com.audio.vibe.ui.i18n.displayName
|
||||||
|
import com.audio.vibe.ui.theme.AppThemeMode
|
||||||
|
import com.audio.vibe.ui.theme.displayName
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingsScreen(
|
fun SettingsScreen(
|
||||||
onBack: () -> Unit = {},
|
onBack: () -> Unit = {},
|
||||||
toPremium: () -> Unit = {},
|
toPremium: () -> Unit = {},
|
||||||
selectedLanguage: AppLanguage = AppLanguage.System,
|
selectedLanguage: AppLanguage = AppLanguage.System,
|
||||||
onLanguageSelected: (AppLanguage) -> Unit = {}
|
onLanguageSelected: (AppLanguage) -> Unit = {},
|
||||||
|
selectedThemeMode: AppThemeMode = AppThemeMode.Light,
|
||||||
|
onThemeModeSelected: (AppThemeMode) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
val strings = LocalAppStrings.current
|
val strings = LocalAppStrings.current
|
||||||
val unavailableText = stringResource(R.string.temporarily_unavailable)
|
val unavailableText = stringResource(R.string.temporarily_unavailable)
|
||||||
var dialog by remember { mutableStateOf<String?>(null) }
|
var dialog by remember { mutableStateOf<String?>(null) }
|
||||||
var legalPage by remember { mutableStateOf<Pair<String, String>?>(null) }
|
var legalPage by remember { mutableStateOf<Pair<String, String>?>(null) }
|
||||||
val items = listOf(
|
val items = listOf(
|
||||||
Setting(strings.account, Icons.Default.Person),
|
|
||||||
Setting(strings.theme, Icons.Default.Style),
|
Setting(strings.theme, Icons.Default.Style),
|
||||||
Setting(strings.language, Icons.Default.Language),
|
Setting(strings.language, Icons.Default.Language),
|
||||||
Setting(strings.helpAndFeedback, Icons.Default.Feedback),
|
Setting(strings.helpAndFeedback, Icons.Default.Feedback),
|
||||||
@ -175,7 +179,7 @@ fun SettingsScreen(
|
|||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
when (item.label) {
|
when (item.label) {
|
||||||
strings.theme -> strings.themeSystem
|
strings.theme -> selectedThemeMode.displayName(strings)
|
||||||
strings.language -> selectedLanguage.displayName(strings)
|
strings.language -> selectedLanguage.displayName(strings)
|
||||||
else -> ""
|
else -> ""
|
||||||
},
|
},
|
||||||
@ -193,9 +197,10 @@ fun SettingsScreen(
|
|||||||
if (index != items.lastIndex) {
|
if (index != items.lastIndex) {
|
||||||
Spacer(
|
Spacer(
|
||||||
Modifier
|
Modifier
|
||||||
.height(1.dp)
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(start = 48.dp)
|
.padding(start = 48.dp)
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(1.dp)
|
||||||
|
.background(AudioVibeColors.Line)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,7 +209,13 @@ fun SettingsScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dialog != null) {
|
if (dialog != null) {
|
||||||
if (dialog == strings.language) {
|
if (dialog == strings.theme) {
|
||||||
|
ThemeDialog(
|
||||||
|
selectedThemeMode = selectedThemeMode,
|
||||||
|
onThemeModeSelected = onThemeModeSelected,
|
||||||
|
onDismiss = { dialog = null }
|
||||||
|
)
|
||||||
|
} else if (dialog == strings.language) {
|
||||||
LanguageDialog(
|
LanguageDialog(
|
||||||
selectedLanguage = selectedLanguage,
|
selectedLanguage = selectedLanguage,
|
||||||
onLanguageSelected = onLanguageSelected,
|
onLanguageSelected = onLanguageSelected,
|
||||||
@ -229,6 +240,7 @@ fun SettingsScreen(
|
|||||||
private fun FeedbackDialog(onDismiss: () -> Unit) {
|
private fun FeedbackDialog(onDismiss: () -> Unit) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val strings = LocalAppStrings.current
|
val strings = LocalAppStrings.current
|
||||||
|
val toastStyle = currentVibeToastStyle()
|
||||||
val emailApps = remember { FeedbackShare.resolveEmailApps(context) }
|
val emailApps = remember { FeedbackShare.resolveEmailApps(context) }
|
||||||
var message by remember { mutableStateOf("") }
|
var message by remember { mutableStateOf("") }
|
||||||
var includeLogs by remember { mutableStateOf(false) }
|
var includeLogs by remember { mutableStateOf(false) }
|
||||||
@ -239,6 +251,9 @@ private fun FeedbackDialog(onDismiss: () -> Unit) {
|
|||||||
if (emailApps.isEmpty()) {
|
if (emailApps.isEmpty()) {
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
|
containerColor = AudioVibeColors.Surface,
|
||||||
|
titleContentColor = AudioVibeColors.Ink,
|
||||||
|
textContentColor = AudioVibeColors.Muted,
|
||||||
title = { Text(strings.feedbackTitle) },
|
title = { Text(strings.feedbackTitle) },
|
||||||
text = { Text(strings.feedbackNoShareApp) },
|
text = { Text(strings.feedbackNoShareApp) },
|
||||||
confirmButton = {
|
confirmButton = {
|
||||||
@ -250,6 +265,9 @@ private fun FeedbackDialog(onDismiss: () -> Unit) {
|
|||||||
|
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
|
containerColor = AudioVibeColors.Surface,
|
||||||
|
titleContentColor = AudioVibeColors.Ink,
|
||||||
|
textContentColor = AudioVibeColors.Muted,
|
||||||
title = { Text(strings.feedbackTitle) },
|
title = { Text(strings.feedbackTitle) },
|
||||||
text = {
|
text = {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(14.dp)) {
|
Column(verticalArrangement = Arrangement.spacedBy(14.dp)) {
|
||||||
@ -347,8 +365,11 @@ private fun FeedbackDialog(onDismiss: () -> Unit) {
|
|||||||
TextButton(
|
TextButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
if (message.isBlank()) {
|
if (message.isBlank()) {
|
||||||
Toast.makeText(context, strings.feedbackEmptyMessage, Toast.LENGTH_SHORT)
|
showVibeToast(
|
||||||
.show()
|
context = context,
|
||||||
|
message = strings.feedbackEmptyMessage,
|
||||||
|
style = toastStyle
|
||||||
|
)
|
||||||
return@TextButton
|
return@TextButton
|
||||||
}
|
}
|
||||||
val shareIntent = FeedbackShare.createIntent(
|
val shareIntent = FeedbackShare.createIntent(
|
||||||
@ -372,6 +393,52 @@ private fun FeedbackDialog(onDismiss: () -> Unit) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun ThemeDialog(
|
||||||
|
selectedThemeMode: AppThemeMode,
|
||||||
|
onThemeModeSelected: (AppThemeMode) -> Unit,
|
||||||
|
onDismiss: () -> Unit
|
||||||
|
) {
|
||||||
|
val strings = LocalAppStrings.current
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = onDismiss,
|
||||||
|
containerColor = AudioVibeColors.Surface,
|
||||||
|
titleContentColor = AudioVibeColors.Ink,
|
||||||
|
textContentColor = AudioVibeColors.Muted,
|
||||||
|
title = { Text(strings.theme) },
|
||||||
|
text = {
|
||||||
|
Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||||
|
Text(strings.themeDialogText, color = AudioVibeColors.Muted, fontSize = 13.sp)
|
||||||
|
Spacer(Modifier.height(10.dp))
|
||||||
|
AppThemeMode.entries.forEach { themeMode ->
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(48.dp)
|
||||||
|
.clickable {
|
||||||
|
onThemeModeSelected(themeMode)
|
||||||
|
onDismiss()
|
||||||
|
},
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
RadioButton(
|
||||||
|
selected = selectedThemeMode == themeMode,
|
||||||
|
onClick = {
|
||||||
|
onThemeModeSelected(themeMode)
|
||||||
|
onDismiss()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
Text(themeMode.displayName(strings), color = AudioVibeColors.Ink)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
TextButton(onClick = onDismiss) { Text(strings.done) }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun LanguageDialog(
|
private fun LanguageDialog(
|
||||||
selectedLanguage: AppLanguage,
|
selectedLanguage: AppLanguage,
|
||||||
@ -381,6 +448,9 @@ private fun LanguageDialog(
|
|||||||
val strings = LocalAppStrings.current
|
val strings = LocalAppStrings.current
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
|
containerColor = AudioVibeColors.Surface,
|
||||||
|
titleContentColor = AudioVibeColors.Ink,
|
||||||
|
textContentColor = AudioVibeColors.Muted,
|
||||||
title = { Text(strings.language) },
|
title = { Text(strings.language) },
|
||||||
text = {
|
text = {
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
25
app/src/main/java/com/audio/vibe/ui/theme/AppThemeMode.kt
Normal file
25
app/src/main/java/com/audio/vibe/ui/theme/AppThemeMode.kt
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package com.audio.vibe.ui.theme
|
||||||
|
|
||||||
|
import com.audio.vibe.ui.i18n.AppStrings
|
||||||
|
|
||||||
|
enum class AppThemeMode {
|
||||||
|
System,
|
||||||
|
Light,
|
||||||
|
Dark
|
||||||
|
}
|
||||||
|
|
||||||
|
fun AppThemeMode.resolveDarkTheme(systemDark: Boolean): Boolean {
|
||||||
|
return when (this) {
|
||||||
|
AppThemeMode.System -> systemDark
|
||||||
|
AppThemeMode.Light -> false
|
||||||
|
AppThemeMode.Dark -> true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun AppThemeMode.displayName(strings: AppStrings): String {
|
||||||
|
return when (this) {
|
||||||
|
AppThemeMode.System -> strings.themeSystem
|
||||||
|
AppThemeMode.Light -> strings.themeLight
|
||||||
|
AppThemeMode.Dark -> strings.themeDark
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,7 +10,7 @@ val Purple40 = Color(0xFF6650a4)
|
|||||||
val PurpleGrey40 = Color(0xFF625b71)
|
val PurpleGrey40 = Color(0xFF625b71)
|
||||||
val Pink40 = Color(0xFF7D5260)
|
val Pink40 = Color(0xFF7D5260)
|
||||||
|
|
||||||
val Primary = Color(0xFF4285F4)
|
val Primary = Color(0xFF0F68D8)
|
||||||
val PrimaryDark = Color(0xFF3367D6)
|
val PrimaryDark = Color(0xFF6EA8FF)
|
||||||
val BackgroundLight = Color(0xFFF5F7FA)
|
val BackgroundLight = Color(0xFFF6F8FB)
|
||||||
val BackgroundDark = Color(0xFF121212)
|
val BackgroundDark = Color(0xFF101827)
|
||||||
|
|||||||
@ -9,19 +9,33 @@ import androidx.compose.material3.dynamicDarkColorScheme
|
|||||||
import androidx.compose.material3.dynamicLightColorScheme
|
import androidx.compose.material3.dynamicLightColorScheme
|
||||||
import androidx.compose.material3.lightColorScheme
|
import androidx.compose.material3.lightColorScheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import com.audio.vibe.ui.components.DarkAudioVibePalette
|
||||||
|
import com.audio.vibe.ui.components.LightAudioVibePalette
|
||||||
|
import com.audio.vibe.ui.components.LocalAudioVibePalette
|
||||||
|
|
||||||
private val LightColorScheme = lightColorScheme(
|
private val LightColorScheme = lightColorScheme(
|
||||||
primary = Primary,
|
primary = Primary,
|
||||||
|
onPrimary = Color.White,
|
||||||
background = BackgroundLight,
|
background = BackgroundLight,
|
||||||
surface = Color.White
|
onBackground = Color(0xFF111827),
|
||||||
|
surface = Color.White,
|
||||||
|
onSurface = Color(0xFF111827),
|
||||||
|
outline = Color(0xFFDDE5F0),
|
||||||
|
surfaceVariant = Color(0xFFEAF2FF)
|
||||||
)
|
)
|
||||||
|
|
||||||
private val DarkColorScheme = darkColorScheme(
|
private val DarkColorScheme = darkColorScheme(
|
||||||
primary = PrimaryDark,
|
primary = PrimaryDark,
|
||||||
|
onPrimary = Color(0xFF101827),
|
||||||
background = BackgroundDark,
|
background = BackgroundDark,
|
||||||
surface = Color(0xFF1E1E1E)
|
onBackground = Color.White,
|
||||||
|
surface = Color(0xFF1D263A),
|
||||||
|
onSurface = Color.White,
|
||||||
|
outline = Color(0xFF344056),
|
||||||
|
surfaceVariant = Color(0xFF22304A)
|
||||||
)
|
)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@ -41,9 +55,13 @@ fun AudioVibeTheme(
|
|||||||
else -> LightColorScheme
|
else -> LightColorScheme
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompositionLocalProvider(
|
||||||
|
LocalAudioVibePalette provides if (darkTheme) DarkAudioVibePalette else LightAudioVibePalette
|
||||||
|
) {
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = colorScheme,
|
colorScheme = colorScheme,
|
||||||
typography = Typography,
|
typography = Typography,
|
||||||
content = content
|
content = content
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<string name="sound_effects_subtitle">即時與離線音效</string>
|
<string name="sound_effects_subtitle">即時與離線音效</string>
|
||||||
<string name="audio_cutter">音訊剪輯</string>
|
<string name="audio_cutter">音訊剪輯</string>
|
||||||
<string name="audio_cutter_subtitle">剪切、合併、降噪</string>
|
<string name="audio_cutter_subtitle">剪切、合併、降噪</string>
|
||||||
<string name="music_manager">音樂管理</string>
|
<string name="music_manager">曲庫</string>
|
||||||
<string name="music_manager_subtitle">掃描本地曲庫</string>
|
<string name="music_manager_subtitle">掃描本地曲庫</string>
|
||||||
<string name="upgrade_premium">升級會員</string>
|
<string name="upgrade_premium">升級會員</string>
|
||||||
<string name="upgrade">升級</string>
|
<string name="upgrade">升級</string>
|
||||||
@ -44,6 +44,9 @@
|
|||||||
<string name="done">完成</string>
|
<string name="done">完成</string>
|
||||||
<string name="cancel">取消</string>
|
<string name="cancel">取消</string>
|
||||||
<string name="theme_system">系統</string>
|
<string name="theme_system">系統</string>
|
||||||
|
<string name="theme_light">淺色主題</string>
|
||||||
|
<string name="theme_dark">深色主題</string>
|
||||||
|
<string name="theme_dialog_text">選擇應用程式顯示方式。預設使用淺色主題。</string>
|
||||||
<string name="edit_metadata">編輯中繼資料</string>
|
<string name="edit_metadata">編輯中繼資料</string>
|
||||||
<string name="song_title">歌曲名稱</string>
|
<string name="song_title">歌曲名稱</string>
|
||||||
<string name="artist">藝人</string>
|
<string name="artist">藝人</string>
|
||||||
@ -74,9 +77,26 @@
|
|||||||
<string name="genres">類型</string>
|
<string name="genres">類型</string>
|
||||||
<string name="scan_permission_title">掃描本地音樂</string>
|
<string name="scan_permission_title">掃描本地音樂</string>
|
||||||
<string name="allow_access">允許存取</string>
|
<string name="allow_access">允許存取</string>
|
||||||
<string name="scan_again">掃描系統音樂</string>
|
<string name="scan_again">重新掃描</string>
|
||||||
<string name="scan_folder">掃描資料夾/U 盤</string>
|
<string name="scan_folder">掃描資料夾/U 盤</string>
|
||||||
|
<string name="scan_folder_short">資料夾/U 盤</string>
|
||||||
|
<string name="sound_effects_soon">Soon</string>
|
||||||
|
<string name="build_local_library">建立本地曲庫</string>
|
||||||
|
<string name="build_local_library_desc">掃描後可播放、搜尋、編輯標籤</string>
|
||||||
|
<string name="scan_system_music">掃描系統音樂</string>
|
||||||
|
<string name="scan_system_music_desc">掃描裝置 MediaStore 中的音樂檔案</string>
|
||||||
|
<string name="scan_folder_drive_desc">掃描選定目錄或外接儲存裝置中的音樂</string>
|
||||||
|
<string name="scan_skip_duplicates">掃描時會略過已識別的檔案,避免重複加入</string>
|
||||||
|
<string name="library_scanned_summary">已掃描 %1$d 首</string>
|
||||||
|
<string name="library_scanned_summary_formats">已掃描 %1$d 首 · %2$d 種格式</string>
|
||||||
|
<string name="scanning_status_chip">掃描中</string>
|
||||||
|
<string name="all_songs">全部歌曲</string>
|
||||||
|
<string name="recently_added">最近加入</string>
|
||||||
|
<string name="edit_track_label">編輯</string>
|
||||||
<string name="reset_library">重置曲庫</string>
|
<string name="reset_library">重置曲庫</string>
|
||||||
|
<string name="reset_library_confirm_title">確認重置曲庫?</string>
|
||||||
|
<string name="reset_library_confirm_text">只會清空已掃描的資料庫記錄,不會刪除你的音訊檔案。</string>
|
||||||
|
<string name="reset_library_confirm_action">確認重置</string>
|
||||||
<string name="scanning">正在掃描本地音訊...</string>
|
<string name="scanning">正在掃描本地音訊...</string>
|
||||||
<string name="scanned_count">已掃描 %1$d 首歌曲</string>
|
<string name="scanned_count">已掃描 %1$d 首歌曲</string>
|
||||||
<string name="cached_library">掃描時顯示已儲存曲庫</string>
|
<string name="cached_library">掃描時顯示已儲存曲庫</string>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
<string name="sound_effects_subtitle">实时与离线音效</string>
|
<string name="sound_effects_subtitle">实时与离线音效</string>
|
||||||
<string name="audio_cutter">音频剪辑</string>
|
<string name="audio_cutter">音频剪辑</string>
|
||||||
<string name="audio_cutter_subtitle">剪切、拼接、降噪</string>
|
<string name="audio_cutter_subtitle">剪切、拼接、降噪</string>
|
||||||
<string name="music_manager">音乐管理</string>
|
<string name="music_manager">曲库</string>
|
||||||
<string name="music_manager_subtitle">扫描本地曲库</string>
|
<string name="music_manager_subtitle">扫描本地曲库</string>
|
||||||
<string name="upgrade_premium">升级会员</string>
|
<string name="upgrade_premium">升级会员</string>
|
||||||
<string name="premium_footer_desc">解锁无限批量编辑和本地音效包</string>
|
<string name="premium_footer_desc">解锁无限批量编辑和本地音效包</string>
|
||||||
@ -45,6 +45,9 @@
|
|||||||
<string name="done">完成</string>
|
<string name="done">完成</string>
|
||||||
<string name="cancel">取消</string>
|
<string name="cancel">取消</string>
|
||||||
<string name="theme_system">跟随系统</string>
|
<string name="theme_system">跟随系统</string>
|
||||||
|
<string name="theme_light">浅色主题</string>
|
||||||
|
<string name="theme_dark">深色主题</string>
|
||||||
|
<string name="theme_dialog_text">选择应用显示方式。默认使用浅色主题。</string>
|
||||||
<string name="edit_metadata">编辑元数据</string>
|
<string name="edit_metadata">编辑元数据</string>
|
||||||
<string name="song_title">歌曲名</string>
|
<string name="song_title">歌曲名</string>
|
||||||
<string name="artist">歌手</string>
|
<string name="artist">歌手</string>
|
||||||
@ -99,9 +102,26 @@
|
|||||||
<string name="scan_permission_title">扫描本地音乐</string>
|
<string name="scan_permission_title">扫描本地音乐</string>
|
||||||
<string name="scan_permission_text">允许 AudioVibe 读取本机音频文件。文件只用于建立本地曲库,不会上传。</string>
|
<string name="scan_permission_text">允许 AudioVibe 读取本机音频文件。文件只用于建立本地曲库,不会上传。</string>
|
||||||
<string name="allow_access">允许访问</string>
|
<string name="allow_access">允许访问</string>
|
||||||
<string name="scan_again">扫描系统音乐</string>
|
<string name="scan_again">重新扫描</string>
|
||||||
<string name="scan_folder">扫描文件夹/U盘</string>
|
<string name="scan_folder">扫描文件夹/U盘</string>
|
||||||
|
<string name="scan_folder_short">文件夹/U盘</string>
|
||||||
|
<string name="sound_effects_soon">Soon</string>
|
||||||
|
<string name="build_local_library">建立本地曲库</string>
|
||||||
|
<string name="build_local_library_desc">扫描后可播放、搜索、编辑标签</string>
|
||||||
|
<string name="scan_system_music">扫描系统音乐</string>
|
||||||
|
<string name="scan_system_music_desc">扫描设备 MediaStore 中的音乐文件</string>
|
||||||
|
<string name="scan_folder_drive_desc">扫描选定目录或外接存储设备中的音乐</string>
|
||||||
|
<string name="scan_skip_duplicates">扫描时将跳过已识别的文件,避免重复添加</string>
|
||||||
|
<string name="library_scanned_summary">已扫描 %1$d 首</string>
|
||||||
|
<string name="library_scanned_summary_formats">已扫描 %1$d 首 · %2$d 种格式</string>
|
||||||
|
<string name="scanning_status_chip">扫描中</string>
|
||||||
|
<string name="all_songs">全部歌曲</string>
|
||||||
|
<string name="recently_added">最近添加</string>
|
||||||
|
<string name="edit_track_label">编辑</string>
|
||||||
<string name="reset_library">重置曲库</string>
|
<string name="reset_library">重置曲库</string>
|
||||||
|
<string name="reset_library_confirm_title">确认重置曲库?</string>
|
||||||
|
<string name="reset_library_confirm_text">只会清空已扫描的数据库记录,不会删除你的音频文件。</string>
|
||||||
|
<string name="reset_library_confirm_action">确认重置</string>
|
||||||
<string name="scanning">正在扫描本地音频...</string>
|
<string name="scanning">正在扫描本地音频...</string>
|
||||||
<string name="scanned_count">已扫描 %1$d 首歌曲</string>
|
<string name="scanned_count">已扫描 %1$d 首歌曲</string>
|
||||||
<string name="cached_library">扫描过程中显示已保存曲库</string>
|
<string name="cached_library">扫描过程中显示已保存曲库</string>
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<string name="sound_effects_subtitle">Realtime & offline</string>
|
<string name="sound_effects_subtitle">Realtime & offline</string>
|
||||||
<string name="audio_cutter">Audio Cutter</string>
|
<string name="audio_cutter">Audio Cutter</string>
|
||||||
<string name="audio_cutter_subtitle">Trim, merge, denoise</string>
|
<string name="audio_cutter_subtitle">Trim, merge, denoise</string>
|
||||||
<string name="music_manager">Music Manager</string>
|
<string name="music_manager">Library</string>
|
||||||
<string name="music_manager_subtitle">Scan local library</string>
|
<string name="music_manager_subtitle">Scan local library</string>
|
||||||
<string name="upgrade_premium">Upgrade Premium</string>
|
<string name="upgrade_premium">Upgrade Premium</string>
|
||||||
<string name="premium_footer_desc">Unlock unlimited batch edits and local voice packs</string>
|
<string name="premium_footer_desc">Unlock unlimited batch edits and local voice packs</string>
|
||||||
@ -61,6 +61,9 @@
|
|||||||
<string name="done">Done</string>
|
<string name="done">Done</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="theme_system">System</string>
|
<string name="theme_system">System</string>
|
||||||
|
<string name="theme_light">Light</string>
|
||||||
|
<string name="theme_dark">Dark</string>
|
||||||
|
<string name="theme_dialog_text">Choose how AudioVibe should display. Light theme is the default.</string>
|
||||||
<string name="edit_metadata">Edit Metadata</string>
|
<string name="edit_metadata">Edit Metadata</string>
|
||||||
<string name="song_title">Song title</string>
|
<string name="song_title">Song title</string>
|
||||||
<string name="artist">Artist</string>
|
<string name="artist">Artist</string>
|
||||||
@ -115,9 +118,26 @@
|
|||||||
<string name="scan_permission_title">Scan local music</string>
|
<string name="scan_permission_title">Scan local music</string>
|
||||||
<string name="scan_permission_text">Allow AudioVibe to read audio files on this device. Files stay local and are used only to build your music library.</string>
|
<string name="scan_permission_text">Allow AudioVibe to read audio files on this device. Files stay local and are used only to build your music library.</string>
|
||||||
<string name="allow_access">Allow access</string>
|
<string name="allow_access">Allow access</string>
|
||||||
<string name="scan_again">Scan system library</string>
|
<string name="scan_again">Rescan</string>
|
||||||
<string name="scan_folder">Scan folder / drive</string>
|
<string name="scan_folder">Scan folder / drive</string>
|
||||||
|
<string name="scan_folder_short">Folder / USB</string>
|
||||||
|
<string name="sound_effects_soon">Soon</string>
|
||||||
|
<string name="build_local_library">Build local library</string>
|
||||||
|
<string name="build_local_library_desc">Scan to play, search, and edit tags</string>
|
||||||
|
<string name="scan_system_music">Scan system music</string>
|
||||||
|
<string name="scan_system_music_desc">Scan music files indexed by MediaStore</string>
|
||||||
|
<string name="scan_folder_drive_desc">Scan a selected folder or external drive</string>
|
||||||
|
<string name="scan_skip_duplicates">Scanning skips recognized files to avoid duplicates</string>
|
||||||
|
<string name="library_scanned_summary">Scanned %1$d songs</string>
|
||||||
|
<string name="library_scanned_summary_formats">Scanned %1$d songs · %2$d formats</string>
|
||||||
|
<string name="scanning_status_chip">Scanning</string>
|
||||||
|
<string name="all_songs">All songs</string>
|
||||||
|
<string name="recently_added">Recently added</string>
|
||||||
|
<string name="edit_track_label">Edit</string>
|
||||||
<string name="reset_library">Reset library</string>
|
<string name="reset_library">Reset library</string>
|
||||||
|
<string name="reset_library_confirm_title">Reset library?</string>
|
||||||
|
<string name="reset_library_confirm_text">This will clear the scanned database only. Your audio files will not be deleted.</string>
|
||||||
|
<string name="reset_library_confirm_action">Reset</string>
|
||||||
<string name="loading_library">Loading library...</string>
|
<string name="loading_library">Loading library...</string>
|
||||||
<string name="scanning">Scanning local audio...</string>
|
<string name="scanning">Scanning local audio...</string>
|
||||||
<string name="scanned_count">%1$d songs scanned</string>
|
<string name="scanned_count">%1$d songs scanned</string>
|
||||||
|
|||||||
@ -86,21 +86,20 @@ app/src/main/java/com/audio/vibe/
|
|||||||
│
|
│
|
||||||
├── ui/
|
├── ui/
|
||||||
│ ├── theme/
|
│ ├── theme/
|
||||||
│ │ ├── Color.kt # Material3 色彩 + 品牌色 #4285F4
|
│ │ ├── AppThemeMode.kt # 跟随系统 / 浅色 / 深色主题枚举
|
||||||
|
│ │ ├── Color.kt # Material3 色彩 + 当前主色 #0F68D8
|
||||||
│ │ ├── Type.kt # 排版 (headline 22sp / body 16sp)
|
│ │ ├── Type.kt # 排版 (headline 22sp / body 16sp)
|
||||||
│ │ └── Theme.kt # 明暗主题 + Android12 Dynamic Color
|
│ │ └── Theme.kt # Material3 ColorScheme + AudioVibePalette 动态主题
|
||||||
│ │
|
│ │
|
||||||
│ ├── components/
|
│ ├── components/
|
||||||
│ │ └── AudioVibeUi.kt # 10个共享组件 (VibeScreen/Card/Button/Waveform/VoiceDial...)
|
│ │ ├── AudioVibeUi.kt # 共享组件 + AudioVibeColors/AudioVibePalette
|
||||||
|
│ │ └── ToastExt.kt # 跟随 App 主题的 Toast 封装
|
||||||
│ │
|
│ │
|
||||||
│ ├── i18n/
|
│ ├── i18n/
|
||||||
│ │ └── AppLanguage.kt # 23种语言枚举 + AppStrings(100+字段) + CompositionLocal
|
│ │ └── AppLanguage.kt # 23种语言枚举 + AppStrings(100+字段) + CompositionLocal
|
||||||
│ │
|
│ │
|
||||||
│ ├── home/
|
│ ├── home/
|
||||||
│ │ └── HomeScreen.kt # 曲库优先工作台入口,不做营销式首页
|
│ │ ├── MusicManagerScreen.kt # 曲库工作台: 扫描/搜索/pager/播放/分页列表/重置确认
|
||||||
│ │
|
|
||||||
│ ├── musicmanager/
|
|
||||||
│ │ ├── MusicManagerScreen.kt # 音乐库: 扫描/搜索/播放/分页列表
|
|
||||||
│ │ ├── MusicManagerViewModel.kt # 状态管理 + 事件驱动
|
│ │ ├── MusicManagerViewModel.kt # 状态管理 + 事件驱动
|
||||||
│ │ └── LazyPlaybackControllerProvider.kt # 播放控制器懒加载
|
│ │ └── LazyPlaybackControllerProvider.kt # 播放控制器懒加载
|
||||||
│ │
|
│ │
|
||||||
@ -110,8 +109,8 @@ app/src/main/java/com/audio/vibe/
|
|||||||
│ │ ├── PlayerUiState.kt # 播放页 UI 状态模型 + 歌词状态
|
│ │ ├── PlayerUiState.kt # 播放页 UI 状态模型 + 歌词状态
|
||||||
│ │ ├── MiniPlayerBar.kt # 音乐管理页底部迷你播放条
|
│ │ ├── MiniPlayerBar.kt # 音乐管理页底部迷你播放条
|
||||||
│ │ ├── MiniPlayerState.kt # 迷你播放条状态映射
|
│ │ ├── MiniPlayerState.kt # 迷你播放条状态映射
|
||||||
│ │ ├── PlayerQueueSheet.kt # 当前队列弹窗
|
│ │ ├── PlayerQueueSheet.kt # 当前队列弹窗,跟随 App 主题
|
||||||
│ │ ├── PlayerBottomSheet.kt # 播放链路/参数弹窗
|
│ │ ├── PlayerBottomSheet.kt # 播放链路/参数弹窗,跟随 App 主题
|
||||||
│ │ ├── CoverImageLoader.kt # 封面加载:私有缓存/单曲sidecar/目录封面/占位
|
│ │ ├── CoverImageLoader.kt # 封面加载:私有缓存/单曲sidecar/目录封面/占位
|
||||||
│ │ └── lyrics/ # LRC/逐字歌词解析、加载和显示
|
│ │ └── lyrics/ # LRC/逐字歌词解析、加载和显示
|
||||||
│ │
|
│ │
|
||||||
@ -122,7 +121,7 @@ app/src/main/java/com/audio/vibe/
|
|||||||
│ ├── cutter/
|
│ ├── cutter/
|
||||||
│ │ └── AudioCutterScreen.kt # (Demo) 音频裁剪
|
│ │ └── AudioCutterScreen.kt # (Demo) 音频裁剪
|
||||||
│ ├── settings/
|
│ ├── settings/
|
||||||
│ │ └── SettingsScreen.kt # 设置页 + 语言切换 + 问题反馈弹窗
|
│ │ └── SettingsScreen.kt # 设置页 + 主题/语言切换 + 问题反馈弹窗
|
||||||
│ └── premium/
|
│ └── premium/
|
||||||
│ └── PremiumScreen.kt # (静态) 付费页
|
│ └── PremiumScreen.kt # (静态) 付费页
|
||||||
│
|
│
|
||||||
@ -138,7 +137,8 @@ app/src/main/java/com/audio/vibe/
|
|||||||
├── data/
|
├── data/
|
||||||
│ ├── local/
|
│ ├── local/
|
||||||
│ │ ├── MusicLibraryDatabase.kt # Room DB v3 + DAO + Entity
|
│ │ ├── MusicLibraryDatabase.kt # Room DB v3 + DAO + Entity
|
||||||
│ │ └── LanguagePreferences.kt # DataStore 语言偏好
|
│ │ ├── LanguagePreferences.kt # DataStore 语言偏好
|
||||||
|
│ │ └── ThemePreferences.kt # DataStore 主题偏好,默认浅色主题
|
||||||
│ │
|
│ │
|
||||||
│ ├── repository/
|
│ ├── repository/
|
||||||
│ │ ├── MediaStoreMusicScannerRepository.kt # 核心仓库实现:MediaStore/SAF 扫描与解析
|
│ │ ├── MediaStoreMusicScannerRepository.kt # 核心仓库实现:MediaStore/SAF 扫描与解析
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Codex 交接摘要
|
# Codex 交接摘要
|
||||||
|
|
||||||
最后更新:2026-05-28
|
最后更新:2026-05-29
|
||||||
|
|
||||||
新开 Codex 会话时,优先把这个文件作为短上下文。
|
新开 Codex 会话时,优先把这个文件作为短上下文。
|
||||||
|
|
||||||
@ -27,6 +27,10 @@ AudioVibe Android App。技术栈是 Kotlin + Compose + MVVM + Flow + Room/Pagin
|
|||||||
- `CoverImageLoader` 外置封面优先读取 App 私有缓存和单曲 sidecar,再读取同目录通用封面名。
|
- `CoverImageLoader` 外置封面优先读取 App 私有缓存和单曲 sidecar,再读取同目录通用封面名。
|
||||||
- 播放模式包括列表循环、顺序列表、单曲循环和随机播放;随机播放时当前列表 UI 应显示真实随机队列。
|
- 播放模式包括列表循环、顺序列表、单曲循环和随机播放;随机播放时当前列表 UI 应显示真实随机队列。
|
||||||
- 通知栏使用 MediaStyle,紧凑区 3 个按钮:上一曲、播放/暂停、下一曲。
|
- 通知栏使用 MediaStyle,紧凑区 3 个按钮:上一曲、播放/暂停、下一曲。
|
||||||
|
- 默认入口是 `music`,当前曲库工作台代码位于 `ui/home/MusicManagerScreen.kt`、`MusicManagerViewModel.kt` 和 `LazyPlaybackControllerProvider.kt`。
|
||||||
|
- 设置页主题支持跟随系统、浅色主题、深色主题,默认浅色主题;`ThemePreferences` 持久化选择。
|
||||||
|
- `AudioVibeTheme` 同时提供 Material 3 `ColorScheme` 和项目自定义 `LocalAudioVibePalette`,业务 UI 应通过 `AudioVibeColors` 取语义色。
|
||||||
|
- 当前队列弹窗、播放链路弹窗、语言/反馈/主题弹窗和应用内 Toast 都需要跟随 App 内主题。
|
||||||
|
|
||||||
## 必须保持的规则
|
## 必须保持的规则
|
||||||
|
|
||||||
@ -38,6 +42,7 @@ AudioVibe Android App。技术栈是 Kotlin + Compose + MVVM + Flow + Room/Pagin
|
|||||||
- 清空曲库时,如果播放服务已存在,需要同步 `stop()` 并清空 UI 的迷你播放条状态。
|
- 清空曲库时,如果播放服务已存在,需要同步 `stop()` 并清空 UI 的迷你播放条状态。
|
||||||
- 自然切曲应参考手动切曲路径,避免先发布 `ENDED/isPlaying=false` 的 UI 中间态。
|
- 自然切曲应参考手动切曲路径,避免先发布 `ENDED/isPlaying=false` 的 UI 中间态。
|
||||||
- 播放错误信息用 Toast 短暂提示,不要在播放页常驻展示错误条。
|
- 播放错误信息用 Toast 短暂提示,不要在播放页常驻展示错误条。
|
||||||
|
- Toast 必须使用主题化 `showVibeToast()` 或给 `showPlaybackToast()` 传入 `currentVibeToastStyle()`,不要在业务 Composable 中直接使用系统默认 Toast 样式。
|
||||||
- 进度条拖动时,UI 层可以保持按钮显示稳定,但不要为了 UI 闪动修改播放 controller 的真实状态语义。
|
- 进度条拖动时,UI 层可以保持按钮显示稳定,但不要为了 UI 闪动修改播放 controller 的真实状态语义。
|
||||||
- 歌词加载必须按当前歌曲异步更新,并丢弃旧歌曲的过期结果;切曲时不要先闪“无歌词”。
|
- 歌词加载必须按当前歌曲异步更新,并丢弃旧歌曲的过期结果;切曲时不要先闪“无歌词”。
|
||||||
- 歌词乱码修复应传入当前 App 语言环境,让中文、日文、韩文、俄文等候选编码按语言加权。
|
- 歌词乱码修复应传入当前 App 语言环境,让中文、日文、韩文、俄文等候选编码按语言加权。
|
||||||
@ -48,6 +53,8 @@ AudioVibe Android App。技术栈是 Kotlin + Compose + MVVM + Flow + Room/Pagin
|
|||||||
- 反馈日志通过 `FileProvider`(authority: `${applicationId}.feedback_files`)共享,路径映射 `files-path path="diagnostics/"`。
|
- 反馈日志通过 `FileProvider`(authority: `${applicationId}.feedback_files`)共享,路径映射 `files-path path="diagnostics/"`。
|
||||||
- 默认入口是曲库工作台,不做营销式首页,不在首屏大标题展示 AudioVibe 应用名。
|
- 默认入口是曲库工作台,不做营销式首页,不在首屏大标题展示 AudioVibe 应用名。
|
||||||
- 曲库空状态和工具栏都要有“扫描系统音乐”和“扫描文件夹 / U 盘”入口。
|
- 曲库空状态和工具栏都要有“扫描系统音乐”和“扫描文件夹 / U 盘”入口。
|
||||||
|
- 重置曲库前必须弹二次确认,确认后才发送 `ResetRequested`。
|
||||||
|
- 曲库主体使用类似 ViewPager 的结构;当前只开放“全部歌曲”,未实现页不要出现在主交互。
|
||||||
- 标签编辑从已扫描歌曲进入,不在首页放独立标签编辑卡片。
|
- 标签编辑从已扫描歌曲进入,不在首页放独立标签编辑卡片。
|
||||||
- 未实现的专辑、歌手、流派、格式选项卡不要进入主交互。
|
- 未实现的专辑、歌手、流派、格式选项卡不要进入主交互。
|
||||||
- 外置封面 SAF 授权必须选择歌曲所在目录或其上级目录;UI 要展示歌曲路径和建议授权目录。
|
- 外置封面 SAF 授权必须选择歌曲所在目录或其上级目录;UI 要展示歌曲路径和建议授权目录。
|
||||||
@ -73,8 +80,13 @@ AudioVibe Android App。技术栈是 Kotlin + Compose + MVVM + Flow + Room/Pagin
|
|||||||
- `app/src/main/java/com/audio/vibe/domain/model/PlayMode.kt`
|
- `app/src/main/java/com/audio/vibe/domain/model/PlayMode.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/domain/model/ScannedAudioTrack.kt`
|
- `app/src/main/java/com/audio/vibe/domain/model/ScannedAudioTrack.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/domain/repository/MusicScannerRepository.kt`
|
- `app/src/main/java/com/audio/vibe/domain/repository/MusicScannerRepository.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/ui/musicmanager/MusicManagerScreen.kt`
|
- `app/src/main/java/com/audio/vibe/data/local/ThemePreferences.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/ui/musicmanager/MusicManagerViewModel.kt`
|
- `app/src/main/java/com/audio/vibe/ui/theme/AppThemeMode.kt`
|
||||||
|
- `app/src/main/java/com/audio/vibe/ui/home/MusicManagerScreen.kt`
|
||||||
|
- `app/src/main/java/com/audio/vibe/ui/home/MusicManagerViewModel.kt`
|
||||||
|
- `app/src/main/java/com/audio/vibe/ui/home/LazyPlaybackControllerProvider.kt`
|
||||||
|
- `app/src/main/java/com/audio/vibe/ui/components/AudioVibeUi.kt`
|
||||||
|
- `app/src/main/java/com/audio/vibe/ui/components/ToastExt.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/ui/player/PlayerScreen.kt`
|
- `app/src/main/java/com/audio/vibe/ui/player/PlayerScreen.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/ui/player/PlayerViewModel.kt`
|
- `app/src/main/java/com/audio/vibe/ui/player/PlayerViewModel.kt`
|
||||||
- `app/src/main/java/com/audio/vibe/ui/player/MiniPlayerBar.kt`
|
- `app/src/main/java/com/audio/vibe/ui/player/MiniPlayerBar.kt`
|
||||||
@ -97,7 +109,7 @@ AudioVibe Android App。技术栈是 Kotlin + Compose + MVVM + Flow + Room/Pagin
|
|||||||
|
|
||||||
## 建议下一步
|
## 建议下一步
|
||||||
|
|
||||||
1. 按最新 UI 方向把默认工作台改成曲库优先:首屏不展示 App 名称,空状态提供扫描系统音乐和扫描文件夹 / U 盘。
|
1. 真机复测主题设置:跟随系统、浅色主题、深色主题都能切换曲库、设置页、标签编辑页、当前队列弹窗、播放链路弹窗和 Toast。
|
||||||
2. 真机复测标签编辑页:只改基础标签时保存按钮可见;内嵌封面、外置封面、基础标签联合保存路径都能给出明确成功/失败提示。
|
2. 真机复测标签编辑页:只改基础标签时保存按钮可见;内嵌封面、外置封面、基础标签联合保存路径都能给出明确成功/失败提示。
|
||||||
3. 真机复测外置封面 SAF:已授权目录时不重复弹授权;选错目录时提示歌曲路径和正确授权目录;保存后同目录其它歌曲不显示这张单曲封面。
|
3. 真机复测外置封面 SAF:已授权目录时不重复弹授权;选错目录时提示歌曲路径和正确授权目录;保存后同目录其它歌曲不显示这张单曲封面。
|
||||||
4. 真机验证反馈分享的邮箱应用识别和 `setPackage()` 直投,覆盖单/多邮箱应用场景和附带日志。
|
4. 真机验证反馈分享的邮箱应用识别和 `setPackage()` 直投,覆盖单/多邮箱应用场景和附带日志。
|
||||||
|
|||||||
@ -192,7 +192,7 @@ fun String.isEmail(): Boolean = this.contains("@") && this.contains(".")
|
|||||||
"test@abc.com".isEmail() // true — 就像 String 自带的方法
|
"test@abc.com".isEmail() // true — 就像 String 自带的方法
|
||||||
|
|
||||||
// 实际项目中的例子
|
// 实际项目中的例子
|
||||||
fun Context.toast(message: String) = Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
|
// 业务 UI 中优先用 showVibeToast()/showPlaybackToast(..., style),避免系统 Toast 不跟随 App 主题。
|
||||||
fun View.visible() { visibility = View.VISIBLE }
|
fun View.visible() { visibility = View.VISIBLE }
|
||||||
fun View.gone() { visibility = View.GONE }
|
fun View.gone() { visibility = View.GONE }
|
||||||
|
|
||||||
|
|||||||
@ -113,6 +113,7 @@ UI 应该在扫描过程中继续展示已有音乐库。扫描进度和分页
|
|||||||
- 新扫描歌曲写入 `MusicTrackEntity` 时必须使用 `id = 0L`。
|
- 新扫描歌曲写入 `MusicTrackEntity` 时必须使用 `id = 0L`。
|
||||||
- DAO 的 `upsertTracks` 会通过 `sourcePath` 查已有记录,并复用已有数据库 id。
|
- DAO 的 `upsertTracks` 会通过 `sourcePath` 查已有记录,并复用已有数据库 id。
|
||||||
- 不要把路径 hash 或扫描临时 id 写入 Room 主键。
|
- 不要把路径 hash 或扫描临时 id 写入 Room 主键。
|
||||||
|
- 清空曲库入口必须先弹确认框,说明只清空扫描数据库记录、不删除音频文件,用户确认后才触发 reset。
|
||||||
- 清空曲库后,播放状态、`playingId` 和迷你播放条也必须重置,避免 UI 继续引用已删除歌曲。
|
- 清空曲库后,播放状态、`playingId` 和迷你播放条也必须重置,避免 UI 继续引用已删除歌曲。
|
||||||
|
|
||||||
## 已知风险
|
## 已知风险
|
||||||
|
|||||||
@ -110,6 +110,7 @@
|
|||||||
- 队列显示顺序必须来自真实播放队列:随机播放时显示随机列表,非随机播放时显示原始列表。
|
- 队列显示顺序必须来自真实播放队列:随机播放时显示随机列表,非随机播放时显示原始列表。
|
||||||
- 打开队列弹窗时首次滚动到当前播放项;弹窗保持打开期间,自然切曲不应强制回滚列表位置。
|
- 打开队列弹窗时首次滚动到当前播放项;弹窗保持打开期间,自然切曲不应强制回滚列表位置。
|
||||||
- 点击队列歌曲按展示索引切曲。
|
- 点击队列歌曲按展示索引切曲。
|
||||||
|
- 当前列表弹窗颜色必须跟随 App 内主题:`Surface` 背景、`Ink` 主文字、`Muted` 次文字、`Line` 分割线、`Primary/PrimarySoft` 选中态。
|
||||||
|
|
||||||
## 格式路由
|
## 格式路由
|
||||||
|
|
||||||
@ -173,8 +174,9 @@ FFmpeg 链路:
|
|||||||
- 歌曲名、歌手名在播放页和迷你播放条中显示不全时使用走马灯。
|
- 歌曲名、歌手名在播放页和迷你播放条中显示不全时使用走马灯。
|
||||||
- 进度条支持拖动 seek;拖动过程中 UI 进度不受后台播放进度覆盖,松手后 seek 到目标位置。
|
- 进度条支持拖动 seek;拖动过程中 UI 进度不受后台播放进度覆盖,松手后 seek 到目标位置。
|
||||||
- 播放页对 seek 后的按钮闪动可以在 UI 层做短暂显示保持,但不应改变 controller 的真实播放状态。
|
- 播放页对 seek 后的按钮闪动可以在 UI 层做短暂显示保持,但不应改变 controller 的真实播放状态。
|
||||||
- 播放失败信息通过 Toast 短暂提示,不在播放页常驻展示错误条。
|
- 播放失败信息通过主题化 Toast 短暂提示,不在播放页常驻展示错误条;Toast 背景、文字和边框需要跟随 App 内主题。
|
||||||
- 解码参数加载前保留上一帧参数,避免播放链路信息闪为空或短暂闪成错误链路。
|
- 解码参数加载前保留上一帧参数,避免播放链路信息闪为空或短暂闪成错误链路。
|
||||||
|
- 播放链路/播放信息弹窗颜色必须跟随 App 内主题,不能固定为深色 sheet。
|
||||||
|
|
||||||
## 文件访问兜底
|
## 文件访问兜底
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# AudioVibe 项目上下文
|
# AudioVibe 项目上下文
|
||||||
|
|
||||||
最后更新:2026-05-28
|
最后更新:2026-05-29
|
||||||
|
|
||||||
## 产品定位
|
## 产品定位
|
||||||
|
|
||||||
@ -39,6 +39,7 @@ AudioVibe 是面向海外用户的 Android 音频管理、播放、标签编辑
|
|||||||
- `data/local`
|
- `data/local`
|
||||||
- `MusicLibraryDatabase.kt`:Room 数据库、`MusicTrackEntity`、FTS 表、DAO 查询、PagingSource、播放投影、实体映射。
|
- `MusicLibraryDatabase.kt`:Room 数据库、`MusicTrackEntity`、FTS 表、DAO 查询、PagingSource、播放投影、实体映射。
|
||||||
- `LanguagePreferences.kt`:保存 App 语言选项。
|
- `LanguagePreferences.kt`:保存 App 语言选项。
|
||||||
|
- `ThemePreferences.kt`:保存 App 主题选项,默认浅色主题,支持跟随系统、浅色主题、深色主题。
|
||||||
|
|
||||||
- `data/repository`
|
- `data/repository`
|
||||||
- `MediaStoreMusicScannerRepository.kt`:音乐扫描、MediaStore 扫描、SAF 文件夹扫描、歌曲信息解析、能力标识、Room 写入。
|
- `MediaStoreMusicScannerRepository.kt`:音乐扫描、MediaStore 扫描、SAF 文件夹扫描、歌曲信息解析、能力标识、Room 写入。
|
||||||
@ -62,8 +63,8 @@ AudioVibe 是面向海外用户的 Android 音频管理、播放、标签编辑
|
|||||||
- `domain/repository`
|
- `domain/repository`
|
||||||
- `MusicScannerRepository.kt`:扫描、分页、摘要、播放队列 id 的仓库契约。
|
- `MusicScannerRepository.kt`:扫描、分页、摘要、播放队列 id 的仓库契约。
|
||||||
|
|
||||||
- `ui/musicmanager`
|
- `ui/home`
|
||||||
- `MusicManagerScreen.kt`:Compose 音乐管理页面。
|
- `MusicManagerScreen.kt`:Compose 曲库工作台页面;默认首屏入口,包含搜索、扫描、重置确认、曲库 pager、播放和编辑入口。
|
||||||
- `MusicManagerViewModel.kt`:扫描状态、搜索/分类状态、播放状态接线。
|
- `MusicManagerViewModel.kt`:扫描状态、搜索/分类状态、播放状态接线。
|
||||||
- `LazyPlaybackControllerProvider.kt`:只有真正播放时才启动并绑定播放服务。
|
- `LazyPlaybackControllerProvider.kt`:只有真正播放时才启动并绑定播放服务。
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ AudioVibe 是面向海外用户的 Android 音频管理、播放、标签编辑
|
|||||||
- `PlayerScreen.kt`:完整播放页,包含封面、播放控制、可拖动进度条、播放模式、当前队列入口、播放链路入口和歌词显示。
|
- `PlayerScreen.kt`:完整播放页,包含封面、播放控制、可拖动进度条、播放模式、当前队列入口、播放链路入口和歌词显示。
|
||||||
- `PlayerViewModel.kt`:把 `PlaybackState` 映射为播放页 UI 状态,转发播放控制事件,并按当前歌曲异步加载歌词。
|
- `PlayerViewModel.kt`:把 `PlaybackState` 映射为播放页 UI 状态,转发播放控制事件,并按当前歌曲异步加载歌词。
|
||||||
- `MiniPlayerBar.kt` / `MiniPlayerState.kt`:音乐管理页底部迷你播放条和状态映射。
|
- `MiniPlayerBar.kt` / `MiniPlayerState.kt`:音乐管理页底部迷你播放条和状态映射。
|
||||||
- `PlayerQueueSheet.kt` / `PlayerBottomSheet.kt`:当前队列弹窗和播放链路弹窗。
|
- `PlayerQueueSheet.kt` / `PlayerBottomSheet.kt`:当前队列弹窗和播放链路弹窗;颜色跟随 App 内主题,不固定深色。
|
||||||
- `lyrics/`:LRC 外置/内嵌歌词加载、行级/逐字歌词解析和歌词 UI。
|
- `lyrics/`:LRC 外置/内嵌歌词加载、行级/逐字歌词解析和歌词 UI。
|
||||||
- `CoverImageLoader.kt`:封面加载。外置封面优先读取 App 私有缓存和单曲 sidecar,再读取同目录通用封面名,避免单曲编辑污染同目录其它歌曲。
|
- `CoverImageLoader.kt`:封面加载。外置封面优先读取 App 私有缓存和单曲 sidecar,再读取同目录通用封面名,避免单曲编辑污染同目录其它歌曲。
|
||||||
|
|
||||||
@ -107,6 +108,11 @@ AudioVibe 是面向海外用户的 Android 音频管理、播放、标签编辑
|
|||||||
- 标签编辑只能从已扫描歌曲进入,不在首页做独立标签编辑入口。
|
- 标签编辑只能从已扫描歌曲进入,不在首页做独立标签编辑入口。
|
||||||
- 专辑、歌手、流派、格式选项卡暂不实现主路径;可以预留扩展位,但不能让用户误以为当前可用。
|
- 专辑、歌手、流派、格式选项卡暂不实现主路径;可以预留扩展位,但不能让用户误以为当前可用。
|
||||||
- 音效模块当前是预留入口,视觉层级低于曲库和扫描。
|
- 音效模块当前是预留入口,视觉层级低于曲库和扫描。
|
||||||
|
- 曲库主体使用类似 ViewPager 的结构承载页面;当前只开放“全部歌曲”页,未实现的专辑/歌手/格式页不展示空入口。
|
||||||
|
- 点击重置曲库必须先弹确认框,确认文案需要说明只清空扫描数据库记录,不删除用户音频文件。
|
||||||
|
- 主题设置提供跟随系统、浅色主题、深色主题;默认浅色主题。主题选择需要同时驱动 Material 3 `ColorScheme` 和项目自定义 `AudioVibePalette`。
|
||||||
|
- `AudioVibeColors` 中会随主题变化的语义色来自 `LocalAudioVibePalette`;固定沉浸/品牌色如 `Dark`、`DarkPanel`、`Purple` 可以保持默认值。
|
||||||
|
- 应用内 Toast 使用 `showVibeToast()` / `currentVibeToastStyle()`,背景、文字和边框分别跟随 `Surface`、`Ink`、`Line`;不要在业务 UI 里直接使用系统默认 `Toast.makeText()`。
|
||||||
- 标签编辑页只要任一基础标签或封面草稿变化,就应显示保存按钮;点击保存后再判断格式能力、文件权限或 SAF 授权。
|
- 标签编辑页只要任一基础标签或封面草稿变化,就应显示保存按钮;点击保存后再判断格式能力、文件权限或 SAF 授权。
|
||||||
- 内嵌封面成功写入后才设置 `isCoverEdited = true`。
|
- 内嵌封面成功写入后才设置 `isCoverEdited = true`。
|
||||||
- 外置封面写入不使用共享 `cover.jpg` 策略,必须按歌曲生成 sidecar 并写入私有缓存,只影响当前歌曲。
|
- 外置封面写入不使用共享 `cover.jpg` 策略,必须按歌曲生成 sidecar 并写入私有缓存,只影响当前歌曲。
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Review 检查清单
|
# Review 检查清单
|
||||||
|
|
||||||
最后更新:2026-05-28
|
最后更新:2026-05-29
|
||||||
|
|
||||||
检查扫描、播放、Room、音乐管理、标签编辑或封面编辑相关改动时使用此清单。
|
检查扫描、播放、Room、音乐管理、标签编辑或封面编辑相关改动时使用此清单。
|
||||||
|
|
||||||
@ -66,12 +66,17 @@
|
|||||||
- 扫描过程中已有歌曲保持可见。
|
- 扫描过程中已有歌曲保持可见。
|
||||||
- 摘要数量和当前查询/列表状态一致。
|
- 摘要数量和当前查询/列表状态一致。
|
||||||
- 搜索栏和分类栏不会因为扫描消失。
|
- 搜索栏和分类栏不会因为扫描消失。
|
||||||
|
- 曲库主体使用 pager 承载内容,当前只开放“全部歌曲”;未实现的专辑/歌手/格式页不要展示空入口。
|
||||||
|
- 点击重置曲库先弹确认框,用户确认后才发送重置事件。
|
||||||
- 重置会先取消扫描,再清空数据库。
|
- 重置会先取消扫描,再清空数据库。
|
||||||
- 重置曲库会同步停止已存在的播放服务状态并隐藏迷你播放条。
|
- 重置曲库会同步停止已存在的播放服务状态并隐藏迷你播放条。
|
||||||
- 新增 UI 不硬编码用户可见字符串。
|
- 新增 UI 不硬编码用户可见字符串。
|
||||||
- 新增页面或组件时保留 Compose Preview。
|
- 新增页面或组件时保留 Compose Preview。
|
||||||
- 播放页和迷你播放条的长歌曲名/歌手名使用走马灯或稳定占位,切曲不应导致布局跳动。
|
- 播放页和迷你播放条的长歌曲名/歌手名使用走马灯或稳定占位,切曲不应导致布局跳动。
|
||||||
- 播放错误信息使用 Toast 短暂提示,不在播放页常驻展示错误条。
|
- 播放错误信息使用 Toast 短暂提示,不在播放页常驻展示错误条。
|
||||||
|
- 播放错误 Toast 使用 App 主题化样式,颜色跟随当前主题,不使用系统默认 Toast 黑/白样式。
|
||||||
|
- 当前队列弹窗颜色跟随 App 内主题:`Surface` 背景、`Ink` 主文字、`Muted` 次文字、`Line` 分割线、`Primary/PrimarySoft` 选中态。
|
||||||
|
- 播放链路/播放信息弹窗颜色跟随 App 内主题,不能固定为深色 sheet。
|
||||||
- 进度条拖动时,拖动中的显示进度不被后台进度覆盖;松手后按钮显示稳定,不通过修改播放层真实状态来遮蔽 UI 闪动。
|
- 进度条拖动时,拖动中的显示进度不被后台进度覆盖;松手后按钮显示稳定,不通过修改播放层真实状态来遮蔽 UI 闪动。
|
||||||
- 歌词区域保持稳定占位;切曲时旧歌词不能错误落到新歌曲,也不能在新歌词加载前闪出“无歌词”。
|
- 歌词区域保持稳定占位;切曲时旧歌词不能错误落到新歌曲,也不能在新歌词加载前闪出“无歌词”。
|
||||||
- 外置歌词读取覆盖真实文件、SAF Document sibling、MediaStore sibling;文本读取按字节修复编码,不使用默认 `readText()`。
|
- 外置歌词读取覆盖真实文件、SAF Document sibling、MediaStore sibling;文本读取按字节修复编码,不使用默认 `readText()`。
|
||||||
@ -97,6 +102,9 @@
|
|||||||
## 设置 / 反馈
|
## 设置 / 反馈
|
||||||
|
|
||||||
- 设置页不再提供全局存储路径选项。
|
- 设置页不再提供全局存储路径选项。
|
||||||
|
- 主题设置提供跟随系统、浅色主题、深色主题,默认浅色主题,并持久化保存。
|
||||||
|
- 主题切换同时影响 Material 3 组件、`AudioVibeColors` 自定义色板、弹窗、播放队列/链路 bottom sheet 和 Toast。
|
||||||
|
- 新增业务 Composable 不直接调用系统默认 `Toast.makeText()`;应使用 `showVibeToast()` 或带主题样式的 `showPlaybackToast()`。
|
||||||
- release 版本不在界面展示 Timber 调试日志,但反馈流程仍可读取诊断日志文件。
|
- release 版本不在界面展示 Timber 调试日志,但反馈流程仍可读取诊断日志文件。
|
||||||
- 反馈分享先查询邮箱应用;无邮箱应用时直接提示。
|
- 反馈分享先查询邮箱应用;无邮箱应用时直接提示。
|
||||||
- 邮箱分享应预填 `minmin666mz@gmail.com`;如果系统应用不保证收件人字段,UI 要提示用户手动确认。
|
- 邮箱分享应预填 `minmin666mz@gmail.com`;如果系统应用不保证收件人字段,UI 要提示用户手动确认。
|
||||||
|
|||||||
@ -67,13 +67,13 @@ AI轻量化:本地AI音效(低延迟、保护隐私)+ 本地多格式播
|
|||||||
|
|
||||||
扫描入口:空曲库和工具栏都要提供“扫描系统音乐”和“扫描文件夹 / U 盘”两个入口。
|
扫描入口:空曲库和工具栏都要提供“扫描系统音乐”和“扫描文件夹 / U 盘”两个入口。
|
||||||
|
|
||||||
音乐列表:曲库已有数据时直接展示歌曲列表,支持搜索、播放、进入标签编辑。
|
音乐列表:曲库已有数据时直接展示歌曲列表,支持搜索、播放、进入标签编辑。曲库主体采用类似 ViewPager 的结构承载内容,当前 MVP 只开放“全部歌曲”页;专辑、歌手、格式等页面在能力完成前不展示空入口。
|
||||||
|
|
||||||
播放入口:底部迷你播放条显示当前歌曲,点击进入完整播放页。
|
播放入口:底部迷你播放条显示当前歌曲,点击进入完整播放页。
|
||||||
|
|
||||||
预留入口:音效模块可以作为后续能力入口,但视觉层级低于曲库和扫描;音频剪辑、专辑/歌手/格式选项卡等未实现功能不进入主路径。
|
预留入口:音效模块可以作为后续能力入口,但视觉层级低于曲库和扫描;音频剪辑、专辑/歌手/格式选项卡等未实现功能不进入主路径。
|
||||||
|
|
||||||
交互要求:页面加载时间≤1秒,常用操作一步可达,支持深色/浅色模式自动切换(适配系统设置)。
|
交互要求:页面加载时间≤1秒,常用操作一步可达,支持跟随系统、浅色主题、深色主题三种主题设置;默认使用浅色主题。
|
||||||
|
|
||||||
4.1.2 音频标签编辑模块(核心刚需)
|
4.1.2 音频标签编辑模块(核心刚需)
|
||||||
|
|
||||||
@ -167,13 +167,13 @@ AI轻量化:本地AI音效(低延迟、保护隐私)+ 本地多格式播
|
|||||||
|
|
||||||
通知栏与锁屏控制:播放时需要显示系统媒体通知,包含封面、歌曲名、歌手,以及上一曲、播放/暂停、下一曲三个核心控制按钮;必要时可通过删除通知或系统入口停止播放;通知栏、锁屏媒体控件、底部播放条和完整播放页必须共享同一播放状态;Android 13+ 需适配通知权限,Android 8.0+ 需使用前台服务通知渠道,用户拒绝通知权限时仍允许前台播放页控制,但后台播放能力需给出清晰提示
|
通知栏与锁屏控制:播放时需要显示系统媒体通知,包含封面、歌曲名、歌手,以及上一曲、播放/暂停、下一曲三个核心控制按钮;必要时可通过删除通知或系统入口停止播放;通知栏、锁屏媒体控件、底部播放条和完整播放页必须共享同一播放状态;Android 13+ 需适配通知权限,Android 8.0+ 需使用前台服务通知渠道,用户拒绝通知权限时仍允许前台播放页控制,但后台播放能力需给出清晰提示
|
||||||
|
|
||||||
播放队列与状态:播放页和底部播放条共享同一播放状态;从搜索结果或分类列表播放时,应按当前列表顺序形成队列;支持列表循环、顺序列表、单曲循环和随机播放;随机播放时当前队列弹窗应展示真实随机队列而不是原始列表;切换搜索/分类不应打断正在播放的队列,除非用户主动播放新歌曲
|
播放队列与状态:播放页和底部播放条共享同一播放状态;从搜索结果或分类列表播放时,应按当前列表顺序形成队列;支持列表循环、顺序列表、单曲循环和随机播放;随机播放时当前队列弹窗应展示真实随机队列而不是原始列表;切换搜索/分类不应打断正在播放的队列,除非用户主动播放新歌曲。当前队列弹窗和播放链路/播放信息弹窗必须跟随 App 内主题设置,不能固定为深色或系统默认样式。
|
||||||
|
|
||||||
交互要求:扫描速度≤5秒(100首常见格式歌曲),分类清晰,搜索响应≤0.5秒;底部播放条状态更新延迟≤300ms,通知栏媒体状态同步延迟≤500ms,进度拖动响应≤200ms;DSD、WV、高采样率 FLAC/WAV/ALAC 等大文件允许后台渐进式解析,不阻塞主界面
|
交互要求:扫描速度≤5秒(100首常见格式歌曲),分类清晰,搜索响应≤0.5秒;底部播放条状态更新延迟≤300ms,通知栏媒体状态同步延迟≤500ms,进度拖动响应≤200ms;DSD、WV、高采样率 FLAC/WAV/ALAC 等大文件允许后台渐进式解析,不阻塞主界面
|
||||||
|
|
||||||
4.1.6 基础设置模块
|
4.1.6 基础设置模块
|
||||||
|
|
||||||
主题设置:支持深色/浅色/系统自动切换
|
主题设置:提供“跟随系统、浅色主题、深色主题”三个选项,默认选择浅色主题。主题选择需要持久化保存,并同时影响 Material 3 组件、项目自定义颜色 token、设置弹窗、当前队列弹窗、播放链路弹窗和应用内 Toast。
|
||||||
|
|
||||||
语言设置:MVP支持跟随系统、英文、中文;跟随系统时非中文语言统一显示英文,后续迭代扩展日文、韩文、德文、法文等目标市场语言
|
语言设置:MVP支持跟随系统、英文、中文;跟随系统时非中文语言统一显示英文,后续迭代扩展日文、韩文、德文、法文等目标市场语言
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ AI音效(2-3个自然款):真人女声、真人男声、旁白音(无机
|
|||||||
|
|
||||||
极简操作:每个核心功能操作步骤≤3步,避免复杂流程,贴合移动端单手操作习惯
|
极简操作:每个核心功能操作步骤≤3步,避免复杂流程,贴合移动端单手操作习惯
|
||||||
|
|
||||||
反馈清晰:操作后有明显反馈(如按钮变色、提示音、弹窗提示),避免用户困惑
|
反馈清晰:操作后有明显反馈(如按钮变色、主题化 Toast、弹窗提示),避免用户困惑。Toast 颜色必须跟随 App 内主题选择,不依赖系统 Toast 默认样式。
|
||||||
|
|
||||||
一致性:所有模块的按钮样式、颜色、字体保持一致,导航逻辑统一(顶部标题+底部提示,核心入口固定)
|
一致性:所有模块的按钮样式、颜色、字体保持一致,导航逻辑统一(顶部标题+底部提示,核心入口固定)
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,31 @@ AudioVibe 是面向海外用户的 Android 音频管理、播放、标签编辑
|
|||||||
|
|
||||||
### 2.1 色彩
|
### 2.1 色彩
|
||||||
|
|
||||||
使用低饱和、偏冷静的音乐工具色系。主色建议为柔和蓝、青绿或蓝紫之间的 Material 3 tonal palette,避免高饱和紫、荧光蓝、鲜红、亮绿。
|
使用低饱和、偏冷静的音乐工具色系。当前项目主色调以“冷白背景 + 清蓝主色 + 深墨文字”为准,避免高饱和紫、荧光蓝、鲜红、亮绿。
|
||||||
|
|
||||||
|
当前浅色模式推荐 token:
|
||||||
|
|
||||||
|
| Token | 色值 | 用途 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Primary | `#0F68D8` | 选中状态、主按钮、播放进度、格式标签描边 |
|
||||||
|
| Primary Soft | `#EAF2FF` | 扫描中提示、弱选中背景 |
|
||||||
|
| Background | `#F6F8FB` | App 页面底色 |
|
||||||
|
| Surface | `#FFFFFF` | 搜索框、工具按钮、底部栏、列表容器 |
|
||||||
|
| Ink | `#111827` | 标题、主要文字、工具栏图标 |
|
||||||
|
| Muted | `#737D8C` | 副标题、说明、未选中底部导航 |
|
||||||
|
| Line | `#DDE5F0` | 1dp 边框、列表分割线 |
|
||||||
|
|
||||||
|
当前深色模式推荐 token:
|
||||||
|
|
||||||
|
| Token | 色值 | 用途 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Primary | `#6EA8FF` | 深色背景上的选中状态、播放进度、主要强调 |
|
||||||
|
| Primary Soft | `#182B49` | 深色模式弱选中背景、轻提示块 |
|
||||||
|
| Background | `#101827` | App 深色页面底色 |
|
||||||
|
| Surface | `#1D263A` | 搜索框、工具按钮、底部栏、弹窗、列表容器 |
|
||||||
|
| Ink | `#F6F8FB` | 深色模式标题、主要文字 |
|
||||||
|
| Muted | `#AAB4C3` | 深色模式副标题、说明、未选中状态 |
|
||||||
|
| Line | `#344056` | 深色模式 1dp 边框、列表分割线 |
|
||||||
|
|
||||||
推荐色彩策略:
|
推荐色彩策略:
|
||||||
|
|
||||||
@ -33,6 +57,14 @@ AudioVibe 是面向海外用户的 Android 音频管理、播放、标签编辑
|
|||||||
|
|
||||||
浅色模式背景应干净,不要大面积米黄、奶油、棕色、粉紫渐变。深色模式要降低亮色面积,避免夜间刺眼。
|
浅色模式背景应干净,不要大面积米黄、奶油、棕色、粉紫渐变。深色模式要降低亮色面积,避免夜间刺眼。
|
||||||
|
|
||||||
|
主题实现要求:
|
||||||
|
|
||||||
|
- 设置页主题提供三个选项:跟随系统、浅色主题、深色主题;默认选择浅色主题。
|
||||||
|
- App 主题切换必须同时驱动 Material 3 `ColorScheme` 和项目自定义 `AudioVibePalette`,不能只让系统控件或弹窗变色。
|
||||||
|
- `Primary`、`PrimarySoft`、`Background`、`Surface`、`Ink`、`Muted`、`Line`、`Success`、`Warning` 跟随主题变化。
|
||||||
|
- `Dark`、`DarkPanel`、`Purple` 属于固定品牌/沉浸用途颜色,可以保持默认值,不需要在每套主题里重复定义。
|
||||||
|
- 新增 UI 不直接写旧蓝、旧紫或临时半透明白色;优先使用 `AudioVibeColors` 语义 token。
|
||||||
|
|
||||||
### 2.2 字体
|
### 2.2 字体
|
||||||
|
|
||||||
Android 优先使用系统字体与 Material 3 type scale,不单独引入花哨字体。
|
Android 优先使用系统字体与 Material 3 type scale,不单独引入花哨字体。
|
||||||
@ -83,6 +115,7 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
- 禁用态不能只变灰,要保留原因说明。
|
- 禁用态不能只变灰,要保留原因说明。
|
||||||
- 危险操作必须确认。
|
- 危险操作必须确认。
|
||||||
- Toast 只用于短反馈;复杂失败要给可执行下一步。
|
- Toast 只用于短反馈;复杂失败要给可执行下一步。
|
||||||
|
- Toast 必须使用 App 内主题化样式:背景跟随 `Surface`,文字跟随 `Ink`,边框跟随 `Line`,不能依赖系统 Toast 默认黑/白样式。
|
||||||
|
|
||||||
### 3.3 动效
|
### 3.3 动效
|
||||||
|
|
||||||
@ -112,7 +145,7 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
- 不在首屏大标题展示 AudioVibe 应用名,标题使用“曲库”“音乐”“Library”等任务型名称。
|
- 不在首屏大标题展示 AudioVibe 应用名,标题使用“曲库”“音乐”“Library”等任务型名称。
|
||||||
- 音乐管理是主入口,不需要再让用户先点一次功能卡片才能进入常用列表。
|
- 音乐管理是主入口,不需要再让用户先点一次功能卡片才能进入常用列表。
|
||||||
- 空曲库状态必须提供两个明确操作:扫描系统音乐、扫描文件夹 / U 盘。
|
- 空曲库状态必须提供两个明确操作:扫描系统音乐、扫描文件夹 / U 盘。
|
||||||
- 音效模块只作为预留入口,视觉弱于曲库和扫描;未实现前不做强引导。
|
- 音效模块只作为底部导航预留入口,顶部不放音效 pill;未实现前点击只提示“暂不开放”,不进入空页面。
|
||||||
- 标签编辑不作为首页独立入口,必须从已扫描歌曲列表、歌曲详情或播放页进入。
|
- 标签编辑不作为首页独立入口,必须从已扫描歌曲列表、歌曲详情或播放页进入。
|
||||||
- 首页不应出现大 Hero、夸张插画、广告感横幅。免费/高级能力提示要弱化,不压过核心功能。
|
- 首页不应出现大 Hero、夸张插画、广告感横幅。免费/高级能力提示要弱化,不压过核心功能。
|
||||||
|
|
||||||
@ -124,12 +157,16 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
|
|
||||||
- 搜索入口,聚焦态清晰。
|
- 搜索入口,聚焦态清晰。
|
||||||
- 扫描系统音乐、扫描文件夹 / U 盘入口,空状态和工具栏都要容易发现。
|
- 扫描系统音乐、扫描文件夹 / U 盘入口,空状态和工具栏都要容易发现。
|
||||||
|
- 已扫描态工具栏为一行:重新扫描、重置数据库图标、文件夹 / U 盘。该行图标和文字使用深墨色,不能使用蓝色抢占主按钮层级;为避免拥挤,工具栏使用短文案,空状态按钮使用完整文案。
|
||||||
|
- 点击重置数据库/重置曲库前必须弹出确认框,说明只清空扫描数据库记录,不删除用户音频文件,防止误触。
|
||||||
|
- 空曲库状态必须贴近当前设计稿:居中插画、标题“建立本地曲库”、说明文案、竖向主按钮“扫描系统音乐”、竖向次按钮“扫描文件夹 / U 盘”、底部轻提示。
|
||||||
|
- 曲库主体使用类似 ViewPager 的结构承载页面内容。当前只开放“全部歌曲”页;后续文件夹、格式、专辑、歌手等页面只能在能力完成后加入 pager,不要先展示空页。
|
||||||
- 列表项显示封面、标题、艺术家、格式/采样率/位深等关键标签。
|
- 列表项显示封面、标题、艺术家、格式/采样率/位深等关键标签。
|
||||||
- 正在播放歌曲要有稳定高亮,不因分页刷新跳动。
|
- 正在播放歌曲用播放/暂停图标表达,不在列表行加大面积高亮。
|
||||||
- 扫描状态要明确显示进度、数量和失败摘要。
|
- 扫描状态要明确显示进度、数量和失败摘要。
|
||||||
- 底部迷你播放条固定在导航栏上方,列表底部预留空间。
|
- 底部迷你播放条固定在导航栏上方,列表底部预留空间。
|
||||||
|
|
||||||
暂不实现的专辑、歌手、流派、格式选项卡不要出现在主路径里,避免用户点进去发现空功能。可以预留后续扩展位置,但必须弱化为非主交互。
|
暂不实现的专辑、歌手、流派、格式选项卡不要出现在主路径里,避免用户点进去发现空功能。当前只保留“全部歌曲”,不要展示“最近添加”等未实现筛选。
|
||||||
|
|
||||||
列表项高度保持稳定,封面尺寸固定,长文本省略或走马灯,不允许挤压右侧播放按钮。
|
列表项高度保持稳定,封面尺寸固定,长文本省略或走马灯,不允许挤压右侧播放按钮。
|
||||||
|
|
||||||
@ -146,6 +183,12 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
- 技术信息分组:格式、采样率、位深、大小、播放链路等只读信息。
|
- 技术信息分组:格式、采样率、位深、大小、播放链路等只读信息。
|
||||||
- 底部保存栏:返回/撤销、保存。只要有任一草稿变化就显示可保存。
|
- 底部保存栏:返回/撤销、保存。只要有任一草稿变化就显示可保存。
|
||||||
|
|
||||||
|
视觉要求:
|
||||||
|
|
||||||
|
- 表单、技术信息、封面编辑都使用 `Surface` 白底和 `Line` 细边框,不使用旧蓝、旧紫或半透明白色作为常规容器。
|
||||||
|
- 选中态使用 `Primary #0F68D8` 和 `Primary Soft #EAF2FF`;不可写、只读、授权提示使用 `Muted` 文案加明确原因。
|
||||||
|
- 底部保存栏使用白色 Surface + 顶部分割线/细边框,主按钮为 `Primary`,次按钮为 `Primary Soft`。
|
||||||
|
|
||||||
封面编辑规则:
|
封面编辑规则:
|
||||||
|
|
||||||
- 内嵌封面不可写时,内嵌选项变弱,并给出原因。
|
- 内嵌封面不可写时,内嵌选项变弱,并给出原因。
|
||||||
@ -163,6 +206,8 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
|
|
||||||
播放页应沉浸但不重装饰。封面是视觉中心,但不能压过播放控制。
|
播放页应沉浸但不重装饰。封面是视觉中心,但不能压过播放控制。
|
||||||
|
|
||||||
|
播放页沉浸主体可以保持深色音乐氛围,但交互强调必须跟随当前主色系统:播放进度、歌词高亮、队列定位按钮统一使用 `Primary`,不能再使用旧的亮蓝 `#2997FF`。
|
||||||
|
|
||||||
必须包含:
|
必须包含:
|
||||||
|
|
||||||
- 大封面,稳定尺寸,切歌时不闪烁。
|
- 大封面,稳定尺寸,切歌时不闪烁。
|
||||||
@ -174,6 +219,12 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
|
|
||||||
播放失败用短反馈,不要在播放页常驻大错误横幅。播放状态必须与通知栏、迷你播放条一致。
|
播放失败用短反馈,不要在播放页常驻大错误横幅。播放状态必须与通知栏、迷你播放条一致。
|
||||||
|
|
||||||
|
播放页底部弹窗要求:
|
||||||
|
|
||||||
|
- 当前列表弹窗和播放信息/播放链路弹窗必须跟随 App 内主题选择。
|
||||||
|
- 弹窗背景使用 `Surface`,标题/主文字使用 `Ink`,说明文字使用 `Muted`,分割线使用 `Line`,选中态使用 `PrimarySoft` 和 `Primary`。
|
||||||
|
- 浅色主题下不允许继续使用固定深色 sheet;深色主题下不允许出现浅色模式的墨色文字不可读问题。
|
||||||
|
|
||||||
### 4.5 迷你播放条
|
### 4.5 迷你播放条
|
||||||
|
|
||||||
迷你播放条是全局高频组件,要小而清楚。
|
迷你播放条是全局高频组件,要小而清楚。
|
||||||
@ -205,6 +256,14 @@ Android 优先使用系统字体与 Material 3 type scale,不单独引入花
|
|||||||
|
|
||||||
设置页使用安静的列表布局。每个设置项包含图标、标题、必要副标题和右侧状态,不做装饰卡片堆叠。
|
设置页使用安静的列表布局。每个设置项包含图标、标题、必要副标题和右侧状态,不做装饰卡片堆叠。
|
||||||
|
|
||||||
|
语言、帮助与反馈弹窗必须与全局 token 对齐:`Surface` 背景、`Ink` 标题、`Muted` 说明、`Line` 分割线、`Primary` 选中/提交。不要使用系统默认紫色或旧蓝色。
|
||||||
|
|
||||||
|
主题弹窗要求:
|
||||||
|
|
||||||
|
- 入口显示当前选择:跟随系统、浅色主题或深色主题。
|
||||||
|
- 选项使用 radio list,点击选项立即保存并关闭弹窗。
|
||||||
|
- 默认首次进入为浅色主题,而不是跟随系统。
|
||||||
|
|
||||||
帮助反馈页要求:
|
帮助反馈页要求:
|
||||||
|
|
||||||
- FAQ 可展开,展开动画轻。
|
- FAQ 可展开,展开动画轻。
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user