Skip to content

White lines between the images ( not in a standard use case )  #4

Description

@bobymicroby

Libs looks great! Thanks for sharing!

I am trying to use it as the largeIcon of a notification but the end result is big while ( actually alpha ) lines between the images :

example

In order to extract the bitmap from the MultiImageView i've did the following incantation :

LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            View wrapperView = inflater.inflate(R.layout.multi_image_view, null);

            MultiImageView imageView = wrapperView.findViewById(R.id.multi_image_view);

            for (Bitmap cachedIcon : cachedIcons)
            {
                imageView.addImage(cachedIcon);
            }

            imageView.setShape(MultiImageView.Shape.CIRCLE);

            wrapperView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
            wrapperView.layout(0, 0, wrapperView.getMeasuredWidth(), wrapperView.getMeasuredHeight());
            wrapperView.buildDrawingCache();

            Bitmap bitmap =
                    Bitmap.createBitmap(wrapperView.getMeasuredWidth(), wrapperView.getMeasuredHeight(),
                            Bitmap.Config.ARGB_8888);

            Canvas canvas = new Canvas(bitmap);
            wrapperView.draw(canvas);

            return bitmap;

And the R.layout.multi_image_view looks like

<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">


    <com.stfalcon.multiimageview.MultiImageView
        android:id="@+id/multi_image_view"
        android:layout_width="72dp"
        android:layout_height="72dp" />

</FrameLayout>

If a possible cause passes trough your mind, I will be very happy if you share it .

Cheers!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions