Code refactor with ConstraintLayout

This commit is contained in:
Hemanth S 2020-05-14 19:07:15 +05:30
parent f32ef48e51
commit ebb22f6cc7
19 changed files with 316 additions and 442 deletions

View file

@ -1,57 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:background="?attr/rectSelector"
android:clickable="true"
android:focusable="true"
tools:ignore="MissingPrefix">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="4dp"
android:orientation="vertical"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/imageContainer"
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?rectSelector"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:transitionName="@string/transition_album_art"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<View
android:id="@+id/mask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shadow_up_home" />
</LinearLayout>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
android:scaleType="centerCrop"
android:transitionName="@string/transition_album_art"
tools:ignore="ContentDescription"
tools:src="@tools:sample/avatars" />
<View
android:id="@+id/mask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shadow_up_home" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
@ -65,8 +49,7 @@
android:paddingBottom="8dp"
android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/md_white_1000"
tools:text="@string/bug_report_summary" />
tools:text="@tools:sample/full_names" />
</com.google.android.material.card.MaterialCardView>
</FrameLayout>
-
</androidx.constraintlayout.widget.ConstraintLayout>