-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
defaultConfig { | ||
applicationId "com.maning.mnpasswordedittext" | ||
minSdkVersion 14 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'], dir: 'libs') | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile 'com.android.support:appcompat-v7:25.2.0' | ||
|
||
compile project(':pswedittextlibrary') | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/maning/Develop/Android/SDK/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.maning.mnpasswordedittext"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.maning.mnpasswordedittext; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.widget.TextView; | ||
|
||
import com.maning.pswedittextlibrary.MNPasswordEditText; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
private MNPasswordEditText mPswEditText; | ||
private TextView tvShow; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
tvShow = (TextView) findViewById(R.id.tvShow); | ||
mPswEditText = (MNPasswordEditText) findViewById(R.id.mPswEditText); | ||
mPswEditText.setOnPasswordChangeListener(new MNPasswordEditText.OnPasswordChangeListener() { | ||
@Override | ||
public void onPasswordChange(String password) { | ||
tvShow.setText(password); | ||
} | ||
}); | ||
|
||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/activity_main" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#dadada" | ||
android:orientation="vertical" | ||
android:padding="10dp" | ||
> | ||
|
||
<TextView | ||
android:id="@+id/tvShow" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="展现密码的地方" | ||
/> | ||
|
||
|
||
<com.maning.pswedittextlibrary.MNPasswordEditText | ||
android:id="@+id/mPswEditText" | ||
android:layout_width="match_parent" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="10dp" | ||
android:focusableInTouchMode="true" | ||
android:inputType="number" | ||
android:maxLength="6" | ||
android:textSize="20sp" | ||
app:mnPsw_cover_circle_color="@color/colorPrimaryDark" | ||
app:mnPsw_cover_circle_radius="12dp" | ||
/> | ||
|
||
<com.maning.pswedittextlibrary.MNPasswordEditText | ||
android:layout_width="match_parent" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="10dp" | ||
android:focusableInTouchMode="true" | ||
android:inputType="number" | ||
android:maxLength="5" | ||
android:textSize="20sp" | ||
app:mnPsw_background_color="@color/colorAccent" | ||
app:mnPsw_border_color="@color/colorPrimary" | ||
app:mnPsw_border_radius="1dp" | ||
app:mnPsw_border_width="4dp" | ||
app:mnPsw_item_margin="15dp" | ||
app:mnPsw_mode="OriginalText" | ||
app:mnPsw_style="StyleOneself" | ||
app:mnPsw_text_color="#FFFFFF" | ||
/> | ||
|
||
<com.maning.pswedittextlibrary.MNPasswordEditText | ||
android:layout_width="match_parent" | ||
android:layout_height="60dp" | ||
android:layout_marginTop="10dp" | ||
android:focusableInTouchMode="true" | ||
android:inputType="number" | ||
android:maxLength="4" | ||
android:textSize="20sp" | ||
app:mnPsw_background_color="#01e2c4" | ||
app:mnPsw_border_color="#da7202" | ||
app:mnPsw_border_radius="10dp" | ||
app:mnPsw_border_width="10dp" | ||
app:mnPsw_cover_text="哈" | ||
app:mnPsw_item_margin="15dp" | ||
app:mnPsw_mode="Text" | ||
app:mnPsw_style="StyleOneself" | ||
app:mnPsw_text_color="#2e2e2e" | ||
/> | ||
|
||
<com.maning.pswedittextlibrary.MNPasswordEditText | ||
android:layout_width="match_parent" | ||
android:layout_height="50dp" | ||
android:layout_marginTop="10dp" | ||
android:focusableInTouchMode="true" | ||
android:inputType="number" | ||
android:maxLength="6" | ||
android:textSize="20sp" | ||
app:mnPsw_background_color="#FFFFFF" | ||
app:mnPsw_border_color="#7e7e7e" | ||
app:mnPsw_border_radius="2dp" | ||
app:mnPsw_border_width="2dp" | ||
app:mnPsw_cover_bitmap_id="@mipmap/ic_launcher" | ||
app:mnPsw_cover_bitmap_width="30dp" | ||
app:mnPsw_item_margin="5dp" | ||
app:mnPsw_mode="Bitmap" | ||
app:mnPsw_style="StyleOneself" | ||
app:mnPsw_text_color="#393939" | ||
/> | ||
|
||
</LinearLayout> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<resources> | ||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml | ||
(such as screen margins) for screens with more than 820dp of available width. This | ||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | ||
<dimen name="activity_horizontal_margin">64dp</dimen> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#3F51B5</color> | ||
<color name="colorPrimaryDark">#303F9F</color> | ||
<color name="colorAccent">#FF4081</color> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<resources> | ||
<!-- Default screen margins, per the Android Design guidelines. --> | ||
<dimen name="activity_horizontal_margin">16dp</dimen> | ||
<dimen name="activity_vertical_margin">16dp</dimen> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">MNPasswordEditText</string> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<resources> | ||
|
||
<!-- Base application theme. --> | ||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
<!-- Customize your theme here. --> | ||
<item name="colorPrimary">@color/colorPrimary</item> | ||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
<item name="colorAccent">@color/colorAccent</item> | ||
</style> | ||
|
||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.2.0' | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
maven { url "https://jitpack.io" } | ||
} | ||
} | ||
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} |