Giter VIP home page Giter VIP logo

htageditor's Introduction

A Tag Editor with A Smooth Switching Scheme for Keyboard and Panel in Android

中文文档


This Repository is to solve the flashing problem when switching the keyboard and the customized panel. In addition, an editor that handles the keyword tag is provided.

Including three main functions:

  1. Eliminating the screen frashing when the customized panel and the keyboard switch between each other. The layout of a control bar above the soft keyboard is not affected in the same time.
  2. Hidding the keyboard and the panel by touching outside the EditText.
  3. Adding a new function to EditText -- the ability to handle the tags, including automatically highlight, adding by click, adding by typing and delete.

Effects

Key Features

  • Smooth the switch between the keyboard and the panel while the control bar staying at the same position on the screen. The keys are :

    1. Calculate the height of soft keyboard. Refer to LayoutChangeListener.java.
    2. Switch the soft input mode between ADJUST_ NOTHING and ADJUST_RESIZE. Refer to LayoutHandlerImp.java.
  • Add a new function that handling tags to the EditText. The keys are :

    1. Overwrite the delete event in OnKeyListenerinterface in order to delete tag by tag instead of by letter. Refer to RichOnKeyListener.java.
    2. Overwrite TextWatcher in order to add and highlight each input keyword as a tag. Refer to RichTextWatcher.java.

Demo

This demo shows the critical steps when imports the modulelibHTagEditor in your host project.

  1. Inflate layout and obtain element references.
  2. Create data and item layout of tags.
  3. Create all the handler instances. Firstly, to create the main handlerLayoutHandlerImp. Secondly, to register the listenerRichTextWatcher for EditText. Thirdly, to register the listenerSwitcherChangedListener for switch button. Finally, to register the layout listener LayoutChangeListener for the global layout.
  4. Unregister the layout listener when Activity is destroied.

License


Copyright (C) 2017. Henry Tam (Hosle) 

Contact: [email protected]

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.

htageditor's People

Contributors

hosle avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.