mirror of https://git.sr.ht/~oppen/ariane
bookmarks empty layout
This commit is contained in:
parent
fac559bc90
commit
3ccbc5219e
|
@ -13,6 +13,7 @@ import kotlinx.android.synthetic.main.dialog_bookmarks.view.*
|
|||
import oppen.ariane.R
|
||||
import oppen.ariane.io.bookmarks.Bookmark
|
||||
import oppen.ariane.io.bookmarks.BookmarksDatasource
|
||||
import oppen.visible
|
||||
|
||||
|
||||
class BookmarksDialog(
|
||||
|
@ -73,7 +74,10 @@ class BookmarksDialog(
|
|||
bookmarkDatasource.get { bookmarks ->
|
||||
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
bookmarksAdapter.update(bookmarks)
|
||||
when {
|
||||
bookmarks.isEmpty() -> view.bookmarks_empty_layout.visible(true)
|
||||
else -> bookmarksAdapter.update(bookmarks)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,5 +17,38 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/bookmarks_toolbar"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/bookmarks_empty_layout"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_centerInParent="true"
|
||||
android:paddingBottom="60dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/vector_bookmarks"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="You don't have any bookmarks yet"
|
||||
android:paddingTop="@dimen/default_margin_big"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue