How to use dynamicToolbarColor() in android -


following code getting 1 image resource, how change dynamic images, i'm getting images bitmap.

    bitmap bitmap = bitmapfactory.decoderesource(getresources(),             r.drawable.pfpic);      palette.from(bitmap).generate(new palette.paletteasynclistener() {          @override         public void ongenerated(palette palette) {             collapsingtoolbarlayout.setcontentscrimcolor(palette.getmutedcolor(r.attr.colorprimary));             collapsingtoolbarlayout.setstatusbarscrimcolor(palette.getmutedcolor(r.attr.colorprimarydark));         }     }); } 

you converting 1 image, mentioned getting images in form of bitmaps right?!, why don't use bitmap reference?!.

    bmp = bitmapfactory.decodebytearray(b, 0, b.length);                 imageview.setimagebitmap(bmp); 

you can use 'bmp' in following code this

    palette.from(bmp).generate(new palette.paletteasynclistener() { 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -