Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import kotlinx.coroutines.flow.Flow

@Dao
Expand Down Expand Up @@ -47,8 +48,21 @@ interface TelegramDao {
@Query("DELETE FROM telegram_songs WHERE chat_id = :chatId AND thread_id = :threadId")
suspend fun deleteSongsByTopicId(chatId: Long, threadId: Long)

@Transaction
suspend fun clearAll() {
clearAllSongs()
clearAllChannels()
clearAllTopics()
}

@Query("DELETE FROM telegram_songs")
suspend fun clearAll()
suspend fun clearAllSongs()

@Query("DELETE FROM telegram_channels")
suspend fun clearAllChannels()

@Query("DELETE FROM telegram_topics")
suspend fun clearAllTopics()

// ─── Topic methods ────────────────────────────────────────────────────────

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ class MusicRepositoryImpl @Inject constructor(
val allChannels = telegramDao.getAllChannels().first()
allChannels.forEach { channel ->
telegramRepository.deleteAppPlaylistForTelegramChannel(channel.chatId)
telegramRepository.deleteAllTopicPlaylistsForChannel(channel.chatId)
}

musicDao.clearAllTelegramSongs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,14 +810,6 @@ private fun CastControlsTabContent(
onBluetoothClick = onOpenBluetoothSettings
)
}

if (allConnectivityOff) {
WifiOffIllustration(
onTurnOnWifi = onTurnOnWifi,
onOpenBluetoothSettings = onOpenBluetoothSettings
)
}

Spacer(modifier = Modifier.height(bottomSpacing))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ fun AccountsScreen(
painterResource(R.drawable.qq_music)
} else if (account.service == ExternalServiceAccount.TELEGRAM) {
painterResource(R.drawable.telegram)
} else if (account.service == ExternalServiceAccount.JELLYFIN) {
painterResource(R.drawable.ic_jellyfin)
} else if (account.service == ExternalServiceAccount.NAVIDROME) {
painterResource(R.drawable.ic_navidrome_md3)
} else null
)
}
Expand Down Expand Up @@ -554,6 +558,9 @@ private fun EmptyAccountsCard(
ExternalServiceAccount.NETEASE -> painterResource(R.drawable.netease_cloud_music_logo_icon_206716__1_)
ExternalServiceAccount.QQ_MUSIC -> painterResource(R.drawable.qq_music)
ExternalServiceAccount.TELEGRAM -> painterResource(R.drawable.telegram)
ExternalServiceAccount.GOOGLE_DRIVE -> painterResource(R.drawable.rounded_drive_export_24)
ExternalServiceAccount.JELLYFIN -> painterResource(R.drawable.ic_jellyfin)
ExternalServiceAccount.NAVIDROME -> painterResource(R.drawable.ic_navidrome_md3)
else -> null
}
FilledTonalButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.FilledIconButton
import androidx.compose.material3.Icon
import androidx.compose.material.icons.rounded.Visibility
import androidx.compose.material.icons.rounded.VisibilityOff
import androidx.compose.material3.IconButton
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -93,6 +96,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand Down Expand Up @@ -875,6 +879,7 @@ fun ExpressivePasswordInput(
// Local state so keystrokes don't push through the VM uiState on every char,
// which would recompose the whole login screen and cause input jank.
var localPassword by remember { mutableStateOf(password) }
var passwordVisible by remember { mutableStateOf(false) }

// Re-sync from VM only when it actively resets the password (e.g. auth state change).
LaunchedEffect(password) {
Expand All @@ -895,7 +900,6 @@ fun ExpressivePasswordInput(
smoothnessAsPercentBL = 60
)
}
val passwordTransformation = remember { PasswordVisualTransformation() }

val submitPassword = {
if (!isLoading && localPassword.isNotBlank()) {
Expand Down Expand Up @@ -927,7 +931,15 @@ fun ExpressivePasswordInput(
tint = MaterialTheme.colorScheme.primary
)
},
visualTransformation = passwordTransformation,
trailingIcon = {
val image = if (passwordVisible) Icons.Rounded.Visibility else Icons.Rounded.VisibilityOff
val description = if (passwordVisible) "Hide password" else "Show password"

IconButton(onClick = { passwordVisible = !passwordVisible }) {
Icon(imageVector = image, contentDescription = description, tint = MaterialTheme.colorScheme.primary)
}
},
visualTransformation = if (passwordVisible) VisualTransformation.None else PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Password,
imeAction = ImeAction.Done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ fun TelegramDashboardScreen(
}
AlertDialog(
onDismissRequest = { channelPendingRemoval = null },
icon = { Icon(Icons.Rounded.Delete, contentDescription = null) },
icon = { Icon(Icons.Rounded.Delete, contentDescription = null, tint = MaterialTheme.colorScheme.error) },
title = {
Text(
text = stringResource(R.string.presentation_batch_f_remove_channel_confirm_title),
Expand All @@ -343,7 +343,8 @@ fun TelegramDashboardScreen(
R.string.presentation_batch_f_remove_channel_confirm_body,
channelLabel
),
fontFamily = GoogleSansRounded
fontFamily = GoogleSansRounded,
textAlign = TextAlign.Center
)
},
confirmButton = {
Expand All @@ -354,7 +355,8 @@ fun TelegramDashboardScreen(
Text(
text = stringResource(R.string.presentation_batch_f_remove_channel_confirm_action),
fontFamily = GoogleSansRounded,
fontWeight = FontWeight.SemiBold
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.error
)
}
},
Expand Down
Loading