New artist page (same as new album page)
This commit is contained in:
parent
ec6fc07c48
commit
2de2cecd85
9 changed files with 244 additions and 134 deletions
|
|
@ -158,9 +158,6 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
private void setUpObservableListViewParams() {
|
private void setUpObservableListViewParams() {
|
||||||
toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor);
|
toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor);
|
||||||
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
||||||
if (headerViewHeight == 0) {
|
|
||||||
albumArtImageView.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpViews() {
|
private void setUpViews() {
|
||||||
|
|
@ -230,12 +227,7 @@ public class AlbumDetailActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
setUpRecyclerViewPadding();
|
setUpRecyclerViewPadding();
|
||||||
recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
||||||
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
||||||
contentView.post(() -> {
|
contentView.post(() -> observableScrollViewCallbacks.onScrollChanged(-headerViewHeight, false, false));
|
||||||
observableScrollViewCallbacks.onScrollChanged(-(headerViewHeight), false, false);
|
|
||||||
// necessary to fix a bug
|
|
||||||
recyclerView.scrollBy(0, 1);
|
|
||||||
recyclerView.scrollBy(0, -1);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpRecyclerViewPadding() {
|
private void setUpRecyclerViewPadding() {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.kabouzeid.gramophone.ui.activities;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.graphics.PorterDuff;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
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.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsSlidingMusicPanelActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsSlidingMusicPanelActivity;
|
||||||
import com.kabouzeid.gramophone.util.CustomArtistImageUtil;
|
import com.kabouzeid.gramophone.util.CustomArtistImageUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
import com.kabouzeid.gramophone.util.PhonographColorUtil;
|
import com.kabouzeid.gramophone.util.PhonographColorUtil;
|
||||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
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";
|
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)
|
@BindView(R.id.list)
|
||||||
ObservableListView songListView;
|
ObservableListView songListView;
|
||||||
@BindView(R.id.title)
|
@BindView(R.id.image)
|
||||||
TextView artistName;
|
ImageView artistImage;
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar 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;
|
View songListHeader;
|
||||||
RecyclerView albumRecyclerView;
|
RecyclerView albumRecyclerView;
|
||||||
|
|
||||||
private MaterialCab cab;
|
private MaterialCab cab;
|
||||||
private int headerOffset;
|
private int headerViewHeight;
|
||||||
private int titleViewHeight;
|
|
||||||
private int artistImageViewHeight;
|
|
||||||
private int toolbarColor;
|
private int toolbarColor;
|
||||||
private float toolbarAlpha;
|
|
||||||
private boolean usePalette;
|
|
||||||
|
|
||||||
private Artist artist;
|
private Artist artist;
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
@ -105,6 +115,21 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
private LastFMRestClient lastFMRestClient;
|
private LastFMRestClient lastFMRestClient;
|
||||||
|
|
||||||
private boolean forceDownload;
|
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
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -130,41 +155,11 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
return wrapSlidingMusicPanel(R.layout.activity_artist_detail);
|
return wrapSlidingMusicPanel(R.layout.activity_artist_detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final SimpleObservableScrollViewCallbacks observableScrollViewCallbacks = new SimpleObservableScrollViewCallbacks() {
|
private boolean usePalette;
|
||||||
@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 void setUpObservableListViewParams() {
|
private void setUpObservableListViewParams() {
|
||||||
artistImageViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
|
||||||
toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor);
|
toolbarColor = DialogUtils.resolveColor(this, R.attr.defaultFooterColor);
|
||||||
int toolbarHeight = Util.getActionBarSize(this);
|
headerViewHeight = getResources().getDimensionPixelSize(R.dimen.detail_header_height);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initViews() {
|
private void initViews() {
|
||||||
|
|
@ -186,14 +181,11 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
songListView.setAdapter(songAdapter);
|
songListView.setAdapter(songAdapter);
|
||||||
|
|
||||||
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
final View contentView = getWindow().getDecorView().findViewById(android.R.id.content);
|
||||||
contentView.post(() -> {
|
contentView.post(() -> observableScrollViewCallbacks.onScrollChanged(-headerViewHeight, false, false));
|
||||||
songListBackground.getLayoutParams().height = contentView.getHeight();
|
|
||||||
observableScrollViewCallbacks.onScrollChanged(-(artistImageViewHeight + titleViewHeight), false, false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpSongListPadding() {
|
private void setUpSongListPadding() {
|
||||||
songListView.setPadding(0, artistImageViewHeight + titleViewHeight, 0, 0);
|
songListView.setPadding(0, headerViewHeight, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpAlbumRecyclerView() {
|
private void setUpAlbumRecyclerView() {
|
||||||
|
|
@ -301,10 +293,22 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
|
|
||||||
private void setColors(int color) {
|
private void setColors(int color) {
|
||||||
toolbarColor = color;
|
toolbarColor = color;
|
||||||
artistName.setBackgroundColor(color);
|
headerView.setBackgroundColor(color);
|
||||||
artistName.setTextColor(MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(color)));
|
|
||||||
setNavigationbarColor(color);
|
setNavigationbarColor(color);
|
||||||
setTaskDescriptionColor(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() {
|
private void setUpToolbar() {
|
||||||
|
|
@ -318,7 +322,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.menu_artist_detail, menu);
|
getMenuInflater().inflate(R.menu.menu_artist_detail, menu);
|
||||||
menu.findItem(R.id.action_colored_footers).setChecked(usePalette);
|
menu.findItem(R.id.action_colored_footers).setChecked(usePalette);
|
||||||
return true;
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -395,7 +399,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
.start(new MaterialCab.Callback() {
|
.start(new MaterialCab.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCabCreated(MaterialCab materialCab, Menu menu) {
|
public boolean onCabCreated(MaterialCab materialCab, Menu menu) {
|
||||||
setStatusbarColor(ColorUtil.stripAlpha(toolbarColor));
|
|
||||||
return callback.onCabCreated(materialCab, menu);
|
return callback.onCabCreated(materialCab, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -406,7 +409,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCabFinished(MaterialCab materialCab) {
|
public boolean onCabFinished(MaterialCab materialCab) {
|
||||||
setStatusbarColor(ColorUtil.withAlpha(toolbarColor, toolbarAlpha));
|
|
||||||
return callback.onCabFinished(materialCab);
|
return callback.onCabFinished(materialCab);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -442,7 +444,11 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
loadBiography();
|
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());
|
songAdapter.swapDataSet(artist.getSongs());
|
||||||
albumAdapter.swapDataSet(artist.albums);
|
albumAdapter.swapDataSet(artist.albums);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,12 @@ public class MusicUtil {
|
||||||
return songCount + " " + songString;
|
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) {
|
public static long getTotalDuration(@NonNull final Context context, @NonNull List<Song> songs) {
|
||||||
long duration = 0;
|
long duration = 0;
|
||||||
for (int i = 0; i < songs.size(); i++) {
|
for (int i = 0; i < songs.size(); i++) {
|
||||||
|
|
|
||||||
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,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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<include layout="@layout/status_bar" />
|
||||||
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" />
|
|
||||||
|
|
||||||
<View
|
<FrameLayout
|
||||||
android:id="@+id/list_background"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
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.support.v7.widget.Toolbar
|
||||||
android:id="@+id/list"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
style="@style/Toolbar"
|
||||||
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:background="@android:color/transparent" />
|
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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<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
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:orientation="vertical">
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<LinearLayout
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/header"
|
||||||
style="@style/Toolbar"
|
|
||||||
android:background="@android:color/transparent" />
|
|
||||||
|
|
||||||
<ViewStub
|
|
||||||
android:id="@+id/cab_stub"
|
|
||||||
android:layout_width="match_parent"
|
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/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/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/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>
|
</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>
|
||||||
|
|
@ -3,8 +3,6 @@
|
||||||
<dimen name="detail_header_image_height">112dp</dimen>
|
<dimen name="detail_header_image_height">112dp</dimen>
|
||||||
<dimen name="title_view_height">56dp</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>
|
<dimen name="card_on_app_bar_side_padding">72dp</dimen>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,2 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources></resources>
|
||||||
<dimen name="header_image_height">420dp</dimen>
|
|
||||||
</resources>
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="header_image_height">600dp</dimen>
|
|
||||||
<dimen name="detail_header_height">176dp</dimen>
|
<dimen name="detail_header_height">176dp</dimen>
|
||||||
<dimen name="detail_header_image_height">144dp</dimen>
|
<dimen name="detail_header_image_height">144dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
<!-- 3x standard action bar height (56dp) -->
|
<!-- 3x standard action bar height (56dp) -->
|
||||||
<dimen name="toolbar_scrim_height">168dp</dimen>
|
<dimen name="toolbar_scrim_height">168dp</dimen>
|
||||||
|
|
||||||
<dimen name="header_image_height">360dp</dimen>
|
|
||||||
<dimen name="progress_container_height">20dp</dimen>
|
<dimen name="progress_container_height">20dp</dimen>
|
||||||
<dimen name="fab_media_controller_container_height">120dp</dimen>
|
<dimen name="fab_media_controller_container_height">120dp</dimen>
|
||||||
<dimen name="media_controller_container_height">104dp</dimen>
|
<dimen name="media_controller_container_height">104dp</dimen>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue