Skip to content

Commit

Permalink
Merge pull request #1 from vlad1m1r990/project_redesign
Browse files Browse the repository at this point in the history
Optimization and cleanup
  • Loading branch information
VladimirWrites committed Nov 3, 2017
2 parents 39c97fe + 9031014 commit cb0c8e8
Show file tree
Hide file tree
Showing 61 changed files with 1,357 additions and 1,039 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -35,6 +35,7 @@ captures/
# Intellij
*.iml
.idea/workspace.xml
.idea/

# Keystore files
*.jks
10 changes: 3 additions & 7 deletions README.md
Expand Up @@ -34,7 +34,7 @@ Add to your module's build.gradle:
and to your app build.gradle:

dependencies {
compile 'com.github.vlad1m1r990:Lemniscate:1.2.0'
compile 'com.github.vlad1m1r990:Lemniscate:1.3.0'
}

Usage
Expand All @@ -48,8 +48,6 @@ Example of usage:
app:duration="1000"
app:hasHole="false"
app:lineColor="@color/colorPrimary"
app:lineLength="0.6"
app:lineLengthChangeable="true"
app:maxLineLength="0.8"
app:minLineLength="0.4"
app:sizeMultiplier="1"
Expand All @@ -59,10 +57,8 @@ Example of usage:

* **duration** (int) - duration of one animation cycle in millisecondes
* **lineColor** (color) - color of the line
* **lineLengthChangeable** (boolean) - if true, the line length will oscillate between maxLineLength and minLineLength
* **lineLength** (float) - length of line (in percentage; 1.0 is full length, 0.5 is half of length) if **lineLengthChangeable** is false
* **maxLineLength** (float) - max length of line (in percentage; 1.0 is full length, 0.5 is half of length) if **lineLengthChangeable** is true
* **minLineLength** (float) - min length of line (in percentage; 1.0 is full length, 0.5 is half of length) if **lineLengthChangeable** is true
* **maxLineLength** (float) - max length of line (in percentage; 1.0 is full length, 0.5 is half of length)
* **minLineLength** (float) - min length of line (in percentage; 1.0 is full length, 0.5 is half of length)
* **sizeMultiplier** (float) - default size of view will be multiplied with that number
* **strokeWidth** (dimension) - width of line
* **precision** (int) - number of points in curve calculated in one cycle
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Mar 23 13:44:03 CET 2017
#Wed Oct 25 23:03:04 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Empty file modified gradlew 100755 → 100644
Empty file.
16 changes: 9 additions & 7 deletions lemniscate/build.gradle
@@ -1,14 +1,14 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
minSdkVersion 11
targetSdkVersion 25
versionCode 120
versionName "1.2.0"
minSdkVersion 14
targetSdkVersion 26
versionCode 130
versionName "1.3.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -24,6 +24,8 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:26.1.0'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
}

This file was deleted.

Expand Up @@ -21,7 +21,6 @@

import com.vlad1m1r.lemniscate.base.BaseCurveProgressView;


public class BernoullisBowProgressView extends BaseCurveProgressView {

public BernoullisBowProgressView(Context context) {
Expand All @@ -36,11 +35,13 @@ public BernoullisBowProgressView(Context context, AttributeSet attrs, int defSty
super(context, attrs, defStyleAttr);
}

public double getGraphY(double t){
return (mLemniscateParamY * 1.5 * Math.sin(t) * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 6));
@Override
public float getGraphY(double t){
return (float) ((viewSize.getSize() * 0.75 * Math.sin(t) * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 6)));
}

public double getGraphX(double t){
return (mLemniscateParamX * 1.5 * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 6));
@Override
public float getGraphX(double t){
return (float) ((viewSize.getSize() * 0.75 * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 6)));
}
}
Expand Up @@ -21,8 +21,6 @@

import com.vlad1m1r.lemniscate.base.BaseCurveProgressView;



public class BernoullisProgressView extends BaseCurveProgressView {

public BernoullisProgressView(Context context) {
Expand All @@ -37,11 +35,13 @@ public BernoullisProgressView(Context context, AttributeSet attrs, int defStyleA
super(context, attrs, defStyleAttr);
}

public double getGraphY(double t){
return (mLemniscateParamY * Math.sin(t) * Math.cos(t)) / (1 + Math.pow(Math.sin(t), 2));
@Override
public float getGraphY(double t){
return (float) ((viewSize.getSize() / 2 * Math.sin(t) * Math.cos(t)) / (1 + Math.pow(Math.sin(t), 2)));
}

public double getGraphX(double t){
return (mLemniscateParamX * Math.cos(t)) / (1 + Math.pow(Math.sin(t), 2));
@Override
public float getGraphX(double t){
return (float) ((viewSize.getSize() / 2 * Math.cos(t)) / (1 + Math.pow(Math.sin(t), 2)));
}
}
Expand Up @@ -21,7 +21,6 @@

import com.vlad1m1r.lemniscate.base.BaseCurveProgressView;


public class BernoullisSharpProgressView extends BaseCurveProgressView {

public BernoullisSharpProgressView(Context context) {
Expand All @@ -36,11 +35,13 @@ public BernoullisSharpProgressView(Context context, AttributeSet attrs, int defS
super(context, attrs, defStyleAttr);
}

public double getGraphY(double t){
return (mLemniscateParamY * 2 * Math.sin(t) * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 2));
@Override
public float getGraphY(double t){
return (float) ((viewSize.getSize() * Math.sin(t) * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 2)));
}

public double getGraphX(double t){
return (mLemniscateParamX * 2 * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 2));
@Override
public float getGraphX(double t){
return (float) ((viewSize.getSize() * Math.cos(t)) / (1 + Math.pow(Math.cos(t), 2)));
}
}
Expand Up @@ -36,12 +36,12 @@ public GeronosProgressView(Context context, AttributeSet attrs, int defStyleAttr
}

@Override
public double getGraphY(double t) {
return mLemniscateParamX * Math.sin(t) * Math.cos(t);
public float getGraphY(double t) {
return (float) (viewSize.getSize() / 2 * Math.sin(t) * Math.cos(t));
}

@Override
public double getGraphX(double t) {
return mLemniscateParamX * Math.sin(t);
public float getGraphX(double t) {
return (float) (viewSize.getSize() / 2 * Math.sin(t));
}
}

0 comments on commit cb0c8e8

Please sign in to comment.