diff --git a/.idea/dictionaries/shabinder.xml b/.idea/dictionaries/shabinder.xml
index eae09e67..16f2713a 100644
--- a/.idea/dictionaries/shabinder.xml
+++ b/.idea/dictionaries/shabinder.xml
@@ -1,13 +1,17 @@
+ flyer
moshi
musicforeveryone
musicplaceholder
shabinder
singh
+ spoti
+ spotiflyer
spotify
spotifydownloader
+ spotifyler
\ No newline at end of file
diff --git a/ScreenShots/HomeScreen.png b/ScreenShots/HomeScreen.png
index 48da7f45..0804cea7 100644
Binary files a/ScreenShots/HomeScreen.png and b/ScreenShots/HomeScreen.png differ
diff --git a/ScreenShots/Playlist.png b/ScreenShots/Playlist.png
deleted file mode 100644
index 3c83dd57..00000000
Binary files a/ScreenShots/Playlist.png and /dev/null differ
diff --git a/app/build.gradle b/app/build.gradle
index 5d62c3ac..8940d6bc 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,3 +1,20 @@
+/*
+ * 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 .
+ */
+
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
@@ -15,7 +32,7 @@ android {
}
defaultConfig {
- applicationId 'com.shabinder.musicforeveryone'
+ applicationId 'com.shabinder.spotiflyer'
minSdkVersion 22
targetSdkVersion 29
versionCode 1
@@ -55,9 +72,9 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7"
- implementation "androidx.room:room-runtime:2.2.5"
- kapt "androidx.room:room-compiler:2.2.5"
- implementation "androidx.room:room-ktx:2.2.5"
+// implementation "androidx.room:room-runtime:2.2.5"
+// kapt "androidx.room:room-compiler:2.2.5"
+// implementation "androidx.room:room-ktx:2.2.5"
implementation "com.github.bumptech.glide:glide:4.11.0"
kapt "com.github.bumptech.glide:compiler:4.11.0"
@@ -73,7 +90,7 @@ dependencies {
implementation "com.squareup.moshi:moshi-kotlin:1.9.3"
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
-
+ implementation 'com.shreyaspatil:EasyUpiPayment:2.2'
implementation 'com.github.sealedtx:java-youtube-downloader:2.2.2'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
diff --git a/app/src/androidTest/java/com/shabinder/musicForEveryone/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/shabinder/musicForEveryone/ExampleInstrumentedTest.kt
deleted file mode 100644
index f28aa88a..00000000
--- a/app/src/androidTest/java/com/shabinder/musicForEveryone/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.shabinder.musicForEveryone
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.platform.app.InstrumentationRegistry
-import org.junit.Assert.assertEquals
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
- @Test
- fun useAppContext() {
- // Context of the app under test.
- val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.shabinder.spotifydownloader", appContext.packageName)
- }
-}
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/shabinder/spotiflyer/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/shabinder/spotiflyer/ExampleInstrumentedTest.kt
new file mode 100644
index 00000000..956c41db
--- /dev/null
+++ b/app/src/androidTest/java/com/shabinder/spotiflyer/ExampleInstrumentedTest.kt
@@ -0,0 +1,39 @@
+/*
+ * 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
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.platform.app.InstrumentationRegistry
+import org.junit.Assert.assertEquals
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("com.shabinder.spotifydownloader", appContext.packageName)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 71fcd374..011f3294 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,23 @@
+
+
+ package="com.shabinder.spotiflyer">
@@ -20,7 +37,7 @@
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme">
-
+
@@ -28,7 +45,7 @@
-
diff --git a/app/src/main/java/com/shabinder/musicForEveryone/utils/BindingAdapter.kt b/app/src/main/java/com/shabinder/musicForEveryone/utils/BindingAdapter.kt
deleted file mode 100644
index 04b7d209..00000000
--- a/app/src/main/java/com/shabinder/musicForEveryone/utils/BindingAdapter.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.shabinder.musicForEveryone.utils
-
-import android.widget.ImageView
-import androidx.core.net.toUri
-import androidx.databinding.BindingAdapter
-import com.bumptech.glide.Glide
-import com.bumptech.glide.request.RequestOptions
-import com.shabinder.musicForEveryone.R
-
-@BindingAdapter("imageUrl")
-fun bindImage(imgView: ImageView, imgUrl: String?) {
- imgUrl?.let {
- val imgUri = imgUrl.toUri().buildUpon().scheme("https").build()
- Glide.with(imgView.context)
- .load(imgUri)
- .apply(RequestOptions()
- .placeholder(R.drawable.ic_song_placeholder)
- .error(R.drawable.ic_musicplaceholder))
- .into(imgView)
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/shabinder/musicForEveryone/MainActivity.kt b/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt
similarity index 91%
rename from app/src/main/java/com/shabinder/musicForEveryone/MainActivity.kt
rename to app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt
index abc67520..9c675e07 100644
--- a/app/src/main/java/com/shabinder/musicForEveryone/MainActivity.kt
+++ b/app/src/main/java/com/shabinder/spotiflyer/MainActivity.kt
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package com.shabinder.musicForEveryone
+package com.shabinder.spotiflyer
import android.Manifest
import android.app.DownloadManager
@@ -30,11 +30,12 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import com.github.kiulian.downloader.YoutubeDownloader
-import com.shabinder.musicForEveryone.databinding.MainActivityBinding
-import com.shabinder.musicForEveryone.downloadHelper.DownloadHelper
-import com.shabinder.musicForEveryone.utils.SpotifyService
-import com.shabinder.musicForEveryone.utils.SpotifyServiceToken
-import com.shabinder.musicForEveryone.utils.YoutubeInterface
+import com.shabinder.spotiflyer.databinding.MainActivityBinding
+import com.shabinder.spotiflyer.downloadHelper.DownloadHelper
+import com.shabinder.spotiflyer.utils.SpotifyService
+import com.shabinder.spotiflyer.utils.SpotifyServiceToken
+import com.shabinder.spotiflyer.utils.YoutubeInterface
+import com.shreyaspatil.EasyUpiPayment.EasyUpiPayment
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import kotlinx.coroutines.launch
@@ -45,6 +46,7 @@ import okhttp3.Response
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
+
@Suppress("DEPRECATION")
class MainActivity : AppCompatActivity() ,DownloadHelper{
private lateinit var binding: MainActivityBinding
@@ -52,12 +54,12 @@ class MainActivity : AppCompatActivity() ,DownloadHelper{
private var spotifyService : SpotifyService? = null
private var spotifyServiceToken : SpotifyServiceToken? = null
private var downloadManager : DownloadManager? = null
-// private val redirectUri = "musicforeveryone://callback"
+// private val redirectUri = "spotiflyer://callback"
private val clientId:String = "694d8bf4f6ec420fa66ea7fb4c68f89d"
private val clientSecret:String = "02ca2d4021a7452dae2328b47a6e8fe8"
private var isConnected: Boolean = false
private var sharedPref :SharedPreferences? = null
-
+ private var easyUpiPayment:EasyUpiPayment? = null
private var token :String =""
private lateinit var sharedViewModel: SharedViewModel
@@ -100,9 +102,22 @@ class MainActivity : AppCompatActivity() ,DownloadHelper{
Log.i("Connection Status",isConnected.toString())
+ easyUpiPayment = EasyUpiPayment.Builder()
+ .with(this)
+ .setPayeeVpa("technoshab@paytm")
+ .setPayeeName("Shabinder Singh")
+ .setTransactionId("UNIQUE_TRANSACTION_ID")
+ .setTransactionRefId("UNIQUE_TRANSACTION_REF_ID")
+ .setDescription("Thanks for donating")
+ .setAmount("39.00")
+ .build()
+
+ sharedViewModel.easyUpiPayment = easyUpiPayment
+
handleIntentFromExternalActivity()
}
+
/**
* Adding my own new Spotify Web Api Requests!
* */
@@ -162,7 +177,7 @@ class MainActivity : AppCompatActivity() ,DownloadHelper{
}
- private fun authenticateSpotify() {
+ fun authenticateSpotify() {
if (spotifyServiceToken == null) {
getSpotifyToken()
}
diff --git a/app/src/main/java/com/shabinder/musicForEveryone/SharedViewModel.kt b/app/src/main/java/com/shabinder/spotiflyer/SharedViewModel.kt
similarity index 88%
rename from app/src/main/java/com/shabinder/musicForEveryone/SharedViewModel.kt
rename to app/src/main/java/com/shabinder/spotiflyer/SharedViewModel.kt
index e03219b9..350f72ca 100644
--- a/app/src/main/java/com/shabinder/musicForEveryone/SharedViewModel.kt
+++ b/app/src/main/java/com/shabinder/spotiflyer/SharedViewModel.kt
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package com.shabinder.musicForEveryone
+package com.shabinder.spotiflyer
import android.app.DownloadManager
import android.content.Context
@@ -24,10 +24,11 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.github.kiulian.downloader.YoutubeDownloader
import com.google.android.material.dialog.MaterialAlertDialogBuilder
-import com.shabinder.musicForEveryone.models.Album
-import com.shabinder.musicForEveryone.models.Playlist
-import com.shabinder.musicForEveryone.models.Track
-import com.shabinder.musicForEveryone.utils.SpotifyService
+import com.shabinder.spotiflyer.models.Album
+import com.shabinder.spotiflyer.models.Playlist
+import com.shabinder.spotiflyer.models.Track
+import com.shabinder.spotiflyer.utils.SpotifyService
+import com.shreyaspatil.EasyUpiPayment.EasyUpiPayment
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -39,6 +40,8 @@ class SharedViewModel : ViewModel() {
var ytDownloader : YoutubeDownloader? = null
var downloadManager : DownloadManager? = null
var isConnected = MutableLiveData().apply { value = false }
+ var easyUpiPayment: EasyUpiPayment? = null
+
private var viewModelJob = Job()
diff --git a/app/src/main/java/com/shabinder/musicForEveryone/downloadHelper/DownloadHelper.kt b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt
similarity index 85%
rename from app/src/main/java/com/shabinder/musicForEveryone/downloadHelper/DownloadHelper.kt
rename to app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt
index 0621ff89..01e8fa0e 100644
--- a/app/src/main/java/com/shabinder/musicForEveryone/downloadHelper/DownloadHelper.kt
+++ b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-package com.shabinder.musicForEveryone.downloadHelper
+package com.shabinder.spotiflyer.downloadHelper
import android.app.DownloadManager
import android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED
@@ -25,9 +25,9 @@ import android.util.Log
import com.github.kiulian.downloader.YoutubeDownloader
import com.github.kiulian.downloader.model.formats.Format
import com.github.kiulian.downloader.model.quality.AudioQuality
-import com.shabinder.musicForEveryone.fragments.MainFragment
-import com.shabinder.musicForEveryone.models.Track
-import com.shabinder.musicForEveryone.utils.YoutubeInterface
+import com.shabinder.spotiflyer.fragments.MainFragment
+import com.shabinder.spotiflyer.models.Track
+import com.shabinder.spotiflyer.utils.YoutubeInterface
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.File
@@ -37,13 +37,18 @@ interface DownloadHelper {
/**
* Function To Download All Tracks Available in a List
**/
- suspend fun downloadAllTracks(trackList : List