Giter VIP home page Giter VIP logo

rememberedittext's Introduction

RememberEditText GitHub release Maven Central

An EditText which can remember last input, free developer from managing cache everywhere themselves.

中文版

Show popup window after dropdown icon clicked

Introduction

Have you been annoyed with entering the same stuff once and once like username, thread-reply? RememberEditText can remember the last several input automatically and offers a dropdown list to let user choose.

How

View: RememberEditText is an EditText view, but not a viewgroup extends linearlayout like some project. I made it so in order to decrease view layers.

Cache: RememberEditText simply puts its cache in SharedPreference, and keeps a local hashmap version to free from visiting SharedPreference everytime, thus speeds up its looks up and update.

Usage

dependencies {
    compile 'cn.zhaiyifan:rememberedittext:0.9.0'
}
<cn.zhaiyifan.rememberedittext.RememberEditText
    android:id="@+id/username"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:layout_marginRight="@dimen/activity_horizontal_margin"
    android:layout_marginTop="150dp"
    android:hint="Username/PhoneNumber"
    android:inputType="text"
    app:rememberCount="3"
    app:rememberId="username" />

styles:

<declare-styleable name="RememberEditText">
    <!-- auto fill in cache, by default true -->
    <attr name="autoFill" format="boolean" />
    <!-- auto save to cache, by default true -->
    <attr name="autoSave" format="boolean" />
    <!-- dropdown icon to choose between cache values, by default use abc_spinner_mtrl_am_alpha -->
    <attr name="dropDownIcon" format="reference" />
    <!-- delete icon to delete cache value, by default use abc_ic_clear_mtrl_alpha -->
    <attr name="deleteIcon" format="reference" />
    <!-- id of cache, will use view id if not set -->
    <attr name="rememberId" format="string" />
    <!-- count of cache to keep, by default 3 -->
    <attr name="rememberCount" format="integer" />
</declare-styleable>

TODO

  • Make cache loading async.
  • Add more hint mode.
  • Enable pair mode, like username/password.
  • Center gravity is not supported yet, need help (icon is missing when set center gravity).
  • Add encrpytion mode to save stuff like password (low priority).
  • Support RTL (Right to Left).

Screenshots

Show popup window after dropdown icon clicked First start, value auto filled A larger EditText sample

rememberedittext's People

Contributors

markzhai avatar

Watchers

James Cloos avatar Faisal Ahmed 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.