android-shape-imageview alternatives and similar packages
Based on the "ImageView Widget" category.
Alternatively, view android-shape-imageview alternatives based on common mentions on social networks and blogs.
-
subsampling-scale-image-view
Highly configurable, easily extendable view with pan and zoom gestures for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc. -
android-crop
Android library project for cropping images -
TextDrawable
This light-weight library provides images with letter/text like the Gmail app. It extends the Drawable class thus can be used with existing/custom/network ImageView classes. Also included is a fluent interface for creating drawables and a customizable ColorGenerator. -
ImageViewZoom
Android ImageView widget with zoom and pan capabilities -
android-smart-image-view
Android ImageView replacement which allows image loading from URLs or contact address book, with caching -
gesture-imageview
This is a simple Android View class which provides basic pinch and zoom capability for images. -
CircularImageView
Custom view for circular images in Android while maintaining the best draw performance -
SelectableRoundedImageView
Android ImageView that supports different radiuses on each corner. It also supports oval(and circle) shape and border. This would be especially useful for using inside CardView which should be rounded only top left and top right corners(Don't forget to call setPreventCornerOverlap(false) on your cardview). -
SimpleTagImageView
ImageView with a tag in android. So it's a ImageView. -
DrawerArrowDrawable
Visual back-port of the rotating drawer-to-arrow drawable from Android L -
android-cropimage
CropImage Activity from Gallery.apk packaged as a reusable Android library (4.0 and up). -
CropImageView
Widget allows you crop from whatever side in an ImageView. Currently Android only supports centerCrop type of cropping -
BadgedImageview
BadgedImageview allow you show a badge into a Imageview. -
ByakuGallery
ByakuGallery is an open source Android library that allows the visualization of large images with gesture capabilities. This lib is based on AOSP Camera2. -
DexMovingImageView
DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope or time based moving. But you can create your own evaluator. -
Music Cover View
Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. -
Android Parallax Image View
Scroll parallax ImageView -
NoiseView
Android library written in kotlin that add noise effect to image. -
AvatarImageGenerator
Android first letter avatar generator for image placeholder library . Letter avatar like Gmail Android best practice
Get performance insights in less than 4 minutes.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of android-shape-imageview or a related project?
README
Shape Image View
Provides a set of custom shaped android imageview components, and a framework to define more shapes. Implements both shader and bitmap mask based image views.
- Shader based one uses canvas draw methods and Path class,
- Mask based one uses xfermode to draw image on bitmaps defined by android shape XML's or resource bitmaps.
There are many projects online implementing such components, however one goal of this project is to provide a performant/smooth scrolling image view component framework to define different shapes for imageviews.
For use with recycling view such as ListView or GridView please use shader based implementations.
How to use
Gradle dependency:
compile 'com.github.siyamed:android-shape-imageview:[email protected]'
Shader Based ImageView's
BubbleImageView
[Android Bubble ImageView](images/small-bubble.png)
<com.github.siyamed.shapeimageview.BubbleImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/neo"
app:siArrowPosition="right"
app:siSquare="true"/>
Attributes:
siTriangleHeight
the height of the bubble pointer in dpsiArrowPosition
where to point the arrow, currentlyleft|right
siSquare
set width and height to the minimum of the given valuestrue|false
RoundedImageView
[Android Rounded Rectangle ImageView](images/small-rounded.png)
<com.github.siyamed.shapeimageview.RoundedImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/neo"
app:siRadius="6dp"
app:siBorderWidth="6dp"
app:siBorderColor="@color/darkgray"
app:siSquare="true"/>
Attributes:
siBorderColor
border colorsiBorderWidth
border width in dpsiBorderAlpha
alpha value of the border between 0.0-1.0siRadius
corner radius in dpsiSquare
set width and height to the minimum of the given valuestrue|false
CircularImageView
[Android Circular ImageView](images/small-circle.png)
<com.github.siyamed.shapeimageview.CircularImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/neo"
app:siBorderWidth="6dp"
app:siBorderColor="@color/darkgray"/>
Attributes:
siBorderColor
border colorsiBorderWidth
border width in dpsiBorderAlpha
alpha value of the border between 0.0-1.0
ShapeImageView
This view has the capability to process a provided SVG file (for a limited set of SVG elements), build a Path object and draw it on the shader. The library includes SVG files defining a set of basic shapes and ShapeImageView subclasses using those files. You can use whatever SVG you want to have a wonderful and creatively shaped images in your application. The included SVG files are under [library/src/main/res/raw][svg_location]
DiamondImageView | PentagonImageView | HexagonImageView |
---|---|---|
[Android Diamond ImageView](images/small-diamond.png) | [Android Pentagon ImageView](images/small-pentagon.png) | [Android Hexagon ImageView](images/small-hexagon.png) |
OctogonImageView | StarImageView | HeartImageView |
---|---|---|
[Android Octogon ImageView](images/small-octogon.png) | [Android Start ImageView](images/small-star.png) | [Android Heart ImageView](images/small-heart.png) |
<com.github.siyamed.shapeimageview.{ClassName}
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:src="@drawable/neo"
app:siBorderWidth="8dp"
app:siBorderColor="@color/darkgray"/>
Attributes:
siBorderColor
border colorsiBorderWidth
border width in dpsiBorderAlpha
alpha value of the border between 0.0-1.0siStrokeCap
border stroke cap typebutt|round|square
siStrokeJoin
border stroke join typebevel|miter|round
siSquare
set width and height to the minimum of the given valuestrue|false
siShape
a reference to an SVG. This is used by ShapeImageView, not the subclasses of it.
SVG elements that are supported are: rectangle, circle, ellipse, polygon, path, group. Transformations on those elements are also supported.
The system converts an SVG file into a Path. For each element including the parent element <svg>
a new Path is created, and all the children Path's are added to their parent path.
Bitmap Mask Based ImageViews
This view uses extra bitmaps for bitmap masks. Therefore it would be good to use them for very custom shapes, possibly not in a recycling view.
- With [mask bitmap](sample/src/main/res/drawable/star.png):
[Android Star Shape ImageView ](images/small-mask-star.png)
<com.github.siyamed.shapeimageview.mask.PorterShapeImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:siShape="@drawable/star"
android:src="@drawable/neo"
app:siSquare="true"/>
- With [shape XML](sample/src/main/res/drawable/shape_rounded_rectangle.xml):
[Android Star Shape ImageView ](images/small-xmlshape-rounded.png)
<com.github.siyamed.shapeimageview.mask.PorterShapeImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:siShape="@drawable/shape_rounded_rectangle"
android:src="@drawable/neo"
app:siSquare="true"/>
rounded rectangle shape definition in XML:
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="18dp"
android:topRightRadius="18dp"
android:bottomLeftRadius="18dp"
android:bottomRightRadius="18dp" />
<solid android:color="@color/black" />
</shape>
Attributes:
siShape
the bitmap mask shape, either a shape drawable or a bitmapsiSquare
set width and height to the minimum of the given valuestrue|false
This method reads a shape file (either bitmap or an android shape xml), creates a bitmap object using this shape, and finally combines the bitmap of the real image to be shown and the mast bitmap using xfermode.
Sample
See/execute the [sample](sample) for a demonstration of the components.
If you are lazy check this youtube video demonstrating scrolling in the sample app
You can download the sample app from play store
Proguard
-dontwarn android.support.v7.**
-keep class android.support.v7.** { ; }
-keep interface android.support.v7.* { ; }
-keepattributes *Annotation,Signature
-dontwarn com.github.siyamed.**
-keep class com.github.siyamed.shapeimageview.**{ *; }
References
- MostafaGazar/CustomShapeImageView: Used this project a basis for bitmap masks
- geosolutions-it/mapsforge/svg-android: Used and modified to create a path from a svg file