v2rc / badger Goto Github PK
View Code? Open in Web Editor NEWA badge for any drawable :red_circle:
License: Apache License 2.0
A badge for any drawable :red_circle:
License: Apache License 2.0
CountBadge.Factory c = new CountBadge.Factory(context, BadgeShape.circle(.5f, Gravity.END | Gravity.TOP)); c.createBadge().setCount(qnt); Badger.sett(elementoTarget, c);
doesn't work. No badge appears on item;
Can any one using it with glide ? Ex i want to show badge to image icon but load by Glide first ?
if i use paint.setColor(X) it change the border color. i want to set the entire badge color. how can i do this ?
Hi, I am trying to set badge on a drawable like this:
circleFactory = new CountBadge.Factory(this, BadgeShape.oval(1f, 2f, Gravity.BOTTOM));
Drawable drawable = new BitmapDrawable(getResources(), getCircleBitmap(bitmap));
circleFactory.createBadge().setCount(12);
Badger<?> badger = Badger.sett(drawable, circleFactory);
BadgeDrawable badge = badger.badge;
drawable = badger.drawable;
return drawable;
But the drawable is not getting created with Badge. Any suggestions?
Hello, first of all thanks you for your awesome library. (I'm with Kotlin)
I'm trying to make a little changes, I want to change the badge value in the activity onCreate
I got this code in onCreateOptionsMenu :
ovalSquare = CountBadge.Factory(this, BadgeShape.oval(1f, 2f, Gravity.BOTTOM))
Badger.sett(menu.findItem(R.id.profil), ovalSquare).count = badge
but to set the final value in the onCreate I got exception: variable theBadge was not initialised
onCreate Activity
@SuppressWarnings("ConstantConditions")
val theBadge: CountBadge = Badger.sett(theItem, ovalSquare)
theBadge.count = badge
Please can you help me ?
I'm trying to change the factory of the badge to increase it's size if the text goes beyond certain number of digits, in other words:
if the countBadge.getText().length() > 3
then change the factory to oval
what I've tried to do
first time setting up the badge:
CountBadge.Factory circleFactory =new CountBadge.Factory(this,
BadgeShape.circle(.4f, Gravity.END | Gravity.TOP));
Badger.sett(imageView, coloredFactory);
and then in the imageView onClickListener
CountBadge badge = Badger.sett(imageView, null);
if(badge.getText().length() > 3){
CountBadge.Factory ovalFactory = new CountBadge.Factory(
BadgeShape.oval(1f, 2f, Gravity.BOTTOM ),
Color.WHITE,
Color.BLACK);
badge = Badger.sett((ImageView) view, ovalFactory);
}
but nothing changes when the new oval factory is used
Does it work for BottomNavigationView?
What brands does it work for?
How much does it support Android?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.