Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed May 29, 2022
1 parent 8b98552 commit 5f05964
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 28 deletions.
33 changes: 15 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,23 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 31
compileSdkVersion 32

defaultConfig {
applicationId 'org.traccar.client'
buildConfigField 'boolean', 'HIDDEN_APP', 'false'
minSdkVersion 16
targetSdkVersion 31
versionCode 77
versionName '6.16'
targetSdkVersion 32
versionCode 78
versionName '6.17'
multiDexEnabled true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'org.traccar.client'

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}

lintOptions {
checkReleaseBuilds false
resources {
excludes += ['META-INF/DEPENDENCIES']
}
}

flavorDimensions 'default'
Expand All @@ -44,12 +38,15 @@ android {
includeAndroidResources = true
}
}
lint {
checkReleaseBuilds false
}
}

dependencies {
implementation 'com.google.android.material:material:1.5.0-alpha05'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.test:core-ktx:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand All @@ -63,8 +60,8 @@ dependencies {
googleImplementation 'com.google.firebase:firebase-core'
googleImplementation 'com.google.firebase:firebase-analytics'
googleImplementation 'com.google.firebase:firebase-crashlytics'
googleImplementation 'com.google.android.gms:play-services-location:18.0.0'
googleImplementation 'com.google.android.play:core:1.10.2'
googleImplementation 'com.google.android.gms:play-services-location:19.0.1'
googleImplementation 'com.google.android.play:core:1.10.3'
}

if (getGradle().getStartParameter().getTaskRequests().toString().contains('Google')) {
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +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.client">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand All @@ -27,7 +26,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name=".MainApplication"
tools:ignore="GoogleAppIndexingWarning">
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">

<meta-data
android:name="google_analytics_adid_collection_enabled"
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/org/traccar/client/MainFragment.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012 - 2021 Anton Tananaev ([email protected])
* Copyright 2012 - 2022 Anton Tananaev ([email protected])
*
* 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 @@ -62,7 +62,7 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
removeLauncherIcon()
}
setHasOptionsMenu(true)
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
setPreferencesFromResource(R.xml.preferences, rootKey)
initPreferences()

Expand Down Expand Up @@ -126,6 +126,7 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
}
}

@Suppress("DEPRECATION")
override fun onDisplayPreferenceDialog(preference: Preference) {
if (listOf(KEY_INTERVAL, KEY_DISTANCE, KEY_ANGLE).contains(preference.key)) {
val f: EditTextPreferenceDialogFragmentCompat =
Expand Down Expand Up @@ -213,7 +214,7 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
}

private fun initPreferences() {
PreferenceManager.setDefaultValues(activity, R.xml.preferences, false)
PreferenceManager.setDefaultValues(requireActivity(), R.xml.preferences, false)
if (!sharedPreferences.contains(KEY_DEVICE)) {
val id = (Random().nextInt(900000) + 100000).toString()
sharedPreferences.edit().putString(KEY_DEVICE, id).apply()
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
ext.kotlin_version = '1.5.31'
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
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-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip

0 comments on commit 5f05964

Please sign in to comment.