Change custom btn radius

Add constraint for some layout
Add dimens for the custom btn radius
This commit is contained in:
jacques 2024-07-06 11:17:35 +02:00
parent 2daf06ec3b
commit 6582ea770a
5 changed files with 76 additions and 59 deletions

View file

@ -2,8 +2,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="@color/bg_screen1" /> <solid android:color="@color/bg_screen1" />
<corners android:bottomRightRadius="24dp" <corners android:bottomRightRadius="@dimen/btn_radius"
android:bottomLeftRadius="24dp" android:bottomLeftRadius="@dimen/btn_radius"
android:topRightRadius="24dp" android:topRightRadius="@dimen/btn_radius"
android:topLeftRadius="24dp"/> android:topLeftRadius="@dimen/btn_radius"/>
</shape> </shape>

View file

@ -2,8 +2,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="@color/grey" /> <solid android:color="@color/grey" />
<corners android:bottomRightRadius="24dp" <corners android:bottomRightRadius="@dimen/btn_radius"
android:bottomLeftRadius="24dp" android:bottomLeftRadius="@dimen/btn_radius"
android:topRightRadius="24dp" android:topRightRadius="@dimen/btn_radius"
android:topLeftRadius="24dp"/> android:topLeftRadius="@dimen/btn_radius"/>
</shape> </shape>

View file

@ -1,99 +1,113 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:ignore="MissingDefaultResource"> tools:ignore="MissingDefaultResource">
<com.google.android.material.card.MaterialCardView <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:id="@+id/materialCardView"
android:layout_height="wrap_content" android:layout_width="368dp"
android:layout_height="237dp"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
app:cardCornerRadius="11dp" app:cardCornerRadius="11dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_gravity="center"
android:layout_marginTop="12dp"
android:background="@drawable/shadow_bg"
app:srcCompat="@drawable/ic_launcher_foreground" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@id/msg" android:id="@id/msg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="12dp"
android:fontFamily="@font/opensans_semibold" android:fontFamily="@font/opensans_semibold"
android:hints="@+id/msg"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/grey" android:textColor="@color/grey"
android:textSize="15dp" android:textSize="15dp"
android:labelFor="@+id/msg" app:layout_constraintBottom_toBottomOf="parent"
tools:ignore="HardcodedText,SpUsage" /> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.057"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.347"
tools:ignore="HardcodedText,SpUsage"
tools:layout_conversion_absoluteHeight="21dp"
tools:layout_conversion_absoluteWidth="91dp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@id/cpl" android:id="@id/cpl"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="12dp"
android:fontFamily="@font/opensans_regular" android:fontFamily="@font/opensans_regular"
android:text="@string/app_version" android:text="@string/app_version"
android:textColor="@color/grey" android:textColor="@color/grey"
android:textSize="14dp" android:textSize="14dp"
tools:ignore="HardcodedText,SpUsage" /> android:labelFor="@+id/cpl"
</LinearLayout> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
<LinearLayout app:layout_constraintHorizontal_bias="0.046"
android:layout_width="match_parent" app:layout_constraintStart_toStartOf="parent"
android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent"
android:orientation="horizontal"> tools:ignore="HardcodedText,SpUsage"
tools:layout_conversion_absoluteHeight="19dp"
tools:layout_conversion_absoluteWidth="24dp" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/notagreed" android:id="@+id/notagreed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="170dp" android:layout_marginStart="16dp"
android:layout_marginStart="30dp" android:layout_marginBottom="16dp"
android:layout_marginBottom="38dp"
android:background="@drawable/rounded_btn" android:background="@drawable/rounded_btn"
android:gravity="center"
android:maxLines="1"
android:minWidth="100dp"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:text="@string/button_cancel" android:text="@string/button_cancel"
android:textAlignment="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
<Space app:layout_constraintEnd_toStartOf="@+id/agreed"
android:layout_width="100dp" app:layout_constraintHorizontal_bias="0.0"
android:layout_height="wrap_content" /> app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText,SpUsage" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/agreed" android:id="@+id/agreed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="30dp" android:layout_marginEnd="16dp"
android:layout_marginTop="170dp"
android:layout_marginBottom="38dp"
android:background="@drawable/rounded_btn" android:background="@drawable/rounded_btn"
android:gravity="center"
android:maxLines="1"
android:minWidth="100dp"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:text="@string/button_ok" android:text="@string/button_ok"
android:textAlignment="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@+id/notagreed"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/notagreed"
app:layout_constraintVertical_bias="0.0"
tools:ignore="HardcodedText,SpUsage" />
</LinearLayout> <com.google.android.material.imageview.ShapeableImageView
</com.google.android.material.card.MaterialCardView> android:id="@+id/shapeableImageView"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="4dp"
android:background="@drawable/shadow_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_conversion_absoluteHeight="61dp"
tools:layout_conversion_absoluteWidth="61dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -14,6 +14,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:labelFor="@+id/cip13_input_dialog" android:labelFor="@+id/cip13_input_dialog"
android:background="@drawable/background_dialog" android:background="@drawable/background_dialog"
android:contentDescription="@string/enter_cip_13"
app:cardCornerRadius="25dp" app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -65,9 +66,10 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="28dp" android:layout_marginEnd="28dp"
android:autofillHints="cip13"
android:ems="10" android:ems="10"
android:inputType="number" android:inputType="number"
android:labelFor="@id/startcip13" android:hint="@string/enter_cip_13_here"
android:minHeight="48dp" android:minHeight="48dp"
android:textAlignment="textStart" android:textAlignment="textStart"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

View file

@ -7,6 +7,7 @@
<dimen name="fab_width">48dp</dimen> <dimen name="fab_width">48dp</dimen>
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="btn_radius">5dp</dimen>
<!-- Slide dimens --> <!-- Slide dimens -->
<dimen name="dots_height">75dp</dimen> <dimen name="dots_height">75dp</dimen>
<dimen name="dots_margin_bottom">20dp</dimen> <dimen name="dots_margin_bottom">20dp</dimen>