• Stars
    star
    332
  • Rank 126,957 (Top 3 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android Rounded, Circle, Path ImageView

ShapedImageView

Android CI

  • Support circle & round rect shaped
  • Support stroke
  • Support TransitionDrawable
  • New Support custom PathExtension

Screenshots

Demo Preview PathExtension Preview

Usage

dependencies

Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'cn.gavinliu:ShapedImageView:0.8.7'
}

Circle

<cn.gavinliu.android.lib.shapedimageview.ShapedImageView
    ...
    app:shape_mode="circle"

    app:stroke_color="#009688"
    app:stroke_width="3dp" />

Round Rect

<cn.gavinliu.android.lib.shapedimageview.ShapedImageView
    ...
    app:shape_mode="round_rect"
    app:round_radius="20dp"

    app:stroke_color="#009688"
    app:stroke_width="3dp" />

PathExtension

image1.setExtension(new CDPathExtension());

class CDPathExtension implements ShapedImageView.PathExtension {

    @Override
    public void onLayout(Path path, int width, int height) {
        path.reset();
        path.addCircle(width / 2, height / 2, width / 8, Path.Direction.CW);
    }
}

Programmatically

public void setShape(int shapeMode, float radius);

public void setShapeMode(int shapeMode); // SHAPE_MODE_ROUND_RECT | SHAPE_MODE_CIRCLE

public void setShapeRadius(float radius);

public void setStroke(int strokeColor, float strokeWidth);

public void setStrokeColor(int strokeColor);

public void setStrokeWidth(float strokeWidth);

TODO

  • Support Any Shape (SVG to PathShape)

License

The MIT License

Copyright (c) 2016-present, GavinLiu

More Repositories

1

NotificationBox

This is a tool app that solve too much notifications on android device
Java
197
star
2

SimpleOneStep

The SimpleOneStep is like OneStep about Smartisan OS 3.
Java
192
star
3

Android-ScaleLayout

[Deprecated] A Simple & Convenience MultiScreen-Support-Library for Android
Java
159
star
4

SimilarPhoto

Perceptual Hash Algorithm on Android
Java
102
star
5

Android-AbsListView-Drag-And-Drop

A complex ListView & GridView with Drag and Drop functionality
Java
44
star
6

Android-Pc-Socket-Connection

Android <---> PC , ADB Socket Connection Demo
Java
39
star
7

OpenGpad

Virtual Gamepad: Using the computer keyboard to play AndroidPhone Games
38
star
8

BeautifulOfBezier

Android Demo
Java
25
star
9

BeautifulOfRoundedBitmap

Android Demo
Java
20
star
10

OpenGpad-Android

Virtual Gamepad - Android Client
Java
11
star
11

SlidingFilterPanel

一个筛选功能的弹出框实现
Java
10
star
12

FloatingWindow

Easy to use floating window library in Android, just like fragment. Can help you build large floating window applications
Kotlin
10
star
13

BeautifulOfSin

Android Demo
Java
9
star
14

CustomQuickSettingTile

Android Demo
Java
7
star
15

glide-stackblur

Stackblur for glide
C
6
star
16

TransparentSystemBar

Android 4.4+ Transparent API
Java
5
star
17

AndroidStudio-ColorTheme-SublimeText2

Code color theme for AndroidStudio by Sublime Text 2
4
star
18

EatOreo

Android Oreo new api samples
Java
2
star
19

EventCast

EventCast for Android
Java
1
star
20

Android-Demos

Android Demo
Java
1
star
21

PDF.js4Android

PDF.js for Android
JavaScript
1
star
22

Cipher.File

This is encrypt & decrypt file tools based by AES
C
1
star
23

SpiderCover

xiami.com album cover spider base on scrapy
Python
1
star
24

Android-Drawables

BlurDrawale, CircleDrawale ...
C
1
star
25

termux-install-scripts

One key install scripts for termux
Shell
1
star
26

gavinliu.github.io

This is website source code for my blog.
HTML
1
star
27

Capsule

闪念胶囊
Java
1
star
28

A-tour-of-modern-Android-app-development

Shell
1
star
29

DropsPagerIndicator

Java
1
star