xiaolf1/AppDress

能处理过滤指定得view 不被应用滤镜模式吗?

open9527 opened this issue · 2 comments

能处理过滤指定得view 不被应用滤镜模式吗?

WebView 不能被反滤镜

//这个可以暂时解决
private void applyChildColor(@nonnull ViewGroup rootView, @nullable Paint paint) {

    NightColorFilter filter = filterWeakReference.get();
    int childCount = rootView.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View childView = rootView.getChildAt(i);
        if (childView instanceof ViewGroup) {
            if (filter != null && filter.excludeView(childView)) {
                childView.setLayerType(View.LAYER_TYPE_HARDWARE, paint);

// childView.setLayerType(View.LAYER_TYPE_SOFTWARE, paint);
}
applyChildColor((ViewGroup) childView, paint);
} else if (childView != null && filterWeakReference != null) {

            if (filter != null && filter.excludeView(childView)) {
                childView.setLayerType(View.LAYER_TYPE_HARDWARE, paint);

// childView.setLayerType(View.LAYER_TYPE_SOFTWARE, paint);
}
}
}
}