A drawing view for your android application.

Related tags

UI/UX AndroidDraw
Overview

Android Draw Android Arsenal

A drawing view for your android application

Download

For information : checkout Sample App Code in repository.

Get it on Google Play

Dependency

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

	dependencies {
	        implementation 'com.github.divyanshub024:AndroidDraw:v0.1'
	}
  

Usage

There are two ways to use this library.

1. Use Activity

You can call the Drawing Activity using startActivityForResult which will return you bitmap in byteArray. By using this method you will have all the features like change strokeWidth, change strokeColor, change Alpha, erase, redo, undo.

val intent = Intent(this, DrawingActivity::class.java)
startActivityForResult(intent, REQUEST_CODE_DRAW)

// Get bitmap in onActivityResult
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        if (data != null && resultCode == Activity.RESULT_OK) {
            when(requestCode){
                REQUEST_CODE_DRAW -> {
                    val result= data.getByteArrayExtra("bitmap")
                    val bitmap = BitmapFactory.decodeByteArray(result, 0, result.size)
                    saveImage(bitmap)
                }
            }
        }
    }

2.Use DrawView

Declaration

<com.divyanshu.draw.widget.DrawView
        android:id="@+id/draw_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
  • To clear canvas
draw_view.clearCanvas()
  • To set stroke width
// takes input as Float
draw_view.setStrokeWidth(strokeWidth)
  • To set stroke alpha
// takes input as Int
draw_view.setAlpha(progress)
  • To set stroke color
draw_view.setColor(color)
  • To undo
draw_view.undo()
  • To redo
draw_view.redo()

Contributor

Thanks Arslan Şahin for this amazing logo.

Connect

LICENCE

Copyright 2018 Divyanshu Bhargava

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Add defaults to the constructor to allow creating the view from code

    Add defaults to the constructor to allow creating the view from code

    This PR adds support for the other types of constructor which allows the view to be used from code, rather than just from XML layouts.

    This is tested as working from both Kotlin and Java.

    opened by matt-oakes 1
  • Icon color selector

    Icon color selector

    Hi @divyanshub024,

    May I propose the following changes?

    1. A color indicator, to indicate whether current drawing eraser mode is on or off.
    2. A color indicator, to indicate whether an icon is currently being pressed.

    The effect looks like following

    Eraser is off

    earse-off

    Eraser is on

    earse-on

    When icon is pressed

    x

    Thank you very much!

    Regards, Cheok

    opened by yccheok 1
  • Optimize the multi-finger painting experience

    Optimize the multi-finger painting experience

    Hi, @divyanshub024:

    Thank you very much for your AndroidDraw library! I optimized the painting experience with multiple fingers. Example:

    Before optimization: preview2

    Optimized: preview

    opened by Airsaid 0
  • Save draw and edit again later

    Save draw and edit again later

    Is it possible to save the draw to use it later?

    I'm trying to use like this:

    • Draw something;
    • Skip screen and draw something else;
    • Go back to the first one e edit it.

    Save as PNG is not the solution because I won't be able to edit.

    opened by rodtaborda 0
  • Draw on server URL's image view not working

    Draw on server URL's image view not working

    Hello Divyanshu,

    I'm want to draw on the server URL's image view but not working, can you please help me how is possible to draw on the server URL's image view

    opened by Dhaval3344 0
  • [Questions] Background, images, and sizing

    [Questions] Background, images, and sizing

    As for the background, is it purely just white? Or can you export with a transparent background?

    Additionally, is there a way to import images to draw on them?

    Lastly, using images or not, are you able to crop down to smaller sizes?

    opened by TheAlienDrew 0
  • Using in NativeScript

    Using in NativeScript

    Dear Author!

    This view looks fantastic. I would like to use it in NativeScript but there I can't use XML to instantiate this View. I tried to instantiate it from code, but it says that the Attributes constructor parameter is mandatory and can't be null. Can you please help me out?

    opened by stemyke 1
Releases(v0.1)
Owner
Divyanshu Bhargava
Remote Flutter developer | Public Speaker 🎙️| Open source enthusiast | Blogger 📝| Exploring new Tech. 🇮🇳
Divyanshu Bhargava
A drawing view for your android application.

Android Draw A drawing view for your android application Download For information : checkout Sample App Code in repository. Dependency Step 1. Add the

Divyanshu Bhargava 409 Dec 30, 2022
TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.

This project isn't maintained anymore. It is now recommended to use https://github.com/peterLaurence/MapView. MapView is maintained by Peter, one of o

Mike Dunn 1.5k Dec 29, 2022
Animated SVG Drawing for Android

AnimatedSvgView Animated SVG Drawing for Android Usage Get SVG path data and add it to a string array: <string-array name="google_glyph_strings"> <i

Jared Rummler 2k Dec 12, 2022
Android View for displaying and selecting values in a circle-shaped View, with animations and touch gestures.

CircleDisplay Android View for displaying and selecting (by touch) values / percentages in a circle-shaped View, with animations. Features Core featur

Philipp Jahoda 287 Nov 18, 2022
FloatingView can make the target view floating above the anchor view with cool animation

FloatingView FloatingView can make the target view floating above the anchor view with cool animation Links 中文版 README Blog about FloatingView demo.ap

UFreedom 1.8k Dec 27, 2022
用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View.

PathAnimView 用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View. 现已经找到图片->SVG->PATH的正确姿势, Now i have a pic.I have a view. Oh~,Path(A

张旭童 1.1k Oct 28, 2022
Expand your view with no problem ;)

MaryPopup Expand your view with no problem ;) Usage Open marypopup from a view MaryPopup marypopup = MaryPopup.with(context) .

Meetic 925 Nov 29, 2022
A simple library to let you sign (or draw lines) smoothly with your finger into a view and save it.

FingerSignView Introduction FingerSignView is a simple library that lets you finger, or draw lines, smoothly with your finger into a View and save it

Agnaldo Pereira 25 Nov 20, 2022
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

FancyToast-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ... ma

Shashank Singhal 1.2k Dec 26, 2022
Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.

FancyAlertDialog-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ..

Shashank Singhal 350 Dec 9, 2022
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

Umano: News Read To You 9.4k Dec 31, 2022
A simple library to add Emoji support to your Android Application

Emoji A library to add Emoji support to your Android app. Emojis can be picked in a PopupWindow. In order to edit and display text with Emojis this li

Niklas Baudy 1.4k Jan 4, 2023
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+)

RippleView View that imitates Ripple Effect on click which was introduced in Android L. Usage For a working implementation, Have a look at the Sample

Muthuramakrishnan Viswanathan 1.2k Dec 30, 2022
Snake View is a simple and animated linear chart for Android.

Snake View Snake library is a simple and animation line chart for Android. Latest Version How to use Configuring your project dependencies Add the lib

Txus Ballesteros 339 Dec 14, 2022
[] A simple way to "badge" any given Android view at runtime without having to cater for it in layout

Android ViewBadger A simple way to "badge" any given Android view at runtime without having to cater for it in layout. Note: If your aim is to replica

Jeff Gilfelt 3k Nov 28, 2022
Android view with both path from constructed path or from svg.

android-pathview You want to animate svg or normal Paths?<br> Change the color, pathWidth or add svg.<br> Animate the "procentage" property to make th

Georgi Eftimov 2.9k Dec 27, 2022
A horizontal view scroller library for Android

View Flow for Android ViewFlow is an Android UI widget providing a horizontally scrollable ViewGroup with items populated from an Adapter. Scroll down

Patrik Åkerfeldt 1.8k Dec 29, 2022