Code Monkey home page Code Monkey logo

praisewidget's Introduction

PraiseWidget

// 这个是点赞控件哦,适用于社交类app

实际效果可以看看我在朋友圈项目的使用

实现流程:http://blog.csdn.net/mkfrank/article/details/49963779

效果图:

image

使用方法:

在xml定义控件,findViewById后,使用setDataByArray传入数据(本例子用的是PraiseBean),您可以改成你需要用的
正因为如此,我并没有抽取为一个Library
如果需要跟显示图一样超过5行就显示“等xx人”,请跟TextView一样给定android:maxLines="5"

可定义的属性:(attrs.xml)

     <!--显示点赞控件-->
      <declare-styleable name="PraiseWidget">
          <attr name="click_bg_color" format="color"/> //点击的背景色,默认全透明
          <attr name="font_color" format="color"/>  //文字颜色,默认蓝
          <attr name="font_size" format="dimension"/>  //文字大小,默认16sp
          <attr name="zan_icon" format="reference"/>  //第一个点赞的图标,默认一个蓝色的心心
      </declare-styleable>

注意事项:

因为使用了缓存,所以如果在activity引用了,请务必在onDestroy里面调用PraiseWidget.clearPraiseWidgetCache清掉context引用,避免无法回收

praisewidget's People

Contributors

430public avatar razerdp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

praisewidget's Issues

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.