https://github.com/AlexLiuSheng/BadgeView
  
  
    a BadeView  base on android 
    https://github.com/AlexLiuSheng/BadgeView
  
android badge badges badgeview bindview
        Last synced: 7 months ago 
        JSON representation
    
a BadeView base on android
- Host: GitHub
 - URL: https://github.com/AlexLiuSheng/BadgeView
 - Owner: AlexLiuSheng
 - Created: 2016-07-15T03:22:59.000Z (over 9 years ago)
 - Default Branch: master
 - Last Pushed: 2022-08-13T20:47:25.000Z (about 3 years ago)
 - Last Synced: 2025-04-04T18:08:51.733Z (7 months ago)
 - Topics: android, badge, badges, badgeview, bindview
 - Language: Java
 - Size: 241 KB
 - Stars: 730
 - Watchers: 19
 - Forks: 110
 - Open Issues: 13
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-github-android-ui - BadgeView - 基于Android的BadeView (徽章(Badge))
 
README
          # BadgeView
a BadeView  base on android

## 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();
## history version
  - v1.0.6  
  add `setMargin`method,using this method you can change the position of badgeview,but the width of bindview or the height of bindview will be changed.see image effect.
  
  - v1.1.1
  add `setSpace`method,it replace origin method `setMargin`.now `setMargin` is a Deprecated method.Use `setSpace` method to set space  between view and badgeview instead.
## License
        
        Copyright 2016 AllenLiu.
        Licensed to the Apache Software Foundation (ASF) under one or more contributor
        license agreements. See the NOTICE file distributed with this work for
        additional information regarding copyright ownership. The ASF licenses this
        file to you 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.
welecome to star,thank you.