Skip to content

Commit

Permalink
create chip for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
edTheGuy00 committed Feb 17, 2018
1 parent b63389f commit 1ea4409
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/res/drawable-xxhdpi/chip_shape.xml
@@ -0,0 +1,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">

<solid android:color="@color/colorPrimary" />

<padding
android:bottom="4dp"
android:left="10dp"
android:right="4dp"
android:top="4dp" />

<corners android:radius="30dp" />
</shape>
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_trashcan_delete_12dp.xml
@@ -0,0 +1,4 @@
<vector android:height="12dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="12dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFF" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8.46,11.88l1.41,-1.41L12,12.59l2.12,-2.12 1.41,1.41L13.41,14l2.12,2.12 -1.41,1.41L12,15.41l-2.12,2.12 -1.41,-1.41L10.59,14l-2.13,-2.12zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/>
</vector>
30 changes: 30 additions & 0 deletions app/src/main/res/layout/layout_chip_tags.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/categoriesChipLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="10dp"
android:background="@drawable/chip_shape"
android:visibility="visible"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/categoriesChipText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
tools:text="Tag"
android:textSize="14sp"/>

<ImageView
android:id="@+id/chip_action"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="6dp"
android:src="@drawable/ic_trashcan_delete_12dp"
android:background="?selectableItemBackgroundBorderless"
android:contentDescription="@string/chip_action" />

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Expand Up @@ -37,4 +37,5 @@
<string name="title">Title</string>
<string name="post">Post</string>
<string name="preview">Preview</string>
<string name="chip_action">Chip Action</string>
</resources>

0 comments on commit 1ea4409

Please sign in to comment.