diff --git a/.gitignore b/.gitignore index 77cbeee5a..473466522 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,4 @@ build/ .gradletasknamecache gradle.properties +libs/jars/graphViewM.jar diff --git a/build.gradle b/build.gradle index ddd7534ac..607c40806 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { @@ -44,18 +44,20 @@ dependencies { //this is used to generate .jar files and push to maven repo // This is the actual solution, as in http://stackoverflow.com/a/19037807/1002054 -task clearJar(type: Delete) { - delete 'build/outputs/myCompiledLibrary.jar' +task deleteJar(type: Delete) { + delete 'libs/jars/graphViewM.jar' } -task makeJar(type: Copy) { - from('build/intermediates/bundles/release/') - into('build/outputs/') +task createJar(type: Copy) { + //from('build/intermediates/bundles/release/') + from('build/intermediates/packaged-classes/release/') + //from('build/intermediates/aar_main_jar/release/') + into('libs/jars/') include('classes.jar') - rename ('classes.jar', 'myCompiledLibrary.jar') + rename('classes.jar', 'graphViewM.jar') } -makeJar.dependsOn(clearJar, build) +createJar.dependsOn(deleteJar, build) apply from: './maven_push.gradle' diff --git a/gradle.properties b/gradle.properties index 86a27f74c..6f6a1a489 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=4.2.2 +VERSION_NAME=4.2.3 VERSION_CODE=17 GROUP=com.jjoe64 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 01b8bf6b1..5c2d1cf01 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 25f587d12..ef9a9e05e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip diff --git a/gradlew b/gradlew index cccdd3d51..83f2acfdc 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index e95643d6a..24467a141 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/maven_push.gradle b/maven_push.gradle index 3d15ef167..173240238 100644 --- a/maven_push.gradle +++ b/maven_push.gradle @@ -3,7 +3,7 @@ apply plugin: 'signing' import org.gradle.plugins.signing.Sign -gradle.taskGraph.whenReady { taskGraph -> +/*gradle.taskGraph.whenReady { taskGraph -> if (taskGraph.allTasks.any { it instanceof Sign }) { // Use Java 6's console to read from the console (no good for // a CI environment) @@ -21,7 +21,7 @@ gradle.taskGraph.whenReady { taskGraph -> console.printf "\nThanks.\n\n" + file } -} +}*/ def sonatypeRepositoryUrl if (isReleaseBuild()) { diff --git a/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java b/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java index 37210b4e7..9004f2dd2 100644 --- a/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java +++ b/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java @@ -75,6 +75,11 @@ public final class Styles { */ public Paint.Align verticalLabelsSecondScaleAlign; + /** + * the alignment of the horizontal labels bottom + */ + public Paint.Align horizontalLabelsAlign; + /** * the color of the vertical labels */ @@ -400,6 +405,7 @@ public void resetStyles() { mStyles.labelsSpace = (int) mStyles.textSize/5; mStyles.verticalLabelsAlign = Paint.Align.RIGHT; + mStyles.horizontalLabelsAlign = Paint.Align.CENTER; mStyles.verticalLabelsSecondScaleAlign = Paint.Align.LEFT; mStyles.highlightZeroLines = true; @@ -510,6 +516,14 @@ public Paint.Align getVerticalLabelsAlign() { return mStyles.verticalLabelsAlign; } + /** + * @return the alignment of the text of the + * vertical labels + */ + public Paint.Align getHorizontalLabelsAlign() { + return mStyles.horizontalLabelsAlign; + } + /** * @return the font color of the horizontal labels */ @@ -939,7 +953,7 @@ protected boolean adjustHorizontal(boolean changeBounds) { } // it can happen that we need to add some more labels to fill the complete screen - numHorizontalLabels = (int) ((mGraphView.getViewport().mCurrentViewport.width() / exactSteps)) + 1; + numHorizontalLabels = (int) ((mGraphView.getViewport().mCurrentViewport.width() / exactSteps)) + 2; if (mStepsHorizontal != null) { mStepsHorizontal.clear(); @@ -1223,11 +1237,11 @@ protected void drawHorizontalSteps(Canvas canvas) { mPaintLabel.setTextAlign((Paint.Align.LEFT)); } } else { - mPaintLabel.setTextAlign(Paint.Align.CENTER); - if (i == mStepsHorizontal.size() - 1) + mPaintLabel.setTextAlign(getHorizontalLabelsAlign()); + /*if (i == mStepsHorizontal.size() - 1) mPaintLabel.setTextAlign(Paint.Align.RIGHT); if (i == 0) - mPaintLabel.setTextAlign(Paint.Align.LEFT); + mPaintLabel.setTextAlign(Paint.Align.LEFT);*/ } // multiline labels @@ -1517,6 +1531,13 @@ public void setVerticalLabelsAlign(Paint.Align verticalLabelsAlign) { mStyles.verticalLabelsAlign = verticalLabelsAlign; } + /** + * @param horizontalLabelsAlign the alignment of the vertical labels + */ + public void setHorizontalLabelsAlign(Paint.Align horizontalLabelsAlign) { + mStyles.horizontalLabelsAlign = horizontalLabelsAlign; + } + /** * @param verticalLabelsColor the color of the vertical labels */