Skip to content

Commit

Permalink
refactor: improve user experience
Browse files Browse the repository at this point in the history
  • Loading branch information
hpp2334 committed Dec 1, 2024
1 parent d22187b commit 5771bf3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.DeviceFontFamilyName
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.IntOffset
Expand Down Expand Up @@ -357,6 +360,7 @@ private fun PlaylistItem(
maxLines = 1,
modifier = Modifier.wrapContentWidth(),
fontSize = 14.sp,
fontFamily = FontFamily(Font(R.font.noto_sans)),
)
}
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private fun Title(title: String) {
Text(
text = title,
letterSpacing = 1.sp,
fontSize = 14.sp,
)
Box(
modifier = Modifier
Expand Down
Binary file added android/app/src/main/res/font/noto_sans.ttf
Binary file not shown.
2 changes: 1 addition & 1 deletion rust-libs/ease-client-backend/src/services/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub fn app_bootstrap(cx: &Arc<BackendContext>, arg: ArgInitializeApp) -> BResult
cx.set_schema_version(SCHEMA_VERSION);
// Init
init_persistent_state(&cx)?;
cx.asset_server().start(&cx, arg.app_cache_dir);
cx.asset_server().start(&cx, arg.app_document_dir);
Ok(())
}

Expand Down
11 changes: 8 additions & 3 deletions rust-libs/ease-client/src/view_models/music/control.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Duration;

use ease_client_shared::backends::{
connector::ConnectorAction,
generated::{
Expand All @@ -8,9 +10,7 @@ use ease_client_shared::backends::{
player::{ArgPlayMusic, ConnectorPlayerAction, PlayMode},
playlist::Playlist,
};
use misty_vm::{
AppBuilderContext, AsyncTasks, IToHost, Model, ViewModel, ViewModelContext,
};
use misty_vm::{AppBuilderContext, AsyncTasks, IToHost, Model, ViewModel, ViewModelContext};

use super::{
common::MusicCommonVM, lyric::MusicLyricVM, state::CurrentMusicState,
Expand Down Expand Up @@ -155,6 +155,11 @@ impl MusicControlVM {
}

fn request_seek(&self, cx: &ViewModelContext, arg: u64) -> EaseResult<()> {
{
let mut state = cx.model_mut(&self.current);
state.current_duration = Duration::from_millis(arg);
}

cx.spawn::<_, _, EaseError>(&self.tasks, move |cx| async move {
Connector::of(&cx)
.request::<PlayerSeekMsg>(&cx, arg)
Expand Down
2 changes: 1 addition & 1 deletion rust-libs/ease-client/src/view_models/storage/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub(crate) struct StorageImportVM {
}

pub(crate) fn get_entry_type(entry: &StorageEntry) -> StorageEntryType {
const MUSIC_EXTS: [&str; 5] = [".wav", ".mp3", ".aac", ".flac", ".ogg"];
const MUSIC_EXTS: [&str; 6] = [".wav", ".mp3", ".aac", ".flac", ".ogg", ".m4a"];
const IMAGE_EXTS: [&str; 3] = [".jpg", ".jpeg", ".png"];
const LYRIC_EXTS: [&str; 1] = [".lrc"];

Expand Down

0 comments on commit 5771bf3

Please sign in to comment.