Last active
July 7, 2022 14:55
-
-
Save paulfd/632f14645ee454ff8a619a3006f72a61 to your computer and use it in GitHub Desktop.
Round Android buttons with Cardview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<androidx.cardview.widget.CardView | |
android:id="@+id/btnClear" | |
android:layout_width="64dp" | |
android:layout_height="64dp" | |
android:layout_marginEnd="16dp" | |
android:background="@drawable/ic_baseline_save_alt_24" | |
android:clickable="true" | |
android:contentDescription="@string/main_button_text" | |
android:foreground="?android:attr/selectableItemBackground" | |
app:cardBackgroundColor="?colorPrimary" | |
app:cardCornerRadius="32dp" | |
app:layout_constraintTop_toTopOf="@id/btnMain" | |
app:layout_constraintBottom_toBottomOf="@id/btnMain" | |
app:layout_constraintEnd_toStartOf="@id/btnMain"> | |
<ImageView | |
android:id="@+id/ivBtnClear" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="16dp" | |
android:src="@drawable/ic_baseline_close_24" | |
app:tint="@color/black" /> | |
</androidx.cardview.widget.CardView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment