From b39c581458e0f58ec672990c8fecdc65a41e14f8 Mon Sep 17 00:00:00 2001 From: Shabinder Date: Tue, 10 Nov 2020 17:30:03 +0530 Subject: [PATCH] ViewBinding Instead of DataBinding and Image Quality Optimised in favour of Less Cache and App Load. --- .../com/shabinder/spotiflyer/MainActivity.kt | 6 +- .../downloadHelper/DownloadHelper.kt | 2 +- .../recyclerView/DownloadRecordAdapter.kt | 20 ++-- .../downloadrecord/DownloadRecordFragment.kt | 6 +- .../downloadrecord/DownloadRecordViewModel.kt | 1 + .../spotiflyer/ui/gaana/GaanaViewModel.kt | 2 + .../ui/mainfragment/MainFragment.kt | 94 +++--------------- .../spotiflyer/ui/spotify/SpotifyFragment.kt | 6 +- .../spotiflyer/ui/spotify/SpotifyViewModel.kt | 12 +-- .../spotiflyer/ui/youtube/YoutubeViewModel.kt | 7 +- .../shabinder/spotiflyer/utils/Extensions.kt | 45 +++++++++ .../spotiflyer/utils/TrackListFragment.kt | 9 +- .../spotiflyer/utils/TrackListViewModel.kt | 2 +- .../com/shabinder/spotiflyer/utils/Utils.kt | 7 +- .../spotiflyer/worker/ForegroundService.kt | 8 +- app/src/main/res/drawable/gaana.png | Bin 0 -> 16876 bytes app/src/main/res/drawable/ic_gaana.xml | 27 +++++ .../res/layout/download_record_fragment.xml | 7 +- app/src/main/res/layout/main_activity.xml | 1 - app/src/main/res/layout/main_fragment.xml | 31 ++++-- app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/styles.xml | 6 +- 22 files changed, 172 insertions(+), 129 deletions(-) create mode 100644 app/src/main/java/com/shabinder/spotiflyer/utils/Extensions.kt create mode 100644 app/src/main/res/drawable/gaana.png create mode 100644 app/src/main/res/drawable/ic_gaana.xml diff --git a/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt b/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt index 3b32e10c..74c0f886 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt @@ -38,10 +38,7 @@ import com.github.javiersantos.appupdater.enums.UpdateFrom import com.shabinder.spotiflyer.databinding.MainActivityBinding import com.shabinder.spotiflyer.networking.SpotifyService import com.shabinder.spotiflyer.networking.SpotifyServiceTokenRequest -import com.shabinder.spotiflyer.utils.NetworkInterceptor -import com.shabinder.spotiflyer.utils.createDirectories -import com.shabinder.spotiflyer.utils.isOnline -import com.shabinder.spotiflyer.utils.startService +import com.shabinder.spotiflyer.utils.* import com.squareup.moshi.Moshi import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch @@ -160,6 +157,7 @@ class MainActivity : AppCompatActivity(){ Log.i("Spotify Authentication","Started") val token = spotifyServiceTokenRequest.getToken() token.value?.let { + showMessage("Success: Spotify Token Acquired",isSuccess = true) implementSpotifyService(it.access_token) } Log.i("Spotify Token", token.value.toString()) diff --git a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt index 78c73484..33c8973f 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt @@ -79,7 +79,7 @@ object DownloadHelper { showMessage("Download Started, Now You can leave the App!") } startService(mainActivity,downloadList) - },5000) + },3000) } }else{ val searchQuery = "${it.title} - ${it.artists.joinToString(",")}" diff --git a/app/src/main/java/com/shabinder/spotiflyer/recyclerView/DownloadRecordAdapter.kt b/app/src/main/java/com/shabinder/spotiflyer/recyclerView/DownloadRecordAdapter.kt index 6648d542..f2cdd643 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/recyclerView/DownloadRecordAdapter.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/recyclerView/DownloadRecordAdapter.kt @@ -35,12 +35,12 @@ import kotlinx.coroutines.launch class DownloadRecordAdapter: ListAdapter(DownloadRecordDiffCallback()) { private val adapterScope = CoroutineScope(Dispatchers.Default) - //Remember To change when Submitting a Different List / Or Use New Submit List Fun + //Remember To change when Submitting a Different List / Or Use New Submit List Function var source:Source = Source.Spotify override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { val layoutInflater = LayoutInflater.from(parent.context) - val binding =DownloadRecordItemBinding.inflate(layoutInflater) + val binding = DownloadRecordItemBinding.inflate(layoutInflater) return ViewHolder(binding) } @@ -53,11 +53,17 @@ class DownloadRecordAdapter: ListAdapter { + it.findNavController().navigate(DownloadRecordFragmentDirections.actionDownloadRecordToSpotifyFragment((item.link))) + } + item.link.contains("youtube.com",true) || item.link.contains("youtu.be",true) -> { + it.findNavController().navigate(DownloadRecordFragmentDirections.actionDownloadRecordToYoutubeFragment(item.link)) + } + item.link.contains("gaana",true) -> { + it.findNavController().navigate(DownloadRecordFragmentDirections.actionDownloadRecordToGaanaFragment((item.link))) + } + } } } class ViewHolder(val binding: DownloadRecordItemBinding) : RecyclerView.ViewHolder(binding.root) diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordFragment.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordFragment.kt index b48311e9..97150b71 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordFragment.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordFragment.kt @@ -57,7 +57,8 @@ class DownloadRecordFragment : Fragment() { } when(binding.tabLayout.selectedTabPosition){ 0-> adapter.submitList(downloadRecordViewModel.spotifyList,Source.Spotify) - 1-> adapter.submitList(downloadRecordViewModel.ytList,Source.YouTube) + 1-> adapter.submitList(downloadRecordViewModel.gaanaList,Source.Gaana) + 2-> adapter.submitList(downloadRecordViewModel.ytList,Source.YouTube) } } }) @@ -67,7 +68,8 @@ class DownloadRecordFragment : Fragment() { override fun onTabSelected(tab: TabLayout.Tab?) { when(tab?.position){ 0-> adapter.submitList(downloadRecordViewModel.spotifyList,Source.Spotify) - 1-> adapter.submitList(downloadRecordViewModel.ytList,Source.YouTube) + 1-> adapter.submitList(downloadRecordViewModel.gaanaList,Source.Gaana) + 2-> adapter.submitList(downloadRecordViewModel.ytList,Source.YouTube) } } override fun onTabReselected(tab: TabLayout.Tab?) {} diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordViewModel.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordViewModel.kt index 8ce7a1e8..d985d4a3 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordViewModel.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/downloadrecord/DownloadRecordViewModel.kt @@ -41,6 +41,7 @@ class DownloadRecordViewModel @ViewModelInject constructor(val databaseDAO: Data init { getDownloadRecordList() } + private fun getDownloadRecordList() { uiScope.launch { downloadRecordList.postValue(databaseDAO.getRecord().toMutableList()) diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/gaana/GaanaViewModel.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/gaana/GaanaViewModel.kt index 6e81a679..15f83620 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/gaana/GaanaViewModel.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/gaana/GaanaViewModel.kt @@ -40,6 +40,7 @@ class GaanaViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO) override var folderType:String = "" override var subFolder:String = "" var gaanaInterface : GaanaInterface? = null + val gaanaPlaceholderImageUrl = "https://a10.gaanacdn.com/images/social/gaana_social.jpg" fun gaanaSearch(type:String,link:String){ when(type){ @@ -109,6 +110,7 @@ class GaanaViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO) trackList.value = it.tracks.toTrackDetailsList() title.value = link //coverUrl.value = "TODO" + coverUrl.value = gaanaPlaceholderImageUrl withContext(Dispatchers.IO){ databaseDAO.insert(DownloadRecord( type = "Playlist", diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/mainfragment/MainFragment.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/mainfragment/MainFragment.kt index 6ad9a9c0..7a0033e8 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/mainfragment/MainFragment.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/mainfragment/MainFragment.kt @@ -17,9 +17,6 @@ package com.shabinder.spotiflyer.ui.mainfragment -import android.content.Intent -import android.content.pm.PackageManager -import android.net.Uri import android.os.Bundle import android.text.SpannableStringBuilder import android.view.LayoutInflater @@ -32,10 +29,7 @@ import com.shabinder.spotiflyer.MainActivity import com.shabinder.spotiflyer.R import com.shabinder.spotiflyer.SharedViewModel import com.shabinder.spotiflyer.databinding.MainFragmentBinding -import com.shabinder.spotiflyer.utils.Provider -import com.shabinder.spotiflyer.utils.isOnline -import com.shabinder.spotiflyer.utils.showMessage -import com.shabinder.spotiflyer.utils.showNoConnectionAlert +import com.shabinder.spotiflyer.utils.* import com.shreyaspatil.easyupipayment.EasyUpiPayment import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.Dispatchers @@ -122,82 +116,22 @@ class MainFragment : Fragment() { private fun initializeAll() { mainViewModel = ViewModelProvider(this).get(MainViewModel::class.java) sharedViewModel = ViewModelProvider(this.requireActivity()).get(SharedViewModel::class.java) - openYTButton() - openSpotifyButton() - openGithubButton() - openInstaButton() - openLinkedInButton() - historyButton() - binding.usage.text = usageText() - binding.btnDonate.setOnClickListener { - easyUpiPayment.startPayment() + binding.apply { + btnGaana.openPlatformOnClick("com.gaana","http://gaana.com") + btnSpotify.openPlatformOnClick("com.spotify.music","http://open.spotify.com") + btnYoutube.openPlatformOnClick("com.google.android.youtube","http://m.youtube.com") + btnGithub.openPlatformOnClick("http://github.com/Shabinder/SpotiFlyer") + btnInsta.openPlatformOnClick("http://www.instagram.com/mr.shabinder") + btnHistory.setOnClickListener { + findNavController().navigate(MainFragmentDirections.actionMainFragmentToDownloadRecord()) + } + usage.text = usageText() + btnDonate.setOnClickListener { + easyUpiPayment.startPayment() + } } } - /** - * Implementing buttons - **/ - private fun historyButton() { - binding.btnHistory.setOnClickListener { - findNavController().navigate(MainFragmentDirections.actionMainFragmentToDownloadRecord()) - } - } - private fun openSpotifyButton() { - val manager: PackageManager = requireActivity().packageManager - try { - val i = manager.getLaunchIntentForPackage("com.spotify.music") - ?: throw PackageManager.NameNotFoundException() - i.addCategory(Intent.CATEGORY_LAUNCHER) - binding.btnSpotify.setOnClickListener { startActivity(i) } - } catch (e: PackageManager.NameNotFoundException) { - val uri: Uri = - Uri.parse("http://open.spotify.com") - val intent = Intent(Intent.ACTION_VIEW, uri) - binding.btnSpotify.setOnClickListener { - startActivity(intent) - } - } - } - private fun openYTButton() { - val manager: PackageManager = requireActivity().packageManager - try { - val i = manager.getLaunchIntentForPackage("com.google.android.youtube") - ?: throw PackageManager.NameNotFoundException() - i.addCategory(Intent.CATEGORY_LAUNCHER) - binding.btnYoutube.setOnClickListener { startActivity(i) } - } catch (e: PackageManager.NameNotFoundException) { - val uri: Uri = - Uri.parse("http://m.youtube.com") - val intent = Intent(Intent.ACTION_VIEW, uri) - binding.btnYoutube.setOnClickListener { - startActivity(intent) - } - } - } - private fun openGithubButton() { - val uri: Uri = - Uri.parse("http://github.com/Shabinder/SpotiFlyer") - val intent = Intent(Intent.ACTION_VIEW, uri) - binding.btnGithubSpotify.setOnClickListener { - startActivity(intent) - } - } - private fun openLinkedInButton() { - val uri: Uri = - Uri.parse("https://in.linkedin.com/in/shabinder") - val intent = Intent(Intent.ACTION_VIEW, uri) - binding.btnLinkedin.setOnClickListener { - startActivity(intent) - } - } - private fun openInstaButton() { - val uri: Uri = - Uri.parse("http://www.instagram.com/mr.shabinder") - val intent = Intent(Intent.ACTION_VIEW, uri) - binding.developerInstaSpotify.setOnClickListener { - startActivity(intent) - } - } private fun usageText(): SpannableStringBuilder { return SpannableStringBuilder() .append(getText(R.string.d_one)).append("\n") diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyFragment.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyFragment.kt index cc7299a8..465d7eb6 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyFragment.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyFragment.kt @@ -26,7 +26,6 @@ import android.view.ViewGroup import androidx.lifecycle.ViewModelProvider import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.SimpleItemAnimator -import com.shabinder.spotiflyer.MainActivity import com.shabinder.spotiflyer.downloadHelper.DownloadHelper import com.shabinder.spotiflyer.models.DownloadStatus import com.shabinder.spotiflyer.models.spotify.Source @@ -63,8 +62,9 @@ class SpotifyFragment : TrackListFragment( Log.i("Spotify Fragment", "$type : $link") + if(sharedViewModel.spotifyService.value == null){//Authentication pending!! - (activity as MainActivity).authenticateSpotify() + if(isOnline()) mainActivity.authenticateSpotify() } when{ @@ -89,7 +89,7 @@ class SpotifyFragment : TrackListFragment( binding.downloadingFab.visibility = View.VISIBLE rotateAnim(binding.downloadingFab) - for (track in this.viewModel.trackList.value!!){ + for (track in this.viewModel.trackList.value ?: listOf()){ if(track.downloaded != DownloadStatus.Downloaded){ track.downloaded = DownloadStatus.Downloading adapter.notifyItemChanged(this.viewModel.trackList.value!!.indexOf(track)) diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyViewModel.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyViewModel.kt index f6f758d7..705166f9 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyViewModel.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/spotify/SpotifyViewModel.kt @@ -52,7 +52,7 @@ class SpotifyViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO } trackList.value = listOf(it).toTrackDetailsList() title.value = it.name - coverUrl.value = it.album!!.images?.get(0)!!.url!! + coverUrl.value = it.album!!.images?.elementAtOrNull(1)?.url ?: it.album!!.images?.elementAtOrNull(0)?.url withContext(Dispatchers.IO){ databaseDAO.insert(DownloadRecord( type = "Track", @@ -77,11 +77,11 @@ class SpotifyViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO if(File(finalOutputDir(it.name!!,folderType,subFolder)).exists()){//Download Already Present!! it.downloaded = DownloadStatus.Downloaded } - it.album = Album(images = listOf(Image(url = albumObject.images?.get(0)?.url))) + it.album = Album(images = listOf(Image(url = albumObject.images?.elementAtOrNull(1)?.url ?: albumObject.images?.elementAtOrNull(0)?.url ))) } trackList.value = albumObject?.tracks?.items?.toTrackDetailsList() title.value = albumObject?.name - coverUrl.value = albumObject?.images?.get(0)?.url + coverUrl.value = albumObject?.images?.elementAtOrNull(1)?.url ?: albumObject?.images?.elementAtOrNull(0)?.url withContext(Dispatchers.IO){ databaseDAO.insert(DownloadRecord( type = "Album", @@ -124,7 +124,7 @@ class SpotifyViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO Log.i("Total Tracks Fetched",tempTrackList.size.toString()) trackList.value = tempTrackList.toTrackDetailsList() title.value = playlistObject?.name - coverUrl.value = playlistObject?.images?.get(0)?.url.toString() + coverUrl.value = playlistObject?.images?.elementAtOrNull(1)?.url ?: playlistObject?.images?.firstOrNull()?.url.toString() withContext(Dispatchers.IO){ databaseDAO.insert(DownloadRecord( type = "Playlist", @@ -153,14 +153,14 @@ class SpotifyViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO durationSec = (it.duration_ms/1000).toInt(), albumArt = File( Environment.getExternalStorageDirectory(), - Provider.defaultDir +".Images/" + (it.album?.images?.get(0)?.url.toString()).substringAfterLast('/') + ".jpeg"), + Provider.defaultDir +".Images/" + (it.album?.images?.elementAtOrNull(1)?.url ?: it.album?.images?.firstOrNull()?.url.toString()).substringAfterLast('/') + ".jpeg"), albumName = it.album?.name, year = it.album?.release_date, comment = "Genres:${it.album?.genres?.joinToString()}", trackUrl = it.href, downloaded = it.downloaded, source = Source.Spotify, - albumArtURL = it.album?.images?.get(0)?.url.toString() + albumArtURL = it.album?.images?.elementAtOrNull(1)?.url ?: it.album?.images?.firstOrNull()?.url.toString() ) }.toMutableList() diff --git a/app/src/main/java/com/shabinder/spotiflyer/ui/youtube/YoutubeViewModel.kt b/app/src/main/java/com/shabinder/spotiflyer/ui/youtube/YoutubeViewModel.kt index e3e0e242..48d816aa 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/ui/youtube/YoutubeViewModel.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/ui/youtube/YoutubeViewModel.kt @@ -27,11 +27,8 @@ import com.shabinder.spotiflyer.database.DownloadRecord import com.shabinder.spotiflyer.models.DownloadStatus import com.shabinder.spotiflyer.models.TrackDetails import com.shabinder.spotiflyer.models.spotify.Source +import com.shabinder.spotiflyer.utils.* import com.shabinder.spotiflyer.utils.Provider.defaultDir -import com.shabinder.spotiflyer.utils.TrackListViewModel -import com.shabinder.spotiflyer.utils.finalOutputDir -import com.shabinder.spotiflyer.utils.removeIllegalChars -import com.shabinder.spotiflyer.utils.showMessage import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -48,6 +45,7 @@ class YoutubeViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO override var subFolder = "" fun getYTPlaylist(searchId:String, ytDownloader:YoutubeDownloader){ + if(!isOnline())return try{ uiScope.launch(Dispatchers.IO) { Log.i("YT Playlist",searchId) @@ -105,6 +103,7 @@ class YoutubeViewModel @ViewModelInject constructor(val databaseDAO: DatabaseDAO @SuppressLint("DefaultLocale") fun getYTTrack(searchId:String, ytDownloader:YoutubeDownloader) { + if(!isOnline())return try{ uiScope.launch(Dispatchers.IO) { Log.i("YT Video",searchId) diff --git a/app/src/main/java/com/shabinder/spotiflyer/utils/Extensions.kt b/app/src/main/java/com/shabinder/spotiflyer/utils/Extensions.kt new file mode 100644 index 00000000..896657ca --- /dev/null +++ b/app/src/main/java/com/shabinder/spotiflyer/utils/Extensions.kt @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2020 Shabinder Singh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.shabinder.spotiflyer.utils + +import android.content.Intent +import android.content.pm.PackageManager +import android.net.Uri +import android.view.View +import com.shabinder.spotiflyer.utils.Provider.mainActivity + +fun View.openPlatformOnClick(packageName:String, websiteAddress:String){ + val manager: PackageManager = mainActivity.packageManager + try { + val i = manager.getLaunchIntentForPackage(packageName) + ?: throw PackageManager.NameNotFoundException() + i.addCategory(Intent.CATEGORY_LAUNCHER) + this.setOnClickListener { mainActivity.startActivity(i) } + } catch (e: PackageManager.NameNotFoundException) { + val uri: Uri = + Uri.parse(websiteAddress) + val intent = Intent(Intent.ACTION_VIEW, uri) + this.setOnClickListener { mainActivity.startActivity(intent) } + } +} +fun View.openPlatformOnClick(websiteAddress:String){ + val uri: Uri = + Uri.parse(websiteAddress) + val intent = Intent(Intent.ACTION_VIEW, uri) + this.setOnClickListener { mainActivity.startActivity(intent) } +} \ No newline at end of file diff --git a/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListFragment.kt b/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListFragment.kt index 60e4bd56..a5080d81 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListFragment.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListFragment.kt @@ -36,6 +36,7 @@ import com.shabinder.spotiflyer.models.DownloadStatus import com.shabinder.spotiflyer.models.TrackDetails import com.shabinder.spotiflyer.models.spotify.Source import com.shabinder.spotiflyer.recyclerView.TrackListAdapter +import com.shabinder.spotiflyer.utils.Provider.mainActivity abstract class TrackListFragment : Fragment() { @@ -50,6 +51,10 @@ abstract class TrackListFragment : Frag override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + if(!isOnline()){ + showNoConnectionAlert() + mainActivity.onBackPressed() + } sharedViewModel = ViewModelProvider(this.requireActivity()).get(SharedViewModel::class.java) } @@ -72,7 +77,7 @@ abstract class TrackListFragment : Frag **/ private fun initializeLiveDataObservers() { viewModel.trackList.observe(viewLifecycleOwner, { - if (it.isNotEmpty()){ + if (!it.isNullOrEmpty()){ Log.i("GaanaFragment","TrackList Updated") adapter.submitList(it, source) checkIfAllDownloaded() @@ -80,7 +85,7 @@ abstract class TrackListFragment : Frag }) viewModel.coverUrl.observe(viewLifecycleOwner, { - if(it!="Loading") bindImage(binding.coverImage,it, source) + it?.let{bindImage(binding.coverImage,it, source)} }) viewModel.title.observe(viewLifecycleOwner, { diff --git a/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListViewModel.kt b/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListViewModel.kt index 1ab33bd8..4bc69340 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListViewModel.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/utils/TrackListViewModel.kt @@ -35,7 +35,7 @@ abstract class TrackListViewModel:ViewModel() { private val loading = "Loading!" open var title = MutableLiveData().apply { value = loading } - open var coverUrl = MutableLiveData().apply { value = loading } + open var coverUrl = MutableLiveData() override fun onCleared() { super.onCleared() diff --git a/app/src/main/java/com/shabinder/spotiflyer/utils/Utils.kt b/app/src/main/java/com/shabinder/spotiflyer/utils/Utils.kt index 887fb227..ca125bd9 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/utils/Utils.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/utils/Utils.kt @@ -96,7 +96,7 @@ fun isOnline(): Boolean { return result } -fun showMessage(message: String, long: Boolean = false){ +fun showMessage(message: String, long: Boolean = false,isSuccess:Boolean = false , isError:Boolean = false){ CoroutineScope(Dispatchers.Main).launch{ Snackbar.make( mainActivity.snackBarAnchor, @@ -106,6 +106,11 @@ fun showMessage(message: String, long: Boolean = false){ setAction("Ok") { dismiss() } + setActionTextColor(ContextCompat.getColor(mainActivity,R.color.black)) + when{ + isSuccess -> setBackgroundTint(ContextCompat.getColor(mainActivity,R.color.successGreen)) + isError -> setBackgroundTint(ContextCompat.getColor(mainActivity,R.color.errorRed)) + } }.show() } } diff --git a/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt b/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt index edb8b844..f6829393 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt @@ -304,7 +304,7 @@ class ForegroundService : Service(){ } } speed = 0 - updateNotification() +// updateNotification() } override fun onDeleted(download: Download) { @@ -343,7 +343,7 @@ class ForegroundService : Service(){ val track = requestMap[download.request] Log.i(tag,"${track?.title} ETA: ${etaInMilliSeconds/1000} sec") speed = (downloadedBytesPerSecond/1000) - updateNotification() +// updateNotification() } } @@ -448,7 +448,7 @@ class ForegroundService : Service(){ .setSubText("Total: $total Completed:$converted") .setNotificationSilent() .setStyle(NotificationCompat.InboxStyle() - .setBigContentTitle("Speed: $speed KB/s") +// .setBigContentTitle("Speed: $speed KB/s") .addLine(messageList[0]) .addLine(messageList[1]) .addLine(messageList[2]) @@ -540,7 +540,7 @@ class ForegroundService : Service(){ .setNotificationSilent() .setSubText("Total: $total Completed:$converted") .setStyle(NotificationCompat.InboxStyle() - .setBigContentTitle("Speed: $speed KB/s") +// .setBigContentTitle("Speed: $speed KB/s") .addLine(messageList[0]) .addLine(messageList[1]) .addLine(messageList[2]) diff --git a/app/src/main/res/drawable/gaana.png b/app/src/main/res/drawable/gaana.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf81dafa78d84ce01dea6df8ccbc50e4a185333 GIT binary patch literal 16876 zcmeHv^C098U#dY6bVH@S{hMWQc}8G zx?}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e=0(5%P%P2YDSy_RC|?8&A%hBYsGLm==^Q&m?bPs#ep F{{rNfK*0b2 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_gaana.xml b/app/src/main/res/drawable/ic_gaana.xml new file mode 100644 index 00000000..08175bbb --- /dev/null +++ b/app/src/main/res/drawable/ic_gaana.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/app/src/main/res/layout/download_record_fragment.xml b/app/src/main/res/layout/download_record_fragment.xml index dacd85b1..29be0126 100755 --- a/app/src/main/res/layout/download_record_fragment.xml +++ b/app/src/main/res/layout/download_record_fragment.xml @@ -26,7 +26,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - style="@style/Widget.AppCompat.EditText.Gradient" + style="@style/Widget.AppCompat.TextView.Gradient" android:drawablePadding="5dp" android:fontFamily="@font/raleway_semibold" android:text=" Download History " @@ -56,6 +56,11 @@ android:icon="@drawable/ic_spotify_logo" android:text="Spotify" /> + + + + app:layout_constraintTop_toTopOf="@+id/btn_github" /> + app:layout_constraintTop_toBottomOf="@+id/btn_github"/> #99FFFFFF #000000 #121212 - #4BB543 + #59C351 #FF9494 \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c3b734c0..fab32e6a 100755 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -25,6 +25,8 @@ #FF5E5E @color/black @color/dark + @color/black + @color/black @color/white #FC5C7D @color/white @@ -62,11 +64,13 @@ fitCenter 8dp -