Skip to content

Commit

Permalink
Removed NineOldAndroids dependency.
Browse files Browse the repository at this point in the history
Removed dependency on support library Fragments.
Added compatibility with standard SDK Fragments.
  • Loading branch information
wdullaer committed Aug 18, 2014
1 parent 240456a commit 7a4129b
Show file tree
Hide file tree
Showing 66 changed files with 222 additions and 228 deletions.
2 changes: 1 addition & 1 deletion library/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:versionCode="1"
android:versionName="1.0.0">

<uses-sdk android:minSdkVersion="9" />
<uses-sdk android:minSdkVersion="11" />
</manifest>
9 changes: 6 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 7
minSdkVersion 16
targetSdkVersion 19
}

lintOptions {
abortOnError false
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
Expand All @@ -24,6 +28,5 @@ android {
}

dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.android.support:support-v4:19.0.0'
}
12 changes: 4 additions & 8 deletions library/src/com/doomonafireball/betterpickers/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

package com.doomonafireball.betterpickers;

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

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;
Expand Down Expand Up @@ -134,9 +132,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 @@ -20,12 +20,12 @@
import com.doomonafireball.betterpickers.R;
import com.doomonafireball.betterpickers.Utils;
import com.doomonafireball.betterpickers.calendardatepicker.MonthAdapter.CalendarDay;
import com.nineoldandroids.animation.ObjectAnimator;

import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.app.DialogFragment;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.doomonafireball.betterpickers.datepicker.DatePickerDialogFragment.DatePickerDialogHandler;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.util.Log;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.app.DialogFragment;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.doomonafireball.betterpickers.expirationpicker.ExpirationPickerDialogFragment.ExpirationPickerDialogHandler;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.util.Log;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.app.DialogFragment;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.doomonafireball.betterpickers.hmspicker.HmsPickerDialogFragment.HmsPickerDialogHandler;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.util.Log;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import com.doomonafireball.betterpickers.R;

import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.doomonafireball.betterpickers.numberpicker.NumberPickerDialogFragment.NumberPickerDialogHandler;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.util.Log;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import com.doomonafireball.betterpickers.R;

import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

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

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
Expand Down Expand Up @@ -386,7 +385,7 @@ private int snapPrefer30s(int degrees) {
* the input will be "snapped" to the closest visible degrees.
*
* @param degrees The input degrees
* @param forceAboveOrBelow The output may be forced to either the higher or lower step, or may be allowed to snap
* @param forceHigherOrLower The output may be forced to either the higher or lower step, or may be allowed to snap
* to whichever is closer. Use 1 to force strictly higher, -1 to force strictly lower, and 0 to snap to the closer
* one.
* @return output degrees, will be a multiple of 30
Expand Down Expand Up @@ -546,10 +545,10 @@ 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);
mHourRadialTextsView.setAlpha(hourAlpha);
mHourRadialSelectorView.setAlpha(hourAlpha);
mMinuteRadialTextsView.setAlpha(minuteAlpha);
mMinuteRadialSelectorView.setAlpha(minuteAlpha);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@

import com.doomonafireball.betterpickers.R;
import com.doomonafireball.betterpickers.Utils;
import com.nineoldandroids.animation.Keyframe;
import com.nineoldandroids.animation.ObjectAnimator;
import com.nineoldandroids.animation.PropertyValuesHolder;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.animation.AnimatorProxy;

import android.animation.Keyframe;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
Expand Down Expand Up @@ -341,9 +340,9 @@ public ObjectAnimator getDisappearAnimator() {
kf1 = Keyframe.ofFloat(1f, 0f);
PropertyValuesHolder fadeOut = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1);

ObjectAnimator disappearAnimator = ObjectAnimator.ofPropertyValuesHolder(
AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : this, radiusDisappear, fadeOut).setDuration(
duration);
ObjectAnimator disappearAnimator = ObjectAnimator
.ofPropertyValuesHolder(this, radiusDisappear, fadeOut)
.setDuration(duration);
disappearAnimator.addUpdateListener(mInvalidateUpdateListener);

return disappearAnimator;
Expand Down Expand Up @@ -381,8 +380,8 @@ public ObjectAnimator getReappearAnimator() {
kf2 = Keyframe.ofFloat(1f, 1f);
PropertyValuesHolder fadeIn = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1, kf2);

ObjectAnimator reappearAnimator = ObjectAnimator.ofPropertyValuesHolder(
AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : this, radiusReappear, fadeIn)
ObjectAnimator reappearAnimator = ObjectAnimator
.ofPropertyValuesHolder(this, radiusReappear, fadeIn)
.setDuration(totalDuration);
reappearAnimator.addUpdateListener(mInvalidateUpdateListener);
return reappearAnimator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
package com.doomonafireball.betterpickers.radialtimepicker;

import com.doomonafireball.betterpickers.R;
import com.nineoldandroids.animation.Keyframe;
import com.nineoldandroids.animation.ObjectAnimator;
import com.nineoldandroids.animation.PropertyValuesHolder;
import com.nineoldandroids.animation.ValueAnimator;
import com.nineoldandroids.view.animation.AnimatorProxy;

import android.animation.Keyframe;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
Expand Down Expand Up @@ -302,8 +301,8 @@ private void renderAnimations() {
kf1 = Keyframe.ofFloat(1f, 0f);
PropertyValuesHolder fadeOut = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1);

mDisappearAnimator = ObjectAnimator.ofPropertyValuesHolder(
AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : this, radiusDisappear, fadeOut)
mDisappearAnimator = ObjectAnimator
.ofPropertyValuesHolder(this, radiusDisappear, fadeOut)
.setDuration(duration);
mDisappearAnimator.addUpdateListener(mInvalidateUpdateListener);

Expand All @@ -327,8 +326,8 @@ private void renderAnimations() {
kf2 = Keyframe.ofFloat(1f, 1f);
PropertyValuesHolder fadeIn = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1, kf2);

mReappearAnimator = ObjectAnimator.ofPropertyValuesHolder(
AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : this, radiusReappear, fadeIn)
mReappearAnimator = ObjectAnimator
.ofPropertyValuesHolder(this, radiusReappear, fadeIn)
.setDuration(totalDuration);
mReappearAnimator.addUpdateListener(mInvalidateUpdateListener);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
import com.doomonafireball.betterpickers.R;
import com.doomonafireball.betterpickers.Utils;
import com.doomonafireball.betterpickers.radialtimepicker.RadialPickerLayout.OnValueSelectedListener;
import com.nineoldandroids.animation.ObjectAnimator;

import android.animation.ObjectAnimator;
import android.app.ActionBar.LayoutParams;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.util.Log;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
import com.doomonafireball.betterpickers.R;
import com.doomonafireball.betterpickers.calendardatepicker.CalendarDatePickerDialog;

import org.jraf.android.backport.switchwidget.Switch;

import android.app.DialogFragment;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
Expand All @@ -29,8 +28,6 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.ViewConfigurationCompat;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
Expand All @@ -57,6 +54,7 @@
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.Switch;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.doomonafireball.betterpickers.recurrencepicker;

import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;

Expand Down Expand Up @@ -48,11 +47,11 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int w = getMeasuredWidth();
if (h > 0 && w > 0) {
if (w < h) {
if (View.MeasureSpec.getMode(ViewCompat.getMeasuredHeightAndState(this)) != MeasureSpec.EXACTLY) {
if (View.MeasureSpec.getMode(this.getMeasuredHeightAndState()) != MeasureSpec.EXACTLY) {
h = w;
}
} else if (h < w) {
if (View.MeasureSpec.getMode(ViewCompat.getMeasuredWidthAndState(this)) != MeasureSpec.EXACTLY) {
if (View.MeasureSpec.getMode(this.getMeasuredWidthAndState()) != MeasureSpec.EXACTLY) {
w = h;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.doomonafireball.betterpickers.timepicker.TimePickerDialogFragment.TimePickerDialogHandler;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.util.Log;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.app.DialogFragment;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package com.doomonafireball.betterpickers.timezonepicker;

import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Loading

0 comments on commit 7a4129b

Please sign in to comment.