Improved user profile image picking
This commit is contained in:
parent
607d1722da
commit
2c4b00edb9
7 changed files with 412 additions and 360 deletions
|
@ -23,122 +23,114 @@
|
|||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/imageContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/bannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="156dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:srcCompat="@drawable/material_design_default" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bannerSelect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="156dp"
|
||||
android:background="@color/twenty_percent_black_overlay" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:background="?roundSelector"
|
||||
android:padding="16dp"
|
||||
app:srcCompat="@drawable/ic_add_photo_white_24dp" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
android:layout_margin="16dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/userImageContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:elevation="8dp"
|
||||
android:transitionName="@string/transition_user_image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/imageContainer"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageContainer"
|
||||
app:layout_constraintTop_toBottomOf="@id/imageContainer">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<code.name.monkey.retromusic.views.RetroShapeableImageView
|
||||
android:id="@+id/userImage"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center"
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/bannerImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="156dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:retroCornerSize="36dp"
|
||||
app:srcCompat="@drawable/ic_person_flat"
|
||||
app:strokeColor="?attr/colorSurface"
|
||||
app:strokeWidth="2dp" />
|
||||
app:srcCompat="@drawable/material_design_default" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bannerSelect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="156dp"
|
||||
android:background="@color/twenty_percent_black_overlay" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_add_photo_white_24dp"
|
||||
app:tint="?attr/colorControlNormal" />
|
||||
</FrameLayout>
|
||||
android:layout_gravity="end"
|
||||
android:background="?roundSelector"
|
||||
android:padding="16dp"
|
||||
app:srcCompat="@drawable/ic_add_photo_white_24dp" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/nameContainer"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
</FrameLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/userImageContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:elevation="8dp"
|
||||
android:transitionName="@string/transition_user_image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/imageContainer"
|
||||
app:layout_constraintEnd_toEndOf="@id/imageContainer"
|
||||
app:layout_constraintStart_toStartOf="@+id/imageContainer"
|
||||
app:layout_constraintTop_toBottomOf="@id/imageContainer">
|
||||
|
||||
<code.name.monkey.retromusic.views.RetroShapeableImageView
|
||||
android:id="@+id/userImage"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
app:retroCornerSize="36dp"
|
||||
app:srcCompat="@drawable/ic_person_flat"
|
||||
app:strokeColor="?attr/colorSurface"
|
||||
app:strokeWidth="2dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:src="@drawable/ic_add_photo_white_24dp"
|
||||
app:tint="?attr/colorControlNormal" />
|
||||
</FrameLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/nameContainer"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:hintAnimationEnabled="true"
|
||||
app:hintEnabled="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImageContainer">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:hintAnimationEnabled="true"
|
||||
app:hintEnabled="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/userImageContainer">
|
||||
android:autofillHints="name"
|
||||
android:hint="@string/my_name"
|
||||
android:importantForAutofill="yes"
|
||||
android:inputType="textPersonName|textCapWords|text"
|
||||
android:textAppearance="@style/TextViewSubtitle1"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autofillHints="name"
|
||||
android:hint="@string/my_name"
|
||||
android:importantForAutofill="yes"
|
||||
android:inputType="textPersonName|textCapWords|text"
|
||||
android:textAppearance="@style/TextViewSubtitle1"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/next"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue