{"id":13604088,"url":"https://github.com/Dimezis/BlurView","last_synced_at":"2025-04-11T22:32:31.663Z","repository":{"id":37896825,"uuid":"56787441","full_name":"Dimezis/BlurView","owner":"Dimezis","description":"Dynamic iOS-like blur of underlying Views for Android","archived":false,"fork":false,"pushed_at":"2025-03-19T16:12:55.000Z","size":13459,"stargazers_count":3641,"open_issues_count":16,"forks_count":349,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-04-10T20:55:00.585Z","etag":null,"topics":["android","blur","blurview","draw"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dimezis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://paypal.me/dimezis"]}},"created_at":"2016-04-21T16:00:07.000Z","updated_at":"2025-04-10T16:45:02.000Z","dependencies_parsed_at":"2024-01-14T11:10:08.512Z","dependency_job_id":"80129ba1-8672-415f-89de-9c10d469344c","html_url":"https://github.com/Dimezis/BlurView","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimezis%2FBlurView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimezis%2FBlurView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimezis%2FBlurView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dimezis%2FBlurView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dimezis","download_url":"https://codeload.github.com/Dimezis/BlurView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489889,"owners_count":21112657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","blur","blurview","draw"],"created_at":"2024-08-01T19:00:39.695Z","updated_at":"2025-04-11T22:32:31.653Z","avatar_url":"https://github.com/Dimezis.png","language":"Java","readme":"[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine)\n\n# BlurView\n\n\u003ca href=\"url\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/1433500/174389657-f52837db-005b-4a68-b9c6-ce196fa03395.jpg\" width=\"432\" \u003e\u003c/a\u003e\n\nDynamic iOS-like blur for Android Views. Includes library and small example project.\n\nBlurView can be used as a regular FrameLayout. It blurs its underlying content and draws it as a\nbackground for its children. The children of the BlurView are not blurred. BlurView redraws its\nblurred content when changes in view hierarchy are detected (draw() called). It honors its position\nand size changes, including view animation and property animation.\n\n## How to use\n```XML\n  \u003ceightbitlab.com.blurview.BlurView\n      android:id=\"@+id/blurView\"\n      android:layout_width=\"match_parent\"\n      android:layout_height=\"wrap_content\"\n      app:blurOverlayColor=\"@color/colorOverlay\"\u003e\n\n       \u003c!--Any child View here, TabLayout for example. This View will NOT be blurred --\u003e\n\n  \u003c/eightbitlab.com.blurview.BlurView\u003e\n```\n\n```Java\n    float radius = 20f;\n\n    View decorView = getWindow().getDecorView();\n    // ViewGroup you want to start blur from. Choose root as close to BlurView in hierarchy as possible.\n    ViewGroup rootView = (ViewGroup) decorView.findViewById(android.R.id.content);\n    \n    // Optional:\n    // Set drawable to draw in the beginning of each blurred frame.\n    // Can be used in case your layout has a lot of transparent space and your content\n    // gets a too low alpha value after blur is applied.\n    Drawable windowBackground = decorView.getBackground();\n\n    blurView.setupWith(rootView) // Optionally pass RenderEffectBlur or RenderScriptBlur as the second parameter\n           .setFrameClearDrawable(windowBackground) // Optional. Useful when your root has a lot of transparent background, which results in semi-transparent blurred content. This will make the background opaque\n           .setBlurRadius(radius)\n```\n\nAlways try to choose the closest possible root layout to BlurView. This will greatly reduce the amount of work needed for creating View hierarchy snapshot.\n\n## SurfaceView, TextureView, VideoView, MapFragment, GLSurfaceView, etc\nBlurView currently doesn't support blurring of these targets, because they work only with hardware-accelerated Canvas, and BlurView relies on a software Canvas to make a snapshot of Views to blur.\n\n## Gradle\n\nSince JCenter is closing, please use https://jitpack.io/ and release tags as the source of stable\nartifacts.\n```Groovy\nimplementation 'com.github.Dimezis:BlurView:version-2.0.6'\n```\n\n## Rounded corners\nIt's possible to set rounded corners without any custom API, the algorithm is the same as with other regular View:\n\nCreate a rounded drawable, and set it as a background.\n\nThen set up the clipping, so the BlurView doesn't draw outside the corners \n```Java\nblurView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);\nblurView.setClipToOutline(true);\n```\nRelated thread - https://github.com/Dimezis/BlurView/issues/37\n\n## Why blurring on the main thread?\nBecause blurring on other threads would introduce 1-2 frames of latency.\nFor what it's worth, `RenderEffectBlur` performs blur on the Render Thread.\n\n## Compared to other blurring libs\n- The main advantage of BlurView over almost any other library is that it doesn't trigger redundant redraw.\n- The BlurView never invalidates itself or other Views in the hierarchy and updates only when needed relying on just a Bitmap mutation, which is recorded on a hardware-accelerated canvas.\n- It supports multiple BlurViews on the screen without triggering a draw loop.\n- It uses optimized RenderScript Allocations on devices that require certain Allocation sizes, which greatly increases blur performance.\n- It allows choosing a custom root view to take a snapshot from, which reduces the amount of drawing traversals and allows greater flexibility.\n- Supports blurring of Dialogs (and Dialog's background)\n\nOther libs:\n- 🛑 [BlurKit](https://github.com/CameraKit/blurkit-android) - constantly invalidates itself\n- 🛑 [RealtimeBlurView](https://github.com/mmin18/RealtimeBlurView) - constantly invalidates itself\n\nLicense\n-------\n\n    Copyright 2024 Dmytro Saviuk\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":["https://paypal.me/dimezis"],"categories":["Java","模糊效果"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDimezis%2FBlurView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDimezis%2FBlurView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDimezis%2FBlurView/lists"}