Skip to content

Commit

Permalink
Update to AndroidX
Browse files Browse the repository at this point in the history
Use AndroidX instead of the support libraries.
  • Loading branch information
tredpath committed Jul 15, 2020
1 parent 1984cd8 commit 94fe4a4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
11 changes: 4 additions & 7 deletions HeatMapExample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ allprojects {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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:26.1.0'
testCompile 'junit:junit:4.12'
compile project(path: ':HeatMapLib')
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.appcompat:appcompat:1.1.0"
testImplementation 'junit:junit:4.13'
implementation project(path: ':HeatMapLib')
}
11 changes: 7 additions & 4 deletions HeatMapExample/src/main/java/ca/hss/heatmap/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MainActivity.java
*
* Copyright 2017 Heartland Software Solutions Inc.
* Copyright 2020 Heartland Software Solutions Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,16 +20,16 @@

import android.graphics.Color;
import android.os.AsyncTask;
import android.support.annotation.AnyThread;
import android.support.v4.util.ArrayMap;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.AnyThread;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import java.util.Map;
import java.util.Random;

import androidx.collection.ArrayMap;
import ca.hss.heatmaplib.HeatMap;
import ca.hss.heatmaplib.HeatMapMarkerCallback;

Expand Down Expand Up @@ -106,14 +106,17 @@ private void drawNewMap() {
}
}

@SuppressWarnings("SameParameterValue")
private float clamp(float value, float min, float max) {
return value * (max - min) + min;
}

@SuppressWarnings("SameParameterValue")
private double clamp(double value, double min, double max) {
return value * (max - min) + min;
}

@SuppressWarnings("SameParameterValue")
private static int doGradient(double value, double min, double max, int min_color, int max_color) {
if (value >= max) {
return max_color;
Expand Down
4 changes: 1 addition & 3 deletions HeatMapLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ allprojects {
}

dependencies {
compile 'com.android.support:support-v4:26.1.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:26.1.0'
implementation "androidx.annotation:annotation:1.1.0"
}

apply plugin: 'com.github.dcendents.android-maven'
Expand Down
8 changes: 4 additions & 4 deletions HeatMapLib/src/main/java/ca/hss/heatmaplib/HeatMap.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* HeatMap.java
*
* Copyright 2017 Heartland Software Solutions Inc.
* Copyright 2020 Heartland Software Solutions Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,9 +30,9 @@
import android.graphics.RadialGradient;
import android.graphics.Rect;
import android.graphics.Shader;
import android.support.annotation.AnyThread;
import android.support.annotation.WorkerThread;
import android.support.annotation.ColorInt;
import androidx.annotation.AnyThread;
import androidx.annotation.WorkerThread;
import androidx.annotation.ColorInt;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* HeatMapMarkerCallback.java
*
* Copyright 2017 Heartland Software Solutions Inc.
* Copyright 2020 Heartland Software Solutions Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@

import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.ColorInt;
import androidx.annotation.ColorInt;

/**
* A callback to allow markers to be drawn over the heatmap at each data point.
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

android.useAndroidX=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down

0 comments on commit 94fe4a4

Please sign in to comment.