Skip to content

Commit

Permalink
Fixed #68, New logo
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrave-dev committed Feb 13, 2024
1 parent fc3e00a commit e007669
Show file tree
Hide file tree
Showing 65 changed files with 115 additions and 2,727 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId = "com.maxrave.simpmusic"
minSdk = 26
targetSdk = 34
versionCode = 15
versionName = "0.1.8"
versionCode = 16
versionName = "0.2.0"

ksp {
arg("room.schemaLocation", "$projectDir/schemas")
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
android:resource="@array/preloaded_fonts" />
<meta-data
android:name="androidx.car.app.TintableAttributionIcon"
android:resource="@drawable/logo_simpmusic_01_removebg_preview" />
android:resource="@drawable/monochrome" />

<service
android:name=".service.SimpleMediaService"
Expand Down
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SimpleMediaService : MediaLibraryService() {
setMediaNotificationProvider(
DefaultMediaNotificationProvider(this, { MEDIA_NOTIFICATION.NOTIFICATION_ID }, MEDIA_NOTIFICATION.NOTIFICATION_CHANNEL_ID, R.string.notification_channel_name)
.apply {
setSmallIcon(R.drawable.logo_simpmusic_01_removebg_preview)
setSmallIcon(R.drawable.monochrome)
}
)
player = ExoPlayer.Builder(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MusicDownloadService : DownloadService(
override fun getForegroundNotification(downloads: MutableList<Download>, notMetRequirements: Int): Notification =
downloadUtil.downloadNotificationHelper.buildProgressNotification(
this,
R.drawable.logo_simpmusic_01_removebg_preview,
R.drawable.monochrome,
null,
if (downloads.size == 1) Util.fromUtf8Bytes(downloads[0].request.data)
else resources.getQuantityString(R.plurals.n_song, downloads.size, downloads.size),
Expand Down
149 changes: 87 additions & 62 deletions app/src/main/java/com/maxrave/simpmusic/ui/fragment/SearchFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -904,16 +904,18 @@ class SearchFragment : Fragment() {
response.data.let {
resultList.clear()
if (it != null) {
for (i in it){
for (i in it) {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.refreshSearch.isRefreshing = false
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "videos") {
resultAdapter.updateList(resultList)
binding.refreshSearch.isRefreshing = false
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}
is Resource.Error -> {
Expand Down Expand Up @@ -948,16 +950,18 @@ class SearchFragment : Fragment() {
Log.d("SearchFragment", "observeAlbumList: $it")
resultList.clear()
if (it != null) {
for (i in it){
for (i in it) {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.refreshSearch.isRefreshing = false
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "albums") {
resultAdapter.updateList(resultList)
binding.refreshSearch.isRefreshing = false
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}
is Resource.Error -> {
Expand Down Expand Up @@ -1001,12 +1005,14 @@ class SearchFragment : Fragment() {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "featured_playlists") {
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}

Expand Down Expand Up @@ -1053,12 +1059,14 @@ class SearchFragment : Fragment() {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "podcasts") {
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}

Expand Down Expand Up @@ -1098,19 +1106,24 @@ class SearchFragment : Fragment() {
when (response) {
is Resource.Success -> {
response.data.let { playlistsResultArrayList ->
Log.d("SearchFragment", "observePlaylistsList: $playlistsResultArrayList")
Log.d(
"SearchFragment",
"observePlaylistsList: $playlistsResultArrayList"
)
resultList.clear()
if (playlistsResultArrayList != null) {
for (i in playlistsResultArrayList){
for (i in playlistsResultArrayList) {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "playlists") {
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}
is Resource.Error -> {
Expand Down Expand Up @@ -1144,19 +1157,24 @@ class SearchFragment : Fragment() {
when (response) {
is Resource.Success -> {
response.data.let { artistsResultArrayList ->
Log.d("SearchFragment", "observeArtistList: $artistsResultArrayList")
Log.d(
"SearchFragment",
"observeArtistList: $artistsResultArrayList"
)
resultList.clear()
if (artistsResultArrayList != null) {
for (i in artistsResultArrayList){
for (i in artistsResultArrayList) {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "artists") {
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}
is Resource.Error -> {
Expand Down Expand Up @@ -1193,16 +1211,18 @@ class SearchFragment : Fragment() {
Log.d("SearchFragment", "observeSongList: $songsResultArrayList")
resultList.clear()
if (songsResultArrayList != null) {
for (i in songsResultArrayList){
for (i in songsResultArrayList) {
resultList += i
}
}
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "songs") {
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}
is Resource.Error -> {
Expand Down Expand Up @@ -1440,26 +1460,31 @@ class SearchFragment : Fragment() {
temp.addAll(featuredPlaylist)
temp.addAll(podcast)
}
}
catch (e: Exception){
Snackbar.make(requireActivity().findViewById(R.id.mini_player_container), e.message.toString(), Snackbar.LENGTH_LONG)
} catch (e: Exception) {
Snackbar.make(
requireActivity().findViewById(R.id.mini_player_container),
e.message.toString(),
Snackbar.LENGTH_LONG
)
.setAction(getString(R.string.retry)) {
fetchSearchAll(query)
}
.setAnchorView(activity?.findViewById<BottomNavigationView>(R.id.bottom_navigation_view))
.setDuration(3000)
.show()
}
resultList.clear()
viewModel.searchAllResult.postValue(temp)
searchAllResult.addAll(temp)
resultList.addAll(temp)
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
if (viewModel.searchType.value == "all") {
resultList.clear()
viewModel.searchAllResult.postValue(temp)
searchAllResult.addAll(temp)
resultList.addAll(temp)
resultAdapter.updateList(resultList)
binding.shimmerLayout.stopShimmer()
binding.shimmerLayout.visibility = View.GONE
binding.refreshSearch.isRefreshing = false
setEnabledAll(binding.chipGroupTypeSearch, true)
binding.resultList.smoothScrollToPosition(0)
}
}
}
}
Expand Down
Loading

0 comments on commit e007669

Please sign in to comment.