Documente Academic
Documente Profesional
Documente Cultură
Gradle dependency:
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
<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:
####RoundedImageView
<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:
####CircularImageView
<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:
####ShapeImageView This view has the capability to process a provided SVG file (for a
limited set of SVG elements), build aPath 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
DiamondImageView PentagonImageView Hexago
<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:
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.
<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"/>
<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:
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 for a demonstration of the components.
If you are lazy check this youtube video demonstrating scrolling in the sample app
<pl.pawelkleczkowski.customgauge.CustomGauge
android:id="@+id/gauge2"
android:layout_width="140dp"
android:layout_height="140dp"
android:layout_below="@+id/gauge1"
android:layout_centerHorizontal="true"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
gauge:endValue="800"
gauge:pointEndColor="@color/DarkBlue"
gauge:pointStartColor="@color/LightSkyBlue"
gauge:startAngel="135"
gauge:startValue="200"
gauge:strokeCap="ROUND"
gauge:strokeColor="@color/Gray"
gauge:strokeWidth="10dp"
gauge:sweepAngel="270" />
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-
plugin:1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong // in the individual module
build.gradle files }
}