GithubHelp home page GithubHelp logo

amanyadav / icontagview Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 178 KB

IconTagView to display item categories in colorful and easy way.

Home Page: http://www.androidsrc.net

License: GNU Lesser General Public License v3.0

Java 100.00%

icontagview's Introduction

IconTagView

A custom view library to show categories of item which user can select one. This type of view is already used in apps like True Caller, Youtube and Gmail. Now you can also use this in your app.

Screenshots

Main screen

Features

  • Random icon Background color generation
  • Customizeable background, padding, stroke etc.
  • Support for on click for each elements
  • More to come..\m/

Usage

Add this view in your layout file under some ViewGroup.

<net.androidsrc.xTag.TagLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/iconTagView"
        style="@style/TagLayout.Beauty_Red" />

Prepare data to be displayed in the TagLayout

private TagData[] getData(){
        TagData[] data=new TagData[9];
        data[0]=new TagData("Person",R.drawable.ic_person_black_24dp);
        data[1]=new TagData("School",R.drawable.ic_school_black_24dp);
        data[2]=new TagData("Share This",R.drawable.ic_share_black_24dp);
        data[3]=new TagData("Aman",R.drawable.ic_person_black_24dp);
        data[4]=new TagData("Yadav",R.drawable.ic_school_black_24dp);
        data[5]=new TagData("Says",R.drawable.ic_share_black_24dp);
        data[6]=new TagData("Hello",R.drawable.ic_person_black_24dp);
        data[7]=new TagData("To",R.drawable.ic_school_black_24dp);
        data[8]=new TagData("All",R.drawable.ic_share_black_24dp);
        return data;
    }

Now provide this data to TagLayout.

TagLayout iconTagView=(TagLayout)findViewById(R.id.iconTagView);
          iconTagView.setTags(getData());

You can also set OnClickListener to the TagLayout.

iconTagView.setOnTagClickListener(new TagLayout.OnTagClickListener() {
    @Override
    public void onTagClick(String tag) {
        Toast.makeText(MainActivity.this, tag+" Clicked!!", Toast.LENGTH_SHORT).show();
    }
});

Note

You can fully customize layout by creating styles. Elements you can use are.

        <item name="net_borderColor">#49C120</item>
        <item name="net_textColor">#49C120</item>
        <item name="net_backgroundColor">#FFFFFF</item>
        <item name="net_randomIconBackgroundColor">true</item>
        <item name="net_iconBackgroundColor">#FF0000</item>
        <item name="net_borderStrokeWidth">0.5dp</item>
        <item name="net_circlePaddingFactor">1.0</item>
        <item name="net_iconPadding">6dp</item>
        <item name="net_textSize">15dp</item>
        <item name="net_horizontalSpacing">10dp</item>
        <item name="net_verticalSpacing">10dp</item>
        <item name="net_horizontalPadding">10dp</item>
        <item name="net_verticalPadding">10dp</item>

Support Us

Please share and star this library to support us.

License

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.

icontagview's People

Contributors

amanyadav avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

ajrulez

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.