diff --git a/README.md b/README.md index a0ae084c..c3a5b90c 100644 --- a/README.md +++ b/README.md @@ -17,18 +17,17 @@ A simple music app using YouTube Music for backend - Play music from YouTube Music or YouTube free without ads in the background - Browsing Home, Charts, Moods & Genre with YouTube Music data with high speed - Search everything on YouTube -- Analyze your playing data and create custom playlists ... +- Analyze your playing data, create custom playlists and sync with YouTube Music ... - Caching and can save data for offline playback -- Synced lyrics (log in to Spotify to get lyrics) -- Sleep Timer +- Synced lyrics from Musixmatch - Support SponsorBlock -- Google Login -- And many more ... +- Sleep Timer +- And many more ## Screenshot
- +
@@ -36,7 +35,7 @@ A simple music app using YouTube Music for backend
- +
@@ -44,7 +43,7 @@ A simple music app using YouTube Music for backend More [screenshot](https://photos.app.goo.gl/AbieoXG5ctDrpwzp7) here. ## Data -- This app using public api from YouTube Music with some tricks to get data from YouTube Music. +- This app using hidden API from YouTube Music with some tricks to get data from YouTube Music. - Thanks for [InnerTune](https://github.com/z-huang/InnerTune/) for the idea to get data from YouTube Music. This repo is my inspiration to create this app. - My app is using [@SponsorBlock](https://sponsor.ajay.app/) to skip sponsor in YouTube videos. Thanks for this great service. ## Translation diff --git a/app/src/main/java/com/maxrave/simpmusic/service/SimpleMediaServiceHandler.kt b/app/src/main/java/com/maxrave/simpmusic/service/SimpleMediaServiceHandler.kt index 0ae1f99d..9e8e0969 100644 --- a/app/src/main/java/com/maxrave/simpmusic/service/SimpleMediaServiceHandler.kt +++ b/app/src/main/java/com/maxrave/simpmusic/service/SimpleMediaServiceHandler.kt @@ -167,11 +167,11 @@ class SimpleMediaServiceHandler @Inject constructor( player.removeMediaItem(position) } - fun addMediaItem(mediaItem: MediaItem) { + fun addMediaItem(mediaItem: MediaItem, playWhenReady: Boolean = true) { player.clearMediaItems() player.setMediaItem(mediaItem) player.prepare() - player.playWhenReady = true + player.playWhenReady = playWhenReady } fun addMediaItemNotSet(mediaItem: MediaItem) { diff --git a/app/src/main/java/com/maxrave/simpmusic/ui/fragment/home/SettingsFragment.kt b/app/src/main/java/com/maxrave/simpmusic/ui/fragment/home/SettingsFragment.kt index 7c4f6a62..bf82e2e9 100644 --- a/app/src/main/java/com/maxrave/simpmusic/ui/fragment/home/SettingsFragment.kt +++ b/app/src/main/java/com/maxrave/simpmusic/ui/fragment/home/SettingsFragment.kt @@ -199,6 +199,12 @@ class SettingsFragment : Fragment() { } else { Toast.makeText(requireContext(), getString(R.string.no_update), Toast.LENGTH_SHORT).show() + viewModel.getLastCheckForUpdate() + viewModel.lastCheckForUpdate.observe(viewLifecycleOwner) { + binding.tvCheckForUpdate.text = getString(R.string.last_checked_at, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + .withZone(ZoneId.systemDefault()) + .format(Instant.ofEpochMilli(it.toLong()))) + } } } } diff --git a/app/src/main/java/com/maxrave/simpmusic/ui/fragment/other/PlaylistFragment.kt b/app/src/main/java/com/maxrave/simpmusic/ui/fragment/other/PlaylistFragment.kt index 00354ad6..9d6f6124 100644 --- a/app/src/main/java/com/maxrave/simpmusic/ui/fragment/other/PlaylistFragment.kt +++ b/app/src/main/java/com/maxrave/simpmusic/ui/fragment/other/PlaylistFragment.kt @@ -107,10 +107,9 @@ class PlaylistFragment: Fragment() { playlistItemAdapter = PlaylistItemAdapter(arrayListOf()) binding.rvListSong.apply { adapter = playlistItemAdapter - layoutManager = LinearLayoutManager(requireContext()).also { - it.initialPrefetchItemCount = 20 - } + layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) setHasFixedSize(false) + isNestedScrollingEnabled = false } var id = requireArguments().getString("id") val downloaded = arguments?.getInt("downloaded") diff --git a/app/src/main/java/com/maxrave/simpmusic/viewModel/SharedViewModel.kt b/app/src/main/java/com/maxrave/simpmusic/viewModel/SharedViewModel.kt index 331d0811..2cba2c09 100644 --- a/app/src/main/java/com/maxrave/simpmusic/viewModel/SharedViewModel.kt +++ b/app/src/main/java/com/maxrave/simpmusic/viewModel/SharedViewModel.kt @@ -539,7 +539,8 @@ class SharedViewModel @Inject constructor(private var dataStoreManager: DataStor .setAlbumTitle(track.album?.name) .build() ) - .build() + .build(), + type != RECOVER_TRACK_QUEUE ) _nowPlayingMediaItem.value = getCurrentMediaItem() Log.d( @@ -582,7 +583,8 @@ class SharedViewModel @Inject constructor(private var dataStoreManager: DataStor .setAlbumTitle(track.album?.name) .build() ) - .build() + .build(), + type != RECOVER_TRACK_QUEUE ) _nowPlayingMediaItem.value = getCurrentMediaItem() Log.d( diff --git a/app/src/main/res/layout/fragment_playlist.xml b/app/src/main/res/layout/fragment_playlist.xml index cab7717f..a0b74617 100644 --- a/app/src/main/res/layout/fragment_playlist.xml +++ b/app/src/main/res/layout/fragment_playlist.xml @@ -207,6 +207,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/rvListSong" + android:overScrollMode="never" tools:listitem="@layout/item_popular_song" android:layout_marginStart="10sp" android:layout_marginEnd="10sp"> diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 5e189d53..8150ad8d 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -175,7 +175,7 @@