Giter Site home page Giter Site logo

ryanfu / whatsappformatter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sharish/whatsappformatter

0.0 1.0 0.0 375 KB

Simple formatting options for TextView and EditText in the same way Whatsapp provides.

License: Apache License 2.0

Java 100.00%

whatsappformatter's Introduction

WhatsappFormatter

Intro

WhatsappFormatter repo helps to perform formatting just like whatsapp does it on its EditText and TextView. The repo provides custom view such as

  • WhatsappTextView - a TextView that can be used for chat head and the formatting takes place by default.
  • WhatsappEditText - a EditText that can be used for compose box that shows the live formatting as and when we type.

Also provides one liner compatablity for your existing EditText / TextViews.

Demo

Usage

Simple One liner Compatablity

ViewCompat for EditText
EditText editText; // your version of EditText object.
WhatsappViewCompat.applyFormatting(editText);

If you had text change listeners, use it this way to prevent multiple TextWatcher callbacks.

EditText editText; // your version of EditText object.
TextWatcher watcher1, watcher2, watcher3, watcher_n; // your watcher objects.
WhatsappViewCompat.applyFormatting(editText, watcher1, watcher2, watcher3, watcher_n);
ViewCompat for TextView
TextView textView; // your version of TextView object.
WhatsappViewCompat.applyFormatting(textView);

CustomViews

WhatsAppTextView

<com.cooltechworks.views.WhatsAppTextView
                android:id="@+id/whatsapp_edit_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@android:color/black"
                android:textSize="16sp" />

WhatsAppEditText

<com.cooltechworks.views.WhatsAppEditText
                android:id="@+id/whatsapp_edit_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Your Message"
                android:minHeight="48dp"
                android:textColor="@android:color/black"
                android:textSize="16sp" />

Adding to your project

  • Add the following configuration in your build.gradle file.
repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.cooltechworks:WhatsappFormatter:v1.0'
}

Developed By

License

Copyright 2016 Harish Sridharan

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.

whatsappformatter's People

Contributors

sharish avatar

Watchers

 avatar

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.