Skip to content

Commit

Permalink
Project converted to Kotlin
Browse files Browse the repository at this point in the history
Reorganisation and cleanup
  • Loading branch information
VladimirWrites committed Nov 9, 2017
1 parent 263fcf6 commit 897f923
Show file tree
Hide file tree
Showing 71 changed files with 2,218 additions and 2,413 deletions.
19 changes: 13 additions & 6 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
Change Log
==========
Version 1.4.0 *(2017-11-09)*
----------------------------

* Project rewritten in Kotlin.
* Organization of base classes improved
* Fixed bugs in Sample app

Version 1.3.0 *(2017-11-03)*
----------------------------

Expand All @@ -11,8 +18,8 @@ Version 1.3.0 *(2017-11-03)*
Version 1.2.0 *(2017-02-16)*
----------------------------

* New curves added: BernoullisBowProgressView, BernoullisSharpProgressView, XProgressView, RoundScribbleProgressView, ScribbleProgressView
* colorAccent is now being used as default line color
* New curves added: `BernoullisBowProgressView`, `BernoullisSharpProgressView`, `XProgressView`, `RoundScribbleProgressView`, `ScribbleProgressView`
* `colorAccent` is now being used as default line color

Version 1.1.1 *(2017-01-26)*
----------------------------
Expand All @@ -22,19 +29,19 @@ Version 1.1.1 *(2017-01-26)*
Version 1.1.0 *(2017-01-26)*
----------------------------

* Abstract functions getGraphX() and getGraphY() now receive value of getT()
* Abstract functions `getGraphX()` and `getGraphY()` now receive value of `getT()`

Version 1.0.2 *(2017-01-24)*
----------------------------

* Fix: Added OnSaveState for Roulette curves
* Fix: Precision is being saved OnSaveState for all curves
* Fix: Added `onSaveState` for Roulette curves
* Fix: Precision is being saved `onSaveState` for all curves


Version 1.0.1 *(2017-01-23)*
----------------------------

* Fix: Crash on `setColor(int color)` in BaseCurveProgressBar, when called from constructor.
* Fix: Crash on `setColor(int color)` in `BaseCurveProgressBar`, when called from constructor.


Version 1.0.0 *(2017-01-23)*
Expand Down
2 changes: 1 addition & 1 deletion 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.3.0'
compile 'com.github.vlad1m1r990:Lemniscate:1.4.0'
}

Usage
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
@@ -1,12 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.51'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
11 changes: 8 additions & 3 deletions lemniscate/build.gradle
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 26
Expand All @@ -7,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 130
versionName "1.3.0"
versionCode 140
versionName "1.4.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -27,5 +28,9 @@ dependencies {
compile 'com.android.support:appcompat-v7:26.1.0'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.mockito:mockito-core:2.11.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
}

This file was deleted.

@@ -0,0 +1,38 @@
/*
* Copyright 2016 Vladimir Jovanovic
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.vlad1m1r.lemniscate

import android.content.Context
import android.util.AttributeSet

import com.vlad1m1r.lemniscate.base.BaseCurveProgressView

class BernoullisBowProgressView : BaseCurveProgressView {

constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

override fun getGraphY(t: Double): Float =
(viewSize.size.toDouble() * 0.75 * Math.sin(t) * Math.cos(t) / (1 + Math.pow(Math.cos(t), 6.0))).toFloat()

override fun getGraphX(t: Double): Float =
(viewSize.size.toDouble() * 0.75 * Math.cos(t) / (1 + Math.pow(Math.cos(t), 6.0))).toFloat()

}

This file was deleted.

@@ -0,0 +1,38 @@
/*
* Copyright 2016 Vladimir Jovanovic
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.vlad1m1r.lemniscate

import android.content.Context
import android.util.AttributeSet

import com.vlad1m1r.lemniscate.base.BaseCurveProgressView

class BernoullisProgressView : BaseCurveProgressView {

constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

override fun getGraphY(t: Double): Float =
((viewSize.size / 2).toDouble() * Math.sin(t) * Math.cos(t) / (1 + Math.pow(Math.sin(t), 2.0))).toFloat()

override fun getGraphX(t: Double): Float =
(viewSize.size / 2 * Math.cos(t) / (1 + Math.pow(Math.sin(t), 2.0))).toFloat()

}

This file was deleted.

@@ -0,0 +1,38 @@
/*
* Copyright 2016 Vladimir Jovanovic
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.vlad1m1r.lemniscate

import android.content.Context
import android.util.AttributeSet

import com.vlad1m1r.lemniscate.base.BaseCurveProgressView

class BernoullisSharpProgressView : BaseCurveProgressView {

constructor(context: Context) : super(context)

constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

override fun getGraphY(t: Double): Float =
(viewSize.size.toDouble() * Math.sin(t) * Math.cos(t) / (1 + Math.pow(Math.cos(t), 2.0))).toFloat()

override fun getGraphX(t: Double): Float =
(viewSize.size * Math.cos(t) / (1 + Math.pow(Math.cos(t), 2.0))).toFloat()

}

0 comments on commit 897f923

Please sign in to comment.