Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade buildtools: 3.0.0-alpha9, joda-time 2.9.9, appcompat 26.0.0, … #360

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Maven Central](https://img.shields.io/maven-central/v/com.code-troopers.betterpickers/library.svg?style=flat)](https://repo1.maven.org/maven2/com/code-troopers/betterpickers/library/)
[![API](https://img.shields.io/badge/API-9%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=9)
[![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Betterpickers-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/118)

[![Built With Cloudbees](https://www.cloudbees.com/sites/default/files/styles/large/public/Button-Built-on-CB-1.png?itok=3Tnkun-C)](https://codetroopers.ci.cloudbees.com/job/betterpickers-master/)
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ buildscript {
repositories {
jcenter()
mavenLocal()
mavenCentral()
google()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.0.0-beta1'
// to auto install sdk components when building see #248
// classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
classpath 'com.github.plastiv:sdk-manager-plugin:b04aea1cddf87e78db9a4372794d678f9e568c48'
Expand All @@ -26,11 +26,11 @@ allprojects {
repositories {
jcenter()
mavenLocal()
mavenCentral()
google()
}
apply plugin: 'android-sdk-manager' //see #248
}

task wrapper(type: Wrapper) {
gradleVersion = '3.2'
gradleVersion = '4.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
9 changes: 4 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
VERSION_NAME=3.1.0
VERSION_CODE=310
GROUP=com.code-troopers.betterpickers

ANDROID_BUILD_MIN_SDK_VERSION=9
ANDROID_BUILD_TARGET_SDK_VERSION=25
ANDROID_BUILD_SDK_VERSION=25
ANDROID_BUILD_TOOLS_VERSION=25.0.0
ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=26
ANDROID_BUILD_SDK_VERSION=26
ANDROID_BUILD_TOOLS_VERSION=26.0.1

POM_DESCRIPTION=Android library for better number/date/time-picker DialogFragments.
POM_URL=http://github.com/derekbrameyer/android-betterpickers
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Nov 14 18:28:11 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
15 changes: 8 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,13 +155,14 @@ if $cygwin ; then
fi

# Escape application args
for s in "${@}" ; do
s=\"$s\"
APP_ARGS=$APP_ARGS" "$s
done
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
Expand Down
10 changes: 7 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ android {
lintOptions {
abortOnError false
}

// https://developer.android.com/studio/preview/features/java8-support.html
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.android.support:appcompat-v7:25.0.1'
implementation 'com.android.support:appcompat-v7:26.0.0'
}
14 changes: 5 additions & 9 deletions library/src/main/java/com/codetroopers/betterpickers/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@

package com.codetroopers.betterpickers;

import android.animation.Keyframe;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.SuppressLint;
import android.os.Build;
import android.text.format.Time;
import android.view.View;

import com.nineoldandroids.animation.Keyframe;
import com.nineoldandroids.animation.ObjectAnimator;
import com.nineoldandroids.animation.PropertyValuesHolder;
import com.nineoldandroids.view.animation.AnimatorProxy;

import java.util.Calendar;

/**
Expand Down Expand Up @@ -122,7 +120,7 @@ public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfW
* @return The animator object. Use .start() to begin.
*/
public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreaseRatio,
float increaseRatio) {
float increaseRatio) {
Keyframe k0 = Keyframe.ofFloat(0f, 1f);
Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio);
Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio);
Expand All @@ -131,9 +129,7 @@ public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreas
PropertyValuesHolder scaleX = PropertyValuesHolder.ofKeyframe("scaleX", k0, k1, k2, k3);
PropertyValuesHolder scaleY = PropertyValuesHolder.ofKeyframe("scaleY", k0, k1, k2, k3);
ObjectAnimator pulseAnimator =
ObjectAnimator.ofPropertyValuesHolder(
AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(labelToAnimate) : labelToAnimate, scaleX,
scaleY);
ObjectAnimator.ofPropertyValuesHolder(labelToAnimate, scaleX, scaleY);
pulseAnimator.setDuration(PULSE_ANIMATOR_DURATION);

return pulseAnimator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.codetroopers.betterpickers.calendardatepicker;

import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.res.Resources;
Expand Down Expand Up @@ -45,7 +46,6 @@
import com.codetroopers.betterpickers.R;
import com.codetroopers.betterpickers.Utils;
import com.codetroopers.betterpickers.calendardatepicker.MonthAdapter.CalendarDay;
import com.nineoldandroids.animation.ObjectAnimator;

import java.text.SimpleDateFormat;
import java.util.Calendar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ private void onDayClick(int day) {
* @return The date that has accessibility focus, or {@code null} if no date has focus
*/
public CalendarDay getAccessibilityFocus() {
final int day = mTouchHelper.getFocusedVirtualView();
final int day = mTouchHelper.getAccessibilityFocusedVirtualViewId();
if (day >= 0) {
return new CalendarDay(mYear, mMonth, day);
}
Expand Down Expand Up @@ -630,7 +630,7 @@ public void setFocusedVirtualView(int virtualViewId) {
}

public void clearFocusedVirtualView() {
final int focusedVirtualView = getFocusedVirtualView();
final int focusedVirtualView = getAccessibilityFocusedVirtualViewId();
if (focusedVirtualView != ExploreByTouchHelper.INVALID_ID) {
getAccessibilityNodeProvider(MonthView.this).performAction(
focusedVirtualView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
import android.widget.TextView;

import com.codetroopers.betterpickers.R;

/**
* A text view which, when pressed or activated, displays a blue circle around the text.
*/
public class TextViewWithCircularIndicator extends TextView {
public class TextViewWithCircularIndicator extends AppCompatTextView {

private static final int SELECTED_CIRCLE_ALPHA = 60;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.text.format.DateFormat;
Expand Down Expand Up @@ -87,7 +88,7 @@ public DatePicker(Context context) {
* Instantiates a DatePicker object
*
* @param context the Context required for creation
* @param attrs additional attributes that define custom colors, selectors, and backgrounds.
* @param attrs additional attributes that define custom colors, selectors, and backgrounds.
*/
public DatePicker(Context context, AttributeSet attrs) {
super(context, attrs);
Expand All @@ -102,8 +103,8 @@ public DatePicker(Context context, AttributeSet attrs) {
mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark);
mKeyBackgroundResId = R.drawable.key_background_dark;
mButtonBackgroundResId = R.drawable.button_background_dark;
mTitleDividerColor = getResources().getColor(R.color.default_divider_color_dark);
mKeyboardIndicatorColor = getResources().getColor(R.color.default_keyboard_indicator_color_dark);
mTitleDividerColor = ContextCompat.getColor(context, R.color.default_divider_color_dark);
mKeyboardIndicatorColor = ContextCompat.getColor(context, R.color.default_keyboard_indicator_color_dark);
mDeleteDrawableSrcResId = R.drawable.ic_backspace_dark;
mCheckDrawableSrcResId = R.drawable.ic_check_dark;
}
Expand Down Expand Up @@ -240,7 +241,7 @@ public KeyboardPagerAdapter(LayoutInflater inflater) {
* Based on the Locale, inflate the day, month, or year keyboard
*
* @param collection the ViewPager collection group
* @param position the position within the ViewPager
* @param position the position within the ViewPager
* @return an inflated View representing the keyboard for this position
*/
public Object instantiateItem(ViewGroup collection, int position) {
Expand Down Expand Up @@ -760,9 +761,9 @@ public int getDayOfMonth() {
/**
* Set the date shown in the date picker
*
* @param year the new year to set
* @param year the new year to set
* @param monthOfYear the new zero-indexed month to set
* @param dayOfMonth the new day of month to set
* @param dayOfMonth the new day of month to set
*/
public void setDate(int year, int monthOfYear, int dayOfMonth) {
mMonthInput = monthOfYear;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.text.format.DateFormat;
Expand Down Expand Up @@ -95,8 +96,8 @@ public ExpirationPicker(Context context, AttributeSet attrs) {
mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark);
mKeyBackgroundResId = R.drawable.key_background_dark;
mButtonBackgroundResId = R.drawable.button_background_dark;
mTitleDividerColor = getResources().getColor(R.color.default_divider_color_dark);
mKeyboardIndicatorColor = getResources().getColor(R.color.default_keyboard_indicator_color_dark);
mTitleDividerColor = ContextCompat.getColor(context, R.color.default_divider_color_dark);
mKeyboardIndicatorColor = ContextCompat.getColor(context, R.color.default_keyboard_indicator_color_dark);
mDeleteDrawableSrcResId = R.drawable.ic_backspace_dark;
mCheckDrawableSrcResId = R.drawable.ic_check_dark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -71,7 +72,7 @@ public HmsPicker(Context context, AttributeSet attrs) {
mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark);
mKeyBackgroundResId = R.drawable.key_background_dark;
mButtonBackgroundResId = R.drawable.button_background_dark;
mDividerColor = getResources().getColor(R.color.default_divider_color_dark);
mDividerColor = ContextCompat.getColor(context, R.color.default_divider_color_dark);
mDeleteDrawableSrcResId = R.drawable.ic_backspace_dark;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.HapticFeedbackConstants;
Expand Down Expand Up @@ -82,7 +83,7 @@ public NumberPicker(Context context, AttributeSet attrs) {
mKeyBackgroundResId = R.drawable.key_background_dark;
mButtonBackgroundResId = R.drawable.button_background_dark;
mDeleteDrawableSrcResId = R.drawable.ic_backspace_dark;
mDividerColor = getResources().getColor(R.color.default_divider_color_dark);
mDividerColor = ContextCompat.getColor(context, R.color.default_divider_color_dark);
}

protected int getLayoutId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import android.content.Context;
import android.os.Handler;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

/**
* User: derek Date: 6/21/13 Time: 10:37 AM
*/
public class NumberPickerErrorTextView extends TextView {
public class NumberPickerErrorTextView extends AppCompatTextView {

private static final long LENGTH_SHORT = 3000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@

package com.codetroopers.betterpickers.radialtimepicker;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.accessibility.AccessibilityManagerCompat;
import android.text.format.DateUtils;
import android.text.format.Time;
Expand All @@ -39,9 +42,6 @@

import com.codetroopers.betterpickers.HapticFeedbackController;
import com.codetroopers.betterpickers.R;
import com.nineoldandroids.animation.AnimatorSet;
import com.nineoldandroids.animation.ObjectAnimator;
import com.nineoldandroids.view.ViewHelper;

public class RadialPickerLayout extends FrameLayout implements OnTouchListener {

Expand Down Expand Up @@ -130,7 +130,7 @@ public RadialPickerLayout(Context context, AttributeSet attrs) {
mInputEnabled = true;
mGrayBox = new View(context);
mGrayBox.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
mGrayBox.setBackgroundColor(getResources().getColor(R.color.bpTransparent_black));
mGrayBox.setBackgroundColor(ContextCompat.getColor(context, R.color.bpTransparent_black));
mGrayBox.setVisibility(View.INVISIBLE);
addView(mGrayBox);

Expand Down Expand Up @@ -544,10 +544,11 @@ public void setCurrentItemShowing(int index, boolean animate) {
} else {
int hourAlpha = (index == HOUR_INDEX) ? 255 : 0;
int minuteAlpha = (index == MINUTE_INDEX) ? 255 : 0;
ViewHelper.setAlpha(mHourRadialTextsView, hourAlpha);
ViewHelper.setAlpha(mHourRadialSelectorView, hourAlpha);
ViewHelper.setAlpha(mMinuteRadialTextsView, minuteAlpha);
ViewHelper.setAlpha(mMinuteRadialSelectorView, minuteAlpha);
mHourRadialSelectorView.setAlpha(hourAlpha);
mHourRadialTextsView.setAlpha(hourAlpha);
mHourRadialSelectorView.setAlpha(hourAlpha);
mMinuteRadialTextsView.setAlpha(minuteAlpha);
mMinuteRadialSelectorView.setAlpha(minuteAlpha);
}

}
Expand Down