zoukankan      html  css  js  c++  java
  • badgeview

    https://github.com/AlexLiuSheng/BadgeView

    include:

         compile 'com.allenliu.badgeview:library:1.1.1'(newest)

    bind like this:

     BadgeFactory.create(this)
    .setTextColor(Color.White)
    .setWidthAndHeight(25,25)
    .setBadgeBackground(Color.Red)
    .setTextSize(10)
    .setBadgeGravity(Gravity.Right|Gravity.Top)
    .setBadgeCount(20)
    .setShape(BadgeView.SHAPE_CIRCLE)
    .setSpace(10,10)
    .bind(view);
    

    if u want to set space dont use setMargin(),use setSpace instead.

    There are some other constructer methods and you can be easy to create your own shape :

    BadgeFactory.createDot(this).setBadgeCount(20).bind(imageView);
    BadgeFactory.createCircle(this).setBadgeCount(20).bind(imageView);
    BadgeFactory.createRectangle(this).setBadgeCount(20).bind(imageView);
    BadgeFactory.createOval(this).setBadgeCount(20).bind(imageView);
    BadgeFactory.createSquare(this).setBadgeCount(20).bind(imageView);
    BadgeFactory.createRoundRect(this).setBadgeCount(20).bind(imageView);
    

    unbind view just use unbind method.

     badgeView.unbind();
  • 相关阅读:
    git
    读后感
    总结
    封装,策略,Asp换脸
    典型用户
    第四次作业
    第三次作业
    计算
    感悟
    对git的认识
  • 原文地址:https://www.cnblogs.com/tt_mc/p/8504342.html
Copyright © 2011-2022 走看看