use better library for details activity headers
This commit is contained in:
parent
e89aa2e9ef
commit
04f62e9609
9 changed files with 114 additions and 200 deletions
|
|
@ -44,7 +44,7 @@ dependencies {
|
||||||
implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.6.3'
|
implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.6.3'
|
||||||
implementation 'com.google.android.exoplayer:exoplayer:2.11.4'
|
implementation 'com.google.android.exoplayer:exoplayer:2.11.4'
|
||||||
|
|
||||||
implementation 'androidx.core:core:1.3.0'
|
implementation 'androidx.core:core:1.3.1'
|
||||||
implementation 'androidx.media:media:1.1.0'
|
implementation 'androidx.media:media:1.1.0'
|
||||||
implementation 'androidx.fragment:fragment:1.2.5'
|
implementation 'androidx.fragment:fragment:1.2.5'
|
||||||
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
||||||
|
|
@ -66,7 +66,6 @@ dependencies {
|
||||||
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
|
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
|
||||||
implementation 'com.afollestad:material-cab:0.1.12'
|
implementation 'com.afollestad:material-cab:0.1.12'
|
||||||
|
|
||||||
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
|
|
||||||
implementation 'com.heinrichreimersoftware:material-intro:1.6'
|
implementation 'com.heinrichreimersoftware:material-intro:1.6'
|
||||||
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0'
|
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public class AlbumSongAdapter extends SongAdapter {
|
||||||
if (imageText != null) {
|
if (imageText != null) {
|
||||||
imageText.setVisibility(View.VISIBLE);
|
imageText.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
image.setVisibility(View.GONE);
|
image.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
package com.dkanada.gramophone.misc;
|
|
||||||
|
|
||||||
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
|
|
||||||
import com.github.ksoichiro.android.observablescrollview.ScrollState;
|
|
||||||
|
|
||||||
public abstract class SimpleObservableScrollViewCallbacks implements ObservableScrollViewCallbacks {
|
|
||||||
@Override
|
|
||||||
public void onScrollChanged(int i, boolean b, boolean b2) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDownMotionEvent() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -20,7 +20,7 @@ import com.afollestad.materialdialogs.util.DialogUtils;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.bumptech.glide.request.RequestListener;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView;
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
||||||
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
|
|
@ -34,7 +34,6 @@ import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.dkanada.gramophone.interfaces.CabHolder;
|
import com.dkanada.gramophone.interfaces.CabHolder;
|
||||||
import com.dkanada.gramophone.interfaces.MediaCallback;
|
import com.dkanada.gramophone.interfaces.MediaCallback;
|
||||||
import com.dkanada.gramophone.interfaces.PaletteColorHolder;
|
import com.dkanada.gramophone.interfaces.PaletteColorHolder;
|
||||||
import com.dkanada.gramophone.misc.SimpleObservableScrollViewCallbacks;
|
|
||||||
import com.dkanada.gramophone.model.Album;
|
import com.dkanada.gramophone.model.Album;
|
||||||
import com.dkanada.gramophone.model.Artist;
|
import com.dkanada.gramophone.model.Artist;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
|
|
@ -51,21 +50,21 @@ import java.util.List;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements PaletteColorHolder, CabHolder {
|
public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements PaletteColorHolder, CabHolder, AppBarLayout.OnOffsetChangedListener {
|
||||||
public static final String EXTRA_ALBUM = "extra_album";
|
public static final String EXTRA_ALBUM = "extra_album";
|
||||||
|
|
||||||
private Album album;
|
private Album album;
|
||||||
|
|
||||||
|
@BindView(R.id.app_bar_layout)
|
||||||
|
AppBarLayout appBarLayout;
|
||||||
@BindView(R.id.list)
|
@BindView(R.id.list)
|
||||||
ObservableRecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
@BindView(R.id.image)
|
@BindView(R.id.image)
|
||||||
ImageView albumArtImageView;
|
ImageView albumArtImageView;
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
@BindView(R.id.header)
|
@BindView(R.id.header)
|
||||||
View headerView;
|
View headerView;
|
||||||
@BindView(R.id.header_overlay)
|
|
||||||
View headerOverlay;
|
|
||||||
|
|
||||||
@BindView(R.id.artist_icon)
|
@BindView(R.id.artist_icon)
|
||||||
ImageView artistIconImageView;
|
ImageView artistIconImageView;
|
||||||
|
|
@ -118,27 +117,17 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOffsetChanged (AppBarLayout appBarLayout, int verticalOffset) {
|
||||||
|
float headerAlpha = Math.max(0, Math.min(1, 1 + (2 * (float) verticalOffset / headerViewHeight)));
|
||||||
|
headerView.setAlpha(headerAlpha);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected View createContentView() {
|
protected View createContentView() {
|
||||||
return wrapSlidingMusicPanel(R.layout.activity_album_detail);
|
return wrapSlidingMusicPanel(R.layout.activity_album_detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final SimpleObservableScrollViewCallbacks observableScrollViewCallbacks = new SimpleObservableScrollViewCallbacks() {
|
|
||||||
@Override
|
|
||||||
public void onScrollChanged(int scrollY, boolean b, boolean b2) {
|
|
||||||
scrollY += headerViewHeight;
|
|
||||||
|
|
||||||
// Change alpha of overlay
|
|
||||||
float headerAlpha = Math.max(0, Math.min(1, (float) 2 * scrollY / headerViewHeight));
|
|
||||||
headerOverlay.setBackgroundColor(ColorUtil.withAlpha(toolbarColor, headerAlpha));
|
|
||||||
|
|
||||||
// Translate name text
|
|
||||||
headerView.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
|
||||||
headerOverlay.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
|
||||||
albumArtImageView.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private void setUpObservableListViewParams() {
|
private void setUpObservableListViewParams() {
|
||||||
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
||||||
}
|
}
|
||||||
|
|
@ -183,7 +172,7 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
|
|
||||||
private void setColors(int color) {
|
private void setColors(int color) {
|
||||||
toolbarColor = color;
|
toolbarColor = color;
|
||||||
headerView.setBackgroundColor(color);
|
appBarLayout.setBackgroundColor(color);
|
||||||
|
|
||||||
setNavigationbarColor(color);
|
setNavigationbarColor(color);
|
||||||
setTaskDescriptionColor(color);
|
setTaskDescriptionColor(color);
|
||||||
|
|
@ -210,14 +199,7 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpRecyclerView() {
|
private void setUpRecyclerView() {
|
||||||
setUpRecyclerViewPadding();
|
appBarLayout.addOnOffsetChangedListener(this);
|
||||||
recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
|
||||||
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
|
||||||
contentView.post(() -> observableScrollViewCallbacks.onScrollChanged(-headerViewHeight, false, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpRecyclerViewPadding() {
|
|
||||||
recyclerView.setPadding(0, headerViewHeight, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.dkanada.gramophone.ui.activities;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -12,6 +11,7 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
|
|
@ -24,12 +24,12 @@ import com.afollestad.materialdialogs.util.DialogUtils;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.request.RequestListener;
|
import com.bumptech.glide.request.RequestListener;
|
||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
import com.github.ksoichiro.android.observablescrollview.ObservableListView;
|
import com.dkanada.gramophone.adapter.song.SongAdapter;
|
||||||
|
import com.google.android.material.appbar.AppBarLayout;
|
||||||
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
||||||
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
||||||
import com.dkanada.gramophone.R;
|
import com.dkanada.gramophone.R;
|
||||||
import com.dkanada.gramophone.adapter.album.HorizontalAlbumAdapter;
|
import com.dkanada.gramophone.adapter.album.HorizontalAlbumAdapter;
|
||||||
import com.dkanada.gramophone.adapter.song.ArtistSongAdapter;
|
|
||||||
import com.dkanada.gramophone.dialogs.AddToPlaylistDialog;
|
import com.dkanada.gramophone.dialogs.AddToPlaylistDialog;
|
||||||
import com.dkanada.gramophone.dialogs.SleepTimerDialog;
|
import com.dkanada.gramophone.dialogs.SleepTimerDialog;
|
||||||
import com.dkanada.gramophone.glide.CustomGlideRequest;
|
import com.dkanada.gramophone.glide.CustomGlideRequest;
|
||||||
|
|
@ -39,7 +39,6 @@ import com.dkanada.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.dkanada.gramophone.interfaces.CabHolder;
|
import com.dkanada.gramophone.interfaces.CabHolder;
|
||||||
import com.dkanada.gramophone.interfaces.MediaCallback;
|
import com.dkanada.gramophone.interfaces.MediaCallback;
|
||||||
import com.dkanada.gramophone.interfaces.PaletteColorHolder;
|
import com.dkanada.gramophone.interfaces.PaletteColorHolder;
|
||||||
import com.dkanada.gramophone.misc.SimpleObservableScrollViewCallbacks;
|
|
||||||
import com.dkanada.gramophone.model.Album;
|
import com.dkanada.gramophone.model.Album;
|
||||||
import com.dkanada.gramophone.model.Artist;
|
import com.dkanada.gramophone.model.Artist;
|
||||||
import com.dkanada.gramophone.model.Song;
|
import com.dkanada.gramophone.model.Song;
|
||||||
|
|
@ -51,19 +50,21 @@ import com.dkanada.gramophone.util.QueryUtil;
|
||||||
|
|
||||||
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
||||||
|
|
||||||
public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implements PaletteColorHolder, CabHolder {
|
public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implements PaletteColorHolder, CabHolder, AppBarLayout.OnOffsetChangedListener {
|
||||||
public static final String EXTRA_ARTIST = "extra_artist";
|
public static final String EXTRA_ARTIST = "extra_artist";
|
||||||
|
|
||||||
@BindView(R.id.list)
|
@BindView(R.id.app_bar_layout)
|
||||||
ObservableListView songListView;
|
AppBarLayout appBarLayout;
|
||||||
|
@BindView(R.id.albums)
|
||||||
|
RecyclerView albumRecyclerView;
|
||||||
|
@BindView(R.id.songs)
|
||||||
|
RecyclerView songRecyclerView;
|
||||||
@BindView(R.id.image)
|
@BindView(R.id.image)
|
||||||
ImageView artistImage;
|
ImageView artistImage;
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
@BindView(R.id.header)
|
@BindView(R.id.header)
|
||||||
View headerView;
|
View headerView;
|
||||||
@BindView(R.id.header_overlay)
|
|
||||||
View headerOverlay;
|
|
||||||
|
|
||||||
@BindView(R.id.duration_icon)
|
@BindView(R.id.duration_icon)
|
||||||
ImageView durationIconImageView;
|
ImageView durationIconImageView;
|
||||||
|
|
@ -78,32 +79,13 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
@BindView(R.id.album_count_text)
|
@BindView(R.id.album_count_text)
|
||||||
TextView albumCountTextView;
|
TextView albumCountTextView;
|
||||||
|
|
||||||
View songListHeader;
|
|
||||||
RecyclerView albumRecyclerView;
|
|
||||||
|
|
||||||
private MaterialCab cab;
|
private MaterialCab cab;
|
||||||
private int headerViewHeight;
|
private int headerViewHeight;
|
||||||
private int toolbarColor;
|
private int toolbarColor;
|
||||||
|
|
||||||
private Artist artist;
|
private Artist artist;
|
||||||
private HorizontalAlbumAdapter albumAdapter;
|
private HorizontalAlbumAdapter albumAdapter;
|
||||||
private ArtistSongAdapter songAdapter;
|
private SongAdapter songAdapter;
|
||||||
|
|
||||||
private final SimpleObservableScrollViewCallbacks observableScrollViewCallbacks = new SimpleObservableScrollViewCallbacks() {
|
|
||||||
@Override
|
|
||||||
public void onScrollChanged(int scrollY, boolean b, boolean b2) {
|
|
||||||
scrollY += headerViewHeight;
|
|
||||||
|
|
||||||
// Change alpha of overlay
|
|
||||||
float headerAlpha = Math.max(0, Math.min(1, (float) 2 * scrollY / headerViewHeight));
|
|
||||||
headerOverlay.setBackgroundColor(ColorUtil.withAlpha(toolbarColor, headerAlpha));
|
|
||||||
|
|
||||||
// Translate name text
|
|
||||||
headerView.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
|
||||||
headerOverlay.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
|
||||||
artistImage.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -113,7 +95,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
|
|
||||||
usePalette = PreferenceUtil.getInstance(this).getAlbumArtistColoredFooters();
|
usePalette = PreferenceUtil.getInstance(this).getAlbumArtistColoredFooters();
|
||||||
|
|
||||||
initViews();
|
|
||||||
setUpObservableListViewParams();
|
setUpObservableListViewParams();
|
||||||
setUpToolbar();
|
setUpToolbar();
|
||||||
setUpViews();
|
setUpViews();
|
||||||
|
|
@ -144,6 +125,12 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOffsetChanged (AppBarLayout appBarLayout, int verticalOffset) {
|
||||||
|
float headerAlpha = Math.max(0, Math.min(1, 1 + (2 * (float) verticalOffset / headerViewHeight)));
|
||||||
|
headerView.setAlpha(headerAlpha);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected View createContentView() {
|
protected View createContentView() {
|
||||||
return wrapSlidingMusicPanel(R.layout.activity_artist_detail);
|
return wrapSlidingMusicPanel(R.layout.activity_artist_detail);
|
||||||
|
|
@ -155,11 +142,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initViews() {
|
|
||||||
songListHeader = LayoutInflater.from(this).inflate(R.layout.artist_detail_header, songListView, false);
|
|
||||||
albumRecyclerView = songListHeader.findViewById(R.id.recycler_view);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpViews() {
|
private void setUpViews() {
|
||||||
setUpSongListView();
|
setUpSongListView();
|
||||||
setUpAlbumRecyclerView();
|
setUpAlbumRecyclerView();
|
||||||
|
|
@ -167,19 +149,12 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpSongListView() {
|
private void setUpSongListView() {
|
||||||
setUpSongListPadding();
|
appBarLayout.addOnOffsetChangedListener(this);
|
||||||
songListView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
|
||||||
songListView.addHeaderView(songListHeader);
|
|
||||||
|
|
||||||
songAdapter = new ArtistSongAdapter(this, getArtist().songs, this);
|
songAdapter = new SongAdapter(this, getArtist().songs, R.layout.item_list, false, this);
|
||||||
songListView.setAdapter(songAdapter);
|
|
||||||
|
|
||||||
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
songRecyclerView.setLayoutManager(new GridLayoutManager(this, 1));
|
||||||
contentView.post(() -> observableScrollViewCallbacks.onScrollChanged(-headerViewHeight, false, false));
|
songRecyclerView.setAdapter(songAdapter);
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpSongListPadding() {
|
|
||||||
songListView.setPadding(0, headerViewHeight, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpAlbumRecyclerView() {
|
private void setUpAlbumRecyclerView() {
|
||||||
|
|
@ -234,7 +209,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
|
|
||||||
private void setColors(int color) {
|
private void setColors(int color) {
|
||||||
toolbarColor = color;
|
toolbarColor = color;
|
||||||
headerView.setBackgroundColor(color);
|
appBarLayout.setBackgroundColor(color);
|
||||||
|
|
||||||
setNavigationbarColor(color);
|
setNavigationbarColor(color);
|
||||||
setTaskDescriptionColor(color);
|
setTaskDescriptionColor(color);
|
||||||
|
|
@ -350,9 +325,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
albumCountTextView.setText(MusicUtil.getAlbumCountString(this, artist.albums.size()));
|
albumCountTextView.setText(MusicUtil.getAlbumCountString(this, artist.albums.size()));
|
||||||
durationTextView.setText(MusicUtil.getReadableDurationString(MusicUtil.getTotalDuration(this, artist.songs)));
|
durationTextView.setText(MusicUtil.getReadableDurationString(MusicUtil.getTotalDuration(this, artist.songs)));
|
||||||
|
|
||||||
// TODO this activity will crash when an artist is passed with an empty album array
|
if (artist.songs.size() != 0) songAdapter.swapDataSet(artist.songs);
|
||||||
// something in the album adapter is causing the issue
|
|
||||||
if (artist.albums.size() != 0) songAdapter.swapDataSet(artist.songs);
|
|
||||||
if (artist.albums.size() != 0) albumAdapter.swapDataSet(artist.albums);
|
if (artist.albums.size() != 0) albumAdapter.swapDataSet(artist.albums);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,38 +26,33 @@
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/list"
|
android:id="@+id/app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:clipToPadding="false"
|
|
||||||
android:divider="@null"
|
|
||||||
android:dividerHeight="0dp"
|
|
||||||
android:scrollbars="none" />
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/header"
|
android:id="@+id/header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/detail_header_height"
|
android:layout_height="@dimen/detail_header_height"
|
||||||
android:background="?attr/defaultFooterColor"
|
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:elevation="@dimen/toolbar_elevation"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
app:layout_scrollFlags="scroll"
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<!--placeholder image view, the actual image view can't go here or the shared element transition won't work right-->
|
<ImageView
|
||||||
<View
|
android:id="@+id/image"
|
||||||
android:layout_width="@dimen/detail_header_image_height"
|
android:layout_width="@dimen/detail_header_image_height"
|
||||||
android:layout_height="@dimen/detail_header_image_height"
|
android:layout_height="@dimen/detail_header_image_height"
|
||||||
android:layout_margin="16dp" />
|
android:layout_margin="16dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_album_art"
|
||||||
|
android:transitionName="@string/transition_album_art"
|
||||||
|
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -176,30 +171,24 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/transparent" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
</FrameLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/list"
|
||||||
<ImageView
|
|
||||||
android:id="@+id/image"
|
|
||||||
android:layout_width="@dimen/detail_header_image_height"
|
|
||||||
android:layout_height="@dimen/detail_header_image_height"
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/default_album_art"
|
|
||||||
android:transitionName="@string/transition_album_art"
|
|
||||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/header_overlay"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/detail_header_height"
|
android:layout_height="match_parent"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:clipToPadding="false"
|
||||||
tools:ignore="UnusedAttribute" />
|
android:divider="@null"
|
||||||
|
android:dividerHeight="0dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
</FrameLayout>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -26,38 +26,33 @@
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.github.ksoichiro.android.observablescrollview.ObservableListView
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/list"
|
android:id="@+id/app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:clipToPadding="false"
|
|
||||||
android:divider="@null"
|
|
||||||
android:dividerHeight="0dp"
|
|
||||||
android:scrollbars="none" />
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/header"
|
android:id="@+id/header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/detail_header_height"
|
android:layout_height="@dimen/detail_header_height"
|
||||||
android:background="?attr/defaultFooterColor"
|
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:elevation="@dimen/toolbar_elevation"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
app:layout_scrollFlags="scroll"
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<!--placeholder image view, the actual image view can't go here or the shared element transition won't work right-->
|
<ImageView
|
||||||
<View
|
android:id="@+id/image"
|
||||||
android:layout_width="@dimen/detail_header_image_height"
|
android:layout_width="@dimen/detail_header_image_height"
|
||||||
android:layout_height="@dimen/detail_header_image_height"
|
android:layout_height="@dimen/detail_header_image_height"
|
||||||
android:layout_margin="16dp" />
|
android:layout_margin="16dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_artist_image"
|
||||||
|
android:transitionName="@string/transition_artist_image"
|
||||||
|
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -148,30 +143,43 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/transparent" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
</FrameLayout>
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/image"
|
android:id="@+id/albums"
|
||||||
android:layout_width="@dimen/detail_header_image_height"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/detail_header_image_height"
|
android:layout_height="164dp"
|
||||||
android:layout_margin="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:scaleType="centerCrop"
|
android:scrollbars="none" />
|
||||||
android:src="@drawable/default_artist_image"
|
|
||||||
android:transitionName="@string/transition_artist_image"
|
|
||||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/header_overlay"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/detail_header_height"
|
android:layout_height="2dp"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:background="?attr/dividerColor" />
|
||||||
tools:ignore="UnusedAttribute" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/songs"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:divider="@null"
|
||||||
|
android:dividerHeight="0dp"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="164dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:scrollbars="none" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginTop="-8dp"
|
|
||||||
android:background="?attr/dividerColor" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
@ -5,8 +5,8 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools:r8:1.6.84'
|
classpath 'com.android.tools:r8:2.0.88'
|
||||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue