-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from Zolon-DOL/master
Sprint 1 changes 2022
- Loading branch information
Showing
185 changed files
with
34,339 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
group='com.github.philjay' | ||
|
||
android { | ||
compileSdkVersion 30 | ||
buildToolsVersion '30.0.3' | ||
defaultConfig { | ||
minSdkVersion 14 | ||
targetSdkVersion 30 | ||
versionCode 3 | ||
versionName '3.1.0' | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
testOptions { | ||
unitTests.returnDefaultValues = true // this prevents "not mocked" error | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation 'androidx.annotation:annotation:1.0.0' | ||
testImplementation 'junit:junit:4.12' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.github.mikephil.charting"> | ||
|
||
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<application | ||
android:allowBackup="true" | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme" > | ||
</application> --> | ||
|
||
</manifest> |
207 changes: 207 additions & 0 deletions
207
MPChartLib/src/main/java/com/github/mikephil/charting/animation/ChartAnimator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
package com.github.mikephil.charting.animation; | ||
|
||
import android.animation.ObjectAnimator; | ||
import android.animation.ValueAnimator.AnimatorUpdateListener; | ||
import androidx.annotation.RequiresApi; | ||
|
||
import com.github.mikephil.charting.animation.Easing.EasingFunction; | ||
|
||
/** | ||
* Object responsible for all animations in the Chart. Animations require API level 11. | ||
* | ||
* @author Philipp Jahoda | ||
* @author Mick Ashton | ||
*/ | ||
public class ChartAnimator { | ||
|
||
/** object that is updated upon animation update */ | ||
private AnimatorUpdateListener mListener; | ||
|
||
/** The phase of drawn values on the y-axis. 0 - 1 */ | ||
@SuppressWarnings("WeakerAccess") | ||
protected float mPhaseY = 1f; | ||
|
||
/** The phase of drawn values on the x-axis. 0 - 1 */ | ||
@SuppressWarnings("WeakerAccess") | ||
protected float mPhaseX = 1f; | ||
|
||
public ChartAnimator() { } | ||
|
||
@RequiresApi(11) | ||
public ChartAnimator(AnimatorUpdateListener listener) { | ||
mListener = listener; | ||
} | ||
|
||
@RequiresApi(11) | ||
private ObjectAnimator xAnimator(int duration, EasingFunction easing) { | ||
|
||
ObjectAnimator animatorX = ObjectAnimator.ofFloat(this, "phaseX", 0f, 1f); | ||
animatorX.setInterpolator(easing); | ||
animatorX.setDuration(duration); | ||
|
||
return animatorX; | ||
} | ||
|
||
@RequiresApi(11) | ||
private ObjectAnimator yAnimator(int duration, EasingFunction easing) { | ||
|
||
ObjectAnimator animatorY = ObjectAnimator.ofFloat(this, "phaseY", 0f, 1f); | ||
animatorY.setInterpolator(easing); | ||
animatorY.setDuration(duration); | ||
|
||
return animatorY; | ||
} | ||
|
||
/** | ||
* Animates values along the X axis, in a linear fashion. | ||
* | ||
* @param durationMillis animation duration | ||
*/ | ||
@RequiresApi(11) | ||
public void animateX(int durationMillis) { | ||
animateX(durationMillis, Easing.Linear); | ||
} | ||
|
||
/** | ||
* Animates values along the X axis. | ||
* | ||
* @param durationMillis animation duration | ||
* @param easing EasingFunction | ||
*/ | ||
@RequiresApi(11) | ||
public void animateX(int durationMillis, EasingFunction easing) { | ||
|
||
ObjectAnimator animatorX = xAnimator(durationMillis, easing); | ||
animatorX.addUpdateListener(mListener); | ||
animatorX.start(); | ||
} | ||
|
||
/** | ||
* Animates values along both the X and Y axes, in a linear fashion. | ||
* | ||
* @param durationMillisX animation duration along the X axis | ||
* @param durationMillisY animation duration along the Y axis | ||
*/ | ||
@RequiresApi(11) | ||
public void animateXY(int durationMillisX, int durationMillisY) { | ||
animateXY(durationMillisX, durationMillisY, Easing.Linear, Easing.Linear); | ||
} | ||
|
||
/** | ||
* Animates values along both the X and Y axes. | ||
* | ||
* @param durationMillisX animation duration along the X axis | ||
* @param durationMillisY animation duration along the Y axis | ||
* @param easing EasingFunction for both axes | ||
*/ | ||
@RequiresApi(11) | ||
public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easing) { | ||
|
||
ObjectAnimator xAnimator = xAnimator(durationMillisX, easing); | ||
ObjectAnimator yAnimator = yAnimator(durationMillisY, easing); | ||
|
||
if (durationMillisX > durationMillisY) { | ||
xAnimator.addUpdateListener(mListener); | ||
} else { | ||
yAnimator.addUpdateListener(mListener); | ||
} | ||
|
||
xAnimator.start(); | ||
yAnimator.start(); | ||
} | ||
|
||
/** | ||
* Animates values along both the X and Y axes. | ||
* | ||
* @param durationMillisX animation duration along the X axis | ||
* @param durationMillisY animation duration along the Y axis | ||
* @param easingX EasingFunction for the X axis | ||
* @param easingY EasingFunction for the Y axis | ||
*/ | ||
@RequiresApi(11) | ||
public void animateXY(int durationMillisX, int durationMillisY, EasingFunction easingX, | ||
EasingFunction easingY) { | ||
|
||
ObjectAnimator xAnimator = xAnimator(durationMillisX, easingX); | ||
ObjectAnimator yAnimator = yAnimator(durationMillisY, easingY); | ||
|
||
if (durationMillisX > durationMillisY) { | ||
xAnimator.addUpdateListener(mListener); | ||
} else { | ||
yAnimator.addUpdateListener(mListener); | ||
} | ||
|
||
xAnimator.start(); | ||
yAnimator.start(); | ||
} | ||
|
||
/** | ||
* Animates values along the Y axis, in a linear fashion. | ||
* | ||
* @param durationMillis animation duration | ||
*/ | ||
@RequiresApi(11) | ||
public void animateY(int durationMillis) { | ||
animateY(durationMillis, Easing.Linear); | ||
} | ||
|
||
/** | ||
* Animates values along the Y axis. | ||
* | ||
* @param durationMillis animation duration | ||
* @param easing EasingFunction | ||
*/ | ||
@RequiresApi(11) | ||
public void animateY(int durationMillis, EasingFunction easing) { | ||
|
||
ObjectAnimator animatorY = yAnimator(durationMillis, easing); | ||
animatorY.addUpdateListener(mListener); | ||
animatorY.start(); | ||
} | ||
|
||
/** | ||
* Gets the Y axis phase of the animation. | ||
* | ||
* @return float value of {@link #mPhaseY} | ||
*/ | ||
public float getPhaseY() { | ||
return mPhaseY; | ||
} | ||
|
||
/** | ||
* Sets the Y axis phase of the animation. | ||
* | ||
* @param phase float value between 0 - 1 | ||
*/ | ||
public void setPhaseY(float phase) { | ||
if (phase > 1f) { | ||
phase = 1f; | ||
} else if (phase < 0f) { | ||
phase = 0f; | ||
} | ||
mPhaseY = phase; | ||
} | ||
|
||
/** | ||
* Gets the X axis phase of the animation. | ||
* | ||
* @return float value of {@link #mPhaseX} | ||
*/ | ||
public float getPhaseX() { | ||
return mPhaseX; | ||
} | ||
|
||
/** | ||
* Sets the X axis phase of the animation. | ||
* | ||
* @param phase float value between 0 - 1 | ||
*/ | ||
public void setPhaseX(float phase) { | ||
if (phase > 1f) { | ||
phase = 1f; | ||
} else if (phase < 0f) { | ||
phase = 0f; | ||
} | ||
mPhaseX = phase; | ||
} | ||
} |
Oops, something went wrong.