mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
Removed Create Playlist Btn and Refresh in Library if not logged in
This commit is contained in:
parent
ba740e6b92
commit
1fc315e31f
@ -48,8 +48,8 @@ class Library : Fragment() {
|
|||||||
playlistRecyclerView.layoutManager = LinearLayoutManager(view.context)
|
playlistRecyclerView.layoutManager = LinearLayoutManager(view.context)
|
||||||
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
||||||
token = sharedPref?.getString("token","")!!
|
token = sharedPref?.getString("token","")!!
|
||||||
if(token!="") {
|
|
||||||
refreshLayout = view.findViewById(R.id.playlist_refresh)
|
refreshLayout = view.findViewById(R.id.playlist_refresh)
|
||||||
|
if(token!="") {
|
||||||
view.findViewById<ImageView>(R.id.boogh2).visibility=View.GONE
|
view.findViewById<ImageView>(R.id.boogh2).visibility=View.GONE
|
||||||
view.findViewById<TextView>(R.id.textLike2).visibility=View.GONE
|
view.findViewById<TextView>(R.id.textLike2).visibility=View.GONE
|
||||||
fetchPlaylists(view)
|
fetchPlaylists(view)
|
||||||
@ -67,6 +67,8 @@ class Library : Fragment() {
|
|||||||
createPlaylist("$playlistName", view);
|
createPlaylist("$playlistName", view);
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
|
refreshLayout?.isEnabled = false
|
||||||
|
view.findViewById<Button>(R.id.create_playlist).visibility = View.GONE
|
||||||
with(view.findViewById<ImageView>(R.id.boogh2)){
|
with(view.findViewById<ImageView>(R.id.boogh2)){
|
||||||
visibility=View.VISIBLE
|
visibility=View.VISIBLE
|
||||||
setImageResource(R.drawable.ic_login)
|
setImageResource(R.drawable.ic_login)
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
android:text="@string/createPlaylist"
|
android:text="@string/createPlaylist"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:drawableLeft="@drawable/ic_add"/>
|
android:drawableLeft="@drawable/ic_add" />
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user