AndroidTagGroup


Source link: https://github.com/2dxgujun/AndroidTagGroup

AndroidTagGroup

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

Edit Tags

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:

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]

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. 

Resources

An Android service to retrieve GPS locations and route stats using RxJava.

A Simplenote client for Android.

Detailed CardView that displays an action title, description, and buttons to initiate that action.

Dynamic in app URL router for Android.

Android library for implementing cards stack view with swipe to remove feature.

A small tool to convert your app's png&jpg image files into WebP when possible.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes