GithubHelp home page GithubHelp logo

agilie / rotatableautofitedittext Goto Github PK

View Code? Open in Web Editor NEW
54.0 12.0 6.0 219 KB

Extended EditText which allows to move, rotate and resize text at the same time

Home Page: https://agilie.com

License: MIT License

Java 100.00%
edittext rotate autofit kotlin-android customview

rotatableautofitedittext's Introduction

RotatableAutofitEditText

Download

Screenshot1

What is RotatableAutofitEditText?

RotatableAutofitEditText is a lightweight open-source library that allows user to move, rotate, and resize text field at the same time. If you need such functionality in your project, we're happy to save some time for you so you can drink more beer with your friends :)

Usage

Gradle

Add dependency in your build.gradle file:

compile 'com.agilie:rotatable-autofit-edittext:1.2'

Maven

Add rependency in your .pom file:

<dependency>
  <groupId>com.agilie</groupId>
  <artifactId>rotatable-autofit-edittext</artifactId>
  <version>1.2</version>
  <type>pom</type>
</dependency>

How to use

Simply use RotatableAutofitEditText instead of familiar to all Android devs EditText component programmatically or in your xml files:

<com.agilie.RotatableAutofitEditText 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:autofit="http://schemas.android.com/apk/res-auto"
    android:id="@+id/autoResizeEditText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/rounded_corners_white_transparent_50"
    android:gravity="center"
    android:hint="@string/hint_add_some_text"
    android:padding="16dp"
    android:textColor="@android:color/white"
    android:textColorHint="@android:color/darker_gray"
    autofit:clipBounds="true"
    autofit:maxTextSize="@dimen/autoresize_max_text_size"
    autofit:minTextSize="@dimen/autoresize_min_text_size"
    autofit:minWidth="@dimen/autoresize_min_width"
    autofit:movable="true"
    autofit:resizable="true"
    autofit:rotatable="true" />

Here's a list of available properties, feel free to customize them according to your wishes and requirements:

    maxTextSize     // sets maximum text size
    minTextSize     // sets minimum text size 
    minWidth        // sets minimum EditText width
    movable         // true if EditText must move in parent view
    resizable       // true if EditText can be resized with pinch
    rotatable       // true if EditText can be rotated
    clipBounds      // true if EditText must not move out of parent view bounds

Library also supports usage of different Typefaces as well.

Also you can clone this project and compile sample module to test our library in action.

Requirements

Android 3.0+ (API level 11+)

Troubleshooting

Problems? Check the Issues block to find the solution or create an new issue that we will fix asap.

Author

This library is open-sourced by Agilie Team [email protected]

Contributors

Contact us

If you have any questions, suggestions or just need a help with web or mobile development, please email us at
[email protected]
You can ask us anything from basic to complex questions.
We will continue publishing new open-source projects. Stay with us, more updates will follow!

License

The MIT License (MIT) Copyright © 2017 Agilie Team

rotatableautofitedittext's People

Contributors

akotsuba avatar anonymous265 avatar romankapshuk avatar ukevgen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rotatableautofitedittext's Issues

Cursor not visible

When edit a text then the cursor not visible at a time and when open softkeyboard the design cannot reisze

Multi lines

i cant make this edit text has multilines.

zoom in ,out not working with font style

zoom in ,out not working with font style

for example editText.setTypeface(Utility.GetBLACKJAR(getApplicationContext()));

if i settext to edittext with styled font zoom in and out wont work ,zoom in and out only works with normal font style

Stop movement

How to enable/disable drag and drop for movement?

Delete textview

how to delete particular textview from multiple textview ?

Wrong offset calculation

If you add a new RotatableAutofitEditText into layout with the Gravity.CENTER movement will be limited.

Example:

val layoutParams = FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
layoutParams.gravity = Gravity.CENTER
val newEditText = LayoutInflater.from(requireContext()).inflate(R.layout.item_raet, textContainer, false) as RotatableAutofitEditText
textContainer.addView(newEditText, layoutParams)

Auto resizing to the "maxTextSize" on tap of RotatableAutofitEditText

I gave "minTextSize" as 16sp. when i tap on "RotatableAutofitEditText" to Move/ Resize/ Rotate, the size is increasing for ever tap action. At that instance of time, i'm unable to perform Move/ Resize/ Rotate action.
Once it reacher "maxTextSize" it is not allowing to Resize[ Move & Rotate working ].

I have given the inputs to "RotatableAutofitEditText" with
setText, setTextColor, setTypeface, setLetterSpacing, setTextAlignment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.