AndroidGradientImageView is a simple imageview which overlays gradient on its content.

Overview

Platform API License

AndroidGradientImageView

AndroidGradientImageView is a simple imageView which overlays gradient on its content like below:

Setup Gradle

dependencies {
    //...
    implementation 'kr.pe.burt.android.lib:androidgradientimageview:1.0.0'
}

Attributes

AndroidGradientImageView is a simple imageview. It just provides a few attributes for gradient effect.

  • giv_x
    • is left position of gradient
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_y
    • is top position of gradient
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_width
    • is gradient's width
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_height
    • is gradient's height
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_rotate
    • is rotation degree of gradient
    • is float value
    • you can set value from 0.0 to 360.0
  • giv_startColor
    • is start color of gradient
    • is color value
    • you can set value as #FFFFFF or @color/what_color
  • giv_endColor
    • is end color of gradient
    • is color value
    • you can set value as #FFFFFF or @color/what_color
  • giv_middleColor
    • is middle color of gradient
    • is color value
    • you can set value as #FFFFFF or @color/what_color
  • giv_startOffset
    • is offset of start color of gradient
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_middleOffset
    • is offset of middle color of gradient
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_endOffset
    • is offset of end color of gradient
    • is float value
    • you can set value from 0.0 to 1.0
  • giv_alpha
    • is alpha of the gradient
    • is float value
    • you can set value from 0.0 to 1.0

Examples

<kr.pe.burt.android.lib.androidgradientimageview.AndroidGradientImageView
        android:src="@mipmap/ic_launcher"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY"
        app:giv_x="0.0"
        app:giv_y="0.0"
        app:giv_rotate="45.0"
        app:giv_startColor="#8F00"
        app:giv_startOffset="0.3"
        app:giv_middleColor="#80F0"
        app:giv_middleOffset="0.6"
        app:giv_endColor="#800F"
        app:giv_endOffset="0.8"
        />

or you can set attributes just you need

<kr.pe.burt.android.lib.androidgradientimageview.AndroidGradientImageView
        android:src="@drawable/agassi"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY"
        app:giv_rotate="45.0"
        app:giv_startOffset="0.3"
        app:giv_endColor="#c000"
        app:giv_endOffset="0.6"
        />

MIT License

The MIT License (MIT)

Copyright (c) 2016 Sungcheol Kim, https://github.com/skyfe79/AndroidGradientImageView

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
ImageView with a tag on android
ImageView with a tag on android

SimpleTagImageView ImageView with a tag in android. So it's a ImageView. Demo ####Warning:When you set the round radius,the simpletagimageview scale t

Custom ImageView for moving image around the screen (Android)
Custom ImageView for moving image around the screen (Android)

MovingImageView Create a custom ImageView for moving image around the screen. Usage To use MovingImageView, add the module into your project and start

Crop and Rounded Corners added to an ImageView.
Crop and Rounded Corners added to an ImageView.

SuperImageView Extra features for your ImageView provided in a modularized way Documentation for v2 coming this week. CropImageView An ImageView that

Custom ImageView for android with polygon shape (Android)
Custom ImageView for android with polygon shape (Android)

PolygonImageView Create a custom ImageView with polygonal forms. Usage To use PolygonImageView, add the module into your project and start to build xm

BadgedImageview allow you show a badge into a Imageview.
BadgedImageview allow you show a badge into a Imageview.

BadgedImageview BadgedImageview allow you show a badge into a Imageview. I just extracted the widgets from Plaid app developed by Nick Butcher(https:/

Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. :dvd::notes:
Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. :dvd::notes:

Music Cover View A Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. It's used

Flickable ImageView for Android. It's like a view of twitter's detail image.
Flickable ImageView for Android. It's like a view of twitter's detail image.

FlickableView Flickable ImageView for Android. It's like a view of twitter's detail image. It's possible that other views animate with FlickableView.

Create parallax and any other transformation effects on scrolling android ImageView
Create parallax and any other transformation effects on scrolling android ImageView

Android Parallax Image View Creates effect such as vertical parallax, horizontal parallax etc. on android ImageView when it's being vertically or hori

Implementation of ImageView for Android that supports zooming, by various touch gestures.
Implementation of ImageView for Android that supports zooming, by various touch gestures.

PhotoView PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. [ Dependency Add this in your root build.grad

Comments
  • Change colour of gradient dynamically?

    Change colour of gradient dynamically?

    Through java, not xml. Something like gradientImageView.setGradientColor(); doesn't seem to be present.

    Great library though, saved me coding the functionality myself this morning. Cheers. 😄

    opened by Kraahkan 1
Owner
Sungcheol Kim
Sungcheol Kim
Implementation of ImageView for Android that supports zooming, by various touch gestures.

PhotoView PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. [ Dependency Add this in your root build.grad

Baseflow 18.4k Dec 30, 2022
A circular ImageView for Android

CircleImageView A fast circular ImageView perfect for profile images. This is based on RoundedImageView from Vince Mi which itself is based on techniq

Henning Dodenhof 13.8k Mar 29, 2021
Adds touch functionality to Android ImageView.

TouchImageView for Android Capabilities TouchImageView extends ImageView and supports all of ImageView’s functionality. In addition, TouchImageView ad

Michael Ortiz 2.4k Mar 28, 2021
Custom shaped android imageview components

Shape Image View Provides a set of custom shaped android imageview components, and a framework to define more shapes. Implements both shader and bitma

Siyamed SINIR 2.6k Mar 29, 2021
Android ImageView widget with zoom and pan capabilities

ImageViewTouch for Android ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView wi

Alessandro Crugnola 1.9k Jan 4, 2023
ImageView and FrameLayout with gestures control and position animation

GestureViews ImageView and FrameLayout with gestures control and position animation. Main goal of this library is to make images viewing process as sm

Alex Vasilkov 2.3k Dec 30, 2022
Implements pinch-zoom, rotate, pan as an ImageView for Android 2.1+

GestureImageView This is a simple Android View class which provides basic pinch and zoom capability for images. Can be used as a replacement for a sta

Jason 1.1k Nov 10, 2022
Android ImageView that handles animated GIF images

GifImageView Android ImageView that handles Animated GIF images Usage In your build.gradle file: dependencies { compile 'com.felipecsl:gifimageview:

Felipe Lima 1.1k Mar 9, 2021
Android ImageView that supports different radii on each corner.

SelectableRoundedImageView Note that this project is no longer maintained. Android ImageView that supports different radii on each corner. It also sup

Joonho Kim 1.1k Mar 17, 2021