Code Monkey home page Code Monkey logo

androidtaggroup's Introduction

AndroidTagGroup

Release 1.4 Maven Central Android Arsenal Build Status

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

screenshot1

Edit Tags

screenshot2 screenshot3

Download Demo

Usage

Step 1

Gradle

dependencies {
   compile 'me.gujun.android.taggroup:library:1.4@aar'
}

Maven

<dependency>
    <groupId>me.gujun.android.taggroup</groupId>
    <artifactId>library</artifactId>
    <version>1.4</version>
    <type>apklib</type>
</dependency>

Step 2

Use it in your own code:

<me.gujun.android.taggroup.TagGroup
    android:id="@+id/tag_group"
    style="@style/TagGroup" />
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.

How to submit a new tag?

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().

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

How to delete a tag?

To delete a tag as user press "Backspace" key or double-tap the tag which you want to delete.

How to detect tag click event?

Implement a callback interface: TagGroup.OnTagClickListener, and set the listener via setOnTagClickListener().

Build

run ./gradlew assembleDebug (Mac/Linux)

or

run gradlew.bat assembleDebug (Windows)

Attributes

There are several attributes you can set:

Dimension illustrate

attr default mean
atg_isAppendMode false Determine the TagGroup mode, APPEND or single DISPLAY.
atg_inputHint Add Tag/添加标签 The hint of the INPUT tag.
atg_borderColor #49C120 The tag outline border color.
atg_textColor #49C120 The tag text color.
atg_backgroundColor #FFFFFF The tag background color.
atg_dashBorderColor #AAAAAA The tag dash outline border color.
atg_inputHintColor #80000000 The input tag hint text color.
atg_inputTextColor #DE000000 The input tag type text color..
atg_checkedBorderColor #49C120 The checked tag outline border color.
atg_checkedTextColor #FFFFFF The checked text color.
atg_checkedMarkerColor #FFFFFF The checked marker color.
atg_checkedBackgroundColor #49C120 The checked tag background color.
atg_pressedBackgroundColor #EDEDED The tag background color when the tag is being pressed.
atg_borderStrokeWidth 0.5dp The tag outline border stroke width.
atg_textSize 13sp The tag text size.
atg_horizontalSpacing 8dp The horizontal tag spacing.(Mark1)
atg_verticalSpacing 4dp The vertical tag spacing.(Mark2)
atg_horizontalPadding 12dp The horizontal tag padding.(Mark3)
atg_verticalPadding 3dp The vertical tag padding.(Mark4)

Developed By

Jun Gu - [email protected]

Follow me on Weibo Follow me on Google Plus

License

Copyright 2015 Jun Gu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

androidtaggroup's People

Contributors

2dxgujun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidtaggroup's Issues

Change font-family for text inside tags.

How can I change font-family for the text inside the tags?

I tried putting it along with style as below

<style name="TagGroup.Beauty_Red" parent="TagGroup">
    <item name="android:fontFamily">sans-serif-smallcaps</item>
</style>

<style name="TagGroup.Beauty_Red.Inverse" parent="TagGroup">
    <item name="android:fontFamily">sans-serif-smallcaps</item>
</style>

but couldn't get it to work. How can I change this font-family?

multi color for multi tag

hi, thanks for this great lib!

i wanna ask, is it possible to use multi color for each item in tag list?

for example i have 5 tags, i want first and second tag is red background with black list and white color text, while third one is red list with transparent background and black text, rest of all is random.

thanks!

Submit a new tag via EditText

Hello, how would I call the submitTag() using an EditText? So I want to take the value of an EditText, and in the onClick listener of the EditText take the value and create a new tag for it. How can I pass this value to submitTag()?

Control tag view's rounded corners

I believe it would be beneficial to control radius and to be able to switch rounded corners on and off.

(Didn't pick the lib because of this, although overall the lib is great.)

add new tag ability

how can i add "new tag" ability to this component
i saw a picture at home page and i saw new tag box
but i didn't see any property for that

Submit new tag

Hello,

Thank you for this View!

But I can't find out to actually add a new tag (as a user) to a TagGroup. I have the input tag to enter a title, but I don't know how to "submit" the new tag. On my keyboard I only have an "Enter" key, which adds a new line. Did I forget to set something?

Scrolling Tag Touch Issue

If a tag is clicked, while within a scroll view, and then that scroll view is scrolled, it will remain highlighted.

For example: if I am scrolling, and then I scroll by touching a tag and flicking upwards or downwards, then the tag will remain highlighted afterI have removed my finger.

Gravity in center ?

If I just add a tag, this view will align to the left of screen. But I want it in the middle of the screen. How to do that ?
OK, I solve this by adding a parent layout.
But there is another problem, if I have more than one line tags, the second line only have one tag. How to make it in the middle too ?

How to use this library in my project ?

I am a newbie with Android Studio. Could you explain in more details what are the exact and detailed steps to use your library in my Android Studio Project ? Thanks !!!!

Attributes has already been defined

As i sync the gradle after entering your library it gives me error as,

'Error:(1) Attribute "textColor" has already been defined'
'Error:(1) Attribute "backgroundColor" has already been defined'

Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\PL\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1

I checked my color.xml which doesn't have any attribute like 'textColor' or 'backgroundColor'

Help please!

How to disable spellcheck on tag ?

Hi there!

Sometimes there are some tags with the spellcheck like this:
sans titre

How to disable all spellcheck on tags?

Ps: on Android 4.1.1

Thank you very much,

Active fork of AndroidTagGroup

I've recently been working on this library a bit for a side project of mine and thought I'd share the link over here, as the author doesn't seem to be active any more: https://github.com/Eddydpyl/AndroidTagGroup

I'm unsure if this constitutes a problem or if I'm violating any rules by doing so, I'm fairly new here. If so, please do tell me and I'll delete this Issue. Else I'd encourage you to try my fork over the original, as I'm actively developing and may be able to fix any issues you find.

setSingleLine(true) will break the tag layout

I noticed the tag is on multiline. Is there anyway to disable multiLine, just leave it as always on single line mode? I am modifiying the library and put singleLine(true), the result is what I need but it will break the tag layout.

设置点击效果不起作用

设置了
app:atg_borderColor="#4accc4c4"
app:atg_checkedBorderColor="#4db472"
app:atg_checkedTextColor="#4db472"
app:atg_textColor="#4accc4c4"
这几个效果,发现点击效果不起作用,同时希望在listener里面能返回这个tag的对象 这样也能自己做处理

android:minHeight 不起作用

 <me.gujun.android.taggroup.TagGroup
      android:id="@+id/user_tags"
      style="@style/MyTagGroup"
      android:minHeight="200dp"

TagGroup的高度没变。

Problem with adding new tags using Google Keyboard

Hi,

There is a problem with adding new tags using Google Keyboard apparently. The library should have two types of listener, onTouch and onClick events. There is no problem on the emulator but on real device I cannot add new tags by clicking on empty area or pressing the enter key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.