Code refactor

This commit is contained in:
Hemanth S 2020-05-09 14:48:29 +05:30
parent 6e7d945fb1
commit 2d3ad54ab5
54 changed files with 436 additions and 142 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,015 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/>
</vector>

View file

@ -3,8 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/md_black_1000"
android:layout_height="match_parent"
android:background="@color/md_black_1000"
android:orientation="vertical">
<View
@ -72,7 +72,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_invert_colors_white_24dp"
app:srcCompat="@drawable/ic_check_circle_white_24dp"
app:tint="@color/md_white_1000" />
<com.google.android.material.textview.MaterialTextView
@ -94,7 +94,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_theme_palette_white_24dp"
app:srcCompat="@drawable/ic_check_circle_white_24dp"
app:tint="@color/md_white_1000" />
<com.google.android.material.textview.MaterialTextView
@ -116,7 +116,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_view_carousel_black_24dp"
app:srcCompat="@drawable/ic_check_circle_white_24dp"
app:tint="@color/md_white_1000" />
<com.google.android.material.textview.MaterialTextView
@ -139,7 +139,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_rounded_corner"
app:srcCompat="@drawable/ic_check_circle_white_24dp"
app:tint="@color/md_white_1000" />
<com.google.android.material.textview.MaterialTextView
@ -161,7 +161,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:srcCompat="@drawable/ic_favorite_white_24dp"
app:srcCompat="@drawable/ic_check_circle_white_24dp"
app:tint="@color/md_white_1000" />
<com.google.android.material.textview.MaterialTextView
@ -180,8 +180,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingHorizontal="16dp"
android:paddingBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -191,7 +190,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="24dp"
android:paddingHorizontal="16dp"
android:paddingVertical="24dp"
android:text="@string/try_retro_music_premium"
android:textAppearance="@style/TextViewHeadline5"
android:textColor="@color/md_white_1000" />

View file

@ -8,10 +8,11 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
android:layout_margin="16dp"
app:cardCornerRadius="16dp"
app:cardElevation="8dp">
<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/player_image"
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -75,9 +75,7 @@
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="4dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextViewHeadline6"
@ -95,9 +93,9 @@
android:gravity="center"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingTop="4dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp"
android:paddingBottom="8dp"
android:textAppearance="@style/TextViewBody1"
android:textColor="?android:attr/textColorSecondary"
app:layout_constrainedWidth="true"

View file

@ -114,8 +114,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginBottom="8dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"

View file

@ -13,7 +13,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/roundSelector"
android:padding="14dp"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
app:layout_constraintBottom_toBottomOf="@+id/titleContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/titleContainer"
@ -66,7 +67,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/roundSelector"
android:padding="14dp"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
app:layout_constraintBottom_toBottomOf="@+id/titleContainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/titleContainer"

View file

@ -74,10 +74,7 @@
android:freezesText="true"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp"
android:paddingHorizontal="16dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextViewHeadline6"
@ -94,10 +91,8 @@
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:textAppearance="@style/TextViewBody1"
android:textColor="?android:attr/textColorSecondary"
app:layout_constrainedWidth="true"
@ -113,8 +108,7 @@
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingHorizontal="16dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/playPauseButton"

View file

@ -2,25 +2,19 @@
<LinearLayout 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="112dp"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="?attr/rectSelector"
android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
app:civ_border="false"
app:retroCornerSize="56dp"
tools:src="@tools:sample/avatars" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/image"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:retroCornerSize="46dp"
tools:src="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"

View file

@ -29,13 +29,14 @@
android:id="@+id/icon"
android:layout_width="42dp"
android:layout_height="42dp"
android:scaleType="centerCrop"
app:civ_border="false"
app:civ_shadow="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:retroCornerSize="21dp"
app:srcCompat="@drawable/ic_person_flat"
app:srcCompat="@drawable/ic_account_white_24dp"
tools:srcCompat="@tools:sample/backgrounds/scenic[20]" />
<com.google.android.material.textview.MaterialTextView

View file

@ -32,7 +32,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Genre name" />
tools:text="@tools:sample/first_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
@ -43,7 +43,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title"
tools:text="Genre details" />
tools:text="@tools:sample/first_names" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -17,15 +17,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
>
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/playAction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="2dp"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:text="@string/action_play_all"
app:backgroundTint="?attr/colorSurface"
@ -35,8 +34,8 @@
android:id="@+id/shuffleAction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="2dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:text="@string/shuffle"
app:backgroundTint="?attr/colorSurface"

View file

@ -3,7 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:background="@color/md_red_500">
<RelativeLayout
android:id="@+id/image"

View file

@ -11,14 +11,15 @@
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="@tools:sample/lorem" />
tools:text="@tools:sample/full_names" />
<code.name.monkey.retromusic.views.MetalRecyclerViewPager
android:id="@+id/recyclerView"
@ -27,7 +28,7 @@
android:nestedScrollingEnabled="false"
android:overScrollMode="never"
android:visibility="gone"
app:itemMargin="28dp"
app:itemMargin="96dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title"

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/root_layout"
@ -10,10 +10,14 @@
<com.google.android.material.card.MaterialCardView
android:id="@+id/imageContainer"
android:layout_width="match_parent"
android:layout_height="172dp"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="8dp"
app:cardCornerRadius="16dp">
app:cardCornerRadius="16dp"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
@ -24,40 +28,48 @@
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playSongs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_gravity="bottom|end"
android:layout_margin="12dp"
android:background="@drawable/color_circle_gradient"
android:backgroundTint="@color/eighty_percent_black_overlay"
android:padding="8dp"
android:padding="16dp"
app:srcCompat="@drawable/ic_play_arrow_white_32dp" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:ellipsize="end"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingTop="6dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/imageContainer"
tools:ignore="MissingPrefix"
tools:text="My top tracks" />
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingStart="16dp"
app:layout_constraintStart_toStartOf="parent"
android:paddingEnd="8dp"
android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text"
tools:ignore="MissingPrefix"
tools:text="My top tracks" />
tools:text="@tools:sample/full_names" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -12,7 +12,8 @@
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="16dp"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold"
app:layout_constrainedWidth="true"

View file

@ -10,7 +10,7 @@
app:showAsAction="ifRoom" />
<item
android:id="@+id/now_playing"
android:icon="@drawable/ic_playlist_play_white_24dp"
android:icon="@drawable/ic_queue_music_white_24dp"
android:orderInCategory="2"
android:title="@string/now_playing_queue"
app:showAsAction="ifRoom" />