Giter VIP home page Giter VIP logo

roundedimageview's Introduction

RoundedImageView

Download Min API License

A RoundedImageView library that supports rounding any corner or circular shape. RoundedImageView is extended from AppCompatImageView.

What Works?

  • It supports all kinds of drawable, bitmaps, resources just like a normal ImageView.
  • Glide Works fine in my case, other libraries should also work fine.
  • All scale types are working
  • AdjustViewBounds also works
  • Shadows work (only if reverseMask="false").

Limitations

  • Android Studio does not display rounded corner in Layout Preview
  • It is not the fastest library out there.
  • Borders are not supported at the moment. Pull requests are welcomed.
  • Oval shape is not supported.

Gradle

implementation 'com.rishabhharit.roundedimageview:RoundedImageView:0.8.4'

How to use

 <com.rishabhharit.roundedimageview.RoundedImageView
    ...
    app:cornerRadius="8dp"
    app:roundedCorners="topRight|bottomLeft"
    ...
 /> 

Circular Shape

To get Circular shape, all you need to do is set cornerRadius to a value that is higher than the width & height of your RoundedImageView app:cornerRadius="1000dp"

Customizations

app:roundedCorners is pretty flexible. It supports all the following variations

app:roundedCorners="all|top|bottom|right|topLeft|topRight|bottomLeft|bottomRight" (yes you can use multiple at the same time here separated by | )

app:reverseMask="true/false" This attribute can be used to achieve transparency inside the shape instead of outside the given shape. Padding area is also a part of outside region in this case.

Note: Shadows don;t work when reverseMask is true.

Default is value for app:roundedCorners is all

Default is value for app:cornerRadius is 0dp

Default is value for app:reverseMask is false

Medium LinkedIn

roundedimageview's People

Contributors

rishabh876 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.