Skip to content

A simple imageview which allows you to create diagonal cut views easily

License

Notifications You must be signed in to change notification settings

naseemakhtar994/diagonal-imageview

 
 

Repository files navigation

Diagonal ImageView

Android Arsenal

A simple imageview which allows you to create diagonal cut views easily

Samples

Usage

Gradle

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  compile 'com.github.santalu:diagonal-imageview:1.0'
}

XML

<com.santalu.diagonalimageview.DiagonalImageView
    android:id="@+id/image"
    android:layout_width="120dp"
    android:layout_height="120dp"
    android:scaleType="centerCrop"
    android:src="@drawable/demo"
    app:di_borderColor="#FF5722"
    app:di_borderEnabled="false"
    app:di_direction="bottom"
    app:di_overlap="56dp"
    app:di_position="right"/>

Attributes

Name Description Value
di_position position of clip path top, right, bottom, left
di_direction direction of clip path top, right, bottom, left
di_overlap size of clip path dimen
di_borderSize size of border dimen
di_borderColor color of border color
di_borderEnabled visibility of border true, false

Position & Direction Relation

Position Description
TOP LEFT / RIGHT
BOTTOM LEFT / RIGHT
LEFT TOP / BOTTOM
RIGHT TOP / BOTTOM

Notes

  • Set position NONE to disable masking

License

Copyright 2017 Fatih Santalu

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.

About

A simple imageview which allows you to create diagonal cut views easily

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%