Tablets now use the same layout as phones.
This commit is contained in:
parent
f6ec493759
commit
7f991f6729
2 changed files with 1 additions and 199 deletions
|
|
@ -30,7 +30,6 @@ import com.kabouzeid.gramophone.adapter.song.PlayingQueueAdapter;
|
|||
import com.kabouzeid.gramophone.dialogs.SongShareDialog;
|
||||
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||
import com.kabouzeid.gramophone.helper.menu.SongMenuHelper;
|
||||
import com.kabouzeid.gramophone.loader.ArtistLoader;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.ui.activities.base.AbsSlidingMusicPanelActivity;
|
||||
import com.kabouzeid.gramophone.util.ColorUtil;
|
||||
|
|
@ -38,11 +37,6 @@ import com.kabouzeid.gramophone.util.MusicUtil;
|
|||
import com.kabouzeid.gramophone.util.Util;
|
||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||
import com.kabouzeid.gramophone.views.WidthFitSquareLayout;
|
||||
import com.nostra13.universalimageloader.core.DisplayImageOptions;
|
||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
import com.nostra13.universalimageloader.core.assist.FailReason;
|
||||
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;
|
||||
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
|
||||
import org.solovyev.android.views.llm.LinearLayoutManager;
|
||||
|
|
@ -83,9 +77,7 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
|||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
if (Util.isTablet(getResources())) {
|
||||
impl = new TabletImpl();
|
||||
} else if (Util.isLandscape(getResources())) {
|
||||
if (Util.isLandscape(getResources())) {
|
||||
impl = new LandscapeImpl();
|
||||
} else {
|
||||
impl = new PortraitImpl();
|
||||
|
|
@ -478,46 +470,4 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
|||
animatorSet.start();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
private static class TabletImpl extends PortraitImpl {
|
||||
ImageView playerBackground;
|
||||
|
||||
@Override
|
||||
public void init(PlayerFragment fragment) {
|
||||
super.init(fragment);
|
||||
playerBackground = ((ImageView) fragment.getView().findViewById(R.id.player_background));
|
||||
playerBackground.setAlpha(0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateColorChange(PlayerFragment fragment, int newColor) {
|
||||
super.animateColorChange(fragment, newColor);
|
||||
|
||||
fragment.slidingUpPanelLayout.setBackgroundColor(fragment.lastColor);
|
||||
|
||||
AnimatorSet animatorSet = createDefaultColorChangeAnimatorSet(fragment, newColor);
|
||||
animatorSet.play(ViewUtil.createBackgroundColorTransition(fragment.getView(), ColorUtil.shiftColorDown(fragment.lastColor), ColorUtil.shiftColorDown(newColor)));
|
||||
animatorSet.start();
|
||||
|
||||
ImageLoader.getInstance().displayImage(
|
||||
MusicUtil.getArtistImageLoaderString(ArtistLoader.getArtist(fragment.getActivity(), MusicPlayerRemote.getCurrentSong().artistId), false),
|
||||
playerBackground,
|
||||
new DisplayImageOptions.Builder()
|
||||
.cacheInMemory(true)
|
||||
.cacheOnDisk(true)
|
||||
.resetViewBeforeLoading(true)
|
||||
.showImageOnFail(R.drawable.default_artist_image)
|
||||
//.postProcessor(new BlurProcessor.Builder(fragment.getActivity()).build())
|
||||
.displayer(new FadeInBitmapDisplayer(ViewUtil.PHONOGRAPH_ANIM_TIME, true, true, false))
|
||||
.build(),
|
||||
new SimpleImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
|
||||
FadeInBitmapDisplayer.animate(view, ViewUtil.PHONOGRAPH_ANIM_TIME);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
<?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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/player_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<include layout="@layout/shadow_statusbar_actionbar" />
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/player_toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_marginTop="@dimen/status_bar_padding"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<!--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:app="http://schemas.android.com/tools"
|
||||
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="360dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="120dp"
|
||||
android:clickable="false"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:focusable="true"
|
||||
android:gravity="bottom"
|
||||
app:ignore="UnusedAttribute"
|
||||
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" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/player_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.kabouzeid.gramophone.views.WidthFitSquareLayout
|
||||
android:id="@+id/album_cover_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/player_album_cover_fragment"
|
||||
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerAlbumCoverFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</com.kabouzeid.gramophone.views.WidthFitSquareLayout>
|
||||
|
||||
<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"
|
||||
android:layout_below="@id/album_cover_container" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</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">
|
||||
|
||||
<include
|
||||
android:id="@+id/current_song"
|
||||
layout="@layout/item_list" />
|
||||
|
||||
<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>
|
||||
</FrameLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue