view-effects

Apply custom effects on view backgrounds

Github星跟踪图

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

主要指标

概览
名称与所有者mirrajabi/view-effects
主编程语言Java
编程语言Java (语言数: 1)
平台
许可证Other
所有者活动
创建于2016-09-13 00:16:38
推送于2017-05-25 17:42:15
最后一次提交2017-05-25 22:12:15
发布数1
最新版本名称1.0 (发布于 )
第一版名称1.0 (发布于 )
用户参与
星数178
关注者数4
派生数8
提交数44
已启用问题?
问题数4
打开的问题数1
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?