GithubHelp home page GithubHelp logo

likeview's Introduction

LikeView

一个仿即刻点赞效果的view,同时可以设置图标飞出父view。例如listview中使用,可以飞出当前itemview。

gradle

compile 'com.zhuang:likeview:2.1'

xml

<com.zhuang.likeviewlibrary.LikeView
android:id="@+id/likeView"  
android:layout_width="wrap_content"  
android:layout_height="wrap_content"  
app:like_canCancel="true" //是否可以取消点赞,设置了该属性之后,第一次点击新增点赞,第二次点击取消点赞。  
app:like_iconSize="18dp" //点赞的图标的大小,也就是那个大拇指的大小。    
app:like_hasFly="false" //是否有图标飞出  
app:like_textSize="12sp" />//文字大小,也就是点赞数的文字大小。  

  注意:这里的layout_width,layout_height实际上并无效果,likeview的大小由其icon与text大小决定。

likeview的点击事件监听

likeView.setOnLikeListeners(new LikeView.OnLikeListeners() {
    @Override
   public void like(boolean isCancel) {
        //isCancel
       //如果设置了like_canCancel为false,则isCancel可以不管,此时表示likeview被点击了
       //如果设置了like_canCancel为true,表示可以取消点赞,那么isCancel为true时,表示取消点赞,为false时,表示点赞
   }
});

likeview's People

Contributors

likeadog avatar

Watchers

 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.