{"id":13609042,"url":"https://github.com/danielzeller/Blur-LIB-Android","last_synced_at":"2025-04-12T17:33:44.485Z","repository":{"id":48972211,"uuid":"154150765","full_name":"danielzeller/Blur-LIB-Android","owner":"danielzeller","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-06T12:20:07.000Z","size":23166,"stargazers_count":514,"open_issues_count":14,"forks_count":50,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-07T14:42:44.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielzeller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-10-22T13:39:32.000Z","updated_at":"2024-10-27T03:34:42.000Z","dependencies_parsed_at":"2024-01-16T23:30:55.920Z","dependency_job_id":"cfed2a56-b07d-489e-bbf9-2fd3825d6c2d","html_url":"https://github.com/danielzeller/Blur-LIB-Android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielzeller%2FBlur-LIB-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielzeller%2FBlur-LIB-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielzeller%2FBlur-LIB-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielzeller%2FBlur-LIB-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielzeller","download_url":"https://codeload.github.com/danielzeller/Blur-LIB-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605520,"owners_count":21132188,"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":[],"created_at":"2024-08-01T19:01:32.004Z","updated_at":"2025-04-12T17:33:39.474Z","avatar_url":"https://github.com/danielzeller.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Blur-LIB-Android\n\nA library for Blurring the background of a View.\n\n[\u003cimg src=\"/Artwork/PhoneAndScreen.gif\" width=\"400\"/\u003e](https://youtu.be/sYPqS0px61Q)\n\n[See demo on youtube](https://youtu.be/sYPqS0px61Q)\n\n## How it works\nThe blurring is really fast since everything is fully hardware accelerated. The background View that is to be blurred is rendered into a SurfaceTexture using Surface.lockHardwareCanvas().\nThe SurfaceTexture is then blurred using a Guassian blur algorithm and rendered in a SurfaceView or TextureView using OpenGL.\n\n\n## Download\nVia Gradle\n\n```\n   implementation 'no.danielzeller.blurbehindlib:blurbehindlib:1.0.0'\n```\nor Maven\n```\n   \u003cdependency\u003e\n     \u003cgroupId\u003eno.danielzeller.blurbehindlib\u003c/groupId\u003e\n     \u003cartifactId\u003eblurbehindlib\u003c/artifactId\u003e\n     \u003cversion\u003e1.0.0\u003c/version\u003e\n     \u003ctype\u003epom\u003c/type\u003e\n   \u003c/dependency\u003e\n```\n\n## Basics\nCreate a BlurBehindLayout from XML\n\n```xml\n    \u003cno.danielzeller.blurbehindlib.BlurBehindLayout\n        android:id=\"@+id/blurBehindLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\"\n       \n        app:blurRadius=\"100.0\" \n        app:updateMode=\"onScroll\"\n        app:useTextureView=\"false\"\n        app:blurPaddingVertical=\"50dp\"\n        app:blurTextureScale=\"0.5\"\n        app:useChildAlphaAsMask=\"false\"\u003e\n        \u003c!-- Add Children --\u003e\n        \u003c/no.danielzeller.blurbehindlib.BlurBehindLayout\u003e\n```\n\nThen you need to setup the View that is behind the BlurBehindLayout (the one that will be blurred).\n\n```kotlin\n     blurBehindLayout.viewBehind = viewToBlur\n```\n\n[\u003cimg src=\"/Artwork/Transition.gif\" width=\"400\"/\u003e](https://youtu.be/sYPqS0px61Q)\n\n#### Blur radius\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cdiv class=\"highlight\"\u003e\u003cpre\u003eapp:blurRadius = \"100.0\"\u003c/pre\u003e\u003c/div\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cdiv class=\"highlight\"\u003e\u003cpre\u003eblurBehindLayout.blurRadius = 100.f\u003c/pre\u003e\u003c/div\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\nDetermines how strong the blur is. Should be a float value between 0f-200f. Default is 40f.\n\n\n#### Update mode\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cdiv class=\"highlight\"\u003e\u003cpre\u003eapp:updateMode = \"continuously\"\u003c/pre\u003e\u003c/div\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cdiv class=\"highlight\"\u003e\u003cpre\u003eblurBehindLayout.updateMode = UpdateMode.CONTINUOUSLY\u003c/pre\u003e\u003c/div\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\nDetermines how the BlurBehindLayout is updated. When updateMode is UpdateMode.CONTINUOUSLY, the renderer is called repeatedly to re-render the scene. \nWhen updateMode is UpdateMode.ON_SCROLL, the renderer only renders when a View is Scrolled.\nWhen updateMode is UpdateMode.MANUALLY, the renderer only renders when the surface is created and when updateForMilliSeconds(..) is called manually. This is useful when animating the background or during a transition. \n\n\n#### Use TextureView\n```\n    app:useTextureView = \"true\"\n```\nThis can only be changed in the constructor of the BlurBehindLayout either from xml or using the regular constructor from code. Default value is false. Using TextureView should only be used when SurfaceView is'nt an option, either because the Z-ordering breaks or if you animate the BlurBehindLayout's alpha value. Using TextureView instead of SurfaceView has a small impact on performance.\n\n\n#### Blur texture scale\n```\n    app:blurTextureScale = \"0.5\"\n```\nShould be a value between 0.1f-1f. It's recommended to downsample at least to 0.5f. The scale has a big impact on performance, so try keeping it as low as possible. Default is 0.4f. This can only be set in the constructor of the BlurBehindLayout either from xml or using the regular constructor from code. \n\n\n#### Padding vertical \n```\n    app:blurPaddingVertical = \"50dp\"\n```\nYou can use this to make the Blur Texture larger than the BlurBehindLayout in the vertical direction. For instance when the background View is scrolled up and down it looks better with a padding, because it reduces flicker when new pixels enter the blurred area. \n\n\n#### Use child as alpha mask\n```\n    app:useChildAlphaAsMask = \"true\"\n```\nWhen this is true the first child View of the BlurBehindLayout is rendered into a texture. The alpha value of that texture is then used as mask for the Blur texture. When useChildAlphaAsMask is true, useTextureView will be forced to true as well in order to support transparency. \nThis effect can be used for creating text with blurred background and so on. See the DialogFragment for an example. \n\n\n\n## Contact\n\nYou can reach me on Twitter as [@zellah](https://twitter.com/zellah) or [email](mailto:hello@danielzeller.no).\n\n\n## Who's behind this?\n\nDeveloped by Daniel Zeller - [danielzeller.no](http://danielzeller.no/), a freelance developer situated in Oslo, Norway.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielzeller%2FBlur-LIB-Android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielzeller%2FBlur-LIB-Android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielzeller%2FBlur-LIB-Android/lists"}