Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ build/
.gradletasknamecache
gradle.properties

libs/jars/graphViewM.jar
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply plugin: 'com.android.library'


android {
compileSdkVersion 27
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=4.2.2
VERSION_NAME=4.2.3
VERSION_CODE=17
GROUP=com.jjoe64

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
22 changes: 19 additions & 3 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions maven_push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -21,7 +21,7 @@ gradle.taskGraph.whenReady { taskGraph ->

console.printf "\nThanks.\n\n" + file
}
}
}*/

def sonatypeRepositoryUrl
if (isReleaseBuild()) {
Expand Down
29 changes: 25 additions & 4 deletions src/main/java/com/jjoe64/graphview/GridLabelRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down