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:layout_height="wrap_content"
android:layout_gravity="bottom">
<com.google.android.material.button.MaterialButton
android:layout_gravity="right"
android:id="@+id/create_playlist" android:id="@+id/create_playlist"
android:layout_marginBottom="15dp" android:layout_width="wrap_content"
android:layout_marginRight="15dp" android:layout_height="wrap_content"
android:layout_width="50dp" android:layout_gravity="bottom|end"
android:layout_height="50dp" android:layout_margin="16dp"
android:insetLeft="0dp" app:tint="?android:attr/colorBackground"
android:insetTop="0dp" app:backgroundTint="?attr/colorSecondary"
android:insetRight="0dp" app:srcCompat="@drawable/ic_add" />
android:insetBottom="0dp"
app:cornerRadius="16dp"
app:icon="@drawable/ic_add"
android:backgroundTint="?attr/colorSecondary"
app:iconGravity="textStart"
app:iconPadding="0dp" />
</FrameLayout>
</FrameLayout> </FrameLayout>