Fix tablet layout crashing
This commit is contained in:
parent
dac7bd16b7
commit
4e48e10be0
17 changed files with 103 additions and 141 deletions
|
@ -11,7 +11,6 @@ import code.name.monkey.retromusic.R
|
|||
import code.name.monkey.retromusic.activities.base.AbsBaseActivity
|
||||
import code.name.monkey.retromusic.fragments.settings.MainSettingsFragment
|
||||
import kotlinx.android.synthetic.main.activity_settings.appBarLayout
|
||||
import kotlinx.android.synthetic.main.activity_settings.detailContentFrame
|
||||
import kotlinx.android.synthetic.main.activity_settings.toolbar
|
||||
|
||||
class SettingsActivity : AbsBaseActivity() {
|
||||
|
@ -46,16 +45,16 @@ class SettingsActivity : AbsBaseActivity() {
|
|||
fun setupFragment(fragment: Fragment, @StringRes titleName: Int) {
|
||||
val fragmentTransaction = fragmentManager
|
||||
.beginTransaction()
|
||||
.setCustomAnimations(R.anim.sliding_in_left, R.anim.sliding_out_right, android.R.anim.slide_in_left, android.R.anim.slide_out_right)
|
||||
.setCustomAnimations(
|
||||
R.anim.sliding_in_left,
|
||||
R.anim.sliding_out_right,
|
||||
android.R.anim.slide_in_left,
|
||||
android.R.anim.slide_out_right
|
||||
)
|
||||
|
||||
if (detailContentFrame == null) {
|
||||
fragmentTransaction.replace(R.id.contentFrame, fragment, fragment.tag)
|
||||
fragmentTransaction.addToBackStack(null)
|
||||
fragmentTransaction.commit()
|
||||
} else {
|
||||
fragmentTransaction.replace(R.id.detailContentFrame, fragment, fragment.tag)
|
||||
fragmentTransaction.commit()
|
||||
}
|
||||
|
||||
TransitionManager.beginDelayedTransition(appBarLayout)
|
||||
setTitle(titleName)
|
||||
|
|
|
@ -27,7 +27,6 @@ import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
|
|||
import code.name.monkey.retromusic.service.MusicService
|
||||
import code.name.monkey.retromusic.util.MusicUtil
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
import code.name.monkey.retromusic.util.ViewUtil
|
||||
import kotlinx.android.synthetic.main.fragment_player_playback_controls.nextButton
|
||||
import kotlinx.android.synthetic.main.fragment_player_playback_controls.playPauseButton
|
||||
|
@ -159,20 +158,10 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment(), OnSharedPref
|
|||
}
|
||||
|
||||
private fun updatePlayPauseDrawableState() {
|
||||
val playResIcon = if (RetroUtil.isTablet()) {
|
||||
R.drawable.ic_play_arrow_white_64dp
|
||||
} else {
|
||||
R.drawable.ic_play_arrow_white_24dp
|
||||
}
|
||||
val pauseResIcon = if (RetroUtil.isTablet()) {
|
||||
R.drawable.ic_pause_white_64dp
|
||||
} else {
|
||||
R.drawable.ic_pause_white_64dp
|
||||
}
|
||||
if (MusicPlayerRemote.isPlaying) {
|
||||
playPauseButton.setImageResource(playResIcon)
|
||||
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp)
|
||||
} else {
|
||||
playPauseButton.setImageResource(pauseResIcon)
|
||||
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2019 Hemanth Savarala.
|
||||
~
|
||||
~ Licensed under the GNU General Public License v3
|
||||
~
|
||||
~ This is free software: you can redistribute it and/or modify it under
|
||||
~ the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
~ See the GNU General Public License for more details.
|
||||
-->
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/contentFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/detailContentFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
app:layout_collapseMode="pin"
|
||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
|
||||
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal"
|
||||
tools:title="@string/action_settings" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -15,9 +15,9 @@
|
|||
grid:layout_columnWeight="1"
|
||||
grid:layout_row="0">
|
||||
|
||||
<include layout="@layout/card_retro_info"/>
|
||||
|
||||
<include layout="@layout/card_credit" />
|
||||
|
||||
<include layout="@layout/card_social" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -29,9 +29,8 @@
|
|||
grid:layout_columnWeight="1"
|
||||
grid:layout_row="0">
|
||||
|
||||
<include layout="@layout/card_social"/>
|
||||
<include layout="@layout/card_retro_info" />
|
||||
|
||||
<include layout="@layout/card_other" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.gridlayout.widget.GridLayout>
|
|
@ -13,7 +13,12 @@
|
|||
|
||||
<code.name.monkey.appthemehelper.common.views.ATEAccentTextView
|
||||
android:id="@+id/sb1"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="?attr/listPreferredItemPaddingEnd"
|
||||
android:text="@string/credit_title"
|
||||
android:textAppearance="@style/TextViewOverline"
|
||||
android:textColor="?colorAccent"
|
||||
|
|
|
@ -13,7 +13,12 @@
|
|||
|
||||
<code.name.monkey.appthemehelper.common.views.ATEAccentTextView
|
||||
android:id="@+id/sb4"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="?attr/listPreferredItemPaddingEnd"
|
||||
android:text="@string/others"
|
||||
android:textAppearance="@style/TextViewOverline"
|
||||
android:textColor="?colorAccent"
|
||||
|
|
|
@ -14,7 +14,12 @@
|
|||
|
||||
<code.name.monkey.appthemehelper.common.views.ATEAccentTextView
|
||||
android:id="@+id/sb2"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="?attr/listPreferredItemPaddingEnd"
|
||||
android:text="@string/support_development"
|
||||
android:textAppearance="@style/TextViewOverline"
|
||||
android:textColor="?colorAccent"
|
||||
|
|
|
@ -13,7 +13,12 @@
|
|||
|
||||
<code.name.monkey.appthemehelper.common.views.ATEAccentTextView
|
||||
android:id="@+id/sb3"
|
||||
style="@style/SubTitleTextAppearance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="?attr/listPreferredItemPaddingEnd"
|
||||
android:text="@string/social"
|
||||
android:textAppearance="@style/TextViewOverline"
|
||||
android:textColor="?colorAccent"
|
||||
|
|
|
@ -18,9 +18,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:minHeight="72dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="PrivateResource">
|
||||
|
@ -65,7 +67,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="52dp" />
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@android:id/widget_frame"
|
||||
|
|
|
@ -18,9 +18,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:minHeight="72dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="PrivateResource">
|
||||
|
@ -65,6 +67,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="56dp" />
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -18,9 +18,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:minHeight="72dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="PrivateResource">
|
||||
|
@ -46,13 +48,13 @@
|
|||
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:maxLines="@string/grid_size_1"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_front_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="52dp" />
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -18,9 +18,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:minHeight="72dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="PrivateResource">
|
||||
|
@ -65,7 +67,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="52dp" />
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekbar"
|
||||
|
|
|
@ -18,9 +18,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:minHeight="72dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp"
|
||||
tools:ignore="PrivateResource">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
|
@ -67,7 +69,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="56dp" />
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESwitch
|
||||
android:id="@android:id/checkbox"
|
||||
|
|
|
@ -18,8 +18,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/rectSelector"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:minHeight="?attr/listPreferredItemHeight"
|
||||
android:paddingStart="?attr/listPreferredItemPaddingStart"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
|
||||
android:paddingBottom="16dp"
|
||||
tools:ignore="PrivateResource">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
|
@ -53,7 +56,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="52dp" />
|
||||
app:layout_constraintGuide_begin="@dimen/list_pref_guideline_begin" />
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESwitch
|
||||
android:id="@android:id/checkbox"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
android:id="@android:id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="70dp"
|
||||
android:paddingStart="@dimen/pref_title_padding"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textAppearance="@style/TextViewOverline"
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
<dimen name="toolbar_margin_vertical">16dp</dimen>
|
||||
<dimen name="item_song_height">64dp</dimen>
|
||||
<dimen name="button_padding_vertical">16dp</dimen>
|
||||
<dimen name="pref_title_padding">80dp</dimen>
|
||||
</resources>
|
||||
|
|
|
@ -48,4 +48,6 @@
|
|||
<dimen name="button_corner">24dp</dimen>
|
||||
<dimen name="bottom_sheet_peek_1_height">56dp</dimen>
|
||||
<dimen name="bottom_sheet_peek_2_height">32dp</dimen>
|
||||
<dimen name="list_pref_guideline_begin">56dp</dimen>
|
||||
<dimen name="pref_title_padding">70dp</dimen>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue