• Stars
    star
    209
  • Rank 188,325 (Top 4 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 6 years ago

Reviews

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

Repository Details

Android library that allows perform manipulations with text and easily combine it with images.

DroidArt Awesome

Header image

Meet DroidArt by Cleveroad

We are happy to share our latest Android library with you - DroidArt. The Android app component shows the example of DroidArt library usage. It allows perform manipulations with text and easily combine it with images. If your app is about image editing, take a closer look at this customizable component.

Demo image

Here is how the DroidArt app component works. The first step is to select a background. Users can choose an image from the device’s gallery or take a photo right away. The next step is to type text over the image. Users can customize text by choosing font, changing size and color, adding shadow and blurring it.

However, the main feature of the library is the possibility to bend text along the Bézier curve. Therefore, it can fit any shape of your background image. After all the manipulations, user can save the result in the device’s gallery.

Try this simple and intuitive library for Android apps and bring new experience to your app users. If you need more details on how you can use the component and what benefits it provides, get in touch with us.

Awesome

Setup and usage

Installation

by gradle :

dependencies {
    implementation 'com.cleveroad.droidart:droidart:1.0.1'
}

Usage

DroidArt

  <com.cleveroad.droidart.EditorView
          android:id="@+id/evDroidArt"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:font_path="fonts/some_fonts.ttf"
          app:text="@string/some_text"
          app:text_color="@color/text_color"
          app:text_shadow_color="@color/text_shadow"
          app:text_size="25sp"/>
attribute name description
text Text value for displaying.
text_color Value of color for displaying text.
text_size Value for size of displaying text.
text_elevation_percent Elevation in percent. Shadow will be shown only if [textShadowColor] will be set.
text_shadow_color Color of the shadow of the text.
text_shadow_blur_radius Radius for shadow blur.
selector_color Value of color for the selector rectangle.
button_color Value of color for the control buttons.
font_id Id to the custom font for text. Note than if id will be incorrect, you will receive [RuntimeException].
icon_reset_button drag and drop mode. If enable, column or row will change its position with dragging after long press on row or column header.
icon_scale_button drag and drop mode. If enable, column or row will change its position with dragging after long press on row or column header.
icon_change_view_button drag and drop mode. If enable, column or row will change its position with dragging after long press on row or column header.
/**
* Text value for displaying
*/
var text: String

/**
 * Value of color for displaying text
 */
var textColor: Int

/**
 * Value for size of displaying text
 */
var textSize: Float

/**
 * Id to the custom font for text
 *
 * Note than if id will be incorrect, you will receive [RuntimeException]
 */
var fontId: Int

/**
 * Elevation in percent
 *
 * Shadow will be shown only if [textShadowColor] will be set
 */
var textElevationPercent: Int

/**
 * Color of the shadow of the text
 */
var textShadowColor: Int

/**
 * Radius for shadow blur
 */
var textShadowBlurRadius: Float

/**
 * Use the method to subscribe to receive a callback when a touch event occurs
 *
 * @param touchEventCallback  The interface for listener to the touch event
 */
fun subscribeTouchEventCallback(touchEventCallback: TouchEventCallback)

/**
 * Use the method to subscribe to receive a callback when a touch event occurs
 *
 * @param changeViewTextCallback  The interface for listener to the change view text mode
 */
fun subscribeChangeViewTextCallback(changeViewTextCallback: ChangeViewTextCallback)

/**
 * Use the method to cancel the subscription of receiving a callback
 * when a touch event occurs
 *
 * @param touchEventCallback  The interface for listener to the touch event
 */
fun unsubscribeTouchEventCallback(touchEventCallback: TouchEventCallback)

/**
 * Use the method to cancel the subscription of receiving a callback
 * when a change view text mode occurs
 *
 * @param changeViewTextCallback  The interface for listener to the change view text mode
 */
fun unsubscribeChangeViewTextCallback(changeViewTextCallback: ChangeViewTextCallback)

/**
 * Use the method to set [PathEffect] to the selector paint
 * @see PathEffect
 */
fun setPathEffectForSelector(effect: PathEffect)

/**
 * Use the method to set [Color] to the selector rectangle
 * @see Color
 */
fun setColorForSelector(@ColorInt intColor: Int)

/**
 * Use the method to set [Color] to the dash paint
 * @see Color
 */
fun setColorForDashLine(@ColorInt intColor: Int)

/**
 * Use the method to set [Color] to control buttons
 * @see Color
 */
fun setColorForSelectorButton(@ColorInt intColor: Int)

/**
 * Use the method to set [Color] to shadow
 * @see Color
 */
fun setColorForTextShadow(@ColorInt intColor: Int)

/**
 * Use the method to set the width for stroking
 *
 * @param width set the paint's stroke width, used whenever the paint's
 *              style is Stroke or StrokeAndFill.
 */
fun setStrokeWidthForSelector(width: Float)

/**
 * Use the method to set the width for stroking
 *
 * @param width set the paint's stroke width, used whenever the paint's
 *              style is Stroke or StrokeAndFill.
 */
fun setStrokeWidthForDashLine(width: Float)

/**
 * Use the method to set the icon for the change view button
 *
 * @param resId  The resource id for the button icon
 */
fun setBitmapChangeViewTextButton(@DrawableRes resId: Int)

/**
 * Use the method to set the icon for the scale button
 *
 * @param resId  The resource id for the button icon
 */
fun setBitmapScaleButton(@DrawableRes resId: Int)

/**
 * Use the method to set the icon for the reset button
 *
 * @param resId  The resource id for the button icon
 */
fun setBitmapResetChangeViewTextButton(@DrawableRes resId: Int)

/**
 * Use the method to obtain current [ChangeText] mod
 */
fun getChangeViewTextMode()

/**
 * Use the method for set the [ShowButtonOnSelector] mode for the button
 *
 * @param showButtonOnSelector  The enum for show a button on the selector
 */
fun showScaleRotateButton(showButtonOnSelector: ShowButtonOnSelector)

/**
 * Use the method for set the [ShowButtonOnSelector] mode for the button
 *
 * @param showButtonOnSelector  The enum for show a button on the selector
 */
fun showChangeViewTextButton(showButtonOnSelector: ShowButtonOnSelector)

/**
 * Use the method for set the [ShowButtonOnSelector] mode for the button
 *
 * @param showButtonOnSelector  The enum for show a button on the selector
 */
fun showResetViewTextButton(showButtonOnSelector: ShowButtonOnSelector)

/**
 * Use the method for set the [ChangeText] mode for text
 *
 * @param changeText  The enum with different types of actions for interacting with text
 */
fun changeViewTextMode(changeText: ChangeText)

/**
 * Use the method for set the initial value for the Bezier curve
 */
fun resetViewText()

/**
 * Use the method to draw the text in the bitmap
 *@see Bitmap
 *
 * @param bitmap  The bitmap that will be drawn below the text
 */
fun saveResult(bitmap: Bitmap): Bitmap

/**
 * Use the method to move text to the center of the screen
 */
fun moveTextToCenter()

Fragment/Activity usage

private const val DASH_PATH_ON_DISTANCE = 30F
private const val DASH_PATH_OFF_DISTANCE = 10F
private const val DASH_PATH_PHASE = 0F
private const val STROKE_WIDTH_FOR_DASH_LINE = 4F
...
evDroidArt = (EditorView) view.findViewById(R.id.evDroidArt)

evDroidArt?.apply {
    setPathEffectForSelector(
                DashPathEffect(floatArrayOf(DASH_PATH_ON_DISTANCE, DASH_PATH_OFF_DISTANCE),
                DASH_PATH_PHASE))
    setStrokeWidthForDashLine(STROKE_WIDTH_FOR_DASH_LINE)
    setColorForTextShadow(Color.GRAY)
    setColorForSelectorButton(Color.WHITE)
    setColorForDashLine(Color.WHITE)
    showScaleRotateButton(ShowButtonOnSelector.HIDE_BUTTON)
    showResetViewTextButton(ShowButtonOnSelector.HIDE_BUTTON)
    subscribeTouchEventCallback(touchEventCallback)
}

XML usage

   <com.cleveroad.droidart.EditorView
           android:id="@+id/evDroidArt"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           app:font_path="fonts/some_fonts.ttf"
           app:text="@string/some_text"
           app:text_color="@color/text_color"
           app:text_shadow_color="@color/text_shadow"
           app:text_size="25sp"/>

Changelog

See changelog history.

Support

If you have any questions, issues or propositions, please create a new issue in this repository.

If you want to hire us, send an email to [email protected] or fill the form on contact page

Follow us:

Awesome Awesome Awesome Awesome Awesome

License


The MIT License (MIT)

Copyright (c) 2016 Cleveroad Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

SlidingTutorial-Android

Android Library for making animated tutorials inside your app
Java
2,486
star
2

FanLayoutManager

Using Fan Layout Manager you can implement the horizontal list, the items of which move like fan blades
Java
2,056
star
3

AdaptiveTableLayout

Library that makes it possible to read, edit and write CSV files
Java
1,902
star
4

WaveInApp

Live Audio Equalizer with wave effect
Java
1,785
star
5

MusicBobber

Awesome Audio Widget for any Android Music App
Java
881
star
6

LoopBar

Tap Bar with infinite scrolling. Make the navigation menu right at fingerprints, in a tab bar.
Java
741
star
7

CRNetworkButton

Send Button for iOS
Swift
654
star
8

FireworkyPullToRefresh

Let's try to refresh your data with our library!
Java
641
star
9

BubbleAnimationLayout

You don’t want your apps look and feel boring, do you? Add some bubbles!
Java
577
star
10

CycleMenu

Custom LayoutManager for the inner RecyclerView
Java
575
star
11

CRPageViewController

While a standard page view allows you to navigate between pages by using simple gestures, our component goes further
Objective-C
394
star
12

PlayWidget

Break the monotony and make your music player unique!
Java
366
star
13

Bitutorial

Crumbling tutorial for Android Apps
Java
357
star
14

CRParticleEffect

A CocoaPod that simplifies creation of the particle effects.
Objective-C
348
star
15

Android-Marshmallow-Boot-Animation

Java
244
star
16

BlurTutorial

Library for creating blur effects under Android UI elements
Kotlin
155
star
17

flutter_sliding_tutorial

User onboarding library with smooth animation of objects and background colors
Dart
127
star
18

CRRulerControl

Customizable component, created by Cleveroad iOS developers, is aimed at turning a simple ruler into a handy and smart instrument
Objective-C
112
star
19

ARFaceDetection

AR-based library for Android which is capable of detecting faces and overlaying images above the user’s head
Kotlin
52
star
20

slidingtutorial-ios

iOS Library for making animated tutorials inside your app
Objective-C
49
star
21

Bootstrap

This set of libraries is designed to help developers accomplish various tasks easier and faster
Kotlin
40
star
22

cr_calendar

Highly customizable, feature-packed calendar widget for Flutter.
Dart
31
star
23

CRRollingLabel

Objective-C
30
star
24

CRCellCollectionView

With this component, pictures in your apps collection view will look like honeycomb instead of the boring standard variant
Objective-C
28
star
25

ColorDetection

ColorDetection is an app built with OpenCV and using computer vision at its core. It’s able to detect and change colors of objects using a camera of iOS devices.
Objective-C++
22
star
26

cr_logger

Dart
15
star
27

cr_file_saver

Kotlin
3
star
28

CRRefreshControl

2
star
29

cr_json_widget

Dart
2
star
30

CRPlotView

1
star
31

CRPinCodeControl

1
star
32

cr_mentions

Dart
1
star