Fix text alignment

This commit is contained in:
h4h13 2019-10-02 22:04:39 +05:30
parent 612e58ee87
commit 034767dfda
14 changed files with 256 additions and 292 deletions

View file

@ -13,8 +13,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 376
versionName '3.4.100-beta02'
versionCode 377
versionName '3.4.200-beta03'
multiDexEnabled true

View file

@ -53,6 +53,11 @@ class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
updateShuffleState()
updatePrevNextColor()
updateProgressTextColor()
val fabColor = Color.WHITE
TintHelper.setTintAuto(playerPlayPauseFab, fabColor, true)
TintHelper.setTintAuto(playerPlayPauseFab, MaterialValueHelper.getPrimaryTextColor(requireContext(), ColorUtil.isColorLight(fabColor)), false)
}
@ -63,7 +68,7 @@ class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(code.name.monkey.retromusic.R.layout.fragment_classic_player_playback_controls, container, false)
return inflater.inflate(R.layout.fragment_classic_player_playback_controls, container, false)
}
override fun onCreate(savedInstanceState: Bundle?) {
@ -103,10 +108,6 @@ class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
}
private fun setUpPlayPauseFab() {
val fabColor = Color.WHITE
TintHelper.setTintAuto(playerPlayPauseFab, fabColor, true)
playerPlayPauseFab.setColorFilter(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(fabColor)), PorterDuff.Mode.SRC_IN)
playerPlayPauseFab.setOnClickListener(PlayPauseButtonOnClickHandler())
playerPlayPauseFab.post {
if (playerPlayPauseFab != null) {

View file

@ -65,7 +65,7 @@
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textSize="24sp"
android:textAppearance="@style/TextViewHeadline5"
android:textStyle="bold"
tools:ignore="MissingPrefix"
tools:text="Title" />
@ -76,6 +76,7 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingTop="8dp"
tools:text="Text" />
</LinearLayout>

View file

@ -75,17 +75,6 @@
tools:text="00:22" />
</RelativeLayout>
<LinearLayout
android:id="@id/titleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
@ -101,29 +90,31 @@
android:paddingEnd="16dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextViewHeadline6"
tools:text="@string/bug_report_summary" />
android:textAppearance="@style/TextViewSubtitle1"
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer"
tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:ellipsize="end"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingStart="16dp"
android:paddingTop="24dp"
android:paddingEnd="16dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnSecondary"
tools:text="@string/bug_report_summary" />
</LinearLayout>
android:maxLines="1"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:textAppearance="@style/TextViewBody2"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:text="@tools:sample/lorem/random" />
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
@ -136,7 +127,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:ignore="ContentDescription,UnusedAttribute"
tools:showIn="@layout/fragment_player_playback_controls">

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/playback_controls"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@ -54,7 +54,6 @@
android:id="@+id/volumeFragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp" />

View file

@ -99,7 +99,7 @@
android:name="code.name.monkey.retromusic.fragments.player.color.ColorPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_player_playback_controls" />
tools:layout="@layout/fragment_color_player_playback_controls" />
</FrameLayout>
<FrameLayout

View file

@ -58,17 +58,6 @@
tools:progress="20" />
</RelativeLayout>
<LinearLayout
android:id="@id/titleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
@ -85,6 +74,11 @@
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer"
tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView
@ -98,8 +92,13 @@
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:textAppearance="@style/TextViewBody2"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:text="@tools:sample/lorem/random" />
</LinearLayout>
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
@ -112,7 +111,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:ignore="ContentDescription,UnusedAttribute"
tools:showIn="@layout/fragment_player_playback_controls">

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/playback_controls"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical"
tools:ignore="MissingPrefix">
@ -80,12 +80,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingStart="24dp"
android:paddingTop="12dp"
android:paddingEnd="24dp"
android:textAppearance="@style/TextViewBody2"
tools:text="@tools:sample/lorem/random" />
</LinearLayout>

View file

@ -56,23 +56,13 @@
tools:progress="20" />
</RelativeLayout>
<LinearLayout
android:id="@id/titleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@color/md_red_500"
android:ellipsize="end"
android:fontFeatureSettings="smcp"
@ -80,16 +70,23 @@
android:maxLines="1"
android:padding="4dp"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textAppearance="@style/TextViewBody2"
android:textSize="12sp"
android:textStyle="bold"
tools:text="Title" />
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toTopOf="@+id/title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer"
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@color/md_red_500"
android:ellipsize="end"
android:fontFeatureSettings="smcp"
@ -97,11 +94,15 @@
android:maxLines="1"
android:padding="4dp"
android:textAllCaps="true"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
tools:text="Title" />
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:text="@tools:sample/full_names" />
</LinearLayout>
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
@ -114,7 +115,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:ignore="ContentDescription,UnusedAttribute"
tools:showIn="@layout/fragment_player_playback_controls">

View file

@ -25,7 +25,6 @@
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
style="@style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="marquee"
@ -34,6 +33,7 @@
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/md_white_1000"
app:layout_constraintEnd_toStartOf="@+id/songFavourite"
app:layout_constraintStart_toEndOf="@+id/playerMenu"
@ -49,6 +49,7 @@
android:gravity="center"
android:maxLines="1"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:textColor="@color/md_white_1000"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -62,18 +62,7 @@
tools:progress="20" />
</RelativeLayout>
<LinearLayout
android:id="@id/titleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer">
<androidx.appcompat.widget.AppCompatTextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -84,15 +73,19 @@
android:freezesText="true"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:attr/textColorPrimary"
tools:text="Title" />
android:textAppearance="@style/TextViewSubtitle1"
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer"
tools:text="@tools:sample/lorem/random" />
<androidx.appcompat.widget.AppCompatTextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -100,11 +93,15 @@
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingStart="12dp"
android:paddingTop="24dp"
android:paddingEnd="12dp"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:textAppearance="@style/TextViewBody2"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:text="@tools:sample/lorem/random" />
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
@ -117,7 +114,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:ignore="ContentDescription,UnusedAttribute"
tools:showIn="@layout/fragment_player_playback_controls">

View file

@ -40,7 +40,7 @@
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textSize="22sp"
android:textAppearance="@style/TextViewHeadline5"
android:textStyle="bold"
tools:ignore="MissingPrefix"
tools:text="Title" />
@ -50,6 +50,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:paddingTop="8dp"
android:maxLines="1"
android:textColor="?colorOnBackground"
tools:text="Text" />

View file

@ -62,16 +62,6 @@
tools:text="00:22" />
</RelativeLayout>
<LinearLayout
android:id="@id/titleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
@ -88,9 +78,14 @@
android:paddingEnd="16dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?android:attr/textColorPrimary"
tools:text="Title" />
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressContainer"
tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
@ -101,9 +96,15 @@
android:gravity="center"
android:maxLines="1"
android:padding="16dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
android:textAppearance="@style/TextViewBody1"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:text="@tools:sample/lorem/random" />
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
@ -116,7 +117,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:ignore="ContentDescription,UnusedAttribute"
tools:showIn="@layout/fragment_player_playback_controls">

View file

@ -6,27 +6,12 @@
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/titleContainer"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
style="@style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
@ -37,65 +22,52 @@
android:paddingEnd="16dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="16dp"
tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
style="@style/TextAppearance.MaterialComponents.Body2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textAppearance="@style/TextViewBody2"
app:layout_constraintBottom_toTopOf="@+id/songCurrentProgress"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:layout_editor_absoluteX="16dp"
tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/songCurrentProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textAppearance="@style/TextViewSubtitle2"
app:layout_constraintBottom_toTopOf="@+id/playerMediaControllerContainer"
app:layout_constraintTop_toBottomOf="@+id/text"
tools:layout_editor_absoluteX="16dp"
tools:text="22.00/ 33.00" />
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="wrap_content"
android:layoutDirection="ltr"
android:paddingStart="4dp"
android:paddingEnd="4dp"
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer"
app:layout_constraintTop_toBottomOf="@+id/songCurrentProgress"
tools:ignore="ContentDescription,UnusedAttribute"
tools:showIn="@layout/fragment_player_playback_controls">
@ -181,7 +153,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playerMediaControllerContainer"
tools:backgroundTint="@color/md_red_400"
tools:layout_height="52dp" />
</androidx.constraintlayout.widget.ConstraintLayout>