Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.github.grakhell:EffectView-ext

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.github.grakhell:EffectView-ext

Extension to EffectView lib that's provide blur and tint effect

  • 1.2.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Effect View

A view that allows you to apply several effects to a bitmap obtained from a configurable source

It takes bitmap from a source and apply multiple effects to it then draw it on self canvas. Effect View redraws its content when changes in view hierarchy are detected (draw() called).

Download

Maven Central

Grab via Gradle:

groovy

    implementation 'io.github.grakhell:EffectView:$latest_version'

kotlin dsl

    implementation("io.github.grakhell:EffectView:$latest_version")

for extensions with bundled effects

groovy

    implementation 'io.github.grakhell:EffectView-ext:$latest_version'

kotlin dsl

    implementation("io.github.grakhell:EffectView-ext:$latest_version")

How to use

<io.github.grakhell.effectview.EffectView
	android:layout_width="match_parent"
	android:layout_height="match_parent"/>

EffectView for work required bitmap source. By default bitmap source from view is provided.

//ViewGroup or View you want to start effects from. Choose root as close to EffectView in hierarchy as possible.
//Always try to choose the closest possible layout or view to EffectView.
val contentImageView = (View) getWindow().getDecorView().findViewById(android.R.id.content);
val src = ViewBitmapSource(contentImageView)

EffectView can apply multiple effects at once. By default blur and tint effects is provided, but you can create your own effects by overriding base Effect class. Default blur effect uses Renderscript Toolkit

val blurEffect = BlurEffect(src, radius = 5)
val tintEffect = TintEffect(blurEffect, color = Color.BLACK, alpha = 60)
effectView.apply {
    setSource(tintEffect) // sets source
}

Licence

Copyright 2022 Dmitrii Z.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

FAQs

Package last updated on 16 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc