Merge pull request #480 from kabouzeid/album-detail-redesign
Redesigned album and artist detail page
This commit is contained in:
commit
24af95872f
17 changed files with 616 additions and 269 deletions
|
|
@ -51,8 +51,8 @@ android {
|
|||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
applicationId 'com.kabouzeid.gramophone'
|
||||
versionCode 155
|
||||
versionName '0.16.9'
|
||||
versionCode 157
|
||||
versionName '1.0.0 BETA 2'
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,18 @@
|
|||
<body>
|
||||
|
||||
<p>You can view the changelog dialog again at any time from the <i>about</i> section.</p>
|
||||
<p>We are coming closer to the first final release!</p>
|
||||
|
||||
<h3>Version 1.0.0 BETA 2</h3>
|
||||
<ol>
|
||||
<li><b>NEW:</b> Artist page redesign</li>
|
||||
<li><b>IMPROVEMENT:</b> Improved the look of the new album page</li>
|
||||
</ol>
|
||||
|
||||
<h3>Version 1.0.0 BETA 1</h3>
|
||||
<ol>
|
||||
<li><b>NEW:</b> Album page redesign</li>
|
||||
</ol>
|
||||
|
||||
<h3>Version 0.16.9</h3>
|
||||
<ol>
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
private static String EUGENE_CHEUNG_GITHUB = "https://github.com/arkon";
|
||||
private static String EUGENE_CHEUNG_WEBSITE = "https://echeung.me/";
|
||||
|
||||
private static String ADRIAN_TWITTER = "https://twitter.com/froschgames";
|
||||
private static String ADRIAN_WEBSITE = "https://froschgames.com/";
|
||||
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
@BindView(R.id.app_version)
|
||||
|
|
@ -102,6 +105,10 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
AppCompatButton eugeneCheungGitHub;
|
||||
@BindView(R.id.eugene_cheung_website)
|
||||
AppCompatButton eugeneCheungWebsite;
|
||||
@BindView(R.id.adrian_twitter)
|
||||
AppCompatButton adrianTwitter;
|
||||
@BindView(R.id.adrian_website)
|
||||
AppCompatButton adrianWebsite;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -156,6 +163,8 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
aleksandarTesicGooglePlus.setOnClickListener(this);
|
||||
eugeneCheungGitHub.setOnClickListener(this);
|
||||
eugeneCheungWebsite.setOnClickListener(this);
|
||||
adrianTwitter.setOnClickListener(this);
|
||||
adrianWebsite.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -228,6 +237,10 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
openUrl(EUGENE_CHEUNG_GITHUB);
|
||||
} else if (v == eugeneCheungWebsite) {
|
||||
openUrl(EUGENE_CHEUNG_WEBSITE);
|
||||
} else if (v == adrianTwitter) {
|
||||
openUrl(ADRIAN_TWITTER);
|
||||
} else if (v == adrianWebsite) {
|
||||
openUrl(ADRIAN_WEBSITE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.kabouzeid.gramophone.ui.activities;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
|
@ -24,8 +24,6 @@ import com.afollestad.materialcab.MaterialCab;
|
|||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.afollestad.materialdialogs.util.DialogUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView;
|
||||
import com.kabouzeid.appthemehelper.util.ColorUtil;
|
||||
import com.kabouzeid.appthemehelper.util.MaterialValueHelper;
|
||||
|
|
@ -36,7 +34,6 @@ import com.kabouzeid.gramophone.dialogs.DeleteSongsDialog;
|
|||
import com.kabouzeid.gramophone.dialogs.SleepTimerDialog;
|
||||
import com.kabouzeid.gramophone.glide.PhonographColoredTarget;
|
||||
import com.kabouzeid.gramophone.glide.SongGlideRequest;
|
||||
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper;
|
||||
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||
import com.kabouzeid.gramophone.interfaces.CabHolder;
|
||||
import com.kabouzeid.gramophone.interfaces.LoaderIds;
|
||||
|
|
@ -51,13 +48,13 @@ import com.kabouzeid.gramophone.model.Song;
|
|||
import com.kabouzeid.gramophone.ui.activities.base.AbsSlidingMusicPanelActivity;
|
||||
import com.kabouzeid.gramophone.ui.activities.tageditor.AbsTagEditorActivity;
|
||||
import com.kabouzeid.gramophone.ui.activities.tageditor.AlbumTagEditorActivity;
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||
import com.kabouzeid.gramophone.util.PhonographColorUtil;
|
||||
import com.kabouzeid.gramophone.util.Util;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
|
@ -84,19 +81,33 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
ImageView albumArtImageView;
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
@BindView(R.id.title)
|
||||
TextView albumTitleView;
|
||||
@BindView(R.id.list_background)
|
||||
View songsBackgroundView;
|
||||
@BindView(R.id.header)
|
||||
View headerView;
|
||||
@BindView(R.id.header_overlay)
|
||||
View headerOverlay;
|
||||
|
||||
@BindView(R.id.artist_icon)
|
||||
ImageView artistIconImageView;
|
||||
@BindView(R.id.duration_icon)
|
||||
ImageView durationIconImageView;
|
||||
@BindView(R.id.song_count_icon)
|
||||
ImageView songCountIconImageView;
|
||||
@BindView(R.id.album_year_icon)
|
||||
ImageView albumYearIconImageView;
|
||||
@BindView(R.id.artist_text)
|
||||
TextView artistTextView;
|
||||
@BindView(R.id.duration_text)
|
||||
TextView durationTextView;
|
||||
@BindView(R.id.song_count_text)
|
||||
TextView songCountTextView;
|
||||
@BindView(R.id.album_year_text)
|
||||
TextView albumYearTextView;
|
||||
|
||||
private AlbumSongAdapter adapter;
|
||||
|
||||
private MaterialCab cab;
|
||||
private int headerOffset;
|
||||
private int titleViewHeight;
|
||||
private int albumArtViewHeight;
|
||||
private int headerViewHeight;
|
||||
private int toolbarColor;
|
||||
private float toolbarAlpha;
|
||||
|
||||
@Nullable
|
||||
private Spanned wiki;
|
||||
|
|
@ -109,8 +120,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
setDrawUnderStatusbar(true);
|
||||
ButterKnife.bind(this);
|
||||
|
||||
supportPostponeEnterTransition();
|
||||
|
||||
lastFMRestClient = new LastFMRestClient(this);
|
||||
|
||||
setUpObservableListViewParams();
|
||||
|
|
@ -128,43 +137,32 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
private final SimpleObservableScrollViewCallbacks observableScrollViewCallbacks = new SimpleObservableScrollViewCallbacks() {
|
||||
@Override
|
||||
public void onScrollChanged(int scrollY, boolean b, boolean b2) {
|
||||
scrollY += albumArtViewHeight + titleViewHeight;
|
||||
float flexibleRange = albumArtViewHeight - headerOffset;
|
||||
|
||||
// Translate album cover
|
||||
albumArtImageView.setTranslationY(Math.max(-albumArtViewHeight, -scrollY / 2));
|
||||
|
||||
// Translate list background
|
||||
songsBackgroundView.setTranslationY(Math.max(0, -scrollY + albumArtViewHeight));
|
||||
scrollY += headerViewHeight;
|
||||
|
||||
// Change alpha of overlay
|
||||
toolbarAlpha = Math.max(0, Math.min(1, (float) scrollY / flexibleRange));
|
||||
toolbar.setBackgroundColor(ColorUtil.withAlpha(toolbarColor, toolbarAlpha));
|
||||
setStatusbarColor(ColorUtil.withAlpha(toolbarColor, cab != null && cab.isActive() ? 1 : toolbarAlpha));
|
||||
float headerAlpha = Math.max(0, Math.min(1, (float) 2 * scrollY / headerViewHeight));
|
||||
headerOverlay.setBackgroundColor(ColorUtil.withAlpha(toolbarColor, headerAlpha));
|
||||
|
||||
// Translate name text
|
||||
int maxTitleTranslationY = albumArtViewHeight;
|
||||
int titleTranslationY = maxTitleTranslationY - scrollY;
|
||||
titleTranslationY = Math.max(headerOffset, titleTranslationY);
|
||||
|
||||
albumTitleView.setTranslationY(titleTranslationY);
|
||||
headerView.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
||||
headerOverlay.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
||||
albumArtImageView.setTranslationY(Math.max(-scrollY, -headerViewHeight));
|
||||
}
|
||||
};
|
||||
|
||||
private void setUpObservableListViewParams() {
|
||||
albumArtViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
||||
toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor);
|
||||
int toolbarHeight = Util.getActionBarSize(this);
|
||||
titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height);
|
||||
headerOffset = toolbarHeight;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
headerOffset += getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
||||
}
|
||||
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
||||
}
|
||||
|
||||
private void setUpViews() {
|
||||
setUpRecyclerView();
|
||||
setUpSongsAdapter();
|
||||
artistTextView.setOnClickListener(v -> {
|
||||
if (album != null) {
|
||||
NavigationUtil.goToArtist(AlbumDetailActivity.this, album.getArtistId());
|
||||
}
|
||||
});
|
||||
setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor));
|
||||
}
|
||||
|
||||
private void loadAlbumCover() {
|
||||
|
|
@ -172,19 +170,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
.checkIgnoreMediaStore(this)
|
||||
.generatePalette(this).build()
|
||||
.dontAnimate()
|
||||
.listener(new RequestListener<Object, BitmapPaletteWrapper>() {
|
||||
@Override
|
||||
public boolean onException(Exception e, Object model, Target<BitmapPaletteWrapper> target, boolean isFirstResource) {
|
||||
supportStartPostponedEnterTransition();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(BitmapPaletteWrapper resource, Object model, Target<BitmapPaletteWrapper> target, boolean isFromMemoryCache, boolean isFirstResource) {
|
||||
supportStartPostponedEnterTransition();
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.into(new PhonographColoredTarget(albumArtImageView) {
|
||||
@Override
|
||||
public void onColorReady(int color) {
|
||||
|
|
@ -195,11 +180,24 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
|
||||
private void setColors(int color) {
|
||||
toolbarColor = color;
|
||||
albumTitleView.setBackgroundColor(color);
|
||||
albumTitleView.setTextColor(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(color)));
|
||||
headerView.setBackgroundColor(color);
|
||||
|
||||
setNavigationbarColor(color);
|
||||
setTaskDescriptionColor(color);
|
||||
|
||||
toolbar.setBackgroundColor(color);
|
||||
setSupportActionBar(toolbar); // needed to auto readjust the toolbar content color
|
||||
setStatusbarColor(color);
|
||||
|
||||
int secondaryTextColor = MaterialValueHelper.getSecondaryTextColor(this, ColorUtil.isColorLight(color));
|
||||
artistIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
durationIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
songCountIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
albumYearIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
artistTextView.setTextColor(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(color)));
|
||||
durationTextView.setTextColor(secondaryTextColor);
|
||||
songCountTextView.setTextColor(secondaryTextColor);
|
||||
albumYearTextView.setTextColor(secondaryTextColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -211,17 +209,11 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
setUpRecyclerViewPadding();
|
||||
recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
||||
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
||||
contentView.post(() -> {
|
||||
songsBackgroundView.getLayoutParams().height = contentView.getHeight();
|
||||
observableScrollViewCallbacks.onScrollChanged(-(albumArtViewHeight + titleViewHeight), false, false);
|
||||
// necessary to fix a bug
|
||||
recyclerView.scrollBy(0, 1);
|
||||
recyclerView.scrollBy(0, -1);
|
||||
});
|
||||
contentView.post(() -> observableScrollViewCallbacks.onScrollChanged(-headerViewHeight, false, false));
|
||||
}
|
||||
|
||||
private void setUpRecyclerViewPadding() {
|
||||
recyclerView.setPadding(0, albumArtViewHeight + titleViewHeight, 0, 0);
|
||||
recyclerView.setPadding(0, headerViewHeight, 0, 0);
|
||||
}
|
||||
|
||||
private void setUpToolBar() {
|
||||
|
|
@ -251,7 +243,7 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_album_detail, menu);
|
||||
return true;
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
private void loadWiki() {
|
||||
|
|
@ -377,7 +369,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
.start(new MaterialCab.Callback() {
|
||||
@Override
|
||||
public boolean onCabCreated(MaterialCab materialCab, Menu menu) {
|
||||
setStatusbarColor(ColorUtil.stripAlpha(toolbarColor));
|
||||
return callback.onCabCreated(materialCab, menu);
|
||||
}
|
||||
|
||||
|
|
@ -388,7 +379,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
|
||||
@Override
|
||||
public boolean onCabFinished(MaterialCab materialCab) {
|
||||
setStatusbarColor(ColorUtil.withAlpha(toolbarColor, toolbarAlpha));
|
||||
return callback.onCabFinished(materialCab);
|
||||
}
|
||||
});
|
||||
|
|
@ -424,7 +414,12 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
loadWiki();
|
||||
}
|
||||
|
||||
albumTitleView.setText(album.getTitle());
|
||||
getSupportActionBar().setTitle(album.getTitle());
|
||||
artistTextView.setText(album.getArtistName());
|
||||
songCountTextView.setText(MusicUtil.getSongCountString(this, album.getSongCount()));
|
||||
durationTextView.setText(MusicUtil.getReadableDurationString(MusicUtil.getTotalDuration(this, album.songs)));
|
||||
albumYearTextView.setText(String.valueOf(album.getYear()));
|
||||
|
||||
adapter.swapDataSet(album.songs);
|
||||
}
|
||||
|
||||
|
|
@ -440,7 +435,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
|||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<Album> loader, Album data) {
|
||||
supportStartPostponedEnterTransition();
|
||||
setAlbum(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.kabouzeid.gramophone.ui.activities;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
|
@ -48,6 +48,7 @@ import com.kabouzeid.gramophone.model.Artist;
|
|||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.ui.activities.base.AbsSlidingMusicPanelActivity;
|
||||
import com.kabouzeid.gramophone.util.CustomArtistImageUtil;
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||
import com.kabouzeid.gramophone.util.PhonographColorUtil;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
|
@ -73,27 +74,36 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
public static final String EXTRA_ARTIST_ID = "extra_artist_id";
|
||||
|
||||
@BindView(R.id.image)
|
||||
ImageView artistImage;
|
||||
@BindView(R.id.list_background)
|
||||
View songListBackground;
|
||||
@BindView(R.id.list)
|
||||
ObservableListView songListView;
|
||||
@BindView(R.id.title)
|
||||
TextView artistName;
|
||||
@BindView(R.id.image)
|
||||
ImageView artistImage;
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
@BindView(R.id.header)
|
||||
View headerView;
|
||||
@BindView(R.id.header_overlay)
|
||||
View headerOverlay;
|
||||
|
||||
@BindView(R.id.duration_icon)
|
||||
ImageView durationIconImageView;
|
||||
@BindView(R.id.song_count_icon)
|
||||
ImageView songCountIconImageView;
|
||||
@BindView(R.id.album_count_icon)
|
||||
ImageView albumCountIconImageView;
|
||||
@BindView(R.id.duration_text)
|
||||
TextView durationTextView;
|
||||
@BindView(R.id.song_count_text)
|
||||
TextView songCountTextView;
|
||||
@BindView(R.id.album_count_text)
|
||||
TextView albumCountTextView;
|
||||
|
||||
View songListHeader;
|
||||
RecyclerView albumRecyclerView;
|
||||
|
||||
private MaterialCab cab;
|
||||
private int headerOffset;
|
||||
private int titleViewHeight;
|
||||
private int artistImageViewHeight;
|
||||
private int headerViewHeight;
|
||||
private int toolbarColor;
|
||||
private float toolbarAlpha;
|
||||
private boolean usePalette;
|
||||
|
||||
private Artist artist;
|
||||
@Nullable
|
||||
|
|
@ -105,6 +115,21 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
private LastFMRestClient lastFMRestClient;
|
||||
|
||||
private boolean forceDownload;
|
||||
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
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -112,15 +137,13 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
setDrawUnderStatusbar(true);
|
||||
ButterKnife.bind(this);
|
||||
|
||||
supportPostponeEnterTransition();
|
||||
|
||||
lastFMRestClient = new LastFMRestClient(this);
|
||||
usePalette = PreferenceUtil.getInstance(this).albumArtistColoredFooters();
|
||||
|
||||
initViews();
|
||||
setUpObservableListViewParams();
|
||||
setUpViews();
|
||||
setUpToolbar();
|
||||
setUpViews();
|
||||
|
||||
getSupportLoaderManager().initLoader(LOADER_ID, getIntent().getExtras(), this);
|
||||
}
|
||||
|
|
@ -130,41 +153,10 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
return wrapSlidingMusicPanel(R.layout.activity_artist_detail);
|
||||
}
|
||||
|
||||
private final SimpleObservableScrollViewCallbacks observableScrollViewCallbacks = new SimpleObservableScrollViewCallbacks() {
|
||||
@Override
|
||||
public void onScrollChanged(int scrollY, boolean b, boolean b2) {
|
||||
scrollY += artistImageViewHeight + titleViewHeight;
|
||||
float flexibleRange = artistImageViewHeight - headerOffset;
|
||||
|
||||
// Translate album cover
|
||||
artistImage.setTranslationY(Math.max(-artistImageViewHeight, -scrollY / 2));
|
||||
|
||||
// Translate list background
|
||||
songListBackground.setTranslationY(Math.max(0, -scrollY + artistImageViewHeight));
|
||||
|
||||
// Change alpha of overlay
|
||||
toolbarAlpha = Math.max(0, Math.min(1, (float) scrollY / flexibleRange));
|
||||
toolbar.setBackgroundColor(ColorUtil.withAlpha(toolbarColor, toolbarAlpha));
|
||||
setStatusbarColor(ColorUtil.withAlpha(toolbarColor, cab != null && cab.isActive() ? 1 : toolbarAlpha));
|
||||
|
||||
// Translate name text
|
||||
int maxTitleTranslationY = artistImageViewHeight;
|
||||
int titleTranslationY = maxTitleTranslationY - scrollY;
|
||||
titleTranslationY = Math.max(headerOffset, titleTranslationY);
|
||||
|
||||
artistName.setTranslationY(titleTranslationY);
|
||||
}
|
||||
};
|
||||
private boolean usePalette;
|
||||
|
||||
private void setUpObservableListViewParams() {
|
||||
artistImageViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
||||
toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor);
|
||||
int toolbarHeight = Util.getActionBarSize(this);
|
||||
titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height);
|
||||
headerOffset = toolbarHeight;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
headerOffset += getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
||||
}
|
||||
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
|
|
@ -175,6 +167,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
private void setUpViews() {
|
||||
setUpSongListView();
|
||||
setUpAlbumRecyclerView();
|
||||
setColors(DialogUtils.resolveColor(this, R.attr.defaultFooterColor));
|
||||
}
|
||||
|
||||
private void setUpSongListView() {
|
||||
|
|
@ -186,14 +179,11 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
songListView.setAdapter(songAdapter);
|
||||
|
||||
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
||||
contentView.post(() -> {
|
||||
songListBackground.getLayoutParams().height = contentView.getHeight();
|
||||
observableScrollViewCallbacks.onScrollChanged(-(artistImageViewHeight + titleViewHeight), false, false);
|
||||
});
|
||||
contentView.post(() -> observableScrollViewCallbacks.onScrollChanged(-headerViewHeight, false, false));
|
||||
}
|
||||
|
||||
private void setUpSongListPadding() {
|
||||
songListView.setPadding(0, artistImageViewHeight + titleViewHeight, 0, 0);
|
||||
songListView.setPadding(0, headerViewHeight, 0, 0);
|
||||
}
|
||||
|
||||
private void setUpAlbumRecyclerView() {
|
||||
|
|
@ -301,10 +291,22 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
private void setColors(int color) {
|
||||
toolbarColor = color;
|
||||
artistName.setBackgroundColor(color);
|
||||
artistName.setTextColor(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(color)));
|
||||
headerView.setBackgroundColor(color);
|
||||
|
||||
setNavigationbarColor(color);
|
||||
setTaskDescriptionColor(color);
|
||||
|
||||
toolbar.setBackgroundColor(color);
|
||||
setSupportActionBar(toolbar); // needed to auto readjust the toolbar content color
|
||||
setStatusbarColor(color);
|
||||
|
||||
int secondaryTextColor = MaterialValueHelper.getSecondaryTextColor(this, ColorUtil.isColorLight(color));
|
||||
durationIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
songCountIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
albumCountIconImageView.setColorFilter(secondaryTextColor, PorterDuff.Mode.SRC_IN);
|
||||
durationTextView.setTextColor(secondaryTextColor);
|
||||
songCountTextView.setTextColor(secondaryTextColor);
|
||||
albumCountTextView.setTextColor(secondaryTextColor);
|
||||
}
|
||||
|
||||
private void setUpToolbar() {
|
||||
|
|
@ -318,7 +320,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_artist_detail, menu);
|
||||
menu.findItem(R.id.action_colored_footers).setChecked(usePalette);
|
||||
return true;
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -395,7 +397,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
.start(new MaterialCab.Callback() {
|
||||
@Override
|
||||
public boolean onCabCreated(MaterialCab materialCab, Menu menu) {
|
||||
setStatusbarColor(ColorUtil.stripAlpha(toolbarColor));
|
||||
return callback.onCabCreated(materialCab, menu);
|
||||
}
|
||||
|
||||
|
|
@ -406,7 +407,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
@Override
|
||||
public boolean onCabFinished(MaterialCab materialCab) {
|
||||
setStatusbarColor(ColorUtil.withAlpha(toolbarColor, toolbarAlpha));
|
||||
return callback.onCabFinished(materialCab);
|
||||
}
|
||||
});
|
||||
|
|
@ -442,7 +442,11 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
loadBiography();
|
||||
}
|
||||
|
||||
artistName.setText(artist.getName());
|
||||
getSupportActionBar().setTitle(artist.getName());
|
||||
songCountTextView.setText(MusicUtil.getSongCountString(this, artist.getSongCount()));
|
||||
albumCountTextView.setText(MusicUtil.getAlbumCountString(this, artist.getAlbumCount()));
|
||||
durationTextView.setText(MusicUtil.getReadableDurationString(MusicUtil.getTotalDuration(this, artist.getSongs())));
|
||||
|
||||
songAdapter.swapDataSet(artist.getSongs());
|
||||
albumAdapter.swapDataSet(artist.albums);
|
||||
}
|
||||
|
|
@ -459,7 +463,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<Artist> loader, Artist data) {
|
||||
supportStartPostponedEnterTransition();
|
||||
setArtist(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import org.jaudiotagger.audio.AudioFileIO;
|
|||
import org.jaudiotagger.tag.FieldKey;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -124,15 +123,28 @@ public class MusicUtil {
|
|||
|
||||
@NonNull
|
||||
public static String getPlaylistInfoString(@NonNull final Context context, @NonNull List<Song> songs) {
|
||||
final int songCount = songs.size();
|
||||
final String songString = songCount == 1 ? context.getResources().getString(R.string.song) : context.getResources().getString(R.string.songs);
|
||||
final long duration = getTotalDuration(context, songs);
|
||||
return MusicUtil.getSongCountString(context, songs.size()) + " • " + MusicUtil.getReadableDurationString(duration);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String getSongCountString(@NonNull final Context context, int songCount) {
|
||||
final String songString = songCount == 1 ? context.getResources().getString(R.string.song) : context.getResources().getString(R.string.songs);
|
||||
return songCount + " " + songString;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String getAlbumCountString(@NonNull final Context context, int albumCount) {
|
||||
final String albumString = albumCount == 1 ? context.getResources().getString(R.string.album) : context.getResources().getString(R.string.albums);
|
||||
return albumCount + " " + albumString;
|
||||
}
|
||||
|
||||
public static long getTotalDuration(@NonNull final Context context, @NonNull List<Song> songs) {
|
||||
long duration = 0;
|
||||
for (int i = 0; i < songs.size(); i++) {
|
||||
duration += songs.get(i).duration;
|
||||
}
|
||||
|
||||
return songCount + " " + songString + " • " + MusicUtil.getReadableDurationString(duration);
|
||||
return duration;
|
||||
}
|
||||
|
||||
public static String getReadableDurationString(long songDurationMillis) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,11 @@ public class NavigationUtil {
|
|||
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, artistId);
|
||||
|
||||
//noinspection unchecked
|
||||
activity.startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||
if (sharedElements != null && sharedElements.length > 0) {
|
||||
activity.startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||
} else {
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static void goToAlbum(@NonNull final Activity activity, final int albumId, @Nullable Pair... sharedElements) {
|
||||
|
|
@ -37,7 +41,11 @@ public class NavigationUtil {
|
|||
intent.putExtra(AlbumDetailActivity.EXTRA_ALBUM_ID, albumId);
|
||||
|
||||
//noinspection unchecked
|
||||
activity.startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||
if (sharedElements != null && sharedElements.length > 0) {
|
||||
activity.startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||
} else {
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static void goToGenre(@NonNull final Activity activity, final Genre genre, @Nullable Pair... sharedElements) {
|
||||
|
|
|
|||
10
app/src/main/res/drawable/ic_album_white_24dp.xml
Normal file
10
app/src/main/res/drawable/ic_album_white_24dp.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,16.5c-2.49,0 -4.5,-2.01 -4.5,-4.5S9.51,7.5 12,7.5s4.5,2.01 4.5,4.5 -2.01,4.5 -4.5,4.5zM12,11c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1z" />
|
||||
</vector>
|
||||
|
|
@ -1,87 +1,218 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/header_image_height"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_album_art"
|
||||
android:transitionName="@string/transition_album_art"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
<include layout="@layout/status_bar" />
|
||||
|
||||
<View
|
||||
android:id="@+id/list_background"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/windowBackground" />
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="0dp"
|
||||
android:scrollbars="none" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/title_view_height"
|
||||
android:height="@dimen/title_view_height"
|
||||
android:background="?attr/defaultFooterColor"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="72dp"
|
||||
android:paddingRight="72dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</LinearLayout>
|
||||
<ViewStub
|
||||
android:id="@+id/cab_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
<include layout="@layout/shadow_statusbar_toolbar" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include layout="@layout/status_bar" />
|
||||
<com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="0dp"
|
||||
android:scrollbars="none" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute">
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/cab_stub"
|
||||
<LinearLayout
|
||||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
android:layout_height="@dimen/detail_header_height"
|
||||
android:background="?attr/defaultFooterColor"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<!--placeholder image view, the actual image view can't go here or the shared element transition won't work right-->
|
||||
<View
|
||||
android:layout_width="@dimen/detail_header_image_height"
|
||||
android:layout_height="@dimen/detail_header_image_height"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/artist_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_person_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/song_count_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_music_note_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/song_count_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/duration_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_timer_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/duration_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/album_year_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_event_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_year_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<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" />
|
||||
|
||||
</FrameLayout>
|
||||
<View
|
||||
android:id="@+id/header_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/detail_header_height"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -1,86 +1,188 @@
|
|||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/header_image_height"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_artist_image"
|
||||
android:transitionName="@string/transition_artist_image"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
<include layout="@layout/status_bar" />
|
||||
|
||||
<View
|
||||
android:id="@+id/list_background"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/windowBackground" />
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<com.github.ksoichiro.android.observablescrollview.ObservableListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="0dp"
|
||||
android:scrollbars="none" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/title_view_height"
|
||||
android:height="@dimen/title_view_height"
|
||||
android:background="?attr/defaultFooterColor"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="72dp"
|
||||
android:paddingRight="72dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</LinearLayout>
|
||||
<ViewStub
|
||||
android:id="@+id/cab_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
<include layout="@layout/shadow_statusbar_toolbar" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include layout="@layout/status_bar" />
|
||||
<com.github.ksoichiro.android.observablescrollview.ObservableListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="0dp"
|
||||
android:scrollbars="none" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute">
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/cab_stub"
|
||||
<LinearLayout
|
||||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
android:layout_height="@dimen/detail_header_height"
|
||||
android:background="?attr/defaultFooterColor"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<!--placeholder image view, the actual image view can't go here or the shared element transition won't work right-->
|
||||
<View
|
||||
android:layout_width="@dimen/detail_header_image_height"
|
||||
android:layout_height="@dimen/detail_header_image_height"
|
||||
android:layout_margin="16dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/album_count_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_album_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_count_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/song_count_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_music_note_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/song_count_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/duration_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="0dp"
|
||||
app:srcCompat="@drawable/ic_timer_white_24dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/duration_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<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_artist_image"
|
||||
android:transitionName="@string/transition_artist_image"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
</FrameLayout>
|
||||
<View
|
||||
android:id="@+id/header_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/detail_header_height"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -299,6 +299,65 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/adrian"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/adrian_summary"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/adrian_website"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/website"
|
||||
android:textColor="#4183c4" />
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/adrian_twitter"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/twitter"
|
||||
android:textColor="#00aced" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<resources>
|
||||
<dimen name="detail_header_height">144dp</dimen>
|
||||
<dimen name="detail_header_image_height">112dp</dimen>
|
||||
<dimen name="title_view_height">56dp</dimen>
|
||||
|
||||
<dimen name="header_image_height">180dp</dimen>
|
||||
|
||||
<dimen name="card_on_app_bar_side_padding">72dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="header_image_height">420dp</dimen>
|
||||
</resources>
|
||||
<resources></resources>
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
<resources>
|
||||
<dimen name="header_image_height">600dp</dimen>
|
||||
<dimen name="detail_header_height">176dp</dimen>
|
||||
<dimen name="detail_header_image_height">144dp</dimen>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
<dimen name="default_item_margin">16dp</dimen>
|
||||
|
||||
<dimen name="detail_header_height">176dp</dimen>
|
||||
<dimen name="detail_header_image_height">144dp</dimen>
|
||||
<dimen name="title_view_height">72dp</dimen>
|
||||
<dimen name="toolbar_elevation">4dp</dimen>
|
||||
<dimen name="card_elevation">2dp</dimen>
|
||||
|
|
@ -9,7 +11,6 @@
|
|||
<!-- 3x standard action bar height (56dp) -->
|
||||
<dimen name="toolbar_scrim_height">168dp</dimen>
|
||||
|
||||
<dimen name="header_image_height">360dp</dimen>
|
||||
<dimen name="progress_container_height">20dp</dimen>
|
||||
<dimen name="fab_media_controller_container_height">120dp</dimen>
|
||||
<dimen name="media_controller_container_height">104dp</dimen>
|
||||
|
|
|
|||
|
|
@ -8,11 +8,13 @@
|
|||
<string name="michael_cook_cookicons" translatable="false">Michael Cook (Cookicons)</string>
|
||||
<string name="aleksandar_tesic" translatable="false">Aleksandar Tešić</string>
|
||||
<string name="eugene_cheung">Eugene Cheung</string>
|
||||
<string name="adrian">Adrian</string>
|
||||
|
||||
<string name="aachen_germany" translatable="false">Aachen, Germany</string>
|
||||
|
||||
<string name="google_plus" translatable="false">Google Plus</string>
|
||||
<string name="git_hub" translatable="false">GitHub</string>
|
||||
<string name="twitter" translatable="false">Twitter</string>
|
||||
|
||||
<string name="card">Card</string>
|
||||
<string name="flat">Flat</string>
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@
|
|||
<string name="restore">Restore</string>
|
||||
<string name="no_purchase_found">No purchase found.</string>
|
||||
<string name="eugene_cheung_summary">For his contributions to the source code.</string>
|
||||
<string name="adrian_summary">For creating the album page design.</string>
|
||||
<string name="add_action">Add</string>
|
||||
<string name="blacklist">Blacklist</string>
|
||||
<string name="remove_from_blacklist">Remove from blacklist</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue