Android 类似于qq、微信未读消息提示效果的组件使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huangliniqng/article/details/82015889

ImageviewBound

带有角标的iamgeview,类似于qq、微信未读消息提示效果

1.引入方式

maven:

<dependency>
  <groupId>com.hlq</groupId>
  <artifactId>imageviewBound</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

gradle:

  compile 'com.hlq:imageviewBound:1.0.0'

2.使用方式

 在xml中:
  <hlq.ImageViewBound
      android:id="@+id/wode"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:src="@mipmap/ic_launcher" />
  在java代码中:
  imageViewBound.setMessageNum(1);每次设置都实时有效
  当设置的数量>=100时,则会显示99+,字体大小根据设置的数字自动适配。

3.效果图

avatar
项目源码:https://github.com/huanglinqing123/ImageviewBound
欢迎start和issue
欢迎关注技术公众号,微信号搜索ColorfulCode 代码男人

分享技术文章,投稿分享,不限技术种类,不限技术深度,让更多人因为分享而受益。

猜你喜欢

转载自blog.csdn.net/huangliniqng/article/details/82015889