question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v1.6.0 BlurView No Longer Works on Emulator

See original GitHub issue

Thank you for updating the library and continuously improving the features!

I am trying to upgrade my libraries to use v1.6.0 but I run into an issue where the BlurView doesn’t render because the new BlurViewFacade might be interfering.

v1.6.0 MaxthonSnap20190417215002

v1.5.0 (working) MaxthonSnap20190417215410

I’m extending BlurView because I need to apply rounded corners to the blur. This is my custom BlurView with rounded corners:

package stream.customalert.ui;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;

import eightbitlab.com.blurview.BlurView;
import eightbitlab.com.blurview.RenderScriptBlur;
import stream.customalert.CustomAlertDialogue;

public class CustomBlurDialogue extends BlurView {

    public CustomBlurDialogue(Context context) {
        super(context);
        init();
    }

    public CustomBlurDialogue(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
        initCorners(context);
    }

    public CustomBlurDialogue(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
        initCorners(context);
    }

    private void init() {

    }

    private void initCorners(Context context) {
            setRoundedCorners(CustomAlertDialogue.Units.dpToPx(context, 15));
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
    }

    public void create(View decorView, float radius) {

        ViewGroup rootView = decorView.findViewById(android.R.id.content);
        Drawable windowBackground = decorView.getBackground();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            setupWith(rootView)
                    .setFrameClearDrawable(windowBackground)
                    .setBlurAlgorithm(new RenderScriptBlur(getContext()))
                    .setBlurRadius(radius)
                    .setHasFixedTransformationMatrix(true);
        }
    }

    /**
     * Set Rounded Corners on Lollipop and above. Use rounded drawable and disable blur below Lollipop.
     * @param cornerRadius - set corner radius in pixels.
     */
    private void setRoundedCorners(int cornerRadius) {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            setBackground(new RoundedCornersDrawable(cornerRadius));
            setOutlineProvider(ViewOutlineProvider.BACKGROUND);
            setClipToOutline(true);
        }
    }
}

Before the introduction of BlurViewFacade, it was working because the blur was handled within the BlurView class. Now, it appears the blur is handled by the BlurViewFacade. Do you have any ideas how I can extend BlurView successfully?

Perhaps there is a way to have BlurViewFacade without breaking BlurView’s extensibility or maybe I’m using BlurViewFacade wrong?

Thanks for taking a look!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Dimeziscommented, Apr 20, 2019

Fixed in 1.6.1. Btw you should now be able to use a regular dialog in your lib and the blur position will be calculated properly

0reactions
searchy2commented, Apr 20, 2019

Thanks you so much! You’re amazing 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Emulator is not working properly. The screen goes ...
Android emulator has not been working properly for the past 1 month. Can someone please suggest what might be the issue.
Read more >
How to Fix Shaking Screen in PCSX2 1.6.0 - YouTube
While running PCSX2 with an ISO file (game), press F5 to toggle your interlacing modes to fix shaking issues. Toggling the interlacing modes ......
Read more >
PCSX2's new dev releases [QT] are INSANELY good ... - Reddit
The problem is that PS2 is a console with a lot of games with issues and slowdowns, so maybe you think that the...
Read more >
Xenoblade Chronicles 3 - Emulator/Etc Discussion | Page 43
AMD GPUs have a bit more issues playing Xenoblade 3 than Nvidia GPUs. ... remove motion blur, remove outlines, vulkan workaround.
Read more >
Not valid sdk version after upgrading Android Expo app ( #3112
I am trying to learn React Native and am too running into the "32.0.0 is not a valid SDK version" error when I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found