include MaterialChipsInput as subdir lib

This commit is contained in:
Vincent Breitmoser
2018-07-02 20:06:47 +02:00
parent c98e835936
commit 053cbdf43e
40 changed files with 2963 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white_transparency" />
<corners android:radius="16dp" />
</shape>
</item>
<item android:drawable="@drawable/bg_chip_view" />
</ripple>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/colorChipViewBackground"/>
<corners android:radius="16dp"/>
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/colorAccent"/>
<corners android:radius="2dp"/>
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#A6A6A6"
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#fff"
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#fff"
android:pathData="M12,5.9c1.16,0 2.1,0.94 2.1,2.1s-0.94,2.1 -2.1,2.1S9.9,9.16 9.9,8s0.94,-2.1 2.1,-2.1m0,9c2.97,0 6.1,1.46 6.1,2.1v1.1L5.9,18.1L5.9,17c0,-0.64 3.13,-2.1 6.1,-2.1M12,4C9.79,4 8,5.79 8,8s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,13c-2.67,0 -8,1.34 -8,4v3h16v-3c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#aaffffff"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="rectangle">
<solid android:color="@color/colorChipViewBackground"/>
<corners android:radius="16dp"/>
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_chip_view">
<!-- content -->
<LinearLayout
android:id="@+id/content"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:clickable="true"
android:background="@drawable/ripple_chip_view">
<!-- label -->
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="8dp"
android:textSize="14sp"
android:text="Paulcito"/>
<!-- remove button -->
<ImageButton
android:id="@+id/delete_button"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_cancel_grey_24dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp" />
</LinearLayout>
</RelativeLayout>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.pchmn.materialchips.views.ScrollViewMaxHeight xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
app:maxHeight="150dp" >
<android.support.v7.widget.RecyclerView
android:id="@+id/chips_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp" />
</com.pchmn.materialchips.views.ScrollViewMaxHeight>

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true">
<!-- content -->
<LinearLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginBottom="12dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="12dp"
android:background="@drawable/bg_chip_view_opened"
android:clickable="true"
android:elevation="6dp"
android:orientation="horizontal"
tools:targetApi="lollipop">
<!-- info -->
<LinearLayout
android:id="@+id/info_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingTop="16dp">
<!-- name -->
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:scrollHorizontally="true"
android:text="sdfdsfdsfdgs"
android:textSize="16sp" />
<!-- info -->
<TextView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1"
android:scrollHorizontally="true"
android:text="paul@gmail.com"
android:textSize="14sp" />
</LinearLayout>
<!-- delete button -->
<ImageButton
android:id="@+id/delete_button"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_cancel_white_24dp" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:background="@android:color/white"
android:foreground="?attr/selectableItemBackground">
<!-- info -->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:layout_marginLeft="18dp"
android:layout_marginRight="16dp">
<!-- name -->
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@android:color/black"
android:text="Two line item"/>
<TextView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="2dp"
android:textSize="13sp"
android:text="secondary text"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:background="@android:color/white" />
</RelativeLayout>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="ChipView">
<attr name="label" format="string" />
<attr name="labelColor" format="color" />
<attr name="deletable" format="boolean" />
<attr name="deleteIcon" format="reference" />
<attr name="deleteIconColor" format="color" />
<attr name="backgroundColor" format="color" />
</declare-styleable>
<declare-styleable name="ChipsInput">
<attr name="hint" format="string" />
<attr name="hintColor" format="color" />
<attr name="textColor" format="color" />
<attr name="maxRows" format="integer" />
<attr name="chip_labelColor" format="color" />
<attr name="chip_deletable" format="boolean" />
<attr name="chip_deleteIcon" format="reference" />
<attr name="chip_deleteIconColor" format="color" />
<attr name="chip_backgroundColor" format="color" />
<attr name="showChipDetailed" format="boolean" />
<attr name="chip_detailed_textColor" format="color" />
<attr name="chip_detailed_backgroundColor" format="color" />
<attr name="chip_detailed_deleteIconColor" format="color" />
<attr name="filterable_list_backgroundColor" format="color" />
<attr name="filterable_list_textColor" format="color" />
</declare-styleable>
<declare-styleable name="ScrollViewMaxHeight">
<attr name="maxHeight" format="dimension" />
</declare-styleable>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorChipViewBackground">#E0E0E0</color>
<color name="chips_opened_bg">#009688</color>
<color name="colorCloseChip">#ababab</color>
<color name="white_transparency">#b9ffffff</color>
<color name="colorAccent">?attr/colorAccent</color>
</resources>

View File

@@ -0,0 +1,20 @@
<resources>
<!-- LetterTileProvider -->
<!-- All of the possible tile background colors -->
<array name="letter_tile_colors">
<item>#f16364</item>
<item>#f58559</item>
<item>#f9a43e</item>
<item>#e4c62e</item>
<item>#67bf74</item>
<item>#59a2be</item>
<item>#2093cd</item>
<item>#ad62a7</item>
</array>
<!-- The default letter tile text size -->
<dimen name="tile_letter_font_size">17sp</dimen>
<!-- The deafult tile size -->
<dimen name="letter_tile_size">32dp</dimen>
<!-- /LetterTileProvider -->
</resources>