Git Product home page Git Product logo

androidtaglayout's Introduction

AndroidTagLayout

A custom view that nicely displays a list of selectable tags.

Download

TagLayout Screenshot

Usage

In your layout resource:

<com.flaviuspopescu.TagLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ...
    custom:com.flaviuspopescu.tags="@array/tags_sample"
    custom:com.flaviuspopescu.tagBackground="@drawable/rounded_rectangle"
    custom:com.flaviuspopescu.tagBackgroundSelected="@drawable/rounded_rectangle_selected"
    custom:com.flaviuspopescu.tagTextColor="@android:color/white"
    custom:com.flaviuspopescu.tagTextFont="fonts/Roboto-Medium.ttf"
    custom:com.flaviuspopescu.tagVerticalSpacing="8dp"
    custom:com.flaviuspopescu.tagTextPadding="@dimen/tag_text_padding"
/>

The attribute tagTextPadding is mandatory if you are using custom background drawables which add some padding around the text (see the sample app) and must be set to the same value. Otherwise, the expected tag widths would be incorrectly calculated resulting in clipped views.

Installation

Add the library as a dependency in your module's build.gradle:

dependencies {
  ...
  compile 'com.flaviuspopescu:taglayout:+'
}

Make sure you have jcenter() added as a maven repo in your project's build.gradle (newer Android Studio version already include this by default):

repositories {
    jcenter()
}

androidtaglayout's People

Contributors

flaviuspopescu avatar flavp avatar

Stargazers

 avatar Cuongph avatar Minh Nguyen avatar 黑虫师兄 avatar vivek vekariya avatar Roberto Frontado avatar Pranav Lathigara avatar Adnan Abdulhussein avatar

Watchers

 avatar James Cloos avatar

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.