Skip to content

Commit

Permalink
Upgrade to gradle 6.5, ensure checksum of gradle-wrapper is official …
Browse files Browse the repository at this point in the history
…listed.

Solve new lint-warnings.
  • Loading branch information
Starcommander committed Jun 5, 2020
1 parent 9a55ee9 commit 279473f
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 82 deletions.
4 changes: 2 additions & 2 deletions PocketMaps/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android {
}

lintOptions {
disable 'InvalidPackage','MissingPrefix'
disable 'InvalidPackage','MissingPrefix','ProtectedPermissions'
}
}

Expand All @@ -48,7 +48,7 @@ dependencies {
implementation 'org.mapsforge:vtm-android:0.12.0:natives-x86_64'
implementation 'org.mapsforge:vtm-jts:0.12.0'
implementation 'org.mapsforge:vtm-themes:0.12.0'
implementation 'com.caverock:androidsvg-aar:1.4'
//implementation 'com.caverock:androidsvg-aar:1.4'

implementation 'org.slf4j:slf4j-api:1.7.28'
implementation 'org.slf4j:slf4j-android:1.7.28'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ public void onClick(Address addr)

// use a linear layout manager
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getApplicationContext());
layoutManager.setOrientation(LinearLayout.VERTICAL);
layoutManager.setOrientation(RecyclerView.VERTICAL);
listView.setLayoutManager(layoutManager);
listView.setItemAnimator(new DefaultItemAnimator());
listView.setAdapter(adapter);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.junjunguo.pocketmaps.activities;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
Expand Down Expand Up @@ -145,6 +146,7 @@ public OnClickListener createNaviCenterListener()
/**
* init and implement performance for settings
*/
@SuppressLint("ResourceAsColor")
private void initSettingsBtnHandler() {
settingsSetBtn.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
Expand Down Expand Up @@ -185,6 +187,7 @@ private void initSettingsBtnHandler() {
/**
* init and implement performance for favourites
*/
@SuppressLint("ResourceAsColor")
private void initFavourBtnHandler() {
initSearchLocationHandler(false, true, R.id.map_southbar_favour_add_fab, true);
initPointOnMapHandler(TabAction.AddFavourit, R.id.map_southbar_favour_select_fab, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.junjunguo.pocketmaps.R;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
Expand Down Expand Up @@ -111,9 +112,9 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in

/** Check if permission is already permitted.
* @param sPermission The Permission of android.Manifest.permission.xyz **/
public static boolean checkPermission(String sPermission, Activity activity) {
public static boolean checkPermission(String sPermission, Context context) {
// Check if the Camera permission has been granted
if (ActivityCompat.checkSelfPermission(activity, sPermission)
if (ActivityCompat.checkSelfPermission(context, sPermission)
== PackageManager.PERMISSION_GRANTED) {
return true;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import com.junjunguo.pocketmaps.activities.Permission;

import static com.villoren.android.kalmanlocationmanager.lib.KalmanLocationManager.KALMAN_PROVIDER;
import static com.villoren.android.kalmanlocationmanager.lib.KalmanLocationManager.UseProvider;
Expand Down Expand Up @@ -123,20 +124,26 @@ public void run() {
mLooper = Looper.myLooper();

if (mUseProvider == UseProvider.GPS || mUseProvider == UseProvider.GPS_AND_NET) {

mLocationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, mMinTimeGpsProvider, 0.0f, mOwnLocationListener, mLooper);
requestLoc(LocationManager.GPS_PROVIDER, mMinTimeGpsProvider);
}

if (mUseProvider == UseProvider.NET || mUseProvider == UseProvider.GPS_AND_NET) {

mLocationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER, mMinTimeNetProvider, 0.0f, mOwnLocationListener, mLooper);
requestLoc(LocationManager.NETWORK_PROVIDER, mMinTimeNetProvider);
}

Looper.loop();
}

private void requestLoc(String provider, long upTime)
{
String sPermission = android.Manifest.permission.ACCESS_FINE_LOCATION;
if (Permission.checkPermission(sPermission, mContext))
{
mLocationManager.requestLocationUpdates(
provider, upTime, 0.0f, mOwnLocationListener, mLooper);
}
}

/** Set maxPredictTime in millis. Disable with negative value. **/
public void setMaxPredictTime(long maxPredictTime)
{
Expand Down
18 changes: 9 additions & 9 deletions PocketMaps/app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,45 @@
android:id="@+id/menu_about_pocket_maps"
android:orderInCategory="100"
android:title="About"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_home_page"
android:orderInCategory="100"
android:title="@string/visit_home_page"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_rate_pocket_maps"
android:orderInCategory="100"
android:title="@string/rate_pocket_maps"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_voices"
android:orderInCategory="100"
android:title="@string/voice_navi"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_switch_maps_dir"
android:orderInCategory="100"
android:title="@string/switch_maps_dir"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_autoselect_map"
android:orderInCategory="100"
android:title="@string/autoselect_map"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_export"
android:orderInCategory="100"
android:title="@string/exp"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_units"
android:orderInCategory="100"
android:title="@string/units"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_help"
android:orderInCategory="100"
android:title="@string/help"
android:showAsAction="never"/>
app:showAsAction="never"/>
</menu>
18 changes: 9 additions & 9 deletions PocketMaps/app/src/main/res/menu/menu_maps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,46 @@
android:id="@+id/menu_map_downloaded"
android:orderInCategory="100"
android:title="Downloaded"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_africa"
android:orderInCategory="100"
android:title="Africa"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_asia"
android:orderInCategory="100"
android:title="Asia"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_australia_oceania"
android:orderInCategory="100"
android:title="Australia-oceania"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_central_america"
android:orderInCategory="100"
android:title="Central-america"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_europe"
android:orderInCategory="100"
android:title="Europe"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_north_america"
android:orderInCategory="100"
android:title="North-america"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_russia"
android:orderInCategory="100"
android:title="Russia"
android:showAsAction="never"/>
app:showAsAction="never"/>
<item
android:id="@+id/menu_map_south_america"
android:orderInCategory="100"
android:title="South-america"
android:showAsAction="never"/>
app:showAsAction="never"/>
</group>
</menu>
5 changes: 0 additions & 5 deletions PocketMaps/app/src/main/res/values-w820dp/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>


<dimen name="fab_size">56dp</dimen>

<dimen name="button_elevation">2dp</dimen>
<dimen name="button_press_elevation">4dp</dimen>
</resources>
3 changes: 2 additions & 1 deletion PocketMaps/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// NOTE: Versions compatible with wrapper: https://developer.android.com/studio/releases/gradle-plugin
}
}

Expand Down
4 changes: 4 additions & 0 deletions PocketMaps/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ org.gradle.jvmargs=-Xmx1536m
# 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
# org.gradle.parallel=true

# Enable to use AndroidX
android.useAndroidX=true
android.enableJetifier=true
Binary file modified PocketMaps/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions PocketMaps/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Oct 26 11:57:58 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
78 changes: 43 additions & 35 deletions PocketMaps/gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

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=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
Loading

0 comments on commit 279473f

Please sign in to comment.