All Projects → florent37 → Kanvas

florent37 / Kanvas

Licence: apache-2.0
Make canvas easier to use in Kotlin 😊

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Kanvas

Shapeofview
Give a custom shape to any android view, Material Design 2 ready
Stars: ✭ 2,977 (+3101.08%)
Mutual labels:  xml, material, view
Materialtimelineview
With MaterialTimelineView you can easily create a material looking timeline.
Stars: ✭ 443 (+376.34%)
Mutual labels:  material, view
Materialimageloading
Material image loading implementation
Stars: ✭ 396 (+325.81%)
Mutual labels:  material, view
Textfieldboxes
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.
Stars: ✭ 760 (+717.2%)
Mutual labels:  xml, material
MultiStateToggleButton
Android's ToggleButton offers only two states, MultiStateToggleButton fixes this by offering as many states depending on the number of drawable resources passed in.
Stars: ✭ 20 (-78.49%)
Mutual labels:  view, xml
FigmaConvertXib
FigmaConvertXib is a tool for exporting design elements from figma.com and generating files to a projects iOS .xib / Android .xml
Stars: ✭ 111 (+19.35%)
Mutual labels:  view, xml
Chips Input Layout
A customizable Android ViewGroup for displaying Chips (specified in the Material Design Guide).
Stars: ✭ 591 (+535.48%)
Mutual labels:  material, view
Arclayout
With Arc Layout explore new styles and approaches on material design
Stars: ✭ 1,662 (+1687.1%)
Mutual labels:  material, view
Mylittlecanvas
🎨Need to create a custom view ? You don't know how to use Canvas, use MyLittleCanvas instead !
Stars: ✭ 870 (+835.48%)
Mutual labels:  view, canvas
Readablebottombar
Yet another material bottom bar library for Android
Stars: ✭ 977 (+950.54%)
Mutual labels:  material, view
Viewtooltip
A fluent tooltip for Android
Stars: ✭ 1,029 (+1006.45%)
Mutual labels:  material, view
Smartopencv
🔥 🔥 🔥 SmartOpenCV是一个OpenCV在Android端的增强库,解决了OpenCV Android SDK在图像预览方面存在的诸多问题,且无需修改OpenCV SDK源码,与OpenCV的SDK解耦
Stars: ✭ 1,869 (+1909.68%)
Mutual labels:  sdk, canvas
Materialsearchbar
Material Design Search Bar for Android
Stars: ✭ 2,008 (+2059.14%)
Mutual labels:  material, view
Fiftyshadesof
An elegant context-care loading placeholder for Android
Stars: ✭ 1,110 (+1093.55%)
Mutual labels:  material, view
Expansionpanel
Android - Expansion panels contain creation flows and allow lightweight editing of an element.
Stars: ✭ 1,984 (+2033.33%)
Mutual labels:  material, view
Kotlinpleaseanimate
Kotlin, please, can you animate my views ?
Stars: ✭ 541 (+481.72%)
Mutual labels:  material, view
Ringprogressbar
A material design circle the progress bar.
Stars: ✭ 789 (+748.39%)
Mutual labels:  material, view
Android Toy
不积跬步 无以至千里
Stars: ✭ 54 (-41.94%)
Mutual labels:  view, canvas
Animated Stars Android
Draw animated stars on Android view canvas - written in Kotlin
Stars: ✭ 85 (-8.6%)
Mutual labels:  view, canvas
Cpm8266
Z80-CP/M2.2 emulation on ESP8266 NONOS SDK + the NoSDK from cnlohr
Stars: ✭ 91 (-2.15%)
Mutual labels:  sdk

Kanvas

WORK IN PROGRESS

Make canvas easier to use in Kotlin 😊

✨ Use shapes & write less code to do more magic ✨

arc

//create your shapes
val background = rectShape { view ->
   color = Color.parseColor("#6fbf73")
   cornerRadius = 16.dpToPx(context)

   left = 100f
   width = view.width / 2f
   top = 100f
   height = view.height / 3f
}

//create an animator
val canvasAnimator = obtainCanvasAnimator()
fun animate(){
    canvasAnimator
            .play(background.animate().right.to(this.width.toFloat()))
            .start()
}

//draw them
override fun onDraw(canvas: Canvas) {
    super.onDraw(canvas)
    canvas.draw(background)
}

Examples

arc dots slider tree

Available shapes

Shapes link
Rect
Circle
Text
Arc
Line
Triangle
Drawable
Path

Animation

Follow the example of SwitchView

Shape animations are executed by an instance of ShapeAnimator attached to your view

val canvasAnimator = CanvasAnimator(this)

All animated methods of shapes are wrapped into the method .animate()

For example, for a CircleShape, you can animate his position (centerX) using

myCircleShape.animate().centerX.to(15);

Then use your ShapeAnimator to execute this animation

shapeAnimator.play(myCircleShape.animate().centerX.to(15);)
    .setDuration(500)
    .start()

Added support methods to Canvas

drawArc(centerX, centerY, circleRadius, startAngle, sweepAngle, paint)

drawArc(center: PointF, circleRadius, startAngle, sweepAngle, paint)

drawArc(left, top, right, bottom, startAngle, sweepAngle, useCenter, paint)

drawOval(left, top, right, bottom, startAngle, sweepAngle, useCenter, paint)

drawLine(start: PointF, end: PointF, paint)

drawRoundRect(left, top, right, bottom, rx, ry, paint)

Added support methods to Path

addRoundRect(left, top, right, bottom, rx, ry, dir: Path.Direction)

addRoundRect(left, top, right, bottom, radiiArray, dir: Path.Direction)

arcTo(centerX, centerY, circleRadius, startAngle, sweepAngle, forceMoveTo)

arcTo(center: PointF, circleRadius, startAngle, sweepAngle, forceMoveTo)

arcTo(left, top, right, bottom, startAngle, sweepAngle, forceMoveTo)

Fiches Plateau Moto : https://www.fiches-plateau-moto.fr/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].