Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 220.127.116.11 release ready!
Owner and Founder. Opencart
In Mobikul application, we allow user to provide different category icon’s for each category. Category icons can be changed at any instance of time.
In this blog we will see how the icons of any menu item can be changed.
Let us explore it step by steps:
A powerful image downloading and caching library for Android.
Target Interface represents an arbitrary listener for image loading. This interface is generally used as a mediator between our view and source image.
There are three methods that are overridden when we use this inteface.
A. void onBitmapLoaded(Bitmap bitmap, LoadedFrom from)
Callback when an image has been successfully loaded.
B. void onBitmapFailed(Drawable errorDrawable)
Callback indicating the image could not be successfully loaded.
C. void onPrepareLoad(Drawable placeHolderDrawable)
Callback invoked right before your request is submitted.
In this sample code, we have create a new instance of Interface Target and passed this instance to picasso library for image loading. When the drawable is loaded onBitmapLoaded method is called and provide bitmap of the image.
Since bitmap cannot be directly added to a menu item. So, we have converted this bitmap to bitmap drawable. And then we can use this drawable (Bitmap Drawable) as a icon in Menu item.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.
Owner, Shop ATV Escape
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.