1
0
mirror of https://github.com/libre-tube/LibreTube.git synced 2024-12-15 06:40:30 +05:30

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
app/src/main
java/com/github/libretube
res/layout

View File

@ -58,7 +58,8 @@ class Library : Fragment() {
Log.d(TAG, "hmm")
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()
newFragment.show(childFragmentManager, "Create Playlist")
}
@ -67,7 +68,8 @@ class Library : Fragment() {
}
} else {
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)) {
visibility = View.VISIBLE
setImageResource(R.drawable.ic_login)

View File

@ -64,27 +64,14 @@
</ScrollView>
</com.github.libretube.util.CustomSwipeToRefresh>
<FrameLayout
android:layout_width="match_parent"
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/create_playlist"
android:layout_width="wrap_content"
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: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>
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:tint="?android:attr/colorBackground"
app:backgroundTint="?attr/colorSecondary"
app:srcCompat="@drawable/ic_add" />
</FrameLayout>