[m] Reorganised files and fixed tests

This commit is contained in:
choelzl 2023-04-06 23:03:54 +02:00
parent 26bb848f3b
commit dccdd4dbf8
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
8 changed files with 14 additions and 13 deletions

View File

@ -35,7 +35,6 @@ android {
} }
} }
dependencies { dependencies {
implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.core:core-ktx:1.9.0'
@ -45,10 +44,8 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3' implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3' implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'androidx.core:core-ktx:1.9.0'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

View File

@ -15,7 +15,7 @@
tools:replace="android:allowBackup" tools:replace="android:allowBackup"
> >
<activity <activity
android:name=".MainActivity" android:name=".activity.MainActivity"
android:exported="true" android:exported="true"
android:theme="@style/Theme.Beendroid.NoActionBar"> android:theme="@style/Theme.Beendroid.NoActionBar">
<intent-filter> <intent-filter>

View File

@ -1,4 +1,4 @@
package net.helcel.beendroid package net.helcel.beendroid.activity
import android.content.Context import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
@ -8,6 +8,7 @@ import android.widget.CheckBox
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import net.helcel.beendroid.R
import net.helcel.beendroid.countries.GeoLoc import net.helcel.beendroid.countries.GeoLoc
import net.helcel.beendroid.countries.LocType import net.helcel.beendroid.countries.LocType
import java.util.* import java.util.*

View File

@ -1,4 +1,4 @@
package net.helcel.beendroid package net.helcel.beendroid.activity
import android.graphics.Bitmap import android.graphics.Bitmap
import android.graphics.Canvas import android.graphics.Canvas
@ -8,8 +8,11 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.caverock.androidsvg.SVG import com.caverock.androidsvg.SVG
import com.caverock.androidsvg.SVGImageView import com.caverock.androidsvg.SVGImageView
import net.helcel.beendroid.R
import net.helcel.beendroid.countries.Country import net.helcel.beendroid.countries.Country
import net.helcel.beendroid.countries.WORLD import net.helcel.beendroid.countries.WORLD
import net.helcel.beendroid.svg.Level
import net.helcel.beendroid.svg.PSVGWrapper
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
@ -23,9 +26,9 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
map = findViewById(R.id.map) map = findViewById(R.id.map)
val cm = HashMap<Country,PSVGWrapper>() val cm = HashMap<Country, PSVGWrapper>()
Country.values().forEach { c-> Country.values().forEach { c->
cm[c] = PSVGWrapper(applicationContext,c,Level.ZERO).load() cm[c] = PSVGWrapper(applicationContext,c, Level.ZERO).load()
} }
val fm = cm.values.fold("") { acc, e -> acc + e.data } val fm = cm.values.fold("") { acc, e -> acc + e.data }

View File

@ -1,4 +1,4 @@
package net.helcel.beendroid package net.helcel.beendroid.svg
enum class Level(id: Int) { enum class Level(id: Int) {
ZERO(0), ONE(1); ZERO(0), ONE(1);

View File

@ -1,4 +1,4 @@
package net.helcel.beendroid package net.helcel.beendroid.svg
import android.content.Context import android.content.Context
import net.helcel.beendroid.countries.Country import net.helcel.beendroid.countries.Country

View File

@ -1,7 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context="net.helcel.beendroid.MainActivity"> tools:context="net.helcel.beendroid.activity.MainActivity">
<item <item
android:id="@+id/action_settings" android:id="@+id/action_settings"
android:orderInCategory="100" android:orderInCategory="100"

View File

@ -34,7 +34,7 @@ class CountryTest {
fun allCountriesInAGroup() { fun allCountriesInAGroup() {
Country.values().forEach { c -> Country.values().forEach { c ->
val cnt = CountryGroup.values().none { val cnt = CountryGroup.values().none {
it.countries.contains((c)) it.children.contains((c))
} }
Assert.assertEquals("$c has no group !",cnt,false) Assert.assertEquals("$c has no group !",cnt,false)
} }
@ -44,7 +44,7 @@ class CountryTest {
fun allCountriesInASingleGroup() { fun allCountriesInASingleGroup() {
Country.values().forEach { c -> Country.values().forEach { c ->
val cnt = listOf(EEE,FFF,ABB,NNN,SRR,UUU,XXX,ZZZ).count { val cnt = listOf(EEE,FFF,ABB,NNN,SRR,UUU,XXX,ZZZ).count {
it.countries.contains((c)) it.children.contains((c))
} }
Assert.assertEquals("$c is in none or multiple continents",cnt,1) Assert.assertEquals("$c is in none or multiple continents",cnt,1)
} }