mabbas007 / TagsEditText

Android EditText for view tags or chips
Apache License 2.0
694 stars 124 forks source link

[Proposal] Support tag's padding #26

Closed shiraji closed 7 years ago

shiraji commented 7 years ago

Currently, when I have a background drawable xml

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="4dp"/>
    <solid android:color="@color/solid"/>
    <stroke android:width="1dp"
         android:color="@color/border"/>
</shape>

it produce the following

before

This pull request let users add padding to the tag. Like the following.

after

<mabbas007.tagsedittext.TagsEditText
                android:id="@+id/tags_edit"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:enabled="true"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:gravity="center_vertical"
                android:hint="@string/hint"
                android:includeFontPadding="false"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:textColorHint="@color/text_hint"
                app:allowSpaceInTag="true"
                app:tagsBackground="@drawable/shape"
                app:tagsCloseImagePadding="5dp"
                app:tagsCloseImageRight="@drawable/delete"
                app:tagsPaddingBottom="6dp"
                app:tagsPaddingLeft="10dp"
                app:tagsPaddingRight="10dp"
                app:tagsPaddingTop="6dp"
                app:tagsTextColor="@color/black"
                app:tagsTextSize="@dimen/defaultTagsTextSize"
                />

What do you think?

mabbas007 commented 7 years ago

Good idea, I'll merge it 👍

shiraji commented 7 years ago

Thanks!