Added landscape version for now playing screen
This commit is contained in:
parent
36d9facc48
commit
4dc8178012
6 changed files with 400 additions and 178 deletions
|
|
@ -147,7 +147,9 @@ public class AlbumCoverPagerAdapter extends CustomFragmentStatePagerAdapter {
|
||||||
new SimpleImageLoadingListener() {
|
new SimpleImageLoadingListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLoadingFailed(String imageUri, View view, @Nullable FailReason failReason) {
|
public void onLoadingFailed(String imageUri, View view, @Nullable FailReason failReason) {
|
||||||
setColor(ColorUtil.resolveColor(view.getContext(), R.attr.default_bar_color));
|
if(getActivity() != null) {
|
||||||
|
setColor(ColorUtil.resolveColor(getActivity(), R.attr.default_bar_color));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,13 @@ public class Playlist implements Parcelable {
|
||||||
this.name = in.readString();
|
this.name = in.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final Creator<Playlist> CREATOR = new Creator<Playlist>() {
|
||||||
|
public Playlist createFromParcel(Parcel source) {
|
||||||
|
return new Playlist(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Playlist[] newArray(int size) {
|
||||||
|
return new Playlist[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import android.view.ViewAnimationUtils;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
|
|
@ -49,17 +48,11 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
@Bind(R.id.playing_queue_card)
|
@Bind(R.id.playing_queue_card)
|
||||||
CardView playingQueueCard;
|
CardView playingQueueCard;
|
||||||
@Bind(R.id.album_cover_container)
|
|
||||||
SquareLayout albumCoverContainer;
|
|
||||||
@Bind(R.id.player_content)
|
|
||||||
RelativeLayout playerContent;
|
|
||||||
@Bind(R.id.color_background)
|
@Bind(R.id.color_background)
|
||||||
View colorBackground;
|
View colorBackground;
|
||||||
|
@Bind(R.id.player_queue_sub_header)
|
||||||
|
TextView playerQueueSubHeader;
|
||||||
|
|
||||||
@Bind(R.id.player_queue_subheader)
|
|
||||||
TextView playerQueueSubheader;
|
|
||||||
|
|
||||||
MediaEntryViewHolder currentSongViewHolder;
|
|
||||||
|
|
||||||
private int lastColor;
|
private int lastColor;
|
||||||
|
|
||||||
|
|
@ -70,8 +63,16 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
|
|
||||||
private PlayingQueueAdapter playingQueueAdapter;
|
private PlayingQueueAdapter playingQueueAdapter;
|
||||||
|
|
||||||
|
private Impl impl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
if (Util.isLandscape(getResources())) {
|
||||||
|
impl = new LandscapeImpl();
|
||||||
|
} else {
|
||||||
|
impl = new PortraitImpl();
|
||||||
|
}
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_player, container, false);
|
View view = inflater.inflate(R.layout.fragment_player, container, false);
|
||||||
ButterKnife.bind(this, view);
|
ButterKnife.bind(this, view);
|
||||||
return view;
|
return view;
|
||||||
|
|
@ -81,24 +82,13 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
public void onViewCreated(final View view, Bundle savedInstanceState) {
|
public void onViewCreated(final View view, Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
impl.init(this);
|
||||||
|
|
||||||
setUpPlayerToolbar();
|
setUpPlayerToolbar();
|
||||||
setUpSubFragments();
|
setUpSubFragments();
|
||||||
|
|
||||||
playingQueueAdapter = new PlayingQueueAdapter(
|
setUpRecyclerView();
|
||||||
((AppCompatActivity) getActivity()),
|
|
||||||
MusicPlayerRemote.getPlayingQueue(),
|
|
||||||
R.layout.item_list,
|
|
||||||
false,
|
|
||||||
null);
|
|
||||||
recyclerView.setAdapter(playingQueueAdapter);
|
|
||||||
|
|
||||||
layoutManager = new LinearLayoutManager(getActivity());
|
|
||||||
layoutManager.setChildSize((int) (getResources().getDisplayMetrics().density * 72));
|
|
||||||
recyclerView.setLayoutManager(layoutManager);
|
|
||||||
|
|
||||||
setUpDragSort();
|
|
||||||
|
|
||||||
//slidingUpPanelLayout.setParallaxOffset(Util.resolveDimensionPixelSize(activity, R.attr.actionBarSize) + getResources().getDimensionPixelSize(R.dimen.status_bar_padding));
|
|
||||||
slidingUpPanelLayout.setPanelSlideListener(this);
|
slidingUpPanelLayout.setPanelSlideListener(this);
|
||||||
slidingUpPanelLayout.setAntiDragView(view.findViewById(R.id.draggable_area));
|
slidingUpPanelLayout.setAntiDragView(view.findViewById(R.id.draggable_area));
|
||||||
|
|
||||||
|
|
@ -106,13 +96,12 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
@Override
|
@Override
|
||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
setUpPanelAndAlbumCoverHeight();
|
impl.setUpPanelAndAlbumCoverHeight(PlayerFragment.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// for some reason the xml attribute doesn't get applied here.
|
||||||
playingQueueCard.setCardBackgroundColor(ColorUtil.resolveColor(getActivity(), R.attr.cardBackgroundColor));
|
playingQueueCard.setCardBackgroundColor(ColorUtil.resolveColor(getActivity(), R.attr.cardBackgroundColor));
|
||||||
|
|
||||||
setUpCurrentSongView();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -149,22 +138,7 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
@SuppressWarnings("ConstantConditions")
|
||||||
private void updateCurrentSong() {
|
private void updateCurrentSong() {
|
||||||
Song song = MusicPlayerRemote.getCurrentSong();
|
impl.updateCurrentSong(this, MusicPlayerRemote.getCurrentSong());
|
||||||
currentSongViewHolder.title.setText(song.title);
|
|
||||||
currentSongViewHolder.text.setText(song.artistName);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpPanelAndAlbumCoverHeight() {
|
|
||||||
int topMargin = getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
|
||||||
|
|
||||||
final int availablePanelHeight = slidingUpPanelLayout.getHeight() - playerContent.getHeight() + topMargin;
|
|
||||||
final int minPanelHeight = (int) getResources().getDisplayMetrics().density * (72 + 24) + topMargin;
|
|
||||||
if (availablePanelHeight < minPanelHeight) {
|
|
||||||
albumCoverContainer.getLayoutParams().height = albumCoverContainer.getHeight() - (minPanelHeight - availablePanelHeight);
|
|
||||||
albumCoverContainer.forceSquare(false);
|
|
||||||
}
|
|
||||||
slidingUpPanelLayout.setPanelHeight(Math.max(minPanelHeight, availablePanelHeight));
|
|
||||||
((AbsSlidingMusicPanelActivity) getActivity()).setAntiDragView(slidingUpPanelLayout.findViewById(R.id.player_panel));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpSubFragments() {
|
private void setUpSubFragments() {
|
||||||
|
|
@ -186,16 +160,23 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
toolbar.setOnMenuItemClickListener(this);
|
toolbar.setOnMenuItemClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
private void setUpRecyclerView() {
|
||||||
private void setUpCurrentSongView() {
|
playingQueueAdapter = new PlayingQueueAdapter(
|
||||||
currentSongViewHolder = new MediaEntryViewHolder(getView().findViewById(R.id.current_song));
|
((AppCompatActivity) getActivity()),
|
||||||
|
MusicPlayerRemote.getPlayingQueue(),
|
||||||
|
R.layout.item_list,
|
||||||
|
false,
|
||||||
|
null);
|
||||||
|
recyclerView.setAdapter(playingQueueAdapter);
|
||||||
|
|
||||||
currentSongViewHolder.separator.setVisibility(View.VISIBLE);
|
layoutManager = new LinearLayoutManager(getActivity());
|
||||||
currentSongViewHolder.shortSeparator.setVisibility(View.GONE);
|
layoutManager.setChildSize((int) (getResources().getDisplayMetrics().density * 72));
|
||||||
currentSongViewHolder.image.setScaleType(ImageView.ScaleType.CENTER);
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
currentSongViewHolder.image.setImageDrawable(Util.getTintedDrawable(getActivity(), R.drawable.ic_volume_up_white_24dp, ColorUtil.resolveColor(getActivity(), R.attr.icon_color)));
|
|
||||||
|
setUpDragSort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateIsFavorite() {
|
private void updateIsFavorite() {
|
||||||
boolean isFavorite = MusicUtil.isFavorite(getActivity(), MusicPlayerRemote.getCurrentSong());
|
boolean isFavorite = MusicUtil.isFavorite(getActivity(), MusicPlayerRemote.getCurrentSong());
|
||||||
Drawable favoriteIcon = Util.getTintedDrawable(getActivity(), isFavorite ? R.drawable.ic_favorite_white_24dp : R.drawable.ic_favorite_outline_white_24dp, ViewUtil.getToolbarIconColor(getActivity(), false));
|
Drawable favoriteIcon = Util.getTintedDrawable(getActivity(), isFavorite ? R.drawable.ic_favorite_white_24dp : R.drawable.ic_favorite_outline_white_24dp, ViewUtil.getToolbarIconColor(getActivity(), false));
|
||||||
|
|
@ -227,28 +208,8 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
return lastColor;
|
return lastColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
|
||||||
private void animateColorChange(final int newColor) {
|
private void animateColorChange(final int newColor) {
|
||||||
slidingUpPanelLayout.setBackgroundColor(lastColor);
|
impl.animateColorChange(this, newColor);
|
||||||
Animator backgroundAnimator;
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
int topMargin = getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
|
||||||
int x = (int) (playbackControlsFragment.playPauseFab.getX() + playbackControlsFragment.playPauseFab.getWidth() / 2 + playbackControlsFragment.getView().getX());
|
|
||||||
int y = (int) (topMargin + playbackControlsFragment.playPauseFab.getY() + playbackControlsFragment.playPauseFab.getHeight() / 2 + playbackControlsFragment.getView().getY());
|
|
||||||
float startRadius = Math.max(playbackControlsFragment.playPauseFab.getWidth() / 2, playbackControlsFragment.playPauseFab.getHeight() / 2);
|
|
||||||
float endRadius = Math.max(colorBackground.getWidth(), colorBackground.getHeight());
|
|
||||||
colorBackground.setBackgroundColor(newColor);
|
|
||||||
backgroundAnimator = ViewAnimationUtils.createCircularReveal(colorBackground, x, y, startRadius, endRadius);
|
|
||||||
} else {
|
|
||||||
backgroundAnimator = ViewUtil.createBackgroundColorTransition(colorBackground, lastColor, newColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
Animator subHeaderAnimator = ViewUtil.createTextColorTransition(playerQueueSubheader, lastColor, newColor);
|
|
||||||
|
|
||||||
AnimatorSet animatorSet = new AnimatorSet();
|
|
||||||
animatorSet.playTogether(backgroundAnimator, subHeaderAnimator);
|
|
||||||
animatorSet.setDuration(ViewUtil.PHONOGRAPH_ANIM_TIME).start();
|
|
||||||
|
|
||||||
lastColor = newColor;
|
lastColor = newColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -298,7 +259,7 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
public void onPanelSlide(View view, float slide) {
|
public void onPanelSlide(View view, float slide) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
float density = getResources().getDisplayMetrics().density;
|
float density = getResources().getDisplayMetrics().density;
|
||||||
playingQueueCard.setCardElevation(density * 6 * slide + 2 * density);
|
playingQueueCard.setCardElevation((6 * slide + 2) * density);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -326,4 +287,116 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
||||||
public void onPanelHidden(View view) {
|
public void onPanelHidden(View view) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Impl {
|
||||||
|
void init(PlayerFragment fragment);
|
||||||
|
|
||||||
|
void updateCurrentSong(PlayerFragment fragment, Song song);
|
||||||
|
|
||||||
|
void animateColorChange(PlayerFragment fragment, final int newColor);
|
||||||
|
|
||||||
|
void setUpPanelAndAlbumCoverHeight(PlayerFragment fragment);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static abstract class BaseImpl implements Impl {
|
||||||
|
public AnimatorSet createDefaultColorChangeAnimatorSet(PlayerFragment fragment, int newColor) {
|
||||||
|
Animator backgroundAnimator;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
int topMargin = fragment.getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
int x = (int) (fragment.playbackControlsFragment.playPauseFab.getX() + fragment.playbackControlsFragment.playPauseFab.getWidth() / 2 + fragment.playbackControlsFragment.getView().getX());
|
||||||
|
int y = (int) (topMargin + fragment.playbackControlsFragment.playPauseFab.getY() + fragment.playbackControlsFragment.playPauseFab.getHeight() / 2 + fragment.playbackControlsFragment.getView().getY());
|
||||||
|
float startRadius = Math.max(fragment.playbackControlsFragment.playPauseFab.getWidth() / 2, fragment.playbackControlsFragment.playPauseFab.getHeight() / 2);
|
||||||
|
float endRadius = Math.max(fragment.colorBackground.getWidth(), fragment.colorBackground.getHeight());
|
||||||
|
fragment.colorBackground.setBackgroundColor(newColor);
|
||||||
|
backgroundAnimator = ViewAnimationUtils.createCircularReveal(fragment.colorBackground, x, y, startRadius, endRadius);
|
||||||
|
} else {
|
||||||
|
backgroundAnimator = ViewUtil.createBackgroundColorTransition(fragment.colorBackground, fragment.lastColor, newColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
Animator subHeaderAnimator = ViewUtil.createTextColorTransition(fragment.playerQueueSubHeader, fragment.lastColor, newColor);
|
||||||
|
|
||||||
|
AnimatorSet animatorSet = new AnimatorSet();
|
||||||
|
animatorSet.playTogether(backgroundAnimator, subHeaderAnimator);
|
||||||
|
animatorSet.setDuration(ViewUtil.PHONOGRAPH_ANIM_TIME);
|
||||||
|
return animatorSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
private static class PortraitImpl extends BaseImpl {
|
||||||
|
MediaEntryViewHolder currentSongViewHolder;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(PlayerFragment fragment) {
|
||||||
|
currentSongViewHolder = new MediaEntryViewHolder(fragment.getView().findViewById(R.id.current_song));
|
||||||
|
|
||||||
|
currentSongViewHolder.separator.setVisibility(View.VISIBLE);
|
||||||
|
currentSongViewHolder.shortSeparator.setVisibility(View.GONE);
|
||||||
|
currentSongViewHolder.image.setScaleType(ImageView.ScaleType.CENTER);
|
||||||
|
currentSongViewHolder.image.setImageDrawable(Util.getTintedDrawable(fragment.getActivity(), R.drawable.ic_volume_up_white_24dp, ColorUtil.resolveColor(fragment.getActivity(), R.attr.icon_color)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUpPanelAndAlbumCoverHeight(PlayerFragment fragment) {
|
||||||
|
SquareLayout albumCoverContainer = (SquareLayout) fragment.getView().findViewById(R.id.album_cover_container);
|
||||||
|
int topMargin = fragment.getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
||||||
|
|
||||||
|
final int availablePanelHeight = fragment.slidingUpPanelLayout.getHeight() - fragment.getView().findViewById(R.id.player_content).getHeight() + topMargin;
|
||||||
|
final int minPanelHeight = (int) fragment.getResources().getDisplayMetrics().density * (72 + 24) + topMargin;
|
||||||
|
if (availablePanelHeight < minPanelHeight) {
|
||||||
|
albumCoverContainer.getLayoutParams().height = albumCoverContainer.getHeight() - (minPanelHeight - availablePanelHeight);
|
||||||
|
albumCoverContainer.forceSquare(false);
|
||||||
|
}
|
||||||
|
fragment.slidingUpPanelLayout.setPanelHeight(Math.max(minPanelHeight, availablePanelHeight));
|
||||||
|
|
||||||
|
((AbsSlidingMusicPanelActivity) fragment.getActivity()).setAntiDragView(fragment.slidingUpPanelLayout.findViewById(R.id.player_panel));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateCurrentSong(PlayerFragment fragment, Song song) {
|
||||||
|
currentSongViewHolder.title.setText(song.title);
|
||||||
|
currentSongViewHolder.text.setText(song.artistName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void animateColorChange(PlayerFragment fragment, int newColor) {
|
||||||
|
fragment.slidingUpPanelLayout.setBackgroundColor(fragment.lastColor);
|
||||||
|
|
||||||
|
createDefaultColorChangeAnimatorSet(fragment, newColor).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
private static class LandscapeImpl extends BaseImpl {
|
||||||
|
@Override
|
||||||
|
public void init(PlayerFragment fragment) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUpPanelAndAlbumCoverHeight(PlayerFragment fragment) {
|
||||||
|
int topMargin = fragment.getResources().getDimensionPixelSize(R.dimen.status_bar_padding);
|
||||||
|
int panelHeight = fragment.slidingUpPanelLayout.getHeight() - fragment.playbackControlsFragment.getView().getHeight() + topMargin;
|
||||||
|
fragment.slidingUpPanelLayout.setPanelHeight(panelHeight);
|
||||||
|
|
||||||
|
((AbsSlidingMusicPanelActivity) fragment.getActivity()).setAntiDragView(fragment.slidingUpPanelLayout.findViewById(R.id.player_panel));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateCurrentSong(PlayerFragment fragment, Song song) {
|
||||||
|
fragment.toolbar.setTitle(song.title);
|
||||||
|
fragment.toolbar.setSubtitle(song.artistName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void animateColorChange(PlayerFragment fragment, int newColor) {
|
||||||
|
fragment.slidingUpPanelLayout.setBackgroundColor(fragment.lastColor);
|
||||||
|
|
||||||
|
AnimatorSet animatorSet = createDefaultColorChangeAnimatorSet(fragment, newColor);
|
||||||
|
animatorSet.play(ViewUtil.createBackgroundColorTransition(fragment.toolbar, fragment.lastColor, newColor))
|
||||||
|
.with(ViewUtil.createBackgroundColorTransition(fragment.getView().findViewById(R.id.status_bar), ColorUtil.shiftColorDown(fragment.lastColor), ColorUtil.shiftColorDown(newColor)));
|
||||||
|
animatorSet.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
133
app/src/main/res/layout-land/fragment_player.xml
Normal file
133
app/src/main/res/layout-land/fragment_player.xml
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!--The unused FrameLayout layout is necessary to prevent a crash on rotate-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="UselessParent">
|
||||||
|
|
||||||
|
<include layout="@layout/status_bar" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/player_toolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
android:background="@android:color/transparent" />
|
||||||
|
|
||||||
|
<android.support.percent.PercentRelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!--suppress AndroidDomInspection -->
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/player_album_cover_fragment"
|
||||||
|
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerAlbumCoverFragment"
|
||||||
|
app:layout_aspectRatio="100%"
|
||||||
|
app:layout_heightPercent="100%" />
|
||||||
|
|
||||||
|
<com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/player_sliding_layout"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/tools"
|
||||||
|
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toEndOf="@+id/player_album_cover_fragment"
|
||||||
|
android:layout_toRightOf="@+id/player_album_cover_fragment"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="bottom"
|
||||||
|
sothree:umanoFadeColor="#00000000"
|
||||||
|
sothree:umanoOverlay="true"
|
||||||
|
sothree:umanoPanelHeight="0dp"
|
||||||
|
sothree:umanoScrollableView="@+id/player_recycler_view"
|
||||||
|
sothree:umanoShadowHeight="0dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/color_background"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/playback_controls_fragment"
|
||||||
|
class="com.kabouzeid.gramophone.ui.fragments.player.PlaybackControlsFragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/player_panel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/playing_queue_card"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginTop="@dimen/status_bar_padding"
|
||||||
|
app:cardBackgroundColor="?cardBackgroundColor"
|
||||||
|
app:cardElevation="@dimen/card_elevation"
|
||||||
|
app:cardUseCompatPadding="false">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<!--This is necessary for the drag sorting to work at the top-->
|
||||||
|
<View
|
||||||
|
android:id="@+id/draggable_area"
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/card_content"
|
||||||
|
android:layout_alignTop="@+id/card_content"
|
||||||
|
android:layout_marginTop="120dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/card_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_queue_sub_header"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:text="@string/up_next"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||||
|
android:textColor="?android:textColorSecondary" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/player_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
|
||||||
|
|
||||||
|
</android.support.percent.PercentRelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</FrameLayout>
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.sothree.slidinguppanel.SlidingUpPanelLayout
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/player_sliding_layout"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!--The unused FrameLayout layout is necessary to prevent a crash on rotate-->
|
||||||
|
|
||||||
|
<com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/player_sliding_layout"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/tools"
|
||||||
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
||||||
|
|
@ -86,12 +91,12 @@
|
||||||
|
|
||||||
<!--This is necessary for the drag sorting to work at the top-->
|
<!--This is necessary for the drag sorting to work at the top-->
|
||||||
<View
|
<View
|
||||||
android:layout_marginTop="120dp"
|
|
||||||
android:layout_alignTop="@+id/card_content"
|
|
||||||
android:layout_alignBottom="@+id/card_content"
|
|
||||||
android:id="@+id/draggable_area"
|
android:id="@+id/draggable_area"
|
||||||
android:layout_width="72dp"
|
android:layout_width="72dp"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/card_content"
|
||||||
|
android:layout_alignTop="@+id/card_content"
|
||||||
|
android:layout_marginTop="120dp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/card_content"
|
android:id="@+id/card_content"
|
||||||
|
|
@ -104,7 +109,7 @@
|
||||||
layout="@layout/item_list" />
|
layout="@layout/item_list" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/player_queue_subheader"
|
android:id="@+id/player_queue_sub_header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
|
@ -127,4 +132,5 @@
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
|
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
|
||||||
|
</FrameLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<com.sothree.slidinguppanel.SlidingUpPanelLayout
|
<com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/sliding_layout"
|
||||||
android:id="@+id/sliding_layout"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -20,9 +19,9 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?android:colorBackground">
|
android:background="?android:colorBackground">
|
||||||
|
|
||||||
<fragment
|
<fragment android:id="@+id/player_fragment"
|
||||||
android:id="@+id/player_fragment"
|
|
||||||
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerFragment"
|
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerFragment"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue