Skip to content

Commit

Permalink
v1.3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
2dxgujun committed May 21, 2015
1 parent d1963d3 commit 8d664c2
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 54 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change Log
==========

Version 1.3 *(2015-05-21)*
----------------------------

- Attributes refactor.
- Add listener for detect tag click event.
- Fix: Interrupted click event by touch event.


Version 1.2 *(2015-04-14)*
----------------------------

Expand Down
66 changes: 28 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AndroidTagGroup-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1539)
[![Build Status](https://travis-ci.org/2dxgujun/AndroidTagGroup.png?branch=master)](https://travis-ci.org/2dxgujun/AndroidTagGroup)

The AndroidTagGroup is a layout for a set of tags.You can use it to group people, books or anything you want.
The TagGroup is a special layout with a set of tags. You can use it to tag people, books or anything you want.

Also you can contribute new idea to me.


# Demo

### Screenshot
![Demo screenshot](http://ww2.sinaimg.cn/large/bce2dea9gw1epouvl2mvuj20dw0ehmyb.jpg)

### Append Tag
![Append mode](http://ww4.sinaimg.cn/large/bce2dea9gw1epouw5y9ijj20dw06dt8x.jpg)
![screenshot1](http://ww4.sinaimg.cn/large/bce2dea9jw1esbsby9v5fj20u00w8jxx.jpg)

### Delete tag
![Delete tag](http://ww3.sinaimg.cn/large/bce2dea9gw1epouweadrqj20dw05dglt.jpg)
### Edit Tags
![screenshot2](http://ww4.sinaimg.cn/large/bce2dea9jw1esbsbngv8fj20u005w75v.jpg)
![screenshot3](http://ww4.sinaimg.cn/large/bce2dea9jw1esbsbmoagij20u005sabl.jpg)

[Download Demo](https://github.com/2dxgujun/AndroidTagGroup/releases/download/v1.2/AndroidTagGroup-Demo-v1.2.apk)
[Download Demo](https://github.com/2dxgujun/AndroidTagGroup/releases/download/v1.3/AndroidTagGroup-Demo-v1.3.apk)

# Usage

Expand All @@ -29,7 +26,7 @@ Also you can contribute new idea to me.
#### Gradle
```groovy
dependencies {
compile 'me.gujun.android.taggroup:library:1.2@aar'
compile 'me.gujun.android.taggroup:library:1.3@aar'
}
```

Expand All @@ -38,7 +35,7 @@ dependencies {
<dependency>
<groupId>me.gujun.android.taggroup</groupId>
<artifactId>library</artifactId>
<version>1.2</version>
<version>1.3</version>
<type>apklib</type>
</dependency>
```
Expand All @@ -49,43 +46,29 @@ Use it in your own code:
```xml
<me.gujun.android.taggroup.TagGroup
android:id="@+id/tag_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
style="@style/TagGroup" />
```

```java
TagGroup mTagGroup = (TagGroup) findViewById(R.id.tag_group);
mTagGroup.setTags(new String[]{"Tag1", "Tag2", "Tag3"});
```

Use `setTags(...)` to set the initial tags in the group.

To "submit" a new tag as user press "Enter" or tap the blank area of the tag group, also you can "submit" a new tag via `submitTag()`.
To delete a tag as user press "Backspace" or double-tap the tag which you want to delete.

**Note**: Google keyboard (a few soft keyboard not honour the key event) currently not supported "Enter" key to "submit" a new tag.
#### How to submit a new tag?

I made some pre-design style. You can use them via `style` property.
To "submit" a new tag as user press "Enter" or tap the blank area of the tag group, also you can "submit" a new tag via `submitTag()`.

![Present color](http://ww4.sinaimg.cn/large/bce2dea9gw1epouwn8og4j20dw0a5aal.jpg)
#### How to delete a tag?

Use the present style just like below:
To delete a tag as user press "Backspace" key or double-tap the tag which you want to delete.

```xml
<me.gujun.android.taggroup.TagGroup
android:id="@+id/tag_group"
style="@style/TagGroup.Beauty_Red"/>
```
#### How to detect tag click event?

In the above picture, the style is:
Implement a callback interface: `TagGroup.OnTagClickListener`, and set the listener via `setOnTagClickListener()`.

`TagGroup`
`TagGroup.Beauty_Red`
`TagGroup.Holo_Dark`
`TagGroup.Light_Blue`
`TagGroup.Indigo`

You can get more beautiful color from [Adobe Color CC](https://color.adobe.com), and you can also contribute your color style to AndroidTagGroup!
**Note**: Google keyboard (a few soft keyboard not honour the key event) currently not supported "Enter" key to "submit" a new tag.

# Build

Expand All @@ -104,11 +87,18 @@ There are several attributes you can set:
| attr | default | mean |
|:--------------------- |:---------------- |:------------------------------------------------------- |
| isAppendMode | false | Determine the TagGroup mode, APPEND or single DISPLAY. |
| inputTagHint | Add Tag/添加标签 | Hint of the INPUT state tag. |
| brightColor | #49C120 | The bright color of the tag. |
| dimColor | #AAAAAA | The dim color of the tag. |
| backgroundColor | #FFFFFF | The background color of the tag. |
| pressedBackgroundColor| #EDEDED | The background color of the tag when user press. |
| inputHint | Add Tag/添加标签 | The hint of the INPUT tag. |
| borderColor | #49C120 | The tag outline border color. |
| textColor | #49C120 | The tag text color. |
| backgroundColor | #FFFFFF | The tag background color. |
| dashBorderColor | #AAAAAA | The tag dash outline border color. |
| inputHintColor | #80000000 | The input tag hint text color. |
| inputTextColor | #DE000000 | The input tag type text color.. |
| checkedBorderColor | #49C120 | The checked tag outline border color. |
| checkedTextColor | #FFFFFF | The checked text color. |
| checkedMarkerColor | #FFFFFF | The checked marker color. |
| checkedBackgroundColor| #49C120 | The checked tag background color. |
| pressedBackgroundColor| #EDEDED | The tag background color when the tag is being pressed. |
| borderStrokeWidth | 0.5dp | The tag outline border stroke width. |
| textSize | 13sp | The tag text size. |
| horizontalSpacing | 8dp | The horizontal tag spacing.(Mark1) |
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</activity>
<activity
android:name=".TagEditorActivity"
android:label="@string/title_activity_secondary"
android:label="@string/title_activity_tag_editor"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
Expand Down
18 changes: 9 additions & 9 deletions demo/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
android:text="@string/tags_default"
android:textSize="16sp" />

<TextView
android:id="@+id/tv_prompt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="@string/add_tags"
android:textColor="@android:color/darker_gray" />

<me.gujun.android.taggroup.TagGroup
android:id="@+id/tag_group"
style="@style/TagGroup"
Expand Down Expand Up @@ -46,15 +55,6 @@
style="@style/TagGroup.Beauty_Red.Inverse"
android:layout_marginTop="5dp" />

<TextView
android:id="@+id/tv_prompt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="@string/add_tags"
android:textColor="@android:color/darker_gray" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
3 changes: 1 addition & 2 deletions demo/src/main/res/layout/activity_tag_editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

<me.gujun.android.taggroup.TagGroup
android:id="@+id/tag_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TagGroup"
app:isAppendMode="true"/>
</LinearLayout>
2 changes: 1 addition & 1 deletion demo/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<string name="app_name">TagGroup-Demo</string>
<string name="add_tags">Add Tags</string>
<string name="title_activity_secondary">Add Tags</string>
<string name="title_activity_tag_editor">Edit Tags</string>
<string name="tags_default">Tags (Default)</string>
<string name="tags_large">Tags (Large)</string>
<string name="tags_small">Tags (Small)</string>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">TagGroup-Demo</string>
<string name="title_activity_secondary">添加标签</string>
<string name="title_activity_tag_editor">编辑标签</string>
<string name="add_tags">添加标签</string>
<string name="tags_default">标签(默认)</string>
<string name="tags_small">标签(小号)</string>
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=1.2
VERSION_CODE=4
VERSION_NAME=1.3
VERSION_CODE=13
GROUP=me.gujun.android.taggroup

POM_DESCRIPTION=Android Library to display a set of tags
Expand Down

0 comments on commit 8d664c2

Please sign in to comment.