Issue
I have a drawable:
Drawable drawable = Theme.getCachedWallpaper();
and I have a view that I need set this drawable on this view:
fragmentView.setBackgroundDrawable(drawable);
but I need set this drawable with white (or red or black and ...) color filter such :
to
Solution
Use FrameLayout and create extra blank layout above your image. You can set background and alpha values programmatically as below
yourview.setBackgroundColor(ContextCompat.getColor(this,R.color.colorAccent));
yourview.setAlpha(0.5f); // alpha value ranges from 0.0f to 1.0f
Answered By - karan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.