Giter Club home page Giter Club logo

badger's People

Contributors

ligi avatar miquelbeltran avatar tynn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

badger's Issues

it doen't work on menu item

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;

Using with glide ?

Can any one using it with glide ? Ex i want to show badge to image icon but load by Glide first ?

how to set badge color ?

if i use paint.setColor(X) it change the border color. i want to set the entire badge color. how can i do this ?

Set Badge on Drawable

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?

Set the Badge value outside onOptionsItemSelected

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 ?

How to Change the badge factory dynamically?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.