Skip to content

Commit

Permalink
Merge branch 'release/1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Feb 8, 2022
2 parents fd2815a + 685910e commit 5b0ae8d
Show file tree
Hide file tree
Showing 51 changed files with 323 additions and 187 deletions.
11 changes: 5 additions & 6 deletions .idea/gradle.xml

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

10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.5.21'
ext.kotlin_version = '1.6.10'
ext.androidx_hilt_version = '1.0.0'
ext.hilt_version = '2.40.5'
ext.retrofit_version = '2.9.0'

repositories {
google()
Expand All @@ -12,11 +15,10 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.4.1"
// NOTE: Do not place application dependencies here; they belong
// in the individual module build.gradle files
}
}

Expand Down
2 changes: 1 addition & 1 deletion gn_mobile_core
Submodule gn_mobile_core updated 215 files
2 changes: 1 addition & 1 deletion gn_mobile_maps
Submodule gn_mobile_maps updated 41 files
+0 −9 .idea/codeStyles/Project.xml
+1 −1 .idea/compiler.xml
+2 −3 .idea/gradle.xml
+5 −0 .idea/jarRepositories.xml
+12 −1 .idea/misc.xml
+0 −12 .idea/runConfigurations.xml
+20 −16 app/build.gradle
+7 −2 app/src/main/AndroidManifest.xml
+11 −0 app/src/main/java/fr/geonature/maps/sample/ui/home/HomeActivity.kt
+2 −0 app/src/main/java/fr/geonature/maps/sample/ui/home/HomeListFragment.kt
+2 −0 app/src/main/java/fr/geonature/maps/sample/ui/home/MenuItem.kt
+4 −0 app/src/main/java/fr/geonature/maps/sample/ui/home/MenuItemRecyclerViewAdapter.kt
+55 −2 app/src/main/java/fr/geonature/maps/sample/ui/map/MapActivity.kt
+1 −2 app/src/main/java/fr/geonature/maps/sample/ui/settings/PreferencesActivity.kt
+33 −3 app/src/main/java/fr/geonature/maps/sample/ui/settings/PreferencesFragment.kt
+1 −1 app/src/main/java/fr/geonature/maps/sample/util/PreferencesUtils.kt
+2 −0 app/src/main/res/values-fr/prefs.xml
+3 −0 app/src/main/res/values/prefs.xml
+33 −0 app/src/main/res/xml/data_extraction_rules.xml
+12 −0 app/src/main/res/xml/preferences_about.xml
+11 −0 app/src/main/res/xml/preferences_permissions.xml
+1 −9 app/src/main/res/xml/preferences_storage.xml
+2 −2 app/version.properties
+4 −4 build.gradle
+1 −1 gn_mobile_core
+1 −1 gradle/wrapper/gradle-wrapper.properties
+24 −22 maps/build.gradle
+14 −6 maps/src/main/AndroidManifest.xml
+3 −3 maps/src/main/java/fr/geonature/maps/settings/LayerSettingsViewModel.kt
+112 −91 maps/src/main/java/fr/geonature/maps/ui/MapFragment.kt
+40 −7 maps/src/main/java/fr/geonature/maps/ui/overlay/CompassOrientationProvider.kt
+41 −21 maps/src/main/java/fr/geonature/maps/ui/overlay/MyLocationOverlay.kt
+4 −4 maps/src/main/java/fr/geonature/maps/ui/widget/RotateCompassButton.kt
+92 −0 maps/src/main/java/fr/geonature/maps/util/CheckPermissionLifecycleObserver.kt
+88 −0 maps/src/main/java/fr/geonature/maps/util/ManageExternalStoragePermissionLifecycleObserver.kt
+1 −1 maps/src/main/java/fr/geonature/maps/util/MapSettingsPreferencesUtils.kt
+36 −0 maps/src/main/java/fr/geonature/maps/util/PermissionUtils.kt
+2 −2 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/CirclePointOverlayTest.kt
+1 −1 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/LineStringOverlayTest.kt
+2 −2 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/PolygonOverlayTest.kt
+2 −2 maps/version.properties
6 changes: 4 additions & 2 deletions gn_mobile_occtax.iml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/out/production/classes" />
<output-test url="file://$MODULE_DIR$/out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/out" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
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 @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
48 changes: 30 additions & 18 deletions occtax/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.application'
id 'dagger.hilt.android.plugin'
id 'kotlin-android'
id 'kotlin-kapt'
}

version = "1.3.0"
version = "1.3.1"

android {
compileSdkVersion 29
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}

defaultConfig {
applicationId "fr.geonature.occtax"
minSdkVersion 21
targetSdkVersion 29
versionCode updateVersionCode(module.name)
targetSdkVersion 31
versionCode updateVersionCode(project.name)
versionName version
buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\""
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
archivesBaseName = module.name + "-" + versionName
archivesBaseName = project.name + "-" + versionName
}

signingConfigs {
release {
readKeystoreProperties(module.name)
readKeystoreProperties(project.name)
}
}

Expand Down Expand Up @@ -66,18 +74,22 @@ dependencies {
implementation project(':viewpager')
implementation project(':maps')

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
// Hilt dependencies
implementation "androidx.hilt:hilt-work:$androidx_hilt_version"
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "androidx.hilt:hilt-compiler:$androidx_hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"

implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation "io.github.l4digital:fastscroll:2.0.1"

// Testing dependencies
testImplementation 'androidx.test:core:1.4.0'
testImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.7.3'
}
1 change: 1 addition & 0 deletions occtax/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<activity
android:name=".ui.home.HomeActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
2 changes: 2 additions & 0 deletions occtax/src/main/java/fr/geonature/occtax/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fr.geonature.occtax

import android.app.Application
import android.util.Log
import dagger.hilt.android.HiltAndroidApp
import fr.geonature.mountpoint.util.MountPointUtils
import fr.geonature.occtax.di.ServiceLocator

Expand All @@ -10,6 +11,7 @@ import fr.geonature.occtax.di.ServiceLocator
*
* @author S. Grimault
*/
@HiltAndroidApp
class MainApplication : Application() {

override fun onCreate() {
Expand Down
8 changes: 4 additions & 4 deletions occtax/src/main/java/fr/geonature/occtax/input/InputTaxon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ package fr.geonature.occtax.input

import android.os.Parcel
import android.os.Parcelable
import fr.geonature.commons.data.AbstractTaxon
import fr.geonature.commons.data.entity.AbstractTaxon
import fr.geonature.commons.input.AbstractInputTaxon
import java.util.SortedMap
import java.util.TreeMap

/**
* Describes an input taxon.
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class InputTaxon : AbstractInputTaxon {

val properties: SortedMap<String, PropertyValue> =
TreeMap<String, PropertyValue> { o1, o2 ->
TreeMap { o1, o2 ->
val i1 = defaultPropertiesMnemonic.indexOfFirst { it.first == o1 }
val i2 = defaultPropertiesMnemonic.indexOfFirst { it.first == o2 }

Expand All @@ -25,7 +25,7 @@ class InputTaxon : AbstractInputTaxon {
else -> i1 - i2
}
}
private val counting: SortedMap<Int, CountingMetadata> = TreeMap<Int, CountingMetadata>()
private val counting: SortedMap<Int, CountingMetadata> = TreeMap()

constructor(taxon: AbstractTaxon) : super(taxon)
constructor(source: Parcel) : super(source) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package fr.geonature.occtax.input

import android.os.Parcel
import android.os.Parcelable
import fr.geonature.commons.data.Nomenclature
import fr.geonature.commons.data.entity.Nomenclature
import fr.geonature.commons.input.AbstractInputTaxon
import java.io.Serializable

/**
* Property value for [AbstractInputTaxon]
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
data class PropertyValue(
val code: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package fr.geonature.occtax.input.io
import android.text.TextUtils
import android.util.JsonReader
import android.util.JsonToken
import fr.geonature.commons.data.Taxon
import fr.geonature.commons.data.Taxonomy
import fr.geonature.commons.data.entity.Taxon
import fr.geonature.commons.data.entity.Taxonomy
import fr.geonature.commons.input.io.InputJsonReader
import fr.geonature.commons.util.toDate
import fr.geonature.maps.jts.geojson.io.GeoJsonReader
Expand All @@ -19,7 +19,7 @@ import java.util.Locale
/**
* Default implementation of [InputJsonReader.OnInputJsonReaderListener].
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class OnInputJsonReaderListenerImpl : InputJsonReader.OnInputJsonReaderListener<Input> {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package fr.geonature.occtax.settings

import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import fr.geonature.commons.settings.AppSettingsManagerImpl
import fr.geonature.commons.settings.IAppSettingsManager
import fr.geonature.occtax.settings.io.OnAppSettingsJsonReaderListenerImpl
import javax.inject.Singleton

/**
* Application settings module.
*
* @author S. Grimault
*/
@Module
@InstallIn(SingletonComponent::class)
object AppSettingsModule {

@Singleton
@Provides
fun provideAppSettingsManager(
@ApplicationContext appContext: Context
): IAppSettingsManager<AppSettings> {
return AppSettingsManagerImpl(
appContext,
OnAppSettingsJsonReaderListenerImpl()
)
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package fr.geonature.occtax.settings

import android.app.Application
import dagger.hilt.android.lifecycle.HiltViewModel
import fr.geonature.commons.settings.IAppSettingsManager
import javax.inject.Inject
import fr.geonature.commons.settings.AppSettingsViewModel as BaseAppSettingsViewModel
import fr.geonature.occtax.settings.io.OnAppSettingsJsonReaderListenerImpl

/**
* [AppSettings] view model.
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class AppSettingsViewModel(application: Application) : BaseAppSettingsViewModel<AppSettings>(
application,
OnAppSettingsJsonReaderListenerImpl()
)
@HiltViewModel
class AppSettingsViewModel @Inject constructor(appSettingsManager: IAppSettingsManager<AppSettings>) :
BaseAppSettingsViewModel<AppSettings>(
appSettingsManager
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import fr.geonature.commons.data.Dataset
import fr.geonature.commons.data.entity.Dataset
import fr.geonature.occtax.R

/**
* Let the user to choose a [Dataset] from the list.
*
* @see DatasetListFragment
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class DatasetListActivity : AppCompatActivity(),
DatasetListFragment.OnDatasetListFragmentListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ import androidx.loader.content.Loader
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import fr.geonature.commons.data.Dataset
import fr.geonature.commons.data.entity.Dataset
import fr.geonature.commons.data.helper.Provider.buildUri
import fr.geonature.occtax.R
import fr.geonature.occtax.R.layout.fast_scroll_recycler_view

/**
* [Fragment] to let the user to choose a [Dataset] from the list.
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class DatasetListFragment : Fragment() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import android.widget.CheckBox
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.l4digital.fastscroll.FastScroller
import fr.geonature.commons.data.Dataset
import fr.geonature.commons.data.entity.Dataset
import fr.geonature.occtax.R

/**
* Default RecyclerView Adapter used by [DatasetListFragment].
*
* @see DatasetListFragment
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class DatasetRecyclerViewAdapter(private val listener: OnDatasetRecyclerViewAdapterListener) :
RecyclerView.Adapter<DatasetRecyclerViewAdapter.ViewHolder>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import android.text.format.DateFormat
import android.util.AttributeSet
import android.util.Pair
import android.view.View
import fr.geonature.commons.data.AppSync
import fr.geonature.commons.data.entity.AppSync
import fr.geonature.occtax.R
import fr.geonature.occtax.ui.shared.view.ListItemActionView
import java.text.NumberFormat

/**
* Custom [View] about [AppSync].
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
* @author S. Grimault
*/
class AppSyncView : ListItemActionView {

Expand Down
Loading

0 comments on commit 5b0ae8d

Please sign in to comment.