Giter Site home page Giter Site logo

hokoblurdrawable's People

Contributors

hokofly avatar taehagen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hokoblurdrawable's Issues

No license?

Adding a license to the repo would be nice :)

Opengl

callDrawGLFunction2 removed from android 12.
and this lib not working on Android 12.

Need backup

hello.
Can you create and aar file from library?

裁剪圆角

尝试使用minminaya/GenaralRoundLayout的方法给BlurFrameLayout添加圆角,结果模糊消失。有没有什么方法可以让BlurDrawable支持圆角?
代码如下

class BlurFrameLayout : FrameLayout, IRoundView {

    private lateinit var generalRoundViewImpl: GeneralRoundViewImpl

    var blurDrawable: BlurDrawable = BlurDrawable()
        private set

    constructor(context: Context?) : super(context!!) {
        init(null)
    }

    constructor(context: Context?, attrs: AttributeSet?) : super(
        context!!, attrs
    ) {
        init(attrs)
    }

    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context!!, attrs, defStyleAttr
    ) {
        init(attrs)
    }

    private fun init(attrs: AttributeSet?) {
        generalRoundViewImpl = GeneralRoundViewImpl(
            this, context, attrs,
            R.styleable.BlurFrameLayout,
            R.styleable.BlurFrameLayout_corner_radius
        )
        background = blurDrawable
    }

    override fun onDetachedFromWindow() {
        super.onDetachedFromWindow()
        blurDrawable.freeGLResource()
    }

    override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
        super.onLayout(changed, left, top, right, bottom)
        generalRoundViewImpl.onLayout(changed, left, top, right, bottom)
    }

    override fun dispatchDraw(canvas: Canvas?) {
        generalRoundViewImpl.beforeDispatchDraw(canvas)
        super.dispatchDraw(canvas)
        generalRoundViewImpl.afterDispatchDraw(canvas)
    }

    override fun setCornerRadius(cornerRadius: Float) {
        generalRoundViewImpl.setCornerRadius(cornerRadius)
    }
}

Android 9 and 10 support

Hi, on Android 9 and 10 callDrawGLFunction2 is no longer available, can you fix it. Thank you !

高斯模糊消失了

手机 vivo x20
当我的应用从后台切到前台,发现 高斯模糊区域没有在高斯模糊了

使用中出现卡顿现象,模糊的图片是已经滑走的背景图;demo 中无法复现。

调试源码,发现在 DrawFunctor postEventFromNative 中返回的 GLInfo,执行 onDraw 方法时, mParentGLInfo.contains(info) 返回 true, 执行了 isChildRedraw = true。
打印 mParentGLInfo 和 info 的值分别为:

info = GLInfo{clipLeft=1185, clipTop=1200, clipRight=3047, clipBottom=1380, viewportWidth=3047, viewportHeight=1440, transform=[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1200.0, 0.0, 1.0], isLayer=false}

mParentInfo = GLInfo{clipLeft=1, clipTop=1200, clipRight=3047, clipBottom=1380, viewportWidth=3047, viewportHeight=1440, transform=[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1200.0, 0.0, 1.0], isLayer=false}

我注销掉 DrawFunctor.onDraw() 中的if/ else 判断, 直接执行 else 内的代码块,暂时规避问题;
还未跟进 c++ 代码;
大佬有时间关注下。

Doe not work?

Hi, I've come across this project while I was looking for a project that can blur the background of an activity.

I have downloaded and modified it's BlurDrawableActivity theme to the following in order to have user's current wallpaper.

`<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

@color/colorPrimary
@color/colorPrimaryDark
@color/colorAccent
true
@android:color/transparent
@android:color/transparent
true
@android:color/transparent
@null

</style>`

Then in order to test background bluer, I have removed everything onCreate and changed activity_blur_drawable.xml to the following by thinking that that BlurFrameLayout should blur the wallpaper.

`
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"

    >


<com.hoko.blur.view.BlurFrameLayout
        android:id="@+id/blur_frameLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        >

</com.hoko.blur.view.BlurFrameLayout>
`

Unfortunately it doesn't seem to work. Background is still the same.

I have then tried the code as is and saw that issue still there. Blurring does not seem to work.

My device is on Andorid 9. What could be the issue?

Here is the LogCat output as demo app started

2019-12-07 18:29:09.740 21609-21609/? E/Zygote: isWhitelistProcess - Process is Whitelisted 2019-12-07 18:29:09.740 21609-21609/? E/Zygote: accessInfo : 1 2019-12-07 18:29:09.743 21609-21609/? I/r.drawable.dem: Late-enabling -Xcheck:jni 2019-12-07 18:29:09.772 21609-21616/? E/r.drawable.dem: Failed to send DDMS packet REAQ to debugger (-1 of 20): Broken pipe 2019-12-07 18:29:09.860 21609-21635/? D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so 2019-12-07 18:29:09.866 21609-21609/? I/MultiWindowDecorSupport: updateCaptionType >> com.android.internal.policy.MultiWindowDecorSupport@e253fda, isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true 2019-12-07 18:29:09.866 21609-21609/? D/MultiWindowDecorSupport: setCaptionType = 0 2019-12-07 18:29:09.869 21609-21635/? E/GraphicsEnv: Failed to get gpu service 2019-12-07 18:29:09.876 21609-21609/? W/r.drawable.dem: Attempt to remove non-JNI local reference, dumping thread 2019-12-07 18:29:09.876 21609-21609/? W/r.drawable.dem: Attempt to remove non-JNI local reference, dumping thread 2019-12-07 18:29:09.879 21609-21609/? D/OpenGLRenderer: Skia GL Pipeline 2019-12-07 18:29:09.881 21609-21609/? D/EmergencyMode: [EmergencyManager] android createPackageContext successful 2019-12-07 18:29:09.891 21609-21609/? D/InputTransport: Input channel constructed: fd=60 2019-12-07 18:29:09.891 21609-21609/? D/ViewRootImpl@f3d503d[BlurDrawableActivity]: setView = DecorView@7bbf032[BlurDrawableActivity] TM=true MM=false 2019-12-07 18:29:09.900 21609-21609/? D/ViewRootImpl@f3d503d[BlurDrawableActivity]: Relayout returned: old=[0,0][1440,3040] new=[0,0][1440,3040] result=0x7 surface={true 526255411200} changed=true 2019-12-07 18:29:09.909 21609-21637/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1 2019-12-07 18:29:09.909 21609-21637/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 1 2019-12-07 18:29:09.909 21609-21637/? I/OpenGLRenderer: Initialized EGL, version 1.4 2019-12-07 18:29:09.909 21609-21637/? D/OpenGLRenderer: Swap behavior 2 2019-12-07 18:29:09.912 21609-21637/? D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 2019-12-07 18:29:09.912 21609-21637/? D/OpenGLRenderer: eglCreateWindowSurface = 0x7a872f8400, 0x7a87445010 2019-12-07 18:29:09.913 21609-21609/? W/r.drawable.dem: Accessing hidden method Landroid/view/DisplayListCanvas;->callDrawGLFunction2(J)V (light greylist, reflection) 2019-12-07 18:29:09.925 21609-21609/? D/ViewRootImpl@f3d503d[BlurDrawableActivity]: MSG_RESIZED: frame=[0,0][1440,3040] ci=[0,114][0,168] vi=[0,114][0,168] or=1 2019-12-07 18:29:09.926 21609-21609/? D/ViewRootImpl@f3d503d[BlurDrawableActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1 2019-12-07 18:29:09.926 21609-21609/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@7bbf032[BlurDrawableActivity] 2019-12-07 18:29:09.926 21609-21609/? D/InputMethodManager: getNavigationBarColor() 0 2019-12-07 18:29:09.927 21609-21609/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@7bbf032[BlurDrawableActivity] 2019-12-07 18:29:09.927 21609-21609/? D/InputMethodManager: getNavigationBarColor() 0 2019-12-07 18:29:09.927 21609-21609/? V/InputMethodManager: Starting input: tba=com.hoko.blur.drawable.demo ic=null mNaviBarColor 0 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false 2019-12-07 18:29:09.927 21609-21609/? D/InputMethodManager: startInputInner - Id : 0 2019-12-07 18:29:09.927 21609-21609/? I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus 2019-12-07 18:29:09.937 21609-21622/? D/InputTransport: Input channel constructed: fd=71 2019-12-07 18:29:09.938 21609-21609/? D/InputMethodManager: prepareNavigationBarInfo() DecorView@7bbf032[BlurDrawableActivity] 2019-12-07 18:29:09.938 21609-21609/? D/InputMethodManager: getNavigationBarColor() 0 2019-12-07 18:29:09.938 21609-21609/? V/InputMethodManager: Starting input: tba=com.hoko.blur.drawable.demo ic=null mNaviBarColor 0 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false 2019-12-07 18:29:09.938 21609-21609/? D/InputMethodManager: startInputInner - Id : 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.