Fix tablet layout crashing
This commit is contained in:
parent
acf2d0043e
commit
f578aa0937
3 changed files with 16 additions and 11 deletions
|
@ -8,7 +8,9 @@ import androidx.viewpager.widget.ViewPager
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.adapter.album.AlbumCoverPagerAdapter
|
import code.name.monkey.retromusic.adapter.album.AlbumCoverPagerAdapter
|
||||||
import code.name.monkey.retromusic.adapter.album.AlbumCoverPagerAdapter.AlbumCoverFragment
|
import code.name.monkey.retromusic.adapter.album.AlbumCoverPagerAdapter.AlbumCoverFragment
|
||||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen.ADAPTIVE
|
||||||
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen.FIT
|
||||||
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen.FULL
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment
|
import code.name.monkey.retromusic.fragments.base.AbsMusicServiceFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
import code.name.monkey.retromusic.transform.CarousalPagerTransformer
|
import code.name.monkey.retromusic.transform.CarousalPagerTransformer
|
||||||
|
@ -46,8 +48,7 @@ class PlayerAlbumCoverFragment : AbsMusicServiceFragment(), ViewPager.OnPageChan
|
||||||
val nowPlayingScreen = PreferenceUtil.getInstance(requireContext()).nowPlayingScreen
|
val nowPlayingScreen = PreferenceUtil.getInstance(requireContext()).nowPlayingScreen
|
||||||
|
|
||||||
if (PreferenceUtil.getInstance(requireContext()).carouselEffect() &&
|
if (PreferenceUtil.getInstance(requireContext()).carouselEffect() &&
|
||||||
!((nowPlayingScreen == NowPlayingScreen.FULL) || (nowPlayingScreen == NowPlayingScreen.ADAPTIVE)
|
!((nowPlayingScreen == FULL) || (nowPlayingScreen == ADAPTIVE) || (nowPlayingScreen == FIT))
|
||||||
|| (nowPlayingScreen == NowPlayingScreen.FIT))
|
|
||||||
) {
|
) {
|
||||||
viewPager.clipToPadding = false
|
viewPager.clipToPadding = false
|
||||||
viewPager.setPadding(40, 40, 40, 0)
|
viewPager.setPadding(40, 40, 40, 0)
|
||||||
|
|
|
@ -56,6 +56,11 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/playerToolbar">
|
app:layout_constraintTop_toBottomOf="@+id/playerToolbar">
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -69,10 +74,6 @@
|
||||||
tools:layout="@layout/fragment_album_cover" />
|
tools:layout="@layout/fragment_album_cover" />
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:freezesText="true"
|
android:freezesText="true"
|
||||||
|
android:gravity="center"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
android:paddingStart="24dp"
|
android:paddingStart="24dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
|
@ -38,10 +39,11 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:paddingStart="24dp"
|
android:paddingStart="24dp"
|
||||||
android:paddingEnd="24dp"
|
android:paddingEnd="24dp"
|
||||||
android:textAppearance="@style/TextViewHeadline5"
|
android:textAppearance="@style/TextViewHeadline4"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/songInfo"
|
app:layout_constraintBottom_toTopOf="@+id/songInfo"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -60,8 +62,9 @@
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
|
android:textAppearance="@style/TextViewHeadline6"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"
|
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/text"
|
app:layout_constraintTop_toBottomOf="@+id/text"
|
||||||
tools:text="@tools:sample/lorem/random"
|
tools:text="@tools:sample/lorem/random"
|
||||||
|
@ -88,12 +91,12 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
app:fabCustomSize="96dp"
|
|
||||||
app:maxImageSize="52dp"
|
|
||||||
android:background="@drawable/color_circle_gradient"
|
android:background="@drawable/color_circle_gradient"
|
||||||
|
app:fabCustomSize="96dp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
|
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
|
||||||
app:layout_constraintStart_toEndOf="@id/previousButton"
|
app:layout_constraintStart_toEndOf="@id/previousButton"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/songInfo"
|
app:layout_constraintTop_toBottomOf="@+id/songInfo"
|
||||||
|
app:maxImageSize="52dp"
|
||||||
app:srcCompat="@drawable/ic_play_arrow_white_32dp"
|
app:srcCompat="@drawable/ic_play_arrow_white_32dp"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue