a BadeView base on android
Java
Latest commit 5c9c3a9 Nov 15, 2016 @AlexLiuSheng committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
.idea add badgeview shape Nov 8, 2016
gradle/wrapper a badgeview Jul 15, 2016
library repair framelayout position Nov 15, 2016
.gitignore a badgeview Jul 15, 2016
README.md Update README.md Nov 15, 2016
build.gradle add badgeview shape Nov 8, 2016
gradle.properties a badgeview Jul 15, 2016
gradlew a badgeview Jul 15, 2016
gradlew.bat a badgeview Jul 15, 2016
settings.gradle a badgeview Jul 15, 2016

README.md

BadgeView

a BadeView base on android

include:

  compile 'com.allenliu.badgeview:library:1.0.6'

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)
.setMargin(0,0,5,0)
.bind(view);

There are some other constructer methods and you can 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();

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.

history version

*v1.0.6
add setMarginmethod,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.