RealtimeBlurView


Source link: https://github.com/mmin18/RealtimeBlurView

RealtimeBlurView

It's just a realtime blurring overlay like iOS UIVisualEffectView.

Just put the view in the layout xml, no Java code is required.

// Views to be blurred <ImageView ../>  <com.github.mmin18.widget.RealtimeBlurView  android:layout_width="match_parent"  android:layout_height="match_parent"  app:realtimeBlurRadius="20dp"  app:realtimeOverlayColor="#8000" />  // Views above blurring overlay <Button ../> 

Try the sample apk: blurring.apk

Adding to project

Add dependencies in your build.gradle:

 dependencies {

compile 'com.github.mmin18:realtimeblurview:1.1.0'  
}
  android {

buildToolsVersion '24.0.2'

  // Use 23.0.3 or higher
defaultConfig {

 minSdkVersion 15
 renderscriptTargetApi 19
 renderscriptSupportModeEnabled true
 // Enable RS support

}
  
}

Add proguard rules if necessary:

-keep class android.support.v8.renderscript.** {
 *; 
}
 

Limitations

  • It will not work with SurfaceView / TextureView like VideoView, GoogleMapView

Performance

RealtimeBlurView use RenderScript to blur the bitmap, just like 500px-android-blur.

Everytime your window draw, it will render a blurred bitmap, so there is a performance cost. Set downsampleFactor>=4 will significantly reduce the render cost. However, if you just want to blur a static view, 500px-android-blur is good enough.

I've run the sample on some old phones like Samsung Galaxy S2, Samsung Galaxy S3, it runs at full FPS. Here is a performance chart while scrolling the list on Nexus 5.

Changelog

1.1.0 (2017-01-02)

Some improvements (OOM, resize, window background)

1.0.8 (2016-11-29)

Fix view not refreshed issue on PopupWindow

1.0.6 (2016-11-7)

Fix crash when view is very small (draw at least 1px)

1.0.5 (2016-11-5)

Support Popup Window (Use it as dialog background) Ignore UnsatisfiedLinkError if APK is not debuggable.

1.0.4 (2016-9-28)

Support custom shape (by override drawBlurredBitmap()), support view in ContextThemeWrapper.

Resources

A light Android library containing code to work with RecyclerViews and ViewGroups which is usually copy-pasted across projects.

Simple PriceView that can be used to represent any prices in Russian rouble currency. Library uses RobotoTextView as text presenter.

SearchView library based on DialogFragment.

Small extension of default ActionBarDrawerToggle.

Extended CollapsingToolbar that implements scrolling behaviour like in Google Play app.

Simple Android library which allows you to create a chunk for NinePatchDrawable at runtime. So you are able to load 9.png images, for example, from assets of your application or from other source.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes