Skip to content

Commit

Permalink
Merge branch 'release/0.1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Oct 30, 2019
2 parents cd43047 + 991e53a commit 841cc81
Show file tree
Hide file tree
Showing 58 changed files with 2,778 additions and 191 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# gn_mobile_occtax
# Occtax-mobile

![Occtax-mobile launcher](https://raw.githubusercontent.com/PnX-SI/gn_mobile_occtax/develop/occtax/src/main/res/mipmap-xxxhdpi/ic_launcher.png)

GeoNature Android mobile application for Occtax module.

## Upgrade git sub modules

Expand Down
105 changes: 105 additions & 0 deletions artwork/occtax_launcher.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 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.6"
version = "0.1.9"

android {
compileSdkVersion 28
Expand Down Expand Up @@ -55,10 +55,10 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'

implementation 'androidx.core:core-ktx:1.2.0-beta01'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0-beta01"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0-rc01"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
implementation 'androidx.recyclerview:recyclerview:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'com.l4digital.fastscroll:fastscroll:2.0.1'
Expand Down
45 changes: 23 additions & 22 deletions occtax/src/debug/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
android:height="108dp"
android:viewportWidth="161.19403"
android:viewportHeight="161.19403">
<group android:translateX="26.597015"
android:translateY="26.597015">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillAlpha="0.20"
android:fillColor="#000000"
android:pathData="M55,21V1h53v20z" />
<path
android:fillColor="#545473"
android:pathData="M54,20V0h54v20z" />
<path
android:fillColor="#ffffff"
android:pathData="m62.117,7.628v4.745h0.719q1.229,0 1.875,-0.609 0.651,-0.609 0.651,-1.771 0,-1.156 -0.646,-1.76Q64.07,7.628 62.836,7.628ZM60.112,6.112h2.115q1.771,0 2.635,0.255 0.87,0.25 1.49,0.854 0.547,0.526 0.813,1.214 0.266,0.688 0.266,1.557 0,0.88 -0.266,1.573 -0.266,0.688 -0.813,1.214 -0.625,0.604 -1.5,0.859 -0.875,0.25 -2.625,0.25h-2.115z" />
<path
android:fillColor="#ffffff"
android:pathData="m68.966,6.112h5.411v1.516h-3.406v1.448h3.203v1.516h-3.203v1.781h3.521v1.516h-5.526z" />
<path
android:fillColor="#ffffff"
android:pathData="m75.331,6.112h2.016l2.063,5.74 2.057,-5.74h2.016l-2.88,7.776h-2.391z" />
</group>
<group
android:translateX="26.597015"
android:translateY="26.597015">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillAlpha="0.20"
android:fillColor="#000000"
android:pathData="M55,26V1h53v25z" />
<path
android:fillColor="#545473"
android:pathData="M54,25V0h54v25z" />
<path
android:fillColor="#ffffff"
android:pathData="m62.117,10.128v4.745h0.719q1.229,0 1.875,-0.609 0.651,-0.609 0.651,-1.771 0,-1.156 -0.646,-1.76Q64.07,10.128 62.836,10.128ZM60.112,8.612h2.115q1.771,0 2.635,0.255 0.87,0.25 1.49,0.854 0.547,0.526 0.813,1.214 0.266,0.688 0.266,1.557 0,0.88 -0.266,1.573 -0.266,0.688 -0.813,1.214 -0.625,0.604 -1.5,0.859 -0.875,0.25 -2.625,0.25h-2.115z" />
<path
android:fillColor="#ffffff"
android:pathData="m68.966,8.612h5.411v1.516h-3.406v1.448h3.203v1.516h-3.203v1.781h3.521v1.516h-5.526z" />
<path
android:fillColor="#ffffff"
android:pathData="m75.331,8.612h2.016l2.063,5.74 2.057,-5.74h2.016l-2.88,7.776h-2.391z" />
</group>
</vector>
Binary file modified occtax/src/debug/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified occtax/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions occtax/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

<activity
android:name=".ui.home.HomeActivity"
android:label="@string/activity_main_title"
android:screenOrientation="portrait">
android:label="@string/activity_main_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand All @@ -33,6 +32,7 @@
<activity
android:name=".ui.input.InputPagerFragmentActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.input.counting.EditCountingMetadataActivity" />

</application>

Expand Down
100 changes: 100 additions & 0 deletions occtax/src/main/java/fr/geonature/occtax/input/CountingMetadata.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package fr.geonature.occtax.input

import android.os.Parcel
import android.os.Parcelable
import java.util.SortedMap
import java.util.TreeMap

/**
* Counting metadata.
*
* @author [S. Grimault](mailto:[email protected])
*/
class CountingMetadata() : Parcelable {

var index: Int = 0
internal set

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

when {
i1 == -1 -> 1
i2 == -1 -> -1
else -> i1 - i2
}
})
var min: Int = 0
var max: Int = 0

constructor(source: Parcel) : this() {
index = source.readInt()
(source.createTypedArrayList(PropertyValue.CREATOR)
?: emptyList<PropertyValue>())
.forEach {
this.properties[it.code] = it
}
min = source.readInt()
max = source.readInt()
}

override fun describeContents(): Int {
return 0
}

override fun writeToParcel(dest: Parcel?,
flags: Int) {
dest?.also {
it.writeInt(index)
it.writeTypedList(this.properties.values.toList())
it.writeInt(min)
it.writeInt(max)
}
}

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

if (index != other.index) return false
if (properties != other.properties) return false
if (min != other.min) return false
if (max != other.max) return false

return true
}

override fun hashCode(): Int {
var result = index
result = 31 * result + properties.hashCode()
result = 31 * result + min
result = 31 * result + max

return result
}

fun isEmpty(): Boolean {
return properties.filterNot { it.value.isEmpty() }.isEmpty() && min == 0 && max == 0
}

companion object {

private val defaultMnemonicOrder = arrayOf("STADE_VIE",
"SEXE",
"OBJ_DENBR",
"TYP_DENBR")

@JvmField
val CREATOR: Parcelable.Creator<CountingMetadata> = object : Parcelable.Creator<CountingMetadata> {

override fun createFromParcel(source: Parcel): CountingMetadata {
return CountingMetadata(source)
}

override fun newArray(size: Int): Array<CountingMetadata?> {
return arrayOfNulls(size)
}
}
}
}
Loading

0 comments on commit 841cc81

Please sign in to comment.