how to set background image layer same trasparent color on image in android

241 views Asked by At

I am new to Android. How to set a layer transparent color above the image using palette API. I set background image and toolbackground color using palette API but how to set above the background image transparent color picking from palette API? Any one please help me how to get this.

Here below my code

Main.java

  final LinearLayout mMainLayout = (LinearLayout)findViewById(R.id.revi_main_layout);

    target = new Target() {
        @Override
        public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) {
            mMainLayout.setBackground(new BitmapDrawable(bitmap));
            Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() {
                public void onGenerated(Palette palette) {
                    movie_image.setImageBitmap(bitmap);

                    int defaultColor = getResources().getColor(R.color.whiteColor);
                    toolbar.setBackgroundColor(palette.getLightVibrantColor(defaultColor));

                    toolbar.setTitleTextColor(palette.getDarkMutedColor(defaultColor));
                    toolbar.setTitle(getString(R.string.title_activity_news_update_fulldec));
                }
            });
        }

        @Override
        public void onBitmapFailed(Drawable errorDrawable) {

        }

        @Override
        public void onPrepareLoad(Drawable placeHolderDrawable) {

        }
    };

Picasso.with(getApplicationContext()).load((Reviews_update.revData.get(mov_pos)).getNewsImage()).into(target);
0

There are 0 answers