How to load a circular appcompat actionbar logo using glide

旧时模样 提交于 2019-12-03 22:04:37

could not find a way, switched to Picasso and changed the code as following

  Picasso.with(mContext)
                    .load(doctorDetailsList.get(0).getDoc_imgurl())
                    .resize(120, 120)
                    .centerCrop()
                    .placeholder(R.drawable.no_image)
                    .into(new com.squareup.picasso.Target()
                    {
                        @Override
                        public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)
                        {
                            RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(mContext.getResources(), bitmap);
                            circularBitmapDrawable.setCircular(true);                             
                            getSupportActionBar().setLogo(circularBitmapDrawable);
                        }

                        @Override
                        public void onBitmapFailed(Drawable errorDrawable)
                        {

                        }

                        @Override
                        public void onPrepareLoad(Drawable placeHolderDrawable)
                        {

                        }
                    });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!