mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Add empty image placeholder in download page
This commit is contained in:
parent
2d7252e9e4
commit
6021654748
4 changed files with 645 additions and 3 deletions
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
|
|
@ -37,6 +37,7 @@
|
|||
<entry key="app/src/main/res/drawable/ic_skip_next_white_24dp.xml" value="0.28055555555555556" />
|
||||
<entry key="app/src/main/res/drawable/ic_skip_previous_white_24dp.xml" value="0.28055555555555556" />
|
||||
<entry key="app/src/main/res/drawable/ic_star.xml" value="0.2722222222222222" />
|
||||
<entry key="app/src/main/res/drawable/ui_empty_list.xml" value="0.28055555555555556" />
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.3229166666666667" />
|
||||
<entry key="app/src/main/res/layout/bottom_sheet_song_dialog.xml" value="0.21666666666666667" />
|
||||
<entry key="app/src/main/res/layout/dialog_playlist_chooser.xml" value="0.3229166666666667" />
|
||||
|
|
|
|||
|
|
@ -155,6 +155,9 @@ public class DownloadFragment extends Fragment {
|
|||
if (bind != null) bind.downloadDownloadedArtistPlaceholder.placeholder.setVisibility(View.VISIBLE);
|
||||
if (bind != null) bind.downloadDownloadedArtistSector.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (bind != null && !artists.isEmpty()) bind.emptyDownloadLayout.setVisibility(View.GONE);
|
||||
if (bind != null && !artists.isEmpty()) bind.fragmentDownloadNestedScrollView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bind != null) bind.downloadDownloadedArtistPlaceholder.placeholder.setVisibility(View.GONE);
|
||||
if (bind != null) bind.downloadDownloadedArtistSector.setVisibility(!artists.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
if (bind != null) bind.downloadedArtistRecyclerView.setLayoutManager(new GridLayoutManager(requireContext(), UIUtil.getSpanCount(artists.size(), 5), GridLayoutManager.HORIZONTAL, false));
|
||||
|
|
@ -186,6 +189,9 @@ public class DownloadFragment extends Fragment {
|
|||
if (bind != null) bind.downloadDownloadedAlbumPlaceholder.placeholder.setVisibility(View.VISIBLE);
|
||||
if (bind != null) bind.downloadDownloadedAlbumSector.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (bind != null && !albums.isEmpty()) bind.emptyDownloadLayout.setVisibility(View.GONE);
|
||||
if (bind != null && !albums.isEmpty()) bind.fragmentDownloadNestedScrollView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bind != null) bind.downloadDownloadedAlbumPlaceholder.placeholder.setVisibility(View.GONE);
|
||||
if (bind != null) bind.downloadDownloadedAlbumSector.setVisibility(!albums.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
if (bind != null) bind.downloadedAlbumRecyclerView.setLayoutManager(new GridLayoutManager(requireContext(), UIUtil.getSpanCount(albums.size(), 5), GridLayoutManager.HORIZONTAL, false));
|
||||
|
|
@ -217,6 +223,9 @@ public class DownloadFragment extends Fragment {
|
|||
if (bind != null) bind.downloadDownloadedTracksPlaceholder.placeholder.setVisibility(View.VISIBLE);
|
||||
if (bind != null) bind.downloadDownloadedTracksSector.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (bind != null && !songs.isEmpty()) bind.emptyDownloadLayout.setVisibility(View.GONE);
|
||||
if (bind != null && !songs.isEmpty()) bind.fragmentDownloadNestedScrollView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (bind != null) bind.downloadDownloadedTracksPlaceholder.placeholder.setVisibility(View.GONE);
|
||||
if (bind != null) bind.downloadDownloadedTracksSector.setVisibility(!songs.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
if (bind != null) bind.downloadedTracksRecyclerView.setLayoutManager(new GridLayoutManager(requireContext(), UIUtil.getSpanCount(songs.size(), 5), GridLayoutManager.HORIZONTAL, false));
|
||||
|
|
|
|||
597
app/src/main/res/drawable/ui_empty_list.xml
Normal file
597
app/src/main/res/drawable/ui_empty_list.xml
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -43,11 +42,47 @@
|
|||
</androidx.appcompat.widget.Toolbar>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/empty_download_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/empty_download_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:maxWidth="240dp"
|
||||
android:maxHeight="240dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ui_empty_list" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_download_screen"
|
||||
style="@style/ItemTitleTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:text="No downloads yet!" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle_download_screen"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="56dp"
|
||||
android:paddingEnd="56dp"
|
||||
android:text="Once you download a song, you'll find it here" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/fragment_download_nested_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/download_linear_layout_container"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue