chore: Improve category chip layout (use actual chip)

This commit is contained in:
Peter Vacho 2025-01-04 23:21:20 +01:00
parent dea4ef9fff
commit 8cb1da9e1e
Signed by: school
GPG key ID: 8CFC3837052871B4
2 changed files with 18 additions and 4 deletions

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M856,570 L570,856q-12,12 -27,18t-30,6q-15,0 -30,-6t-27,-18L103,503q-11,-11 -17,-25.5T80,447v-287q0,-33 23.5,-56.5T160,80h287q16,0 31,6.5t26,17.5l352,353q12,12 17.5,27t5.5,30q0,15 -5.5,29.5T856,570ZM513,800l286,-286 -353,-354L160,160v286l353,354ZM260,320q25,0 42.5,-17.5T320,260q0,-25 -17.5,-42.5T260,200q-25,0 -42.5,17.5T200,260q0,25 17.5,42.5T260,320ZM480,480Z"
android:fillColor="#e8eaed"/>
</vector>

View file

@ -1,17 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
<com.google.android.material.chip.Chip
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chipCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_category_chip"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:textSize="12sp"
android:textColor="?android:attr/textColorPrimary"
android:backgroundTint="@android:color/holo_blue_dark"
app:chipIcon="@drawable/ic_tag"
app:chipIconTint="?android:attr/textColorSecondary"
app:chipBackgroundColor="@android:color/transparent"
app:chipSurfaceColor="@android:color/transparent"
app:chipStrokeColor="@android:color/holo_blue_dark"
app:closeIconEnabled="false"
tools:text="Work" />