Refactoring , editactivity and state level added
This commit is contained in:
parent
3c1080e8c2
commit
b03cbcf457
@ -44,13 +44,14 @@ dependencies {
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.6'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.6'
|
||||
implementation 'androidx.core:core-ktx:1.12.0'
|
||||
implementation "androidx.preference:preference-ktx:1.2.1"
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
||||
implementation 'com.caverock:androidsvg-aar:1.4'
|
||||
implementation "com.mikepenz:aboutlibraries:10.10.0"
|
||||
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
|
||||
implementation 'com.mikepenz:aboutlibraries:10.10.0'
|
||||
|
||||
}
|
@ -14,6 +14,7 @@
|
||||
tools:targetApi="31"
|
||||
tools:replace="android:allowBackup"
|
||||
>
|
||||
<profileable android:shell="true"/>
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="true" >
|
||||
@ -22,6 +23,13 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.EditActivity"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.SettingsActivity"
|
||||
android:exported="true" >
|
||||
|
@ -0,0 +1,30 @@
|
||||
package net.helcel.beendroid.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import net.helcel.beendroid.R
|
||||
import net.helcel.beendroid.countries.Visited
|
||||
import net.helcel.beendroid.countries.World
|
||||
|
||||
|
||||
class EditActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var list : RecyclerView
|
||||
private lateinit var visited : Visited
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setContentView(R.layout.activity_edit)
|
||||
|
||||
visited = Visited(this)
|
||||
visited.load()
|
||||
|
||||
list = findViewById(R.id.list)
|
||||
list.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
|
||||
list.adapter = FoldingListAdapter(this, World.WWW.children, visited) { }
|
||||
}
|
||||
|
||||
}
|
@ -14,7 +14,6 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.checkbox.MaterialCheckBox
|
||||
import net.helcel.beendroid.R
|
||||
import net.helcel.beendroid.countries.GeoLoc
|
||||
import net.helcel.beendroid.countries.LocType
|
||||
import net.helcel.beendroid.countries.Visited
|
||||
import java.util.*
|
||||
|
||||
@ -61,6 +60,7 @@ class FoldingListAdapter(
|
||||
private val visited: Visited,
|
||||
) : RecyclerView.ViewHolder(itemView) {
|
||||
private val textView: TextView = itemView.findViewById(R.id.textView)
|
||||
private val progressView: TextView = itemView.findViewById(R.id.progressView)
|
||||
private val checkBox: MaterialCheckBox = itemView.findViewById(R.id.checkBox)
|
||||
private val subItemView: View = itemView.findViewById(R.id.sub_item)
|
||||
private val list: RecyclerView = itemView.findViewById(R.id.list_list)
|
||||
@ -72,27 +72,37 @@ class FoldingListAdapter(
|
||||
subItemView.visibility = if (el.second) View.VISIBLE else View.GONE
|
||||
|
||||
textView.text = el.first.fullName
|
||||
if (el.first.type == LocType.GROUP) {
|
||||
textView.setTypeface(null, Typeface.BOLD)
|
||||
|
||||
val colorGrayTyped = TypedValue()
|
||||
ctx.theme.resolveAttribute(android.R.attr.panelColorBackground, colorGrayTyped, true)
|
||||
val color = Color.valueOf(colorGrayTyped.data)
|
||||
textView.setBackgroundColor(Color.valueOf(color.red(), color.green(), color.blue(), 0.5f).toArgb())
|
||||
list.adapter = FoldingListAdapter(ctx, el.first.children,visited, parentLambda)
|
||||
textView.parent.parent.requestChildFocus(textView,textView)
|
||||
|
||||
} else {
|
||||
if (el.first.children.isEmpty()) {
|
||||
val colorBackgroundTyped = TypedValue()
|
||||
ctx.theme.resolveAttribute(android.R.attr.colorBackground, colorBackgroundTyped, true)
|
||||
ctx.theme.resolveAttribute(
|
||||
android.R.attr.colorBackground,
|
||||
colorBackgroundTyped,
|
||||
true
|
||||
)
|
||||
textView.backgroundTintList = null
|
||||
textView.background = ColorDrawable(colorBackgroundTyped.data)
|
||||
textView.isActivated = false
|
||||
}else {
|
||||
textView.setTypeface(null, Typeface.BOLD)
|
||||
progressView.text = "${(el.first.children.map { visited.visited(it) }.count { it })}/${el.first.children.size}"
|
||||
|
||||
val layoutParam = checkBox.layoutParams
|
||||
layoutParam.width = 125
|
||||
checkBox.layoutParams = layoutParam
|
||||
checkBox.visibility = View.VISIBLE
|
||||
val colorGrayTyped = TypedValue()
|
||||
ctx.theme.resolveAttribute(
|
||||
android.R.attr.panelColorBackground,
|
||||
colorGrayTyped,
|
||||
true
|
||||
)
|
||||
val color = Color.valueOf(colorGrayTyped.data)
|
||||
textView.setBackgroundColor(
|
||||
Color.valueOf(
|
||||
color.red(),
|
||||
color.green(),
|
||||
color.blue(),
|
||||
0.5f
|
||||
).toArgb()
|
||||
)
|
||||
list.adapter = FoldingListAdapter(ctx, el.first.children, visited, parentLambda)
|
||||
textView.parent.parent.requestChildFocus(textView, textView)
|
||||
}
|
||||
checkBox.checkedState =
|
||||
if (visited.visited(el.first)) MaterialCheckBox.STATE_CHECKED
|
||||
|
@ -1,53 +1,50 @@
|
||||
package net.helcel.beendroid.activity
|
||||
|
||||
import kotlinx.coroutines.*
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.graphics.drawable.PictureDrawable
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.MenuProvider
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.caverock.androidsvg.RenderOptions
|
||||
import com.caverock.androidsvg.SVGImageView
|
||||
import com.github.chrisbanes.photoview.PhotoView
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import net.helcel.beendroid.R
|
||||
import net.helcel.beendroid.activity.fragment.SettingsFragment
|
||||
import net.helcel.beendroid.countries.Visited
|
||||
import net.helcel.beendroid.countries.World
|
||||
|
||||
import net.helcel.beendroid.svg.CSSWrapper
|
||||
import net.helcel.beendroid.svg.PSVGWrapper
|
||||
import net.helcel.beendroid.helper.*
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var sharedPreferences: SharedPreferences
|
||||
|
||||
private lateinit var map : SVGImageView
|
||||
private lateinit var list : RecyclerView
|
||||
private lateinit var photoView : PhotoView
|
||||
|
||||
private lateinit var visited : Visited
|
||||
private lateinit var psvg : PSVGWrapper
|
||||
private lateinit var css : CSSWrapper
|
||||
|
||||
private var processor: ImageProcessor = ImageProcessor({ refreshMapCompute() },{ refreshMapDisplay(it) })
|
||||
|
||||
private val bitmap: Bitmap = Bitmap.createBitmap(1200,900, Bitmap.Config.ARGB_8888)
|
||||
private val canvas = Canvas(bitmap)
|
||||
override fun onActivityReenter(resultCode: Int, data: Intent?) {
|
||||
super.onActivityReenter(resultCode, data)
|
||||
refreshMap()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// Create action bar
|
||||
val colorPrimaryTyped = TypedValue()
|
||||
theme.resolveAttribute(android.R.attr.colorPrimary, colorPrimaryTyped, true)
|
||||
supportActionBar?.setBackgroundDrawable(ColorDrawable(colorPrimaryTyped.data))
|
||||
supportActionBar?.setBackgroundDrawable(colorPrimary(this))
|
||||
|
||||
// Fetch shared preferences to restore app theme upon startup
|
||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
@ -62,7 +59,7 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
|
||||
return when (menuItem.itemId) {
|
||||
R.id.action_edit -> {
|
||||
// TODO: Enable editing selected countries
|
||||
startActivity(Intent(this@MainActivity, EditActivity::class.java))
|
||||
true
|
||||
}
|
||||
R.id.action_stats -> {
|
||||
@ -92,47 +89,21 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
// Populate map from list of countries
|
||||
setContentView(R.layout.activity_main)
|
||||
map = findViewById(R.id.map)
|
||||
map.setImageBitmap(bitmap)
|
||||
refreshMapDisplay(refreshMapCompute())
|
||||
|
||||
// Populate list below the map
|
||||
list = findViewById(R.id.list)
|
||||
list.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
|
||||
list.adapter = FoldingListAdapter(this, World.WWW.children, visited) { processor.process() }
|
||||
photoView = findViewById(R.id.photo_view)
|
||||
photoView.minimumScale = 1f
|
||||
photoView.maximumScale = 30f
|
||||
|
||||
refreshMap()
|
||||
}
|
||||
|
||||
private fun refreshMapDisplay(css_value: String){
|
||||
// Set or reset background (replaces canvas.drawColor(0, 0, 0))
|
||||
val colorBackgroundTyped = TypedValue()
|
||||
theme.resolveAttribute(android.R.attr.colorBackground, colorBackgroundTyped, true)
|
||||
canvas.drawColor(colorBackgroundTyped.data)
|
||||
|
||||
// Render all countries and visited ones
|
||||
psvg.getFill().renderToCanvas(canvas, RenderOptions.create().css(css_value))
|
||||
|
||||
// Render all contours in the same color as the background to make them much clearer
|
||||
psvg.getDraw().renderToCanvas(canvas)
|
||||
}
|
||||
|
||||
private fun refreshMapCompute() : String {
|
||||
return css.get()
|
||||
}
|
||||
|
||||
|
||||
|
||||
class ImageProcessor(private val refreshMapCompute: ()->String, private val refreshMapDisplay: (String)->Unit) {
|
||||
|
||||
private var currentJob : Job? = null
|
||||
fun process() {
|
||||
currentJob?.cancel()
|
||||
currentJob = CoroutineScope(Dispatchers.Main).launch {
|
||||
try {
|
||||
refreshMapDisplay(refreshMapCompute())
|
||||
} catch (_: CancellationException) {
|
||||
}
|
||||
}
|
||||
private fun refreshMap() {
|
||||
val opt : RenderOptions = RenderOptions.create()
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
opt.css(css.get())
|
||||
}
|
||||
photoView.setImageLevel(1)
|
||||
photoView.setImageDrawable(PictureDrawable(psvg.getFill().renderToPicture(opt)))
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package net.helcel.beendroid.activity
|
||||
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import net.helcel.beendroid.R
|
||||
import net.helcel.beendroid.activity.fragment.AboutFragment
|
||||
import net.helcel.beendroid.activity.fragment.LicenseFragment
|
||||
import net.helcel.beendroid.activity.fragment.SettingsFragment
|
||||
import net.helcel.beendroid.helper.*
|
||||
|
||||
class SettingsActivity: AppCompatActivity() {
|
||||
|
||||
@ -16,9 +18,7 @@ class SettingsActivity: AppCompatActivity() {
|
||||
setContentView(R.layout.activity_settings)
|
||||
|
||||
// Create action bar
|
||||
val colorPrimaryTyped = TypedValue()
|
||||
theme.resolveAttribute(android.R.attr.colorPrimary, colorPrimaryTyped, true)
|
||||
supportActionBar?.setBackgroundDrawable(ColorDrawable(colorPrimaryTyped.data))
|
||||
supportActionBar?.setBackgroundDrawable(colorPrimary(this))
|
||||
supportActionBar?.title = getString(R.string.action_settings)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.helcel.beendroid.activity
|
||||
package net.helcel.beendroid.activity.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
@ -1,4 +1,4 @@
|
||||
package net.helcel.beendroid.activity
|
||||
package net.helcel.beendroid.activity.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
@ -1,4 +1,4 @@
|
||||
package net.helcel.beendroid.activity
|
||||
package net.helcel.beendroid.activity.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
@ -1,265 +1,267 @@
|
||||
package net.helcel.beendroid.countries
|
||||
|
||||
import net.helcel.beendroid.countries.Country.*
|
||||
import net.helcel.beendroid.countries.State.*
|
||||
|
||||
enum class Country(override val fullName: String, override val area : Int) : GeoLoc {
|
||||
AFG("Afghanistan", 652864),
|
||||
ALA("Åland Islands", 1580),
|
||||
ALB("Albania", 28748),
|
||||
DZA("Algeria", 2381741),
|
||||
ASM("American Samoa", 199000),
|
||||
AND("Andorra", 468765),
|
||||
AGO("Angola", 1246700),
|
||||
AIA("Anguilla", 96),
|
||||
ATA("Antarctica", 14000000),
|
||||
ATG("Antigua and Barbuda", 442),
|
||||
ARG("Argentina", 2780400),
|
||||
ARM("Armenia", 29743),
|
||||
ABW("Aruba", 180),
|
||||
AUS("Australia", 7692024),
|
||||
AUT("Austria", 83879),
|
||||
AZE("Azerbaijan", 86600),
|
||||
BHS("Bahamas", 13878),
|
||||
BHR("Bahrain", 778),
|
||||
BGD("Bangladesh", 143998),
|
||||
BRB("Barbados", 430),
|
||||
BLR("Belarus", 207595),
|
||||
BEL("Belgium", 30528),
|
||||
BLZ("Belize", 22965),
|
||||
BEN("Benin", 114763),
|
||||
BMU("Bermuda", 54),
|
||||
BTN("Bhutan", 38394),
|
||||
BOL("Bolivia (Plurinational State of)", 1098581),
|
||||
BES("Bonaire, Sint Eustatius and Saba", 294),
|
||||
BIH("Bosnia and Herzegovina", 51209),
|
||||
BWA("Botswana", 581730),
|
||||
BVT("Bouvet Island", 49),
|
||||
BRA("Brazil", 8515767),
|
||||
IOT("British Indian Ocean Territory", 60),
|
||||
BRN("Brunei Darussalam", 5765),
|
||||
BGR("Bulgaria", 110994),
|
||||
BFA("Burkina Faso", 274200),
|
||||
BDI("Burundi", 27834),
|
||||
CPV("Cabo Verde", 4033),
|
||||
KHM("Cambodia", 181035),
|
||||
CMR("Cameroon", 475442),
|
||||
CAN("Canada", 9984670),
|
||||
CYM("Cayman Islands", 264),
|
||||
CAF("Central African Republic", 622436),
|
||||
TCD("Chad", 1284000),
|
||||
CHL("Chile", 756102),
|
||||
CHN("China", 9596961),
|
||||
CXR("Christmas Island", 135),
|
||||
CCK("Cocos (Keeling) Islands", 14),
|
||||
COL("Colombia", 1141748),
|
||||
COM("Comoros", 2235),
|
||||
COG("Congo", 342000),
|
||||
COD("Congo, Democratic Republic of the", 2344858),
|
||||
COK("Cook Islands", 237),
|
||||
CRI("Costa Rica", 51100),
|
||||
CIV("Côte d'Ivoire", 322463),
|
||||
HRV("Croatia", 56594),
|
||||
CUB("Cuba", 109884),
|
||||
CUW("Curaçao", 444),
|
||||
CYP("Cyprus", 9251),
|
||||
CZE("Czech Republic", 78865),
|
||||
DNK("Denmark", 42933),
|
||||
DJI("Djibouti", 23200),
|
||||
DMA("Dominica", 750),
|
||||
ECU("Ecuador", 276841),
|
||||
EGY("Egypt", 1002450),
|
||||
SLV("El Salvador", 21041),
|
||||
GNQ("Equatorial Guinea", 28051),
|
||||
ERI("Eritrea", 117600),
|
||||
EST("Estonia", 45227),
|
||||
SWZ("Eswatini", 17364),
|
||||
ETH("Ethiopia", 1104300),
|
||||
FLK("Falkland Islands (Malvinas)", 12173),
|
||||
FRO("Faroe Islands", 1399),
|
||||
FJI("Fiji", 18333),
|
||||
FIN("Finland", 338424),
|
||||
FRA("France", 643801),
|
||||
GUF("French Guiana", 83534),
|
||||
PYF("French Polynesia", 4167),
|
||||
ATF("French Southern Territories", 7747),
|
||||
GAB("Gabon", 267667),
|
||||
GMB("Gambia", 11295),
|
||||
GEO("Georgia", 69700),
|
||||
DEU("Germany", 357408),
|
||||
GHA("Ghana", 238533),
|
||||
GIB("Gibraltar", 6),
|
||||
GRC("Greece", 131957),
|
||||
GRL("Greenland", 2166086),
|
||||
GRD("Grenada", 344),
|
||||
GLP("Guadeloupe", 1628),
|
||||
GUM("Guam", 541),
|
||||
GTM("Guatemala", 108889),
|
||||
GGY("Guernsey", 78),
|
||||
GIN("Guinea", 245857),
|
||||
GNB("Guinea-Bissau", 36125),
|
||||
GUY("Guyana", 214969),
|
||||
HTI("Haiti", 27750),
|
||||
HMD("Heard Island and McDonald Islands", 412),
|
||||
VAT("Holy See (Vatican)", 1),
|
||||
HND("Honduras", 112492),
|
||||
HKG("Hong Kong", 1104),
|
||||
HUN("Hungary", 93028),
|
||||
ISL("Iceland", 102775),
|
||||
IND("India", 3287263),
|
||||
IDN("Indonesia", 1904569),
|
||||
IRN("Iran (Islamic Republic of)", 1648195),
|
||||
IRQ("Iraq", 438317),
|
||||
IRL("Ireland", 70273),
|
||||
IMN("Isle of Man", 572),
|
||||
ISR("Israel", 22072),
|
||||
ITA("Italy", 301340),
|
||||
JAM("Jamaica", 10991),
|
||||
JPN("Japan", 377915),
|
||||
JEY("Jersey", 118),
|
||||
JOR("Jordan", 89342),
|
||||
KAZ("Kazakhstan", 2724900),
|
||||
KEN("Kenya", 580367),
|
||||
KIR("Kiribati", 811),
|
||||
PRK("Korea (Democratic People's Republic of)", 120538),
|
||||
KOR("Korea, Republic of", 100210),
|
||||
XKO("Kosovo", 10887),
|
||||
KWT("Kuwait", 17818),
|
||||
KGZ("Kyrgyzstan", 199900),
|
||||
LAO("Lao People's Democratic Republic", 236800),
|
||||
LVA("Latvia", 64559),
|
||||
LBN("Lebanon", 10452),
|
||||
LSO("Lesotho", 30355),
|
||||
LBR("Liberia", 111369),
|
||||
LBY("Libya", 1759540),
|
||||
LIE("Liechtenstein", 160),
|
||||
LTU("Lithuania", 65300),
|
||||
LUX("Luxembourg", 2586),
|
||||
MAC("Macao", 32),
|
||||
MDG("Madagascar", 587041),
|
||||
MWI("Malawi", 118484),
|
||||
MYS("Malaysia", 330803),
|
||||
MDV("Maldives", 300),
|
||||
MLI("Mali", 1240192),
|
||||
MLT("Malta", 316),
|
||||
MHL("Marshall Islands", 181),
|
||||
MTQ("Martinique", 1128),
|
||||
MRT("Mauritania", 1030700),
|
||||
MUS("Mauritius", 2040),
|
||||
MYT("Mayotte", 374),
|
||||
MEX("Mexico", 1964375),
|
||||
FSM("Micronesia (Federated States of)", 702),
|
||||
MDA("Moldova, Republic of", 33846),
|
||||
MCO("Monaco", 2),
|
||||
MNG("Mongolia", 1564116),
|
||||
MNE("Montenegro", 13812),
|
||||
MSR("Montserrat", 102),
|
||||
MAR("Morocco", 446550),
|
||||
MOZ("Mozambique", 799380),
|
||||
MMR("Myanmar", 676578),
|
||||
NAM("Namibia", 824292),
|
||||
NRU("Nauru", 21),
|
||||
NPL("Nepal", 147181),
|
||||
NLD("Netherlands", 41526),
|
||||
NCL("New Caledonia", 18575),
|
||||
NZL("New Zealand", 270467),
|
||||
NIC("Nicaragua", 130373),
|
||||
NER("Niger", 1267000),
|
||||
NGA("Nigeria", 923768),
|
||||
NIU("Niue", 261),
|
||||
NFK("Norfolk Island", 35),
|
||||
MNP("Northern Mariana Islands", 457),
|
||||
NOR("Norway", 385207),
|
||||
OMN("Oman", 309500),
|
||||
PAK("Pakistan", 881913),
|
||||
PLW("Palau", 459),
|
||||
PSE("Palestine, State of", 6220),
|
||||
PAN("Panama", 75417),
|
||||
PNG("Papua New Guinea", 462840),
|
||||
PRY("Paraguay", 406752),
|
||||
PER("Peru", 1285216),
|
||||
PHL("Philippines", 300000),
|
||||
PCN("Pitcairn", 47),
|
||||
POL("Poland", 312696),
|
||||
PRT("Portugal", 92090),
|
||||
PRI("Puerto Rico", 9104),
|
||||
QAT("Qatar", 11586),
|
||||
MKD("Republic of North Macedonia", 25713),
|
||||
ROU("Romania", 238391),
|
||||
RUS("Russian Federation", 17125242),
|
||||
RWA("Rwanda", 26338),
|
||||
REU("Réunion", 2511),
|
||||
BLM("Saint Barthélemy", 21),
|
||||
SHN("Saint Helena, Ascension and Tristan da Cunha", 394),
|
||||
KNA("Saint Kitts and Nevis", 270),
|
||||
LCA("Saint Lucia", 617),
|
||||
MAF("Saint Martin (French part)", 53),
|
||||
SPM("Saint Pierre and Miquelon", 242),
|
||||
VCT("Saint Vincent and the Grenadines", 389),
|
||||
WSM("Samoa", 2831),
|
||||
SMR("San Marino", 61),
|
||||
STP("Sao Tome and Principe", 1001),
|
||||
SAU("Saudi Arabia", 2149690),
|
||||
SEN("Senegal", 196722),
|
||||
SRB("Serbia", 88361),
|
||||
SYC("Seychelles", 459),
|
||||
SLE("Sierra Leone", 71740),
|
||||
SGP("Singapore", 725),
|
||||
SXM("Sint Maarten (Dutch part)", 34),
|
||||
SVK("Slovakia", 49036),
|
||||
SVN("Slovenia", 20273),
|
||||
SLB("Solomon Islands", 28896),
|
||||
SOM("Somalia", 637657),
|
||||
ZAF("South Africa", 1221037),
|
||||
SGS("South Georgia and the South Sandwich Islands", 3903),
|
||||
SSD("South Sudan", 619745),
|
||||
ESP("Spain", 505990),
|
||||
LKA("Sri Lanka", 65610),
|
||||
SDN("Sudan", 1839542),
|
||||
SUR("Suriname", 163820),
|
||||
SJM("Svalbard and Jan Mayen", 61399),
|
||||
SWE("Sweden", 450295),
|
||||
CHE("Switzerland", 41284),
|
||||
SYR("Syrian Arab Republic", 185180),
|
||||
TWN("Taiwan, Province of China", 36193),
|
||||
TJK("Tajikistan", 143100),
|
||||
TZA("Tanzania, United Republic of", 947300),
|
||||
THA("Thailand", 513120),
|
||||
TLS("Timor-Leste", 14919),
|
||||
TGO("Togo", 56785),
|
||||
TKL("Tokelau", 12),
|
||||
TON("Tonga", 747),
|
||||
TTO("Trinidad and Tobago", 5128),
|
||||
TUN("Tunisia", 163610),
|
||||
TUR("Turkey", 783562),
|
||||
TKM("Turkmenistan", 488100),
|
||||
TCA("Turks and Caicos Islands", 948),
|
||||
TUV("Tuvalu", 26),
|
||||
UGA("Uganda", 241551),
|
||||
UKR("Ukraine", 603700),
|
||||
ARE("United Arab Emirates", 83600),
|
||||
GBR("United Kingdom of Great Britain and Northern Ireland", 242910),
|
||||
USA("United States of America", 9833517),
|
||||
UMI("United States Minor Outlying Islands", 34),
|
||||
URY("Uruguay", 176215),
|
||||
UZB("Uzbekistan", 447400),
|
||||
VUT("Vanuatu", 12189),
|
||||
VEN("Venezuela (Bolivarian Republic of)", 912050),
|
||||
VNM("Viet Nam", 331212),
|
||||
VGB("Virgin Islands (British", 153),
|
||||
VIR("Virgin Islands (U.S.)", 347),
|
||||
WLF("Wallis and Futuna", 142),
|
||||
ESH("Western Sahara", 266000),
|
||||
YEM("Yemen", 527968),
|
||||
ZMB("Zambia", 752612),
|
||||
ZWE("Zimbabwe", 390757),
|
||||
DOM("Dominican Republic", 48671),
|
||||
ANT("Netherlands Antilles", 800),
|
||||
XAD("Akrotiri and Dhekelia", 254),
|
||||
XCL("Clipperton Island", 6),
|
||||
ZNC("Nothern Cyprus", 3355),
|
||||
enum class Country(override val fullName: String, override val area : Int, override val children : List<GeoLoc>) : GeoLoc {
|
||||
AFG("Afghanistan", 652864, emptyList()),
|
||||
ALA("Åland Islands", 1580, emptyList()),
|
||||
ALB("Albania", 28748, emptyList()),
|
||||
DZA("Algeria", 2381741, emptyList()),
|
||||
ASM("American Samoa", 199000, emptyList()),
|
||||
AND("Andorra", 468765, emptyList()),
|
||||
AGO("Angola", 1246700, emptyList()),
|
||||
AIA("Anguilla", 96, emptyList()),
|
||||
ATA("Antarctica", 14000000, emptyList()),
|
||||
ATG("Antigua and Barbuda", 442, emptyList()),
|
||||
ARG("Argentina", 2780400, emptyList()),
|
||||
ARM("Armenia", 29743, emptyList()),
|
||||
ABW("Aruba", 180, emptyList()),
|
||||
AUS("Australia", 7692024, emptyList()),
|
||||
AUT("Austria", 83879, emptyList()),
|
||||
AZE("Azerbaijan", 86600, emptyList()),
|
||||
BHS("Bahamas", 13878, emptyList()),
|
||||
BHR("Bahrain", 778, emptyList()),
|
||||
BGD("Bangladesh", 143998, emptyList()),
|
||||
BRB("Barbados", 430, emptyList()),
|
||||
BLR("Belarus", 207595, emptyList()),
|
||||
BEL("Belgium", 30528, emptyList()),
|
||||
BLZ("Belize", 22965, emptyList()),
|
||||
BEN("Benin", 114763, emptyList()),
|
||||
BMU("Bermuda", 54, emptyList()),
|
||||
BTN("Bhutan", 38394, emptyList()),
|
||||
BOL("Bolivia (Plurinational State of)", 1098581, emptyList()),
|
||||
BES("Bonaire, Sint Eustatius and Saba", 294, emptyList()),
|
||||
BIH("Bosnia and Herzegovina", 51209, emptyList()),
|
||||
BWA("Botswana", 581730, emptyList()),
|
||||
BVT("Bouvet Island", 49, emptyList()),
|
||||
BRA("Brazil", 8515767, emptyList()),
|
||||
IOT("British Indian Ocean Territory", 60, emptyList()),
|
||||
BRN("Brunei Darussalam", 5765, emptyList()),
|
||||
BGR("Bulgaria", 110994, emptyList()),
|
||||
BFA("Burkina Faso", 274200, emptyList()),
|
||||
BDI("Burundi", 27834, emptyList()),
|
||||
CPV("Cabo Verde", 4033, emptyList()),
|
||||
KHM("Cambodia", 181035, emptyList()),
|
||||
CMR("Cameroon", 475442, emptyList()),
|
||||
CAN("Canada", 9984670, emptyList()),
|
||||
CYM("Cayman Islands", 264, emptyList()),
|
||||
CAF("Central African Republic", 622436, emptyList()),
|
||||
TCD("Chad", 1284000, emptyList()),
|
||||
CHL("Chile", 756102, emptyList()),
|
||||
CHN("China", 9596961, emptyList()),
|
||||
CXR("Christmas Island", 135, emptyList()),
|
||||
CCK("Cocos (Keeling) Islands", 14, emptyList()),
|
||||
COL("Colombia", 1141748, emptyList()),
|
||||
COM("Comoros", 2235, emptyList()),
|
||||
COG("Congo", 342000, emptyList()),
|
||||
COD("Congo, Democratic Republic of the", 2344858, emptyList()),
|
||||
COK("Cook Islands", 237, emptyList()),
|
||||
CRI("Costa Rica", 51100, emptyList()),
|
||||
CIV("Côte d'Ivoire", 322463, emptyList()),
|
||||
HRV("Croatia", 56594, emptyList()),
|
||||
CUB("Cuba", 109884, emptyList()),
|
||||
CUW("Curaçao", 444, emptyList()),
|
||||
CYP("Cyprus", 9251, emptyList()),
|
||||
CZE("Czech Republic", 78865, emptyList()),
|
||||
DNK("Denmark", 42933, emptyList()),
|
||||
DJI("Djibouti", 23200, emptyList()),
|
||||
DMA("Dominica", 750, emptyList()),
|
||||
ECU("Ecuador", 276841, emptyList()),
|
||||
EGY("Egypt", 1002450, emptyList()),
|
||||
SLV("El Salvador", 21041, emptyList()),
|
||||
GNQ("Equatorial Guinea", 28051, emptyList()),
|
||||
ERI("Eritrea", 117600, emptyList()),
|
||||
EST("Estonia", 45227, emptyList()),
|
||||
SWZ("Eswatini", 17364, emptyList()),
|
||||
ETH("Ethiopia", 1104300, emptyList()),
|
||||
FLK("Falkland Islands (Malvinas)", 12173, emptyList()),
|
||||
FRO("Faroe Islands", 1399, emptyList()),
|
||||
FJI("Fiji", 18333, emptyList()),
|
||||
FIN("Finland", 338424, emptyList()),
|
||||
FRA("France", 643801, emptyList()),
|
||||
GUF("French Guiana", 83534, emptyList()),
|
||||
PYF("French Polynesia", 4167, emptyList()),
|
||||
ATF("French Southern Territories", 7747, emptyList()),
|
||||
GAB("Gabon", 267667, emptyList()),
|
||||
GMB("Gambia", 11295, emptyList()),
|
||||
GEO("Georgia", 69700, emptyList()),
|
||||
DEU("Germany", 357408, listOf(DEU_BY, DEU_BE, DEU_BB, DEU_HB, DEU_HH, DEU_HE, DEU_MV, DEU_NI, DEU_NW, DEU_RP, DEU_SL, DEU_SN, DEU_ST, DEU_SH, DEU_TH)),
|
||||
GHA("Ghana", 238533, emptyList()),
|
||||
GIB("Gibraltar", 6, emptyList()),
|
||||
GRC("Greece", 131957, emptyList()),
|
||||
GRL("Greenland", 2166086, emptyList()),
|
||||
GRD("Grenada", 344, emptyList()),
|
||||
GLP("Guadeloupe", 1628, emptyList()),
|
||||
GUM("Guam", 541, emptyList()),
|
||||
GTM("Guatemala", 108889, emptyList()),
|
||||
GGY("Guernsey", 78, emptyList()),
|
||||
GIN("Guinea", 245857, emptyList()),
|
||||
GNB("Guinea-Bissau", 36125, emptyList()),
|
||||
GUY("Guyana", 214969, emptyList()),
|
||||
HTI("Haiti", 27750, emptyList()),
|
||||
HMD("Heard Island and McDonald Islands", 412, emptyList()),
|
||||
VAT("Holy See (Vatican)", 1, emptyList()),
|
||||
HND("Honduras", 112492, emptyList()),
|
||||
HKG("Hong Kong", 1104, emptyList()),
|
||||
HUN("Hungary", 93028, emptyList()),
|
||||
ISL("Iceland", 102775, emptyList()),
|
||||
IND("India", 3287263, emptyList()),
|
||||
IDN("Indonesia", 1904569, emptyList()),
|
||||
IRN("Iran (Islamic Republic of)", 1648195, emptyList()),
|
||||
IRQ("Iraq", 438317, emptyList()),
|
||||
IRL("Ireland", 70273, emptyList()),
|
||||
IMN("Isle of Man", 572, emptyList()),
|
||||
ISR("Israel", 22072, emptyList()),
|
||||
ITA("Italy", 301340, emptyList()),
|
||||
JAM("Jamaica", 10991, emptyList()),
|
||||
JPN("Japan", 377915, listOf(JPN_HO, JPN_AO, JPN_IW, JPN_MI, JPN_AK, JPN_YA, JPN_FU, JPN_IB, JPN_TO, JPN_GU, JPN_SA, JPN_CH, JPN_TY, JPN_KA, JPN_NI, JPN_TOY, JPN_ISH, JPN_FK, JPN_YAM, JPN_NG, JPN_GI, JPN_SHI, JPN_AI, JPN_ME, JPN_SG, JPN_KY, JPN_OS, JPN_HY, JPN_NA, JPN_WK, JPN_TO, JPN_SM, JPN_OK, JPN_HR, JPN_YG, JPN_TS, JPN_KG, JPN_EH, JPN_KC, JPN_FK, JPN_SG, JPN_NG, JPN_KM, JPN_OT, JPN_MY, JPN_KG, JPN_OK)),
|
||||
JEY("Jersey", 118, emptyList()),
|
||||
JOR("Jordan", 89342, emptyList()),
|
||||
KAZ("Kazakhstan", 2724900, emptyList()),
|
||||
KEN("Kenya", 580367, emptyList()),
|
||||
KIR("Kiribati", 811, emptyList()),
|
||||
PRK("Korea (Democratic People's Republic of)", 120538, emptyList()),
|
||||
KOR("Korea, Republic of", 100210, emptyList()),
|
||||
XKO("Kosovo", 10887, emptyList()),
|
||||
KWT("Kuwait", 17818, emptyList()),
|
||||
KGZ("Kyrgyzstan", 199900, emptyList()),
|
||||
LAO("Lao People's Democratic Republic", 236800, emptyList()),
|
||||
LVA("Latvia", 64559, emptyList()),
|
||||
LBN("Lebanon", 10452, emptyList()),
|
||||
LSO("Lesotho", 30355, emptyList()),
|
||||
LBR("Liberia", 111369, emptyList()),
|
||||
LBY("Libya", 1759540, emptyList()),
|
||||
LIE("Liechtenstein", 160, emptyList()),
|
||||
LTU("Lithuania", 65300, emptyList()),
|
||||
LUX("Luxembourg", 2586, emptyList()),
|
||||
MAC("Macao", 32, emptyList()),
|
||||
MDG("Madagascar", 587041, emptyList()),
|
||||
MWI("Malawi", 118484, emptyList()),
|
||||
MYS("Malaysia", 330803, emptyList()),
|
||||
MDV("Maldives", 300, emptyList()),
|
||||
MLI("Mali", 1240192, emptyList()),
|
||||
MLT("Malta", 316, emptyList()),
|
||||
MHL("Marshall Islands", 181, emptyList()),
|
||||
MTQ("Martinique", 1128, emptyList()),
|
||||
MRT("Mauritania", 1030700, emptyList()),
|
||||
MUS("Mauritius", 2040, emptyList()),
|
||||
MYT("Mayotte", 374, emptyList()),
|
||||
MEX("Mexico", 1964375, emptyList()),
|
||||
FSM("Micronesia (Federated States of)", 702, emptyList()),
|
||||
MDA("Moldova, Republic of", 33846, emptyList()),
|
||||
MCO("Monaco", 2, emptyList()),
|
||||
MNG("Mongolia", 1564116, emptyList()),
|
||||
MNE("Montenegro", 13812, emptyList()),
|
||||
MSR("Montserrat", 102, emptyList()),
|
||||
MAR("Morocco", 446550, emptyList()),
|
||||
MOZ("Mozambique", 799380, emptyList()),
|
||||
MMR("Myanmar", 676578, emptyList()),
|
||||
NAM("Namibia", 824292, emptyList()),
|
||||
NRU("Nauru", 21, emptyList()),
|
||||
NPL("Nepal", 147181, emptyList()),
|
||||
NLD("Netherlands", 41526, emptyList()),
|
||||
NCL("New Caledonia", 18575, emptyList()),
|
||||
NZL("New Zealand", 270467, emptyList()),
|
||||
NIC("Nicaragua", 130373, emptyList()),
|
||||
NER("Niger", 1267000, emptyList()),
|
||||
NGA("Nigeria", 923768, emptyList()),
|
||||
NIU("Niue", 261, emptyList()),
|
||||
NFK("Norfolk Island", 35, emptyList()),
|
||||
MNP("Northern Mariana Islands", 457, emptyList()),
|
||||
NOR("Norway", 385207, emptyList()),
|
||||
OMN("Oman", 309500, emptyList()),
|
||||
PAK("Pakistan", 881913, emptyList()),
|
||||
PLW("Palau", 459, emptyList()),
|
||||
PSE("Palestine, State of", 6220, emptyList()),
|
||||
PAN("Panama", 75417, emptyList()),
|
||||
PNG("Papua New Guinea", 462840, emptyList()),
|
||||
PRY("Paraguay", 406752, emptyList()),
|
||||
PER("Peru", 1285216, emptyList()),
|
||||
PHL("Philippines", 300000, emptyList()),
|
||||
PCN("Pitcairn", 47, emptyList()),
|
||||
POL("Poland", 312696, emptyList()),
|
||||
PRT("Portugal", 92090, emptyList()),
|
||||
PRI("Puerto Rico", 9104, emptyList()),
|
||||
QAT("Qatar", 11586, emptyList()),
|
||||
MKD("Republic of North Macedonia", 25713, emptyList()),
|
||||
ROU("Romania", 238391, emptyList()),
|
||||
RUS("Russian Federation", 17125242, emptyList()),
|
||||
RWA("Rwanda", 26338, emptyList()),
|
||||
REU("Réunion", 2511, emptyList()),
|
||||
BLM("Saint Barthélemy", 21, emptyList()),
|
||||
SHN("Saint Helena, Ascension and Tristan da Cunha", 394, emptyList()),
|
||||
KNA("Saint Kitts and Nevis", 270, emptyList()),
|
||||
LCA("Saint Lucia", 617, emptyList()),
|
||||
MAF("Saint Martin (French part)", 53, emptyList()),
|
||||
SPM("Saint Pierre and Miquelon", 242, emptyList()),
|
||||
VCT("Saint Vincent and the Grenadines", 389, emptyList()),
|
||||
WSM("Samoa", 2831, emptyList()),
|
||||
SMR("San Marino", 61, emptyList()),
|
||||
STP("Sao Tome and Principe", 1001, emptyList()),
|
||||
SAU("Saudi Arabia", 2149690, emptyList()),
|
||||
SEN("Senegal", 196722, emptyList()),
|
||||
SRB("Serbia", 88361, emptyList()),
|
||||
SYC("Seychelles", 459, emptyList()),
|
||||
SLE("Sierra Leone", 71740, emptyList()),
|
||||
SGP("Singapore", 725, emptyList()),
|
||||
SXM("Sint Maarten (Dutch part)", 34, emptyList()),
|
||||
SVK("Slovakia", 49036, emptyList()),
|
||||
SVN("Slovenia", 20273, emptyList()),
|
||||
SLB("Solomon Islands", 28896, emptyList()),
|
||||
SOM("Somalia", 637657, emptyList()),
|
||||
ZAF("South Africa", 1221037, emptyList()),
|
||||
SGS("South Georgia and the South Sandwich Islands", 3903, emptyList()),
|
||||
SSD("South Sudan", 619745, emptyList()),
|
||||
ESP("Spain", 505990, emptyList()),
|
||||
LKA("Sri Lanka", 65610, emptyList()),
|
||||
SDN("Sudan", 1839542, emptyList()),
|
||||
SUR("Suriname", 163820, emptyList()),
|
||||
SJM("Svalbard and Jan Mayen", 61399, emptyList()),
|
||||
SWE("Sweden", 450295, emptyList()),
|
||||
CHE("Switzerland", 41284, listOf(CHE_AG, CHE_AR, CHE_AI, CHE_BL, CHE_BS, CHE_BE, CHE_FR, CHE_GE, CHE_GL, CHE_GR, CHE_JU, CHE_LU, CHE_NE, CHE_NW, CHE_OW, CHE_SH, CHE_SZ, CHE_SO, CHE_SG, CHE_TG, CHE_TI, CHE_UR, CHE_VS, CHE_VD, CHE_ZG, CHE_ZH)),
|
||||
SYR("Syrian Arab Republic", 185180, emptyList()),
|
||||
TWN("Taiwan, Province of China", 36193, emptyList()),
|
||||
TJK("Tajikistan", 143100, emptyList()),
|
||||
TZA("Tanzania, United Republic of", 947300, emptyList()),
|
||||
THA("Thailand", 513120, emptyList()),
|
||||
TLS("Timor-Leste", 14919, emptyList()),
|
||||
TGO("Togo", 56785, emptyList()),
|
||||
TKL("Tokelau", 12, emptyList()),
|
||||
TON("Tonga", 747, emptyList()),
|
||||
TTO("Trinidad and Tobago", 5128, emptyList()),
|
||||
TUN("Tunisia", 163610, emptyList()),
|
||||
TUR("Turkey", 783562, emptyList()),
|
||||
TKM("Turkmenistan", 488100, emptyList()),
|
||||
TCA("Turks and Caicos Islands", 948, emptyList()),
|
||||
TUV("Tuvalu", 26, emptyList()),
|
||||
UGA("Uganda", 241551, emptyList()),
|
||||
UKR("Ukraine", 603700, emptyList()),
|
||||
ARE("United Arab Emirates", 83600, emptyList()),
|
||||
GBR("United Kingdom of Great Britain and Northern Ireland", 242910, emptyList()),
|
||||
USA("United States of America", 9833517, emptyList()),
|
||||
UMI("United States Minor Outlying Islands", 34, emptyList()),
|
||||
URY("Uruguay", 176215, emptyList()),
|
||||
UZB("Uzbekistan", 447400, emptyList()),
|
||||
VUT("Vanuatu", 12189, emptyList()),
|
||||
VEN("Venezuela (Bolivarian Republic of)", 912050, emptyList()),
|
||||
VNM("Viet Nam", 331212, emptyList()),
|
||||
VGB("Virgin Islands (British", 153, emptyList()),
|
||||
VIR("Virgin Islands (U.S.)", 347, emptyList()),
|
||||
WLF("Wallis and Futuna", 142, emptyList()),
|
||||
ESH("Western Sahara", 266000, emptyList()),
|
||||
YEM("Yemen", 527968, emptyList()),
|
||||
ZMB("Zambia", 752612, emptyList()),
|
||||
ZWE("Zimbabwe", 390757, emptyList()),
|
||||
DOM("Dominican Republic", 48671, emptyList()),
|
||||
ANT("Netherlands Antilles", 800, emptyList()),
|
||||
XAD("Akrotiri and Dhekelia", 254, emptyList()),
|
||||
XCL("Clipperton Island", 6, emptyList()),
|
||||
ZNC("Nothern Cyprus", 3355, emptyList()),
|
||||
;
|
||||
|
||||
|
||||
override val code = this.name
|
||||
override val type = LocType.COUNTRY
|
||||
override val children = emptyList<GeoLoc>()
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ enum class Group(override val fullName: String, override val children: List<Coun
|
||||
GNQ, ERI, SWZ, ETH, GAB, GMB, GHA, GIN, GNB, KEN, LSO, LBR, LBY, MDG, MWI, MLI, MRT,
|
||||
MUS, MYT, MAR, MOZ, NAM, NER, NGA, COD, REU, RWA, STP, SEN, SYC, SLE, SOM, ZAF, SSD,
|
||||
SHN, SDN, TZA, TGO, TUN, UGA, COD, ZMB, ZWE,
|
||||
ESH,
|
||||
)),
|
||||
NNN("North America", listOf(
|
||||
ABW, AIA, ATG, BHS, BRB, BLZ, BMU, VGB, CAN, CYM, CRI, CUB, CUW, DMA,
|
||||
@ -56,7 +57,6 @@ enum class Group(override val fullName: String, override val children: List<Coun
|
||||
SJM, // Svalbard and Jan Mayen: an archipelago administered by Norway
|
||||
UMI, // United States Minor Outlying Islands: a collection of nine insular areas of the United States
|
||||
VIR, // United States Virgin Islands: an unincorporated territory of the United States in the Caribbean
|
||||
ESH // Western Sahara: a disputed territory claimed by both Morocco and the Sahrawi Arab Democratic Republic
|
||||
)),
|
||||
|
||||
ZZZ("Undefined", listOf(
|
||||
|
@ -1,7 +1,138 @@
|
||||
package net.helcel.beendroid.countries
|
||||
|
||||
enum class State(override val fullName: String, override val area: Int,) : GeoLoc {
|
||||
UNDEFINED("",0);
|
||||
|
||||
AFG_BD("Badakhshan", 44851),
|
||||
AFG_BDG("Badghis", 22447),
|
||||
AFG_BGL("Baghlan", 21397),
|
||||
AFG_BAL("Balkh", 17430),
|
||||
AFG_BAM("Bamyan", 14056),
|
||||
AFG_DAY("Daykundi", 18279),
|
||||
AFG_FRA("Farah", 48402),
|
||||
AFG_FYB("Faryab", 20517),
|
||||
AFG_GHA("Ghazni", 22440),
|
||||
AFG_GHO("Ghor", 36294),
|
||||
AFG_HEL("Helmand", 58971),
|
||||
AFG_HER("Herat", 54588),
|
||||
AFG_JOW("Jowzjan", 12172),
|
||||
AFG_KAB("Kabul", 4900),
|
||||
AFG_KAN("Kandahar", 54610),
|
||||
AFG_KAP("Kapisa", 1829),
|
||||
AFG_KHO("Khost", 3869),
|
||||
AFG_KNR("Kunar", 9423),
|
||||
AFG_KDZ("Kunduz", 8019),
|
||||
AFG_LAG("Laghman", 3844),
|
||||
AFG_LOG("Logar", 3522),
|
||||
AFG_NAN("Nangarhar", 7387),
|
||||
AFG_NIM("Nimroz", 41600),
|
||||
AFG_NUR("Nuristan", 9288),
|
||||
AFG_PAN("Paktia", 6635),
|
||||
AFG_PAR("Paktika", 19308),
|
||||
AFG_PIA("Panjshir", 325),
|
||||
AFG_PRI("Parwan", 5964),
|
||||
AFG_SAM("Samangan", 11497),
|
||||
AFG_SAR("Sar-e Pol", 16392),
|
||||
AFG_SHA("Shamali Plain", 1272),
|
||||
AFG_SOL("Sar-e Pol", 25481),
|
||||
AFG_URO("Urozgan", 12238),
|
||||
AFG_WAR("Wardak", 8894),
|
||||
AFG_ZAB("Zabul", 17296),
|
||||
|
||||
DEU_BW("Baden-Württemberg", 35752),
|
||||
DEU_BY("Bavaria", 70552),
|
||||
DEU_BE("Berlin", 891),
|
||||
DEU_BB("Brandenburg", 29654),
|
||||
DEU_HB("Bremen", 419),
|
||||
DEU_HH("Hamburg", 755),
|
||||
DEU_HE("Hesse", 21115),
|
||||
DEU_MV("Mecklenburg-Vorpommern", 23215),
|
||||
DEU_NI("Lower Saxony", 47709),
|
||||
DEU_NW("North Rhine-Westphalia", 34085),
|
||||
DEU_RP("Rhineland-Palatinate", 19854),
|
||||
DEU_SL("Saarland", 2569),
|
||||
DEU_SN("Saxony", 18417),
|
||||
DEU_ST("Saxony-Anhalt", 20452),
|
||||
DEU_SH("Schleswig-Holstein", 15799),
|
||||
DEU_TH("Thuringia", 16202),
|
||||
|
||||
CHE_AG("Aargau", 1404),
|
||||
CHE_AR("Appenzell Ausserrhoden", 243),
|
||||
CHE_AI("Appenzell Innerrhoden", 173),
|
||||
CHE_BL("Basel-Landschaft", 518),
|
||||
CHE_BS("Basel-Stadt", 37),
|
||||
CHE_BE("Bern", 5959),
|
||||
CHE_FR("Fribourg", 1671),
|
||||
CHE_GE("Geneva", 282),
|
||||
CHE_GL("Glarus", 685),
|
||||
CHE_GR("Graubünden", 7105),
|
||||
CHE_JU("Jura", 838),
|
||||
CHE_LU("Lucerne", 1493),
|
||||
CHE_NE("Neuchâtel", 803),
|
||||
CHE_NW("Nidwalden", 276),
|
||||
CHE_OW("Obwalden", 491),
|
||||
CHE_SH("Schaffhausen", 298),
|
||||
CHE_SZ("Schwyz", 908),
|
||||
CHE_SO("Solothurn", 791),
|
||||
CHE_SG("St. Gallen", 2026),
|
||||
CHE_TG("Thurgau", 991),
|
||||
CHE_TI("Ticino", 2812),
|
||||
CHE_UR("Uri", 1077),
|
||||
CHE_VS("Valais", 5224),
|
||||
CHE_VD("Vaud", 3212),
|
||||
CHE_ZG("Zug", 239),
|
||||
CHE_ZH("Zurich", 1729),
|
||||
|
||||
JPN_HO("Hokkaido", 83424),
|
||||
JPN_AO("Aomori", 12891),
|
||||
JPN_IW("Iwate", 15275),
|
||||
JPN_MI("Miyagi", 7286),
|
||||
JPN_AK("Akita", 11637),
|
||||
JPN_YA("Yamagata", 9323),
|
||||
JPN_FU("Fukushima", 13784),
|
||||
JPN_IB("Ibaraki", 6095),
|
||||
JPN_TOC("Tochigi", 6408),
|
||||
JPN_GU("Gunma", 6362),
|
||||
JPN_SA("Saitama", 3798),
|
||||
JPN_CH("Chiba", 5156),
|
||||
JPN_TY("Tokyo", 2187),
|
||||
JPN_KA("Kanagawa", 2416),
|
||||
JPN_NI("Niigata", 12584),
|
||||
JPN_TOY("Toyama", 4247),
|
||||
JPN_ISH("Ishikawa", 4186),
|
||||
JPN_FK("Fukui", 4181),
|
||||
JPN_YAM("Yamanashi", 4465),
|
||||
JPN_NG("Nagano", 13562),
|
||||
JPN_GI("Gifu", 10621),
|
||||
JPN_SHI("Shizuoka", 7786),
|
||||
JPN_AI("Aichi", 5172),
|
||||
JPN_ME("Mie", 5774),
|
||||
JPN_SHG("Shiga", 4017),
|
||||
JPN_KY("Kyoto", 4612),
|
||||
JPN_OS("Osaka", 19014),
|
||||
JPN_HY("Hyogo", 8395),
|
||||
JPN_NA("Nara", 3691),
|
||||
JPN_WK("Wakayama", 4726),
|
||||
JPN_TO("Tottori", 3507),
|
||||
JPN_SM("Shimane", 6708),
|
||||
JPN_OKY("Okayama", 7114),
|
||||
JPN_HR("Hiroshima", 8479),
|
||||
JPN_YG("Yamaguchi", 6112),
|
||||
JPN_TS("Tokushima", 4147),
|
||||
JPN_KG("Kagawa", 1862),
|
||||
JPN_EH("Ehime", 5676),
|
||||
JPN_KC("Kochi", 7105),
|
||||
JPN_FKK("Fukuoka", 4986),
|
||||
JPN_SG("Saga", 2433),
|
||||
JPN_NGS("Nagasaki", 4132),
|
||||
JPN_KM("Kumamoto", 7409),
|
||||
JPN_OT("Oita", 6341),
|
||||
JPN_MY("Miyazaki", 7775),
|
||||
JPN_KGS("Kagoshima", 9186),
|
||||
JPN_OK("Okinawa", 2281),
|
||||
|
||||
|
||||
UNDEFINED("?",0),
|
||||
;
|
||||
|
||||
override val code = this.name
|
||||
override val children = emptyList<GeoLoc>()
|
||||
|
@ -1,6 +1,9 @@
|
||||
package net.helcel.beendroid.countries
|
||||
|
||||
import android.content.Context
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
class Visited(ctx: Context) {
|
||||
@ -24,9 +27,11 @@ class Visited(ctx: Context) {
|
||||
|
||||
fun setVisited(key: GeoLoc, b: Boolean){
|
||||
locs[key] = b
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
editor.putBoolean(key.code, b)
|
||||
editor.apply()
|
||||
}
|
||||
}
|
||||
|
||||
fun visited(key: GeoLoc): Boolean {
|
||||
return locs.getOrDefault(key,false)
|
||||
|
13
app/src/main/java/net/helcel/beendroid/helper/Theme.kt
Normal file
13
app/src/main/java/net/helcel/beendroid/helper/Theme.kt
Normal file
@ -0,0 +1,13 @@
|
||||
package net.helcel.beendroid.helper
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.TypedValue
|
||||
|
||||
|
||||
|
||||
fun colorPrimary(ctx : Context): ColorDrawable {
|
||||
val colorPrimaryTyped = TypedValue()
|
||||
ctx.theme.resolveAttribute(android.R.attr.colorPrimary, colorPrimaryTyped, true)
|
||||
return ColorDrawable(colorPrimaryTyped.data)
|
||||
}
|
@ -34,7 +34,7 @@ class PSVGWrapper(ctx: Context) {
|
||||
cm[el]?.changeLevel(level)
|
||||
}
|
||||
|
||||
fun build(){
|
||||
private fun build(){
|
||||
fm = World.WWW.children.map { gr ->
|
||||
gr.children.map {c ->
|
||||
val cc = cm[c]
|
||||
|
22
app/src/main/res/layout/activity_edit.xml
Normal file
22
app/src/main/res/layout/activity_edit.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/Theme.Beendroid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/sv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:scrollbars="vertical" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
@ -6,27 +6,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.caverock.androidsvg.SVGImageView
|
||||
android:id="@+id/map"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
app:css="" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/sv"
|
||||
<com.github.chrisbanes.photoview.PhotoView
|
||||
android:id="@+id/photo_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:scrollbars="vertical" />
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
android:layout_height="match_parent"/>
|
||||
</LinearLayout>
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:theme="@style/Theme.Beendroid"
|
||||
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.AboutFragment" >
|
||||
tools:context=".activity.fragment.AboutFragment" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".activity.LicenseFragment" >
|
||||
tools:context=".activity.fragment.LicenseFragment" >
|
||||
|
||||
<fragment
|
||||
android:id="@+id/license_fragment_view"
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@ -12,39 +13,35 @@
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
app:cornerRadius="0dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
android:textAllCaps="false"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:insetTop="4dp"
|
||||
android:insetBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/text2checkbox"
|
||||
app:layout_constraintEnd_toStartOf="@id/text2checkbox"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<Space
|
||||
android:id="@+id/text2checkbox"
|
||||
android:layout_width="0.01dp"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="start|center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/textView"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textAllCaps="false"
|
||||
android:textAppearance="?attr/textAppearanceBody2"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
app:cornerRadius="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/checkBox"
|
||||
app:layout_constraintEnd_toStartOf="@id/checkBox"
|
||||
app:layout_constraintStart_toEndOf="@id/textView" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progressView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/checkBox"
|
||||
app:layout_constraintEnd_toStartOf="@id/checkBox"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
android:id="@+id/checkBox"
|
||||
android:layout_width="0.01dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
app:checkedState="indeterminate"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="@id/textView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
@ -56,7 +53,7 @@
|
||||
android:id="@+id/sub_item"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -7,7 +7,6 @@
|
||||
android:id="@+id/action_edit"
|
||||
android:orderInCategory="100"
|
||||
android:icon="@drawable/edit"
|
||||
android:visible="false"
|
||||
android:title="@string/action_edit"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
|
@ -1,9 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="Theme.Beendroid" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<item name="colorPrimary">@color/teal_700</item>
|
||||
<item name="android:colorPrimary">@color/teal_700</item>
|
||||
<item name="android:panelColorBackground">@color/darkgray</item>
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="colorAccent">?attr/colorPrimary</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,9 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="Theme.Beendroid" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.Beendroid" parent="Theme.Material3.DayNight">
|
||||
<item name="colorPrimary">@color/teal_700</item>
|
||||
<item name="android:colorPrimary">@color/teal_700</item>
|
||||
<item name="android:panelColorBackground">@color/lightgray</item>
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="colorAccent">?attr/colorPrimary</item>
|
||||
|
||||
|
||||
<item name="checkboxStyle">@style/Widget.App.CheckBox</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.CheckBox" parent="Widget.Material3.CompoundButton.CheckBox">
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -16,14 +16,14 @@
|
||||
<Preference
|
||||
app:enabled="true"
|
||||
app:key="@string/licenses"
|
||||
app:icon="@drawable/checklist"
|
||||
app:icon="@drawable/licenses"
|
||||
app:title="@string/licenses"
|
||||
android:summary="@string/foss_licenses"/>
|
||||
|
||||
<Preference
|
||||
app:enabled="true"
|
||||
app:key="@string/about"
|
||||
app:icon="@drawable/info"
|
||||
app:icon="@drawable/about"
|
||||
app:title="@string/about"
|
||||
android:summary="@string/about_beendroid"/>
|
||||
|
||||
|
@ -15,6 +15,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
kotlin.code.style=official
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
|
Loading…
x
Reference in New Issue
Block a user