Added Material Design ShapeableImageView for Circular ImageView

This commit is contained in:
h4h13 2020-02-24 11:12:09 +05:30
parent 6f7054c141
commit 437f73b1dc
14 changed files with 116 additions and 33 deletions

View file

@ -11,10 +11,10 @@
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ See the GNU General Public License for more details.
-->
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView android:id="@+id/container"
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/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
@ -55,15 +55,16 @@
android:background="@drawable/shadow_up"
app:layout_constraintBottom_toBottomOf="parent" />
<code.name.monkey.retromusic.views.CircularImageView
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/userImage"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
app:civ_border="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:retroCornerSize="21dp"
tools:srcCompat="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView

View file

@ -23,7 +23,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<code.name.monkey.retromusic.views.CircularImageView
<code.name.monkey.retromusic.views.RetroShapeableImageView
app:retroCornerSize="21dp"
android:id="@+id/userImage"
android:layout_width="42dp"
android:layout_height="42dp"

View file

@ -6,5 +6,6 @@
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:overScrollMode="never" />
</FrameLayout>

View file

@ -2,7 +2,7 @@
<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="106dp"
android:layout_width="112dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="?attr/rectSelector"
@ -12,12 +12,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<code.name.monkey.retromusic.views.CircularImageView
<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>

View file

@ -25,24 +25,25 @@
android:layout_height="match_parent"
android:background="@drawable/artist_card_gradient_effect">
<code.name.monkey.retromusic.views.CircularImageView
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:civ_border_width="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:retroCornerSize="21dp"
tools:src="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
android:textStyle="bold"

View file

@ -21,19 +21,20 @@
android:gravity="center_vertical"
android:minHeight="64dp"
android:orientation="horizontal"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:paddingStart="12dp"
tools:ignore="PrivateResource">
<code.name.monkey.retromusic.views.CircularImageView
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="42dp"
android:layout_height="42dp"
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"
tools:srcCompat="@tools:sample/backgrounds/scenic[20]" />

View file

@ -23,13 +23,14 @@
android:paddingBottom="24dp"
tools:ignore="PrivateResource">
<code.name.monkey.retromusic.views.CircularImageView
<code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/icon"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_margin="8dp"
app:civ_border="false"
app:civ_shadow="false"
app:retroCornerSize="36dp"
app:srcCompat="@drawable/ic_person_flat"
tools:srcCompat="@tools:sample/backgrounds/scenic[20]" />
@ -38,10 +39,10 @@
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp">
android:paddingStart="16dp"
android:paddingTop="8dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"