Giter VIP home page Giter VIP logo

tagcornerimageview's Introduction

TagCornerImageView

δΈ­ζ–‡
TagCornerImageView is a custom imageview that you can add different style tag on the corner of imageview.

ScreenShots

Demo

You can download demo from:Fir.im

Features

TagCornerImageView is extended ImageView,so You can use it as a ImageView,and can add rect tag,triangle tag or rounded rectangle tag on corner.

Usage

Maven

<dependency>
  <groupId>me.wavever.tagcornerimageview</groupId>
  <artifactId>library</artifactId>
  <version>0.2.0</version>
  <type>pom</type>
</dependency>

Gradle

Add this to your module's build.gradle file:

dependencies {
    ...
    compile 'me.wavever.tagcornerimageview:library:0.2.0'
    }
}

Custom Attribute

tag_type the type of tag , now there are two types , triangle and rect.default value is rect
tag_text the text of rect tag.
tag_text_color the text color of rect tag , defaule value is white
tag_text_size the text size of rect tag , default value is 18sp.
tag_background_color the color of tag's background , default value is blue.
tag_background_alpha the alpha of tag , 0~255 , defaule value is 255.
tag_icon the icon of triangle tag.
tag_gravity the direction of your tag on , four types:left_top_corner, right_top_corner, right_bottom_corner and left_bottom_corner.
note rect style now just support text,so use app:tag_icon in rect style is invalid.

XML

<me.wavever.library.TagCornerImageView
            android:id="@+id/rect_img1"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:scaleType="centerCrop"
            android:src="@mipmap/wukong"
            android:layout_margin="10dp"
            app:tag_background_color="#f56112"
            app:tag_gravity="left_top_corner"
            app:tag_icon="@mipmap/ic_launcher"
            app:tag_text="your text"
            app:tag_text_size="normal is 18sp"
            app:tag_type="rect|triangle|round" />

License

Copyright (c) 2016 Wavever

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.

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.