Skip to content

Commit

Permalink
Target Android 10
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Sep 23, 2019
1 parent 3d400c3 commit 3b90ada
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 20 deletions.
17 changes: 8 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
compileSdkVersion 29

defaultConfig {
applicationId 'org.traccar.manager'
minSdkVersion 19
targetSdkVersion 28
versionCode 18
versionName '2.8'
targetSdkVersion 29
versionCode 19
versionName '2.9'
}

flavorDimensions 'default'
Expand All @@ -20,10 +19,10 @@ android {
}

dependencies {
implementation 'com.android.support:design:28.0.0-rc02'
googleImplementation 'com.google.firebase:firebase-core:16.0.3'
googleImplementation 'com.google.firebase:firebase-messaging:17.3.2'
googleImplementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.android.material:material:1.0.0'
googleImplementation 'com.google.firebase:firebase-core:17.2.0'
googleImplementation 'com.google.firebase:firebase-messaging:20.0.0'
googleImplementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}

if (getGradle().getStartParameter().getTaskRequests().toString().contains('Google')) {
Expand Down
3 changes: 2 additions & 1 deletion app/src/google/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

<application
android:name=".GoogleMainApplication"
tools:replace="android:name">
tools:replace="android:name"
tools:ignore="GoogleAppIndexingWarning">

<meta-data
android:name="google_analytics_adid_collection_enabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.support.v4.content.LocalBroadcastManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.analytics.FirebaseAnalytics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import androidx.core.app.NotificationCompat;

import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.traccar.manager">

<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -10,7 +11,8 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="GoogleAppIndexingWarning">

<activity
android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/traccar/manager/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/org/traccar/manager/MainFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import androidx.annotation.Nullable;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.MimeTypeMap;
Expand Down Expand Up @@ -164,7 +164,6 @@ public WebResourceResponse loadFileFromAssets(String url, String file) throws IO

private WebViewClient webViewClient = new WebViewClient() {

@SuppressWarnings("deprecation")
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
Uri uri = Uri.parse(url);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/org/traccar/manager/StartFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.traccar.manager;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.DialogInterface;
Expand Down Expand Up @@ -54,6 +55,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
return view;
}

@SuppressLint("StaticFieldLeak")
@Override
public void onClick(View view) {
startButton.setEnabled(false);
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.2'
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.2'
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.enableJetifier=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

0 comments on commit 3b90ada

Please sign in to comment.