From 1fc315e31f407e453658fd0c3a2888ac496efd1d Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 10 May 2022 12:20:15 +0200 Subject: [PATCH] Removed Create Playlist Btn and Refresh in Library if not logged in --- app/src/main/java/com/github/libretube/Library.kt | 4 +++- app/src/main/res/layout/fragment_library.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/Library.kt b/app/src/main/java/com/github/libretube/Library.kt index 9776d1209..9f557b0d5 100644 --- a/app/src/main/java/com/github/libretube/Library.kt +++ b/app/src/main/java/com/github/libretube/Library.kt @@ -48,8 +48,8 @@ class Library : Fragment() { playlistRecyclerView.layoutManager = LinearLayoutManager(view.context) val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE) token = sharedPref?.getString("token","")!! + refreshLayout = view.findViewById(R.id.playlist_refresh) if(token!="") { - refreshLayout = view.findViewById(R.id.playlist_refresh) view.findViewById(R.id.boogh2).visibility=View.GONE view.findViewById(R.id.textLike2).visibility=View.GONE fetchPlaylists(view) @@ -67,6 +67,8 @@ class Library : Fragment() { createPlaylist("$playlistName", view); } } else{ + refreshLayout?.isEnabled = false + view.findViewById