Skip to content

Commit

Permalink
Update SDK versions to comply with new Google Play requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Riggs committed Nov 10, 2018
1 parent 7007e52 commit 51f878f
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 83 deletions.
9 changes: 0 additions & 9 deletions .idea/libraries/Gradle__effects_android_23.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/libraries/Gradle__maps_android_23.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/libraries/Gradle__usb_android_23.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions build.gradle
Expand Up @@ -9,9 +9,20 @@ buildscript {
}
}


allprojects {
repositories {
jcenter()
google()
}
}

// This block encapsulates custom properties and makes them available to all
// modules in the project.
ext {
// The following are only a few examples of the types of properties you can define.
compileSdkVersion = 28
// You can also create properties to specify versions for dependencies.
// Having consistent versions between modules can avoid conflicts with behavior.
supportLibVersion = "28.0.0"
}
7 changes: 4 additions & 3 deletions library/build.gradle
@@ -1,15 +1,16 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 'Google Inc.:Google APIs:23'
compileSdkVersion 28

defaultConfig {
minSdkVersion 14
minSdkVersion 16
targetSdkVersion 28
}

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
Expand Down
6 changes: 2 additions & 4 deletions library/library.iml
Expand Up @@ -99,6 +99,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/packaged-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/packaged_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/public_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
Expand All @@ -109,10 +110,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: usb-android-23" level="project" />
<orderEntry type="library" name="Gradle: effects-android-23" level="project" />
<orderEntry type="library" name="Gradle: maps-android-23" level="project" />
</component>
</module>
1 change: 0 additions & 1 deletion library/src/main/AndroidManifest.xml
Expand Up @@ -4,5 +4,4 @@
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:targetSdkVersion="26" />
</manifest>
41 changes: 18 additions & 23 deletions library/src/main/java/net/simonvt/numberpicker/NumberPicker.java
Expand Up @@ -301,7 +301,7 @@ public static final Formatter getTwoDigitFormatter() {
/**
* Cache for the string representation of selector indices.
*/
private final SparseArray<String> mSelectorIndexToStringCache = new SparseArray<String>();
private final SparseArray<String> mSelectorIndexToStringCache = new SparseArray<>();

/**
* The selector indices whose value are show by the selector.
Expand Down Expand Up @@ -369,11 +369,6 @@ public static final Formatter getTwoDigitFormatter() {
*/
private float mLastDownEventY;

/**
* The time of the last down event.
*/
private long mLastDownEventTime;

/**
* The Y position of the last down or move event.
*/
Expand Down Expand Up @@ -503,7 +498,7 @@ public interface OnScrollListener {
/**
* The view is not scrolling.
*/
public static int SCROLL_STATE_IDLE = 0;
int SCROLL_STATE_IDLE = 0;

/**
* The user is scrolling using touch, and his finger is still on the screen.
Expand Down Expand Up @@ -661,7 +656,7 @@ public boolean onLongClick(View v) {

// increment button
if (!mHasSelectorWheel) {
mIncrementButton = (ImageButton) findViewById(R.id.np__increment);
mIncrementButton = findViewById(R.id.np__increment);
mIncrementButton.setOnClickListener(onClickListener);
mIncrementButton.setOnLongClickListener(onLongClickListener);
} else {
Expand All @@ -670,15 +665,15 @@ public boolean onLongClick(View v) {

// decrement button
if (!mHasSelectorWheel) {
mDecrementButton = (ImageButton) findViewById(R.id.np__decrement);
mDecrementButton = findViewById(R.id.np__decrement);
mDecrementButton.setOnClickListener(onClickListener);
mDecrementButton.setOnLongClickListener(onLongClickListener);
} else {
mDecrementButton = null;
}

// input text
mInputText = (EditText) findViewById(R.id.np__numberpicker_input);
mInputText = findViewById(R.id.np__numberpicker_input);
mInputText.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
Expand Down Expand Up @@ -815,7 +810,11 @@ public boolean onInterceptTouchEvent(MotionEvent event) {
removeAllCallbacks();
mInputText.setVisibility(View.INVISIBLE);
mLastDownOrMoveEventY = mLastDownEventY = event.getY();
mLastDownEventTime = event.getEventTime();
/*
The time of the last down event.
*/ /**
* The time of the last down event.
*/long mLastDownEventTime = event.getEventTime();
mIngonreMoveEvents = false;
mShowSoftInputOnTap = false;
// Handle pressed state before any state change.
Expand Down Expand Up @@ -1233,8 +1232,8 @@ private void tryComputeMaxWidth() {
maxTextWidth = (int) (numberOfDigits * maxDigitWidth);
} else {
final int valueCount = mDisplayedValues.length;
for (int i = 0; i < valueCount; i++) {
final float textWidth = mSelectorWheelPaint.measureText(mDisplayedValues[i]);
for (String mDisplayedValue : mDisplayedValues) {
final float textWidth = mSelectorWheelPaint.measureText(mDisplayedValue);
if (textWidth > maxTextWidth) {
maxTextWidth = (int) textWidth;
}
Expand Down Expand Up @@ -1752,9 +1751,7 @@ private int getWrappedSelectorIndex(int selectorIndex) {
* will be displayed in the selector.
*/
private void incrementSelectorIndices(int[] selectorIndices) {
for (int i = 0; i < selectorIndices.length - 1; i++) {
selectorIndices[i] = selectorIndices[i + 1];
}
System.arraycopy(selectorIndices, 1, selectorIndices, 0, selectorIndices.length - 1);
int nextScrollSelectorIndex = selectorIndices[selectorIndices.length - 2] + 1;
if (mWrapSelectorWheel && nextScrollSelectorIndex > mMaxValue) {
nextScrollSelectorIndex = mMinValue;
Expand All @@ -1768,9 +1765,7 @@ private void incrementSelectorIndices(int[] selectorIndices) {
* will be displayed in the selector.
*/
private void decrementSelectorIndices(int[] selectorIndices) {
for (int i = selectorIndices.length - 1; i > 0; i--) {
selectorIndices[i] = selectorIndices[i - 1];
}
System.arraycopy(selectorIndices, 0, selectorIndices, 1, selectorIndices.length - 1);
int nextScrollSelectorIndex = selectorIndices[1] - 1;
if (mWrapSelectorWheel && nextScrollSelectorIndex < mMinValue) {
nextScrollSelectorIndex = mMaxValue;
Expand Down Expand Up @@ -1813,7 +1808,7 @@ private void validateInputTextView(View v) {
updateInputTextView();
} else {
// Check the new value and ensure it's in range
int current = getSelectedPos(str.toString());
int current = getSelectedPos(str);
setValueInternal(current, true);
}
}
Expand Down Expand Up @@ -2490,7 +2485,7 @@ private void findAccessibilityNodeInfosByTextInChild(String searchedLowerCase,
case VIRTUAL_VIEW_ID_DECREMENT: {
String text = getVirtualDecrementButtonText();
if (!TextUtils.isEmpty(text)
&& text.toString().toLowerCase().contains(searchedLowerCase)) {
&& text.toLowerCase().contains(searchedLowerCase)) {
outResult.add(createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_DECREMENT));
}
} return;
Expand All @@ -2511,10 +2506,10 @@ private void findAccessibilityNodeInfosByTextInChild(String searchedLowerCase,
case VIRTUAL_VIEW_ID_INCREMENT: {
String text = getVirtualIncrementButtonText();
if (!TextUtils.isEmpty(text)
&& text.toString().toLowerCase().contains(searchedLowerCase)) {
&& text.toLowerCase().contains(searchedLowerCase)) {
outResult.add(createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_INCREMENT));
}
} return;
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions library/src/main/java/net/simonvt/numberpicker/Scroller.java
Expand Up @@ -30,7 +30,7 @@
* automatically moved to its final stage and computeScrollOffset()
* will always return false to indicate that scrolling is over.
*/
public class Scroller {
class Scroller {
private int mMode;

private int mStartX;
Expand Down Expand Up @@ -61,7 +61,6 @@ public class Scroller {
private static final int FLING_MODE = 1;

private static float DECELERATION_RATE = (float) (Math.log(0.75) / Math.log(0.9));
private static float ALPHA = 800; // pixels / seconds
private static float START_TENSION = 0.4f; // Tension at start: (0.4 * total T, 1.0 * Distance)
private static float END_TENSION = 1.0f - START_TENSION;
private static final int NB_SAMPLES = 100;
Expand Down Expand Up @@ -389,6 +388,8 @@ public void fling(int startX, int startY, int velocityX, int velocityY,
float velocity = (float) Math.sqrt(velocityX * velocityX + velocityY * velocityY);

mVelocity = velocity;
// pixels / seconds
float ALPHA = 800;
final double l = Math.log(START_TENSION * velocity / ALPHA);
mDuration = (int) (1000.0 * Math.exp(l / (DECELERATION_RATE - 1.0)));
mStartTime = AnimationUtils.currentAnimationTimeMillis();
Expand Down
17 changes: 12 additions & 5 deletions mobilinkdTNC/build.gradle
Expand Up @@ -6,19 +6,26 @@ android {

defaultConfig {
applicationId "com.mobilinkd.tncconfig"
minSdkVersion 14
minSdkVersion 16
targetSdkVersion 28

// Defines the version number of your app.
versionCode 16

// Defines a user-friendly version name for your app.
versionName "1.2.2"
}

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

dependencies {
compile project(':library')
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support:gridlayout-v7:28.0.0'
implementation project(':library')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:gridlayout-v7:${rootProject.ext.supportLibVersion}"
}
15 changes: 1 addition & 14 deletions mobilinkdTNC/mobilinkdTNC.iml
Expand Up @@ -87,37 +87,24 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotation_processor_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/apk_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/build-info" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkDebugClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkReleaseClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_main_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/linked_res_for_bundle" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/module_bundle" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
Expand Down
4 changes: 1 addition & 3 deletions mobilinkdTNC/src/main/AndroidManifest.xml
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mobilinkd.tncconfig"
android:versionCode="15"
android:versionName="1.2.1" >
package="com.mobilinkd.tncconfig">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" ></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Expand Down

0 comments on commit 51f878f

Please sign in to comment.