Skip to content

Commit

Permalink
Merge branch 'release/0.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Sep 14, 2019
2 parents 5843caa + 07e9e7c commit a1e3f31
Show file tree
Hide file tree
Showing 25 changed files with 570 additions and 269 deletions.
9 changes: 0 additions & 9 deletions .idea/codeStyles/Project.xml

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

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

buildscript {
ext.kotlin_version = '1.3.41'
ext.kotlin_version = '1.3.50'

repositories {
google()
Expand All @@ -10,7 +10,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your 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 113 files
2 changes: 1 addition & 1 deletion gn_mobile_maps
Submodule gn_mobile_maps updated 53 files
+9 −12 .idea/codeStyles/Project.xml
+6 −6 app/build.gradle
+60 −53 app/src/main/java/fr/geonature/maps/sample/ui/MainActivity.kt
+2 −2 build.gradle
+2 −2 gradle/wrapper/gradle-wrapper.properties
+44 −16 maps/README.md
+6 −4 maps/build.gradle
+5 −8 maps/src/main/java/fr/geonature/maps/jts/geojson/Feature.kt
+5 −8 maps/src/main/java/fr/geonature/maps/jts/geojson/FeatureCollection.kt
+23 −2 maps/src/main/java/fr/geonature/maps/jts/geojson/GeometryUtils.kt
+6 −2 maps/src/main/java/fr/geonature/maps/jts/geojson/filter/IFeatureFilterVisitor.kt
+23 −34 maps/src/main/java/fr/geonature/maps/jts/geojson/filter/NearestFeaturesFilter.kt
+151 −75 maps/src/main/java/fr/geonature/maps/jts/geojson/io/GeoJsonReader.kt
+21 −35 maps/src/main/java/fr/geonature/maps/jts/geojson/io/WKTReader.kt
+26 −38 maps/src/main/java/fr/geonature/maps/settings/LayerSettings.kt
+173 −0 maps/src/main/java/fr/geonature/maps/settings/LayerStyleSettings.kt
+114 −93 maps/src/main/java/fr/geonature/maps/settings/MapSettings.kt
+58 −31 maps/src/main/java/fr/geonature/maps/settings/io/MapSettingsReader.kt
+115 −124 maps/src/main/java/fr/geonature/maps/ui/MapFragment.kt
+47 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/AbstractGeometryOverlay.kt
+41 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/CirclePointOverlay.kt
+62 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/FeatureCollectionOverlay.kt
+76 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/FeatureOverlay.kt
+76 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/FeatureOverlayProvider.kt
+53 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/GeometryCollectionOverlay.kt
+27 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/LineStringOverlay.kt
+47 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/PolygonOverlay.kt
+38 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/filter/ContainsFeaturesFilter.kt
+19 −0 maps/src/main/java/fr/geonature/maps/ui/overlay/feature/filter/IFeatureOverlayFilterVisitor.kt
+103 −120 maps/src/main/java/fr/geonature/maps/ui/widget/EditFeatureButton.kt
+10 −5 maps/src/main/java/fr/geonature/maps/util/ThemeUtils.kt
+1 −1 maps/src/main/res/values-fr/strings.xml
+1 −1 maps/src/main/res/values/strings.xml
+345 −512 maps/src/test/java/fr/geonature/maps/jts/geojson/io/GeoJsonReaderTest.kt
+5 −5 maps/src/test/java/fr/geonature/maps/jts/geojson/io/WKTFileReaderTest.kt
+40 −62 maps/src/test/java/fr/geonature/maps/jts/geojson/io/WKTReaderTest.kt
+36 −34 maps/src/test/java/fr/geonature/maps/settings/LayerSettingsTest.kt
+240 −0 maps/src/test/java/fr/geonature/maps/settings/LayerStyleSettingsTest.kt
+119 −1 maps/src/test/java/fr/geonature/maps/settings/MapSettingsTest.kt
+38 −72 maps/src/test/java/fr/geonature/maps/settings/io/MapSettingsReaderTest.kt
+84 −0 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/CirclePointOverlayTest.kt
+161 −0 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/FeatureCollectionOverlayTest.kt
+185 −0 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/FeatureOverlayTest.kt
+193 −0 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/GeometryCollectionOverlayTest.kt
+76 −0 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/LineStringOverlayTest.kt
+143 −0 maps/src/test/java/fr/geonature/maps/ui/overlay/feature/PolygonOverlayTest.kt
+80 −1 maps/src/test/resources/fixtures/feature_multipolygon.json
+391 −0 maps/src/test/resources/fixtures/featurecollection_polygons.json
+70 −0 maps/src/test/resources/fixtures/features.json
+1 −0 maps/src/test/resources/fixtures/features.wkt
+14 −1 maps/src/test/resources/fixtures/map_settings.json
+2 −1 maps/src/test/resources/fixtures/map_settings_with_invalid_layers.json
+2 −2 maps/version.properties
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Apr 18 21:20:10 CEST 2019
#Wed Aug 21 20:56:36 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
15 changes: 8 additions & 7 deletions occtax/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

version = "0.1.2"
version = "0.1.4"

android {
compileSdkVersion 28
Expand Down Expand Up @@ -51,20 +51,21 @@ dependencies {
implementation project(':maps')

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'

implementation 'androidx.core:core-ktx:1.2.0-alpha02'
implementation 'androidx.core:core-ktx:1.2.0-alpha04'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0-alpha04"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta01'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'com.l4digital.fastscroll:fastscroll:2.0.1'

testImplementation 'junit:junit:4.12'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'org.robolectric:robolectric:4.2'
testImplementation 'org.robolectric:robolectric:4.3'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
9 changes: 3 additions & 6 deletions occtax/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@
</activity>
<activity
android:name=".ui.settings.PreferencesActivity"
android:label="@string/activity_preferences_title">
</activity>
android:label="@string/activity_preferences_title" />
<activity
android:name=".ui.observers.InputObserverListActivity"
android:label="@string/activity_observers_title"
android:theme="@style/AppTheme.NoActionBar">
</activity>
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".ui.input.InputPagerFragmentActivity"
android:screenOrientation="portrait">
</activity>
android:screenOrientation="portrait" />

</application>

Expand Down
19 changes: 18 additions & 1 deletion occtax/src/main/java/fr/geonature/occtax/input/Input.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.locationtech.jts.geom.Geometry
class Input : AbstractInput {

var geometry: Geometry? = null
var selectedFeatureId: String? = null

constructor() : super("occtax")
constructor(source: Parcel) : super(source) {
Expand All @@ -30,7 +31,23 @@ class Input : AbstractInput {

override fun getTaxaFromParcel(source: Parcel): List<AbstractInputTaxon> {
val inputTaxa = source.createTypedArrayList(InputTaxon.CREATOR)
return inputTaxa?: emptyList()
return inputTaxa ?: emptyList()
}

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Input) return false
if (!super.equals(other)) return false

if (geometry != other.geometry) return false

return true
}

override fun hashCode(): Int {
var result = super.hashCode()
result = 31 * result + (geometry?.hashCode() ?: 0)
return result
}

companion object CREATOR : Parcelable.Creator<Input> {
Expand Down
15 changes: 15 additions & 0 deletions occtax/src/main/java/fr/geonature/occtax/input/InputViewModel.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package fr.geonature.occtax.input

import android.app.Application
import fr.geonature.occtax.input.io.OnInputJsonReaderListenerImpl
import fr.geonature.occtax.input.io.OnInputJsonWriterListenerImpl
import fr.geonature.commons.input.InputViewModel as BaseInputModel

/**
* [Input] view model.
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
*/
class InputViewModel(application: Application) : BaseInputModel<Input>(application,
OnInputJsonReaderListenerImpl(),
OnInputJsonWriterListenerImpl())
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package fr.geonature.occtax.settings

import android.app.Application
import fr.geonature.occtax.settings.io.OnAppSettingsJsonReaderListenerImpl
import fr.geonature.commons.settings.AppSettingsViewModel as BaseAppSettingsViewModel

/**
* [AppSettings] view model.
*
* @author [S. Grimault](mailto:sebastien.grimault@gmail.com)
*/
class AppSettingsViewModel(application: Application) : BaseAppSettingsViewModel<AppSettings>(application,
OnAppSettingsJsonReaderListenerImpl())
22 changes: 0 additions & 22 deletions occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ package fr.geonature.occtax.ui.home

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import fr.geonature.commons.input.InputManager
import fr.geonature.commons.settings.AppSettingsManager
import fr.geonature.occtax.input.Input
import fr.geonature.occtax.input.io.OnInputJsonReaderListenerImpl
import fr.geonature.occtax.input.io.OnInputJsonWriterListenerImpl
import fr.geonature.occtax.settings.AppSettings
import fr.geonature.occtax.settings.io.OnAppSettingsJsonReaderListenerImpl
import fr.geonature.occtax.ui.input.InputPagerFragmentActivity
import fr.geonature.occtax.ui.settings.PreferencesActivity
import fr.geonature.occtax.util.IntentUtils
Expand All @@ -23,18 +18,9 @@ import fr.geonature.occtax.util.IntentUtils
class HomeActivity : AppCompatActivity(),
HomeFragment.OnHomeFragmentListener {

private lateinit var inputManager: InputManager<Input>
private lateinit var appSettingsManager: AppSettingsManager<AppSettings>

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

inputManager = InputManager(application,
OnInputJsonReaderListenerImpl(),
OnInputJsonWriterListenerImpl())
appSettingsManager = AppSettingsManager(application,
OnAppSettingsJsonReaderListenerImpl())

if (savedInstanceState == null) {
supportFragmentManager.beginTransaction()
.replace(android.R.id.content,
Expand All @@ -43,14 +29,6 @@ class HomeActivity : AppCompatActivity(),
}
}

override fun getInputManager(): InputManager<Input> {
return inputManager
}

override fun getAppSettingsManager(): AppSettingsManager<AppSettings> {
return appSettingsManager
}

override fun onShowSettings() {
startActivity(PreferencesActivity.newIntent(this))
}
Expand Down
Loading

0 comments on commit a1e3f31

Please sign in to comment.