Skip to content

Commit

Permalink
Update the library to run for api version 28
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Muzaffar committed Sep 4, 2018
1 parent 3c54dbb commit 5a18341
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
9 changes: 8 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ buildscript {
### Gradle

dependencies {
compile 'com.alimuzaffar.lib:pinentryedittext:1.3.2'
implementation ('com.alimuzaffar.lib:pinentryedittext:1.3.4') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'support-v13'
}
}

**Note:** You don't need to exclude all the support groups. However, it's a good idea to do this
as your code is likely to use a different version from the library.

## STEP-2

### Setup PinEntryEditText in your layout
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.android.tools.build:gradle:3.3.0-alpha08'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Jul 28 18:39:30 AEST 2018
#Tue Sep 04 09:40:38 AEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
8 changes: 5 additions & 3 deletions pinentryedittext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {
siteUrl = 'https://github.com/alphamu/PinEntryEditText'
gitUrl = 'https://github.com/alphamu/PinEntryEditText.git'

libraryVersion = '1.3.3'
libraryVersion = '1.3.4'

developerId = 'alphamu'
developerName = 'Ali Muzaffar'
Expand All @@ -25,7 +25,7 @@ ext {

android {
compileSdkVersion 28
buildToolsVersion "27.0.3"
buildToolsVersion '28.0.2'

defaultConfig {
minSdkVersion 14
Expand All @@ -47,7 +47,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support:support-v4:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:support-v13:28.0.0-rc02'
}

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
Expand All @@ -28,10 +27,10 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.support.v4.text.TextUtilsCompat;
import android.support.v4.view.ViewCompat;
import android.support.v13.view.ViewCompat;
import android.support.v7.widget.AppCompatEditText;
import android.text.InputFilter;
import android.text.InputType;
import android.text.TextUtils;
Expand All @@ -43,11 +42,10 @@
import android.view.View;
import android.view.animation.OvershootInterpolator;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

import java.util.Locale;

public class PinEntryEditText extends EditText {
public class PinEntryEditText extends AppCompatEditText {
private static final String XML_NAMESPACE_ANDROID = "http://schemas.android.com/apk/res/android";

protected String mMask = null;
Expand Down Expand Up @@ -107,12 +105,6 @@ public PinEntryEditText(Context context, AttributeSet attrs, int defStyleAttr) {
init(context, attrs);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public PinEntryEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context, attrs);
}

public void setMaxLength(final int maxLength) {
mMaxLength = maxLength;
mNumChars = maxLength;
Expand Down
6 changes: 3 additions & 3 deletions sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "27.0.3"
buildToolsVersion '28.0.2'

defaultConfig {
applicationId "com.alimuzaffar.sample.pin"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.3.3"
versionName "1.3.4"
}
buildTypes {
release {
Expand All @@ -25,6 +25,6 @@ android {
dependencies {
implementation fileTree(include: ['*.jar, *.aar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation project(':pinentryedittext')
}

0 comments on commit 5a18341

Please sign in to comment.