From 4947c97d70d115e236b5d232819f0645e6924bef Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 27 May 2022 20:51:56 +0200 Subject: [PATCH] create playlist rewrite --- .../github/libretube/CreatePlaylistDialog.kt | 42 ++++++++++++++++++- .../main/java/com/github/libretube/Library.kt | 30 +------------ 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt b/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt index bfbfa70f2..c5704aa9c 100644 --- a/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/CreatePlaylistDialog.kt @@ -1,6 +1,8 @@ package com.github.libretube +import android.content.Context import android.os.Bundle +import android.util.Log import android.util.TypedValue import android.view.LayoutInflater import android.view.View @@ -12,9 +14,16 @@ import androidx.core.os.bundleOf import androidx.core.text.HtmlCompat import androidx.fragment.app.DialogFragment import androidx.fragment.app.setFragmentResult +import androidx.lifecycle.lifecycleScope +import com.github.libretube.obj.Playlists import com.google.android.material.textfield.TextInputEditText +import retrofit2.HttpException +import java.io.IOException class CreatePlaylistDialog : DialogFragment() { + val TAG = "CreatePlaylistDialog" + private var token: String = "" + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -36,13 +45,15 @@ class CreatePlaylistDialog : DialogFragment() { dismiss() } + val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE) + token = sharedPref?.getString("token", "")!! + val playlistName = rootView.findViewById(R.id.playlist_name) val createPlaylistBtn = rootView.findViewById