Skip to content

Commit

Permalink
Add maven central and gradle dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
markzhai committed Sep 18, 2015
1 parent bf66934 commit a46164a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RememberEditText
[![GitHub release](https://img.shields.io/badge/sample%20apk-0.9.0-brightgreen.svg?style=flat)](https://github.com/markzhai/RememberEditText/releases/download/v0.9.0/app-debug.apk)
# RememberEditText [![GitHub release](https://img.shields.io/badge/sample%20apk-0.9.0-brightgreen.svg?style=flat)](https://github.com/markzhai/RememberEditText/releases/download/v0.9.0/app-debug.apk) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/cn.zhaiyifan/rememberedittext/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/cn.zhaiyifan/rememberedittext)

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

[中文版](https://github.com/markzhai/RememberEditText/blob/master/README_CN.md "中文版")
Expand All @@ -15,6 +15,11 @@ View: RememberEditText is an EditText view, but not a viewgroup extends linearla
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'
}

```xml
<cn.zhaiyifan.rememberedittext.RememberEditText
android:id="@+id/username"
Expand Down
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apply plugin: 'com.android.library'
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
minSdkVersion 9
Expand All @@ -20,5 +21,4 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
18 changes: 18 additions & 0 deletions library/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
POM_NAME=Android RememberEditText Library
POM_ARTIFACT_ID=rememberedittext
POM_PACKAGING=aar
VERSION_NAME=0.9.0
VERSION_CODE=1
GROUP=cn.zhaiyifan

POM_DESCRIPTION=Android RememberEditText Library
POM_URL=https://github.com/markzhai/RememberEditText
POM_SCM_URL=https://github.com/markzhai/RememberEditText
POM_SCM_CONNECTION=scm:https://github.com/markzhai/RememberEditText.git
POM_SCM_DEV_CONNECTION=scm:https://github.com/markzhai/RememberEditText.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=markzhai
POM_DEVELOPER_NAME=markzhai
POM_DEVELOPER_URL=https://github.com/markzhai/RememberEditText
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* 一个通过SharedPreference存放的持久化map,由于实际提供服务的数据来源
* 是内存中的map,所以可以做到同步返回,不用依赖于SharedPreference实际操作完成。
*/
class PersistedMap {

private static final String KEY_NOT_FOUND_VALUE = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -163,7 +162,7 @@ protected void onDetachedFromWindow() {
}

@Override
protected void onDraw(@NonNull Canvas canvas) {
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.save();

Expand Down Expand Up @@ -207,7 +206,7 @@ protected void onDraw(@NonNull Canvas canvas) {
* {@link android.text.method.ArrowKeyMovementMethod} for EditText touch event handle.
*/
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
public boolean onTouchEvent(MotionEvent event) {
// If touch icon fields, intercept event to prevent further handle.
boolean handled = false;
final int action = event.getAction();
Expand Down
8 changes: 8 additions & 0 deletions library/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="material_blue_grey_800">#ff37474f</color>
<color name="material_blue_grey_900">#ff263238</color>
<color name="material_blue_grey_950">#ff21272b</color>
<color name="material_deep_teal_200">#ff80cbc4</color>
<color name="material_deep_teal_500">#ff009688</color>
</resources>

0 comments on commit a46164a

Please sign in to comment.