switch to fab

This commit is contained in:
Bnyro 2022-06-04 08:16:54 +02:00
parent 2110f8fc95
commit 3c34d56a1c
2 changed files with 12 additions and 23 deletions

View File

@ -58,7 +58,8 @@ class Library : Fragment() {
Log.d(TAG, "hmm") Log.d(TAG, "hmm")
fetchPlaylists(view) fetchPlaylists(view)
} }
view.findViewById<Button>(R.id.create_playlist).setOnClickListener { view.findViewById<com.google.android.material.floatingactionbutton
.FloatingActionButton>(R.id.create_playlist).setOnClickListener {
val newFragment = CreatePlaylistDialog() val newFragment = CreatePlaylistDialog()
newFragment.show(childFragmentManager, "Create Playlist") newFragment.show(childFragmentManager, "Create Playlist")
} }
@ -67,7 +68,8 @@ class Library : Fragment() {
} }
} else { } else {
refreshLayout.isEnabled = false refreshLayout.isEnabled = false
view.findViewById<Button>(R.id.create_playlist).visibility = View.GONE view.findViewById<com.google.android.material.floatingactionbutton
.FloatingActionButton>(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)

View File

@ -64,27 +64,14 @@
</ScrollView> </ScrollView>
</com.github.libretube.util.CustomSwipeToRefresh> </com.github.libretube.util.CustomSwipeToRefresh>
<FrameLayout <com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="match_parent" android:id="@+id/create_playlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"> android:layout_gravity="bottom|end"
android:layout_margin="16dp"
<com.google.android.material.button.MaterialButton app:tint="?android:attr/colorBackground"
android:layout_gravity="right" app:backgroundTint="?attr/colorSecondary"
android:id="@+id/create_playlist" app:srcCompat="@drawable/ic_add" />
android:layout_marginBottom="15dp"
android:layout_marginRight="15dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:insetLeft="0dp"
android:insetTop="0dp"
android:insetRight="0dp"
android:insetBottom="0dp"
app:cornerRadius="16dp"
app:icon="@drawable/ic_add"
android:backgroundTint="?attr/colorSecondary"
app:iconGravity="textStart"
app:iconPadding="0dp" />
</FrameLayout>
</FrameLayout> </FrameLayout>