view-effects

Apply custom effects on view backgrounds

Github stars Tracking Chart

View Filters

Android Arsenal 

CircleCI

At the beginning the only purpose was to blur all layers below.
Now you can do more :

  • Blur background views easily
  • Create custom filters and apply them to views backgrounds

Screenshot

Usage

First add jitpack to your projects build.gradle file

allprojects {
   	repositories {
   		...
   		maven { url "https://jitpack.io" }
   	}
}

Then add the dependency in modules build.gradle file

dependencies {
	  compile 'com.github.mirrajabi:view-effects:e355a1bac4'
 }

Just do the normal ui stuff

<RelativeLayout
     android:layout_width="match_parent" 
     android:layout_height="match_parent"
     android:id="@+id/root_view">
     <View
         android:layout_width="match_parent"
         android:layout_height="100dp"
         android:layout_marginTop="100dp"
         android:layout_marginLeft="20dp"
         android:layout_marginRight="10dp"
         android:id="@+id/my_view"/>
</RelativeLayout>

Then in your code :

ViewFilter.getInstance(this)
          //Use blur effect or implement your custom IRenderer
          .setRenderer(new BlurRenderer(16)) 
          .applyFilterOnView(findViewById(R.id.my_view),
                            findViewById(R.id.root_view));

You can also implement your own IRenderer and use it as the renderer.
in some situations you might want the view background to handle it yourself

ViewFilter.getInstance(this)
          .getFilteredBackgroundOfView(findViewById(R.id.my_view),
                                       findViewById(R.id.root_view));
Any contributions are welcome
About me
My Website

Main metrics

Overview
Name With Ownermirrajabi/view-effects
Primary LanguageJava
Program languageJava (Language Count: 1)
Platform
License:Other
所有者活动
Created At2016-09-13 00:16:38
Pushed At2017-05-25 17:42:15
Last Commit At2017-05-25 22:12:15
Release Count1
Last Release Name1.0 (Posted on )
First Release Name1.0 (Posted on )
用户参与
Stargazers Count179
Watchers Count5
Fork Count8
Commits Count44
Has Issues Enabled
Issues Count4
Issue Open Count1
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private