-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
186 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="dev.kosrat.muslimdata"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
</manifest> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
muslim-data/src/main/java/dev/kosrat/muslimdata/extensions/CityMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
package dev.kosrat.muslimdata.extensions | ||
|
||
class CityMapper { | ||
companion object { | ||
fun map(city: String, countryCode: String): String { | ||
val countries: MutableMap<String, MutableMap<String, List<String>>> = HashMap() | ||
countries["IQ"] = getIQCities() | ||
countries["IR"] = getIRCities() | ||
countries["KW"] = getKWCities() | ||
|
||
val cities = countries[countryCode] | ||
cities?.forEach { | ||
if (it.value.contains(city)) { | ||
return it.key | ||
} | ||
} | ||
return city | ||
} | ||
|
||
private fun getIQCities(): MutableMap<String, List<String>> { | ||
val akre = listOf( | ||
"Amedi", | ||
"Sulav", | ||
"Kani", | ||
"Sheladiz", | ||
"Barzan", | ||
"Bele", | ||
"Shanidar", | ||
"Bujal", | ||
"Mergin", | ||
"Susna", | ||
"Sersink" | ||
) | ||
val bardarash = listOf("Mamuzin") | ||
val darbandikhan = listOf("Zarayan") | ||
val duhok = listOf("Sumel", "Zawita", "Atrish", "Sharya", "Mrebah") | ||
val erbil = listOf( | ||
"Kalak", | ||
"Pirmam", | ||
"Shaqlawa", | ||
"Harir", | ||
"Khalifan", | ||
"Rawanduz", | ||
"Soran", | ||
"Mergasur", | ||
"Galala", | ||
"Choman", | ||
"Hiran", | ||
"Makhmur", | ||
"Qushtapa", | ||
"Kasnazan" | ||
) | ||
val halabja = listOf("Khurmal", "Sirwan", "Byara", "Tawella") | ||
val kifri = listOf("Hajiawa", "Chwarqurna", "Ranya") | ||
val kirkuk = listOf("Taza Khurmatu") | ||
val koysinjaq = listOf("Taqtaq", "Khalakan") | ||
val qalatDizah = listOf("Sangasar", "Zharawa") | ||
val sulaymaniyah = listOf( | ||
"Dokan", | ||
"Bazian", | ||
"Chamchamal", | ||
"Qaran Dagh", | ||
"Arbat", | ||
"Penjwen", | ||
"Said Sadiq", | ||
"Kalar", | ||
"Takiya", | ||
"Shorsh" | ||
) | ||
return mutableMapOf( | ||
"Akre" to akre, | ||
"Bardarash" to bardarash, | ||
"Darbandikhan" to darbandikhan, | ||
"Duhok" to duhok, | ||
"Erbil" to erbil, | ||
"Halabja" to halabja, | ||
"Kifri" to kifri, | ||
"Kirkuk" to kirkuk, | ||
"Koysinjaq" to koysinjaq, | ||
"Qalat itoah" to qalatDizah, | ||
"Sulaymaniyah" to sulaymaniyah | ||
) | ||
} | ||
|
||
private fun getIRCities(): MutableMap<String, List<String>> { | ||
val sanandaj = listOf("Kamyaran", "Divandarreh", "Dehgolan", "Qorveh") | ||
val urmia = listOf("Orumiyeh") | ||
return mutableMapOf( | ||
"Sanandaj" to sanandaj, | ||
"Urmia" to urmia | ||
) | ||
} | ||
|
||
private fun getKWCities(): MutableMap<String, List<String>> { | ||
val alAsimah = listOf( | ||
"Kuwait City", | ||
"Dasman Palace", | ||
"Sharq", | ||
"Mirqab", | ||
"Jibla", | ||
"Dasma", | ||
"Daiya", | ||
"Salhia", | ||
"Bneid Al Qar", | ||
"Kaifan", | ||
"Mansouriya", | ||
"Abdullah al-Salem", | ||
"Nuzha", | ||
"Faiha", | ||
"Shamiya", | ||
"Rawda", | ||
"Adailiya", | ||
"Khaldiya", | ||
"Qadsiya", | ||
"Qortuba", | ||
"Surra", | ||
"Yarmouk", | ||
"Shuwaikh Industrial", | ||
"Rai", | ||
"Granada", | ||
"Sulaibikhat", | ||
"Doha", | ||
"Nahdha", | ||
"Jaber Al Ahmad", | ||
"Qairawan", | ||
"Ahmadi", | ||
"Al Wafrah", | ||
"Sabah Al Salem", | ||
"Messila", | ||
"Al-Masayel", | ||
"Adan", | ||
"Fnaitees", | ||
"Qusor", | ||
"Qurain", | ||
"Abu Fatira", | ||
"Mubarak Al Kabeer", | ||
"Jeleeb Al-Shuyoukh", | ||
"Eqaila", | ||
"Fintas", | ||
"Dahar", | ||
"Mahboula", | ||
"Hadiya", | ||
"Al-Riqqa", | ||
"Abu Halifa", | ||
"Fahad Al Ahmad", | ||
"Assabahiyah", | ||
"Mangaf", | ||
"Fahaheel", | ||
"South Sabahiya", | ||
"Ali Sabah Al Salem", | ||
"Shalayhat Mina Abdullah", | ||
"Zour", | ||
"Al Khiran" | ||
) | ||
val failaka = listOf("Zoor", "Kubbar Island", "Al-Nuwaiseeb") | ||
val abdali = listOf("Jahra") | ||
return mutableMapOf( | ||
"Al Asimah" to alAsimah, | ||
"Failaka Island" to failaka, | ||
"Abdali" to abdali | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters