diff --git a/DOC/ChangeLog.txt b/DOC/ChangeLog.txt
index 1f5812a5..fb377eff 100644
--- a/DOC/ChangeLog.txt
+++ b/DOC/ChangeLog.txt
@@ -3,13 +3,33 @@
// TODO [ADD] line size - swo, wb, wb gusts, sti
// TODO [REF] OkHttp 3.13 Requires Android 5+ – Square Corner Blog – Medium https://medium.com/square-corner-blog/okhttp-3-13-requires-android-5-818bb78d07ce
// TODO [REF] move off rid/wfo/sounding lat/lon/name currently in pref should be in objects (like flutter/iOS)
+// TODO NWS_LOCATION RID_LOC
// TODO [FIX] Canada - some radars have changed code names (need to change maps.xml as well)
// TODO [ADD] radar file class from flutter
+// TODO [FIX] select radar from main screen via icon brings up zoomed out view UtilityLocationFragment
// TODO [FIX] roaming location needs background GPS perm for Android 10 (API 29)
-// TODO [ADD] warning counts in nexrad
// TODO [ADD] textual obs in fixed radars on homescreen
+// TODO [ADD] use ENUM instead of RID_FAV WFO_FAV SND_FAV (util/UtilityFavorites)
+// TODO [FIX] dual/quad pane radar don't take up the entire screen on chomeOS
+// TODO [REF] migrate off WebscreenABModels?
-55341 2020_01_30
+55349 2020_02_02 [REF] utilFav/SettingsHomeScreen refactoring
+ [REF] lint cleanup
+55348 2020_02_02 [REF] utilFav/SettingsHomeScreen refactoring
+55347 2020_02_01 [ADD] move to normal twitter w/o tokens
+55346 2020_02_01 [REF] remove un-needed pref storage in util pref
+ [FIX] twitter activity wasn't going to state of current location
+55345 2020_02_01 [REF] remove un-needed pref storage in util pref
+55344 2020_02_01 [REF] remove un-needed pref storage in util pref
+55343 2020_02_01 [ADD] in nexrad radar if show warnings show count in upper left, tap on count goes to severe dashboard - WIP
+ [FIX] non tst/tor/ffw warnings were not being downloaded outside of backgroundFetch
+ [REF] WIP - move off rid/wfo/sounding lat/lon/name currently in pref should be in objects (like flutter/iOS)
+ [REF] remove un-needed pref storage in util pref
+55342 2020_01_31 [FIX] prelaunch report: at joshuatee.wx.models.UtilityModels.setSubtitleRestoreIMGXYZOOM(UtilityModels.kt:292)
+ java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
+ [FIX] prelaunch report: at joshuatee.wx.models.UtilityModelEsrlInputOutput.getAnimation(UtilityModelEsrlInputOutput.kt:185)
+ java.lang.IndexOutOfBoundsException: Invalid index 37, size is 37 a
+55341 2020_01_30 [ADD] additional graphics for SPC Convective Outlook Day 2
55340 2020_01_30 [REF] use methods in WXGLNexrad to read/write radar info in pref
[FIX] FragmentPagerAdapter deprecated in ViewPagerAdapter.kt
[REF] lint cleanup
@@ -24,7 +44,7 @@
55336 2020_01_27 [REF] lint cleanup
[ADD] fix radar legend pnd - LIFR was not pink
[ADD] RadarFileGeometry (wip)
- [FIX] Obs not working multiplane
+ [FIX] Obs not working multipane
55335 2020_01_27 [FIX] hardcore hourly graph background
55334 2020_01_26 [REF] various code cleanup and var rename for readability
[ADD] change Hourly graph to a black line
diff --git a/app/app.iml b/app/app.iml
index 6185cb01..c037b847 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -19,7 +19,7 @@
-
+
@@ -126,7 +126,7 @@
-
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2d96ad5f..25c9d96a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -22,8 +22,8 @@
@@ -203,11 +203,11 @@
android:parentActivityName="WX" >
ObjectIntent(
- this,
- TextScreenActivity::class.java,
- TextScreenActivity.URL,
- arrayOf(UtilityAlertDialog.showVersion(this, this), "About wX")
- )
+ R.id.action_about -> ObjectIntent(this, SettingsAboutActivity::class.java)
else -> return super.onOptionsItemSelected(item)
}
return true
diff --git a/app/src/main/java/joshuatee/wx/GlobalArrays.kt b/app/src/main/java/joshuatee/wx/GlobalArrays.kt
index 6a5b0afa..4bd3bc01 100644
--- a/app/src/main/java/joshuatee/wx/GlobalArrays.kt
+++ b/app/src/main/java/joshuatee/wx/GlobalArrays.kt
@@ -156,6 +156,7 @@ object GlobalArrays {
"LCH",
"LZK",
"MFR",
+ "MFL",
"MAF",
"BNA",
"MHX",
diff --git a/app/src/main/java/joshuatee/wx/GlobalDictionaries.kt b/app/src/main/java/joshuatee/wx/GlobalDictionaries.kt
index 048767a4..50537946 100644
--- a/app/src/main/java/joshuatee/wx/GlobalDictionaries.kt
+++ b/app/src/main/java/joshuatee/wx/GlobalDictionaries.kt
@@ -22,75 +22,206 @@
package joshuatee.wx
-val NEXRAD_PRODUCT_STRING: Map = mapOf(
- "N0R" to "DS.p19r0",
- "N1R" to "DS.p19r1",
- "N2R" to "DS.p19r2",
- "N3R" to "DS.p19r3",
- "NSP" to "DS.p28sw",
- "NSW" to "DS.p30sw",
- "N0Q" to "DS.p94r0",
- "N1Q" to "DS.p94r1",
- "N2Q" to "DS.p94r2",
- "N3Q" to "DS.p94r3",
- "N0V" to "DS.p27v0",
- "N1V" to "DS.p27v1",
- "N2V" to "DS.p27v2",
- "N3V" to "DS.p27v3",
+object GlobalDictionaries {
- "NCR" to "DS.p37cr",
- "NCZ" to "DS.p38cr",
- "ET" to "DS.p41et",
- "N0U" to "DS.p99v0",
- "N1U" to "DS.p99v1",
- "N2U" to "DS.p99v2",
- "N3U" to "DS.p99v3",
- "N0S" to "DS.56rm0",
- "N1S" to "DS.56rm1",
- "N2S" to "DS.56rm2",
- "N3S" to "DS.56rm3",
- "VIL" to "DS.57vil",
- "STI" to "DS.58sti",
- "TVS" to "DS.61tvs",
- "HI" to "DS.p59hi",
- "DVL" to "DS.134il",
- "EET" to "DS.135et",
- "DSPFIXME" to "DS.138dp",
- "MDA" to "DS.141md",
- "TZ0" to "DS.180z0",
- "TZ1" to "DS.180z1",
- "TZ2" to "DS.180z2",
- "TR0" to "DS.181r0",
- "TR1" to "DS.181r1",
- "TR2" to "DS.181r2",
- "TR3" to "DS.181r3",
- "TV0" to "DS.182v0",
- "TV1" to "DS.182v1",
- "TV2" to "DS.182v2",
- "TV3" to "DS.182v3",
- "TZL" to "DS.186zl",
- "N1P" to "DS.78ohp",
- "NTP" to "DS.80stp",
- "NVL" to "DS.57vil",
- "N0X" to "DS.159x0",
- "N1X" to "DS.159x1",
- "N2X" to "DS.159x2",
- "N3X" to "DS.159x3",
- "N0C" to "DS.161c0",
- "N1C" to "DS.161c1",
- "N2C" to "DS.161c2",
- "N3C" to "DS.161c3",
- "N0K" to "DS.163k0",
- "N1K" to "DS.163k1",
- "N2K" to "DS.163k2",
- "N3K" to "DS.163k3",
- "DAA" to "DS.170aa",
- "DSA" to "DS.172dt",
- "DSP" to "DS.172dt", // FIXME this should be 138
- "H0C" to "DS.165h0",
- "H1C" to "DS.165h1",
- "H2C" to "DS.165h2",
- "H3C" to "DS.165h3",
- "VWP" to "DS.48vwp"
-)
+ // FIXME rename
+ val NEXRAD_PRODUCT_STRING: Map = mapOf(
+ "N0R" to "DS.p19r0",
+ "N1R" to "DS.p19r1",
+ "N2R" to "DS.p19r2",
+ "N3R" to "DS.p19r3",
+ "NSP" to "DS.p28sw",
+ "NSW" to "DS.p30sw",
+ "N0Q" to "DS.p94r0",
+ "N1Q" to "DS.p94r1",
+ "N2Q" to "DS.p94r2",
+ "N3Q" to "DS.p94r3",
+ "N0V" to "DS.p27v0",
+ "N1V" to "DS.p27v1",
+ "N2V" to "DS.p27v2",
+ "N3V" to "DS.p27v3",
+
+ "NCR" to "DS.p37cr",
+ "NCZ" to "DS.p38cr",
+ "ET" to "DS.p41et",
+ "N0U" to "DS.p99v0",
+ "N1U" to "DS.p99v1",
+ "N2U" to "DS.p99v2",
+ "N3U" to "DS.p99v3",
+ "N0S" to "DS.56rm0",
+ "N1S" to "DS.56rm1",
+ "N2S" to "DS.56rm2",
+ "N3S" to "DS.56rm3",
+ "VIL" to "DS.57vil",
+ "STI" to "DS.58sti",
+ "TVS" to "DS.61tvs",
+ "HI" to "DS.p59hi",
+ "DVL" to "DS.134il",
+ "EET" to "DS.135et",
+ "DSPFIXME" to "DS.138dp",
+ "MDA" to "DS.141md",
+ "TZ0" to "DS.180z0",
+ "TZ1" to "DS.180z1",
+ "TZ2" to "DS.180z2",
+ "TR0" to "DS.181r0",
+ "TR1" to "DS.181r1",
+ "TR2" to "DS.181r2",
+ "TR3" to "DS.181r3",
+ "TV0" to "DS.182v0",
+ "TV1" to "DS.182v1",
+ "TV2" to "DS.182v2",
+ "TV3" to "DS.182v3",
+ "TZL" to "DS.186zl",
+ "N1P" to "DS.78ohp",
+ "NTP" to "DS.80stp",
+ "NVL" to "DS.57vil",
+ "N0X" to "DS.159x0",
+ "N1X" to "DS.159x1",
+ "N2X" to "DS.159x2",
+ "N3X" to "DS.159x3",
+ "N0C" to "DS.161c0",
+ "N1C" to "DS.161c1",
+ "N2C" to "DS.161c2",
+ "N3C" to "DS.161c3",
+ "N0K" to "DS.163k0",
+ "N1K" to "DS.163k1",
+ "N2K" to "DS.163k2",
+ "N3K" to "DS.163k3",
+ "DAA" to "DS.170aa",
+ "DSA" to "DS.172dt",
+ "DSP" to "DS.172dt", // FIXME this should be 138
+ "H0C" to "DS.165h0",
+ "H1C" to "DS.165h1",
+ "H2C" to "DS.165h2",
+ "H3C" to "DS.165h3",
+ "VWP" to "DS.48vwp"
+ )
+
+ val wfoToRadarSite: Map = mapOf(
+ "ABQ" to "ABX",
+ "ABR" to "ABR",
+ "AFC" to "AHG",
+ "AFG" to "APD",
+ "AJK" to "ACG",
+ "AKQ" to "AKQ",
+ "ALY" to "ENX",
+ "AMA" to "AMA",
+ "ANC" to "ANC",
+ "APX" to "APX",
+ "ARX" to "ARX",
+ "BGM" to "BGM",
+ "BIS" to "BIS",
+ "BMX" to "BMX",
+ "BOI" to "CBX",
+ "BOU" to "FTG",
+ "BOX" to "BOX",
+ "BRO" to "BRO",
+ "BTV" to "CXX",
+ "BUF" to "BUF",
+ "BYZ" to "BLX",
+ "CAE" to "CAE",
+ "CAR" to "CBW",
+ "CHS" to "CLX",
+ "CLE" to "CLE",
+ "CRP" to "CRP",
+ "CTP" to "CCX",
+ "CYS" to "CYS",
+ "DDC" to "DDC",
+ "DLH" to "DLH",
+ "DMX" to "DMX",
+ "DTX" to "DTX",
+ "DVN" to "DVN",
+ "EAX" to "EAX",
+ "EKA" to "BHX",
+ "EPZ" to "EPZ",
+ "EWX" to "EWX",
+ "FFC" to "FFC",
+ "FGF" to "MVX",
+ "FGZ" to "FSX",
+ "FSD" to "FSD",
+ "FWD" to "FWS",
+ "GGW" to "GGW",
+ "GID" to "UEX",
+ "GJT" to "GJX",
+ "GLD" to "GLD",
+ "GRB" to "GRB",
+ "GRR" to "GRR",
+ "GSP" to "GSP",
+ "GUM" to "GUA",
+ "GYX" to "GYX",
+ "HFO" to "HMO",
+ "HGX" to "HGX",
+ "HNX" to "HNX",
+ "HUN" to "HTX",
+ "ICT" to "ICT",
+ "ILM" to "LTX",
+ "ILN" to "ILN",
+ "ILX" to "ILX",
+ "IND" to "IND",
+ "IWX" to "IWX",
+ "JAN" to "DGX",
+ "JAX" to "JAX",
+ "JKL" to "JKL",
+ "KEY" to "BYX",
+ "LBF" to "LNX",
+ "LCH" to "LCH",
+ "LIX" to "LIX",
+ "LKN" to "LRX",
+ "LMK" to "LVX",
+ "LOT" to "LOT",
+ "LOX" to "VTX",
+ "LSX" to "LSX",
+ "LUB" to "LBB",
+ "LWX" to "LWX",
+ "LZK" to "LZK",
+ "MAF" to "MAF",
+ "MEG" to "NQA",
+ "MFL" to "AMX",
+ "MFR" to "MAX",
+ "MHX" to "MHX",
+ "MKX" to "MKX",
+ "MLB" to "MLB",
+ "MOB" to "MOB",
+ "MPX" to "MPX",
+ "MQT" to "MQT",
+ "MRX" to "MRX",
+ "MSO" to "MSX",
+ "MTR" to "MUX",
+ "OAX" to "OAX",
+ "OHX" to "OHX",
+ "OKX" to "OKX",
+ "OTX" to "OTX",
+ "OUN" to "TLX",
+ "PAH" to "PAH",
+ "PBZ" to "PBZ",
+ "PDT" to "PDT",
+ "PHI" to "DIX",
+ "PIH" to "SFX",
+ "PQR" to "RTX",
+ "PSR" to "IWA",
+ "PUB" to "PUX",
+ "RAH" to "RAX",
+ "REV" to "RGX",
+ "RIW" to "RIW",
+ "RLX" to "RLX",
+ "RNK" to "FCX",
+ "SEW" to "ATX",
+ "SGF" to "SGF",
+ "SGX" to "NKX",
+ "SHV" to "SHV",
+ "SJT" to "SJT",
+ "SJU" to "JUA",
+ "JSJ" to "JUA",
+ "SLC" to "MTX",
+ "STO" to "DAX",
+ "TAE" to "TLH",
+ "TBW" to "TBW",
+ "TFX" to "TFX",
+ "TOP" to "TWX",
+ "TSA" to "INX",
+ "TWC" to "EMX",
+ "UNR" to "UDX",
+ "VEF" to "ESX"
+ )
+}
diff --git a/app/src/main/java/joshuatee/wx/JNI.kt b/app/src/main/java/joshuatee/wx/JNI.kt
index b8ab11e2..cde51f6e 100644
--- a/app/src/main/java/joshuatee/wx/JNI.kt
+++ b/app/src/main/java/joshuatee/wx/JNI.kt
@@ -28,7 +28,7 @@ import java.nio.ByteBuffer
object Jni {
// Native code accessed via JNI was originally developed in 2014. At the time it was necessary for best performnace.
- // 2+ years later gains in hardware and software make the gains neglible in most cases.
+ // 6+ years later gains in hardware and software make the gains negligible in most cases.
init {
System.loadLibrary("radial")
diff --git a/app/src/main/java/joshuatee/wx/StartupActivity.kt b/app/src/main/java/joshuatee/wx/StartupActivity.kt
index cdb36290..119568de 100644
--- a/app/src/main/java/joshuatee/wx/StartupActivity.kt
+++ b/app/src/main/java/joshuatee/wx/StartupActivity.kt
@@ -40,26 +40,10 @@ class StartupActivity : Activity(), ActivityCompat.OnRequestPermissionsResultCal
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
-
- if (Utility.readPrefWithNull(this, "NWS_UNR_X", null) == null) {
- UtilityPref.prefInitStateCode(this)
- UtilityPref.prefInitStateCodeLookup(this)
- UtilityPref.prefInitNWSXY(this)
- UtilityPref.prefInitRIDXY(this)
- UtilityPref.prefInitRIDXY2(this)
- UtilityPref.prefInitNWSLoc(this)
- UtilityPref2.prefInitSetDefaults(this)
- UtilityPref3.prefInitRIDLoc(this)
- UtilityPref.prefInitBig(this)
- UtilityPref.prefInitTwitterCA(this)
- UtilityPref4.prefInitSoundingSites(this)
+ if (Utility.readPrefWithNull(this, "LOC1_LABEL", null) == null) {
+ UtilityLog.d("wx", "INIT PREF")
+ UtilityStorePreferences.setDefaults(this)
}
- if (Utility.readPrefWithNull(
- this,
- "SND_LIX_X",
- null
- ) == null
- ) UtilityPref4.prefInitSoundingSitesLoc(this)
MyApplication.initPreferences(this)
Location.refreshLocationData(this)
UtilityWXJobService.startService(this)
@@ -149,7 +133,7 @@ class StartupActivity : Activity(), ActivityCompat.OnRequestPermissionsResultCal
ObjectIntent(this, WX::class.java)
} else {
val wfo = Location.wfo
- val state = Utility.readPref(this, "NWS_LOCATION_$wfo", "").split(",")[0]
+ val state = Utility.getWfoSiteName(wfo).split(",")[0]
val radarSite = Location.getRid(this, Location.currentLocationStr)
ObjectIntent(
this,
diff --git a/app/src/main/java/joshuatee/wx/UtilityWidget.kt b/app/src/main/java/joshuatee/wx/UtilityWidget.kt
index 7825a297..8d985ec3 100644
--- a/app/src/main/java/joshuatee/wx/UtilityWidget.kt
+++ b/app/src/main/java/joshuatee/wx/UtilityWidget.kt
@@ -42,9 +42,9 @@ import joshuatee.wx.util.*
object UtilityWidget {
- private fun uriShareAndGenerate(context: Context, fn: String): Uri {
+ private fun uriShareAndGenerate(context: Context, fileName: String): Uri {
val dir = File(context.filesDir.toString() + "/shared")
- val file = File(dir, fn)
+ val file = File(dir, fileName)
val imgUri = FileProvider.getUriForFile(
context,
"${MyApplication.packageNameAsString}.fileprovider",
diff --git a/app/src/main/java/joshuatee/wx/WX.kt b/app/src/main/java/joshuatee/wx/WX.kt
index 7c34b8d6..e12f3722 100644
--- a/app/src/main/java/joshuatee/wx/WX.kt
+++ b/app/src/main/java/joshuatee/wx/WX.kt
@@ -127,7 +127,7 @@ class WX : CommonActionBarFragment() {
private fun refreshDynamicContent() {
if (!MyApplication.simpleMode) {
- val tabStr = UtilitySpc.checkSpc(this)
+ val tabStr = UtilitySpc.checkSpc()
vpa.setTabTitles(1, tabStr[0])
vpa.setTabTitles(2, tabStr[1])
if (slidingTabLayout.tabCount > 2) {
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/AFDActivity.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/AFDActivity.kt
index 2d6f5ad4..b0f60c0f 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/AFDActivity.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/AFDActivity.kt
@@ -82,7 +82,6 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
private lateinit var notificationToggle: MenuItem
private lateinit var star: MenuItem
private lateinit var locationList: List
- private val prefTokenLocation = "NWS_LOCATION_"
private val prefToken = "WFO_FAV"
private var ridFavOld = ""
private var version = 0
@@ -123,14 +122,7 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
version = 1
oldProduct = ""
oldWfo = ""
- locationList = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.wfoFav,
- wfo,
- prefTokenLocation,
- prefToken
- )
-
+ locationList = UtilityFavorites.setupFavMenu(this, MyApplication.wfoFav, wfo, prefToken)
spinner = ObjectSpinner(this, this, this, R.id.spinner1, locationList)
imageMap = ObjectImageMap(
this,
@@ -158,7 +150,6 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
this,
MyApplication.wfoFav,
wfo,
- prefTokenLocation,
prefToken
)
spinner.refreshData(this, locationList)
@@ -195,14 +186,11 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
UtilityDownload.getTextProduct(this@AfdActivity, product + wfo + originalWfo)
}
}
-
title = product + wfo
-
// restore the WFO as CLI modifies to a sub-region
if (product == "CLI") {
wfo = originalWfo
}
-
toolbar.subtitle = UtilityWfoText.codeToName[product]
cardList.forEach {
linearLayout.removeView(it)
@@ -212,19 +200,16 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
if (html == "") {
html = "None issued by this office recently."
}
-
if (fixedWidthProducts.contains(product)) {
textCard.setTextAndTranslate(html)
} else {
textCard.setTextAndTranslate(Utility.fromHtml(html))
}
-
if (fixedWidthProducts.contains(product)) {
textCard.tv.typeface = Typeface.create(Typeface.MONOSPACE, Typeface.NORMAL)
} else {
textCard.tv.typeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL)
}
-
UtilityTts.conditionalPlay(activityArguments, 2, applicationContext, html, product)
if (activityArguments[1] == "") {
Utility.writePref(this@AfdActivity, "WFO_TEXT_FAV", product)
@@ -295,19 +280,13 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
wfo = loc.toUpperCase(Locale.US)
originalWfo = wfo
mapShown = false
- locationList = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.wfoFav,
- wfo,
- prefTokenLocation,
- prefToken
- )
+ locationList = UtilityFavorites.setupFavMenu(this, MyApplication.wfoFav, wfo, prefToken)
spinner.refreshData(this, locationList)
}
private fun toggleFavorite() {
val ridFav = UtilityFavorites.toggleFavoriteString(this, wfo, star, prefToken)
- locationList = UtilityFavorites.setupFavMenu(this, ridFav, wfo, prefTokenLocation, prefToken)
+ locationList = UtilityFavorites.setupFavMenu(this, ridFav, wfo, prefToken)
spinner.refreshData(this, locationList)
}
@@ -359,7 +338,9 @@ class AfdActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItemClick
wfoListPerState.clear()
GlobalArrays.wfos
.filter { it.contains(state) }
- .forEach { wfoListPerState.add(MyApplication.space.split(it)[0].replace(":", "")) }
+ .forEach {
+ wfoListPerState.add(MyApplication.space.split(it)[0].replace(":", ""))
+ }
wfoListPerState.sort()
}
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/ImageShowActivity.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/ImageShowActivity.kt
index 9b444fc5..507748b8 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/ImageShowActivity.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/ImageShowActivity.kt
@@ -50,6 +50,7 @@ class ImageShowActivity : BaseActivity(), Toolbar.OnMenuItemClickListener {
// 1: URL
// 2: Title
// 3: (optional) string "true" means a white background is needed
+ //
companion object {
const val URL: String = ""
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/NWSObsSitesActivity.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/NWSObsSitesActivity.kt
index 71448908..04257651 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/NWSObsSitesActivity.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/NWSObsSitesActivity.kt
@@ -100,8 +100,8 @@ class NwsObsSitesActivity : BaseActivity(), Toolbar.OnMenuItemClickListener {
updateButton()
ObjectIntent(
this@NwsObsSitesActivity,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(
"https://www.wrh.noaa.gov/mesowest/timeseries.php?sid=$obsSite",
obsSite
@@ -137,8 +137,8 @@ class NwsObsSitesActivity : BaseActivity(), Toolbar.OnMenuItemClickListener {
val url = "https://www.wrh.noaa.gov/map/?obs=true&wfo=" + Location.wfo.toLowerCase(Locale.US)
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(url, "Observations near " + Location.wfo)
)
}
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/SevereWarning.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/SevereWarning.kt
index aa4d2d86..7d1a9651 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/SevereWarning.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/SevereWarning.kt
@@ -92,7 +92,7 @@ internal class SevereWarning(private val type: PolygonType) {
if (vtecComponents.size > 1) {
wfo = vtecComponents[2]
wfo = wfo.replace("^[KP]".toRegex(), "")
- wfoLocation = Utility.readPref(context, "NWS_LOCATION_$wfo", "")
+ wfoLocation = Utility.getWfoSiteName(wfo)
}
text += " " + wfoLocation + MyApplication.newline
}
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/SpotterReportsActivity.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/SpotterReportsActivity.kt
index 70c1c977..df4e9c81 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/SpotterReportsActivity.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/SpotterReportsActivity.kt
@@ -59,7 +59,6 @@ class SpotterReportsActivity : BaseActivity() {
private fun itemSelected(position: Int) {
val radarSite = UtilityLocation.getNearestOffice(
- this,
"RADAR",
LatLon(
UtilitySpotter.spotterReports[position].lat,
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/SpottersActivity.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/SpottersActivity.kt
index 1e4b8f7e..482938c8 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/SpottersActivity.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/SpottersActivity.kt
@@ -129,8 +129,7 @@ class SpottersActivity : BaseActivity() {
private fun checkFavorite(position: Int) {
if (MyApplication.spotterFav.contains(spotterList[position].uniq + ":")) {
- MyApplication.spotterFav =
- MyApplication.spotterFav.replace(spotterList[position].uniq + ":", "")
+ MyApplication.spotterFav = MyApplication.spotterFav.replace(spotterList[position].uniq + ":", "")
spotterList[position].lastName = spotterList[position].lastName.replace("0FAV ", "")
} else {
MyApplication.spotterFav = MyApplication.spotterFav + spotterList[position].uniq + ":"
@@ -144,7 +143,9 @@ class SpottersActivity : BaseActivity() {
private fun markFavorites() {
spotterList
.filter { MyApplication.spotterFav.contains(it.uniq + ":") && !it.lastName.contains("0FAV ") }
- .forEach { it.lastName = "0FAV " + it.lastName }
+ .forEach {
+ it.lastName = "0FAV " + it.lastName
+ }
sortSpotters()
}
@@ -182,8 +183,8 @@ class SpottersActivity : BaseActivity() {
private fun showItemOnMap(position: Int) {
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(
UtilityMap.getMapUrl(
spotterList[position].lat,
@@ -196,7 +197,6 @@ class SpottersActivity : BaseActivity() {
private fun showItemOnRadar(position: Int) {
val radarSite = UtilityLocation.getNearestOffice(
- this,
"RADAR",
LatLon(spotterList[position].lat, spotterList[position].lon)
)
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/USWarningsWithRadarActivity.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/USWarningsWithRadarActivity.kt
index 81685ad4..1f9f9474 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/USWarningsWithRadarActivity.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/USWarningsWithRadarActivity.kt
@@ -32,6 +32,7 @@ import android.view.MenuItem
import android.view.ContextMenu.ContextMenuInfo
import androidx.appcompat.widget.Toolbar
import joshuatee.wx.Extensions.getImage
+import joshuatee.wx.GlobalDictionaries
import joshuatee.wx.R
import joshuatee.wx.objects.ObjectIntent
@@ -42,7 +43,6 @@ import joshuatee.wx.ui.BaseActivity
import joshuatee.wx.ui.ObjectAlertSummary
import joshuatee.wx.ui.ObjectNavDrawer
import joshuatee.wx.ui.UtilityUI
-import joshuatee.wx.util.Utility
import joshuatee.wx.util.UtilityDownloadNws
import joshuatee.wx.util.UtilityImg
import kotlinx.coroutines.*
@@ -121,7 +121,7 @@ class USWarningsWithRadarActivity : BaseActivity(), Toolbar.OnMenuItemClickListe
}
private fun radarInterface(id: Int) {
- val radarSite = Utility.readPref(this@USWarningsWithRadarActivity, "NWS_RID_" + objectAlertSummary.mapButtonNws[id], "")
+ val radarSite = GlobalDictionaries.wfoToRadarSite[objectAlertSummary.mapButtonNws[id]] ?: ""
ObjectIntent(
this@USWarningsWithRadarActivity,
WXGLRadarActivity::class.java,
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/WebscreenAB.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/WebView.kt
similarity index 79%
rename from app/src/main/java/joshuatee/wx/activitiesmisc/WebscreenAB.kt
rename to app/src/main/java/joshuatee/wx/activitiesmisc/WebView.kt
index 730e3ee0..aed559fd 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/WebscreenAB.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/WebView.kt
@@ -35,18 +35,19 @@ import joshuatee.wx.ui.BaseActivity
import kotlinx.android.synthetic.main.activity_webview_toolbar.*
-class WebscreenAB : BaseActivity() {
+class WebView : BaseActivity() {
+ //
// This is a general purpose activity used to view web pages.
// Toolbar is displayed ( thus AB ie ActionBar (old name) in activity name )
// arg0 URL
// arg1 Title
+ //
companion object {
const val URL: String = ""
}
- // added to support webview history, this var and block below it
private var url = ""
override fun onBackPressed() {
@@ -73,23 +74,13 @@ class WebscreenAB : BaseActivity() {
if (url.startsWith("http")) {
webview.loadUrl(url)
} else {
- if (url.contains("twitter"))
- webview.loadDataWithBaseURL("fake://not/needed", url, "text/html", "utf-8", null)
- else
- webview.loadData(url, "text/html", null)
+ webview.loadData(url, "text/html", null)
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) {
R.id.action_browser -> {
- var urlExt = url
- if (url.contains("https://twitter.com/search?q=%23tornado")) {
- urlExt = "https://twitter.com/hashtag/tornado"
- }
- if (url.contains("https://twitter.com/wunderground")) {
- urlExt = "https://twitter.com/wunderground"
- }
- ObjectIntent(this, Intent.ACTION_VIEW, Uri.parse(urlExt))
+ ObjectIntent(this, Intent.ACTION_VIEW, Uri.parse(url))
true
}
else -> super.onOptionsItemSelected(item)
diff --git a/app/src/main/java/joshuatee/wx/activitiesmisc/WebscreenABState.kt b/app/src/main/java/joshuatee/wx/activitiesmisc/WebViewTwitter.kt
similarity index 54%
rename from app/src/main/java/joshuatee/wx/activitiesmisc/WebscreenABState.kt
rename to app/src/main/java/joshuatee/wx/activitiesmisc/WebViewTwitter.kt
index 064bb969..284f5acd 100644
--- a/app/src/main/java/joshuatee/wx/activitiesmisc/WebscreenABState.kt
+++ b/app/src/main/java/joshuatee/wx/activitiesmisc/WebViewTwitter.kt
@@ -33,25 +33,24 @@ import android.webkit.WebViewClient
import android.widget.AdapterView
import android.widget.AdapterView.OnItemSelectedListener
-import joshuatee.wx.MyApplication
import joshuatee.wx.R
import joshuatee.wx.ui.BaseActivity
import joshuatee.wx.ui.ObjectSpinner
import joshuatee.wx.GlobalArrays
import joshuatee.wx.objects.ObjectIntent
+import joshuatee.wx.settings.Location
import joshuatee.wx.util.Utility
import kotlinx.android.synthetic.main.activity_webview_toolbar_state.*
-class WebscreenABState : BaseActivity(), OnItemSelectedListener {
+class WebViewTwitter : BaseActivity(), OnItemSelectedListener {
- // This is a general purpose activity used to view web pages.
- // Toolbar is displayed ( thus AB ie ActionBar (old name) in activity name )
- // URL and title are passed in via extras
+ //
+ // WebView for twitter weather tags
+ //
- private var url = ""
- private val caArr = listOf(
+ private val canadianSectors = listOf(
"bcstorm: British Columbia",
"abstorm: Alberta",
"skstorm: Saskatchewan",
@@ -64,16 +63,17 @@ class WebscreenABState : BaseActivity(), OnItemSelectedListener {
"ntstorm: North West Territories",
"nlwx: Newfoundland"
)
- private var stateArr = listOf()
- private var stateCodeCurrent = ""
- private var twitterStateId = ""
+ private var sectorList = listOf()
+ private var sector = ""
private lateinit var sp: ObjectSpinner
+ val prefToken = "STATE_CODE"
override fun onBackPressed() {
- if (webview.canGoBack())
+ if (webview.canGoBack()) {
webview.goBack()
- else
+ } else {
super.onBackPressed()
+ }
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
@@ -84,19 +84,11 @@ class WebscreenABState : BaseActivity(), OnItemSelectedListener {
@SuppressLint("SetJavaScriptEnabled", "MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState, R.layout.activity_webview_toolbar_state, null, false)
- title = "twitter"
- stateArr = GlobalArrays.states + caArr
- stateCodeCurrent = Utility.readPref(this, "STATE_CODE", "")
- twitterStateId = Utility.readPref(this, "STATE_TW_ID_$stateCodeCurrent", "")
- url =
- ""
- sp = ObjectSpinner(this, this, this, R.id.spinner1, stateArr)
- sp.setSelection(findPosition(stateCodeCurrent.toLowerCase(Locale.US)))
+ title = "Twitter"
+ sectorList = GlobalArrays.states + canadianSectors
+ sector = Utility.readPref(prefToken, Location.state)
+ sp = ObjectSpinner(this, this, this, R.id.spinner1, sectorList)
+ sp.setSelection(findPosition(sector.toLowerCase(Locale.US)))
val webSettings = webview.settings
webSettings.javaScriptEnabled = true
webview.webViewClient = WebViewClient()
@@ -107,17 +99,13 @@ class WebscreenABState : BaseActivity(), OnItemSelectedListener {
?: 0
override fun onItemSelected(parent: AdapterView<*>, view: View?, pos: Int, id: Long) {
- Utility.writePref(this, "STATE_CODE", MyApplication.colon.split(stateArr[pos])[0])
- stateCodeCurrent = Utility.readPref(this, "STATE_CODE", "")
- twitterStateId = Utility.readPref(this, "STATE_TW_ID_$stateCodeCurrent", "")
- url =
- ""
- webview.loadDataWithBaseURL("fake://not/needed", url, "text/html", "utf-8", null)
+ sector = sectorList[pos].split(":")[0]
+ Utility.writePref(this, prefToken, sector)
+ var url = "https://mobile.twitter.com/hashtag/" + sector.toLowerCase(Locale.US)
+ if (sector.length == 2) {
+ url += "wx"
+ }
+ webview.loadUrl(url)
}
override fun onNothingSelected(parent: AdapterView<*>) {}
@@ -126,8 +114,8 @@ class WebscreenABState : BaseActivity(), OnItemSelectedListener {
return when (item.itemId) {
R.id.action_browser -> {
var tail = "wx"
- var stateTmp = stateCodeCurrent.toLowerCase(Locale.US)
- caArr.forEach {
+ var stateTmp = sector.toLowerCase(Locale.US)
+ canadianSectors.forEach {
if (it.contains("$stateTmp:")) {
tail = ""
stateTmp = stateTmp.replace("wx", "")
diff --git a/app/src/main/java/joshuatee/wx/audio/UtilityTTSTranslations.kt b/app/src/main/java/joshuatee/wx/audio/UtilityTTSTranslations.kt
index bd8f5ef8..7fdce642 100644
--- a/app/src/main/java/joshuatee/wx/audio/UtilityTTSTranslations.kt
+++ b/app/src/main/java/joshuatee/wx/audio/UtilityTTSTranslations.kt
@@ -21,11 +21,12 @@
package joshuatee.wx.audio
+import android.annotation.SuppressLint
import java.util.Locale
object UtilityTtsTranslations {
- // FIXME rename method arg
+ @SuppressLint
internal fun translateAbbreviation(sF: String): String {
// http://www.spc.noaa.gov/misc/acronyms.html
val s = sF.replace("...", " ")
@@ -62,11 +63,13 @@ object UtilityTtsTranslations {
return translateAbbreviationChunk(s)
}
+ @SuppressLint
fun translateAbbreviationsForVisual(sF: String): String {
val s = sF.replace(" ", " ")
return translateAbbreviationChunk(s)
}
+ @SuppressLint
private fun translateAbbreviationChunk(sF: String): String {
var s = sF.toUpperCase(Locale.US)
s = s.replace(" SVR ", " severe ")
diff --git a/app/src/main/java/joshuatee/wx/audio/UtilityVoiceCommand.kt b/app/src/main/java/joshuatee/wx/audio/UtilityVoiceCommand.kt
index c672cdbf..2581a21e 100644
--- a/app/src/main/java/joshuatee/wx/audio/UtilityVoiceCommand.kt
+++ b/app/src/main/java/joshuatee/wx/audio/UtilityVoiceCommand.kt
@@ -33,7 +33,6 @@ import joshuatee.wx.settings.Location
import joshuatee.wx.spc.SpcMesoActivity
import joshuatee.wx.ui.UtilityUI
import joshuatee.wx.MyApplication
-import joshuatee.wx.activitiesmisc.WebscreenAB
import joshuatee.wx.objects.ObjectIntent
import joshuatee.wx.settings.SettingsLocationGenericActivity
import joshuatee.wx.spc.SpcSwoActivity
@@ -60,7 +59,7 @@ object UtilityVoiceCommand {
var validRid = true
if (tokens.size > 1) {
radarSite = tokens[1].toUpperCase(Locale.US)
- if (Utility.readPrefWithNull(context, "RID_LOC_$radarSite", null) == null) {
+ if (Utility.getRadarSiteName(radarSite) == "") {
validRid = false
}
}
@@ -183,27 +182,6 @@ object UtilityVoiceCommand {
USNwsMosaicActivity.URL,
arrayOf("")
)
- } else if (vrString.contains("Twitter")) {
- var stateCodeCurrent: String = Utility.readPref(context, "STATE_CODE", "")
- if (tokens.size > 1) {
- vrString = vrString.replace("Twitter ", "")
- vrString = vrString.replace(" ", "+")
- stateCodeCurrent = Utility.readPref(context, "STATE_LOOKUP_$vrString", "")
- }
- val twitterStateId = Utility.readPref(context, "STATE_TW_ID_$stateCodeCurrent", "")
- ObjectIntent(
- context,
- WebscreenAB::class.java,
- WebscreenAB.URL,
- arrayOf(
- "",
- "twitter: " + stateCodeCurrent.toLowerCase(Locale.US)
- )
- )
} else if (vrString.contains("map")) {
if (tokens.size > 1) {
when (tokens[1]) {
diff --git a/app/src/main/java/joshuatee/wx/fragments/LocationFragment.kt b/app/src/main/java/joshuatee/wx/fragments/LocationFragment.kt
index 62f5f0c8..7009e051 100644
--- a/app/src/main/java/joshuatee/wx/fragments/LocationFragment.kt
+++ b/app/src/main/java/joshuatee/wx/fragments/LocationFragment.kt
@@ -613,11 +613,12 @@ class LocationFragment : Fragment(), OnClickListener { // OnItemSelectedListener
}
private fun getRadarTimeStamp(string: String, j: Int): String {
- var ts = ""
+ var timestamp = ""
val tokens = string.split(" ")
- if (tokens.size > 3)
- ts = tokens[3]
- return oglrArr[j].rid + ": " + ts + " (" + Utility.readPref("RID_LOC_" + oglrArr[j].rid, "") + ")"
+ if (tokens.size > 3) {
+ timestamp = tokens[3]
+ }
+ return oglrArr[j].rid + ": " + timestamp + " (" + Utility.getRadarSiteName(oglrArr[j].rid) + ")"
}
private fun getGPSFromDouble() {
@@ -645,10 +646,7 @@ class LocationFragment : Fragment(), OnClickListener { // OnItemSelectedListener
System.arraycopy(argsOrig, 0, args, 0, argsOrig.size)
args.indices.forEach { z ->
if (args[z] == "WFO_FOR_SND")
- args[z] = UtilityLocation.getNearestSnd(
- activityReference,
- LatLon(Location.x, Location.y)
- )
+ args[z] = UtilityLocation.getNearestSnd(LatLon(Location.x, Location.y))
if (args[z] == "WFO_FOR_GOES")
args[z] = Location.wfo.toLowerCase(Locale.US)
if (args[z] == "STATE_LOWER")
@@ -659,8 +657,8 @@ class LocationFragment : Fragment(), OnClickListener { // OnItemSelectedListener
args[z] = Location.rid
if (args[z] == "ONEK")
args[z] = Utility.readPref("COD_1KM_" + Location.rid, "")
- if (args[z] == "TWOK")
- args[z] = Utility.readPref("STATE_CODE_" + Location.state, "")
+ //if (args[z] == "TWOK")
+ // args[z] = Utility.readPref("STATE_CODE_" + Location.state, "")
}
if (cl != null && id != null) {
intent = Intent(activityReference, cl)
diff --git a/app/src/main/java/joshuatee/wx/fragments/MiscFragment.kt b/app/src/main/java/joshuatee/wx/fragments/MiscFragment.kt
index 74c1f096..ca1925c5 100644
--- a/app/src/main/java/joshuatee/wx/fragments/MiscFragment.kt
+++ b/app/src/main/java/joshuatee/wx/fragments/MiscFragment.kt
@@ -163,18 +163,15 @@ class MiscFragment : Fragment() {
)
hm["twitter_state"] = TileObject(
R.drawable.twstate,
- WebscreenABState::class.java,
+ WebViewTwitter::class.java,
"",
arrayOf(),
resources.getString(R.string.help_twitter),
"twitter_state", "Twitter state"
)
hm["twitter_tornado"] = TileObject(
- R.drawable.twtornado, WebscreenAB::class.java, WebscreenAB.URL,
- arrayOf(
- " ",
- "#tornado"
- ),
+ R.drawable.twtornado, WebView::class.java, WebView.URL,
+ arrayOf("https://mobile.twitter.com/hashtag/tornado", "#tornado"),
resources.getString(R.string.help_twitter), "twitter_tornado", "Twitter tornado"
)
hm["opc"] = TileObject(
diff --git a/app/src/main/java/joshuatee/wx/fragments/UtilityLocationFragment.kt b/app/src/main/java/joshuatee/wx/fragments/UtilityLocationFragment.kt
index 7043f342..3ac0dc77 100644
--- a/app/src/main/java/joshuatee/wx/fragments/UtilityLocationFragment.kt
+++ b/app/src/main/java/joshuatee/wx/fragments/UtilityLocationFragment.kt
@@ -285,7 +285,7 @@ object UtilityLocationFragment {
stringName.contains("Reset zoom and center") -> fnResetRadarView()
else -> {
val ridContext = stringName.split(":")[0]
- var stateContext = Utility.readPref("RID_LOC_$ridContext", "")
+ var stateContext = Utility.getRadarSiteName(ridContext)
stateContext = stateContext.split(",")[0]
ObjectIntent(
activityReference,
diff --git a/app/src/main/java/joshuatee/wx/fragments/ViewPagerAdapter.kt b/app/src/main/java/joshuatee/wx/fragments/ViewPagerAdapter.kt
index db7796eb..4e2fe308 100644
--- a/app/src/main/java/joshuatee/wx/fragments/ViewPagerAdapter.kt
+++ b/app/src/main/java/joshuatee/wx/fragments/ViewPagerAdapter.kt
@@ -7,7 +7,7 @@ import androidx.fragment.app.FragmentPagerAdapter
import joshuatee.wx.MyApplication
//class ViewPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {
-class ViewPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
+class ViewPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
val tabTitles: Array = arrayOf("LOCAL", "SPC", "MISC")
diff --git a/app/src/main/java/joshuatee/wx/models/ModelsSPCSREFActivity.kt b/app/src/main/java/joshuatee/wx/models/ModelsSPCSREFActivity.kt
index 24e2ad24..d8ce27ba 100644
--- a/app/src/main/java/joshuatee/wx/models/ModelsSPCSREFActivity.kt
+++ b/app/src/main/java/joshuatee/wx/models/ModelsSPCSREFActivity.kt
@@ -137,7 +137,7 @@ class ModelsSpcSrefActivity : VideoRecordActivity(), OnMenuItemClickListener, On
om.displayData = DisplayData(this, this, om.numPanes, om.spTime)
setupModel()
spRun = ObjectSpinner(this, this, this, R.id.spinner_run)
- favList = UtilityFavorites.setupFavMenuSref(
+ favList = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.srefFav,
om.displayData.param[om.curImg]
)
@@ -157,7 +157,7 @@ class ModelsSpcSrefActivity : VideoRecordActivity(), OnMenuItemClickListener, On
}
override fun onRestart() {
- favList = UtilityFavorites.setupFavMenuSref(
+ favList = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.srefFav,
om.displayData.param[om.curImg]
)
@@ -318,7 +318,7 @@ class ModelsSpcSrefActivity : VideoRecordActivity(), OnMenuItemClickListener, On
private fun toggleFavorite() {
UtilityFavorites.toggleFavorite(this, om.displayData.param[om.curImg], star, "SREF_FAV")
- favList = UtilityFavorites.setupFavMenuSref(
+ favList = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.srefFav,
om.displayData.param[om.curImg]
)
@@ -328,7 +328,7 @@ class ModelsSpcSrefActivity : VideoRecordActivity(), OnMenuItemClickListener, On
private fun refreshSpinner() {
om.displayData.param[om.curImg] = drw.getUrl()
om.displayData.paramLabel[om.curImg] = drw.getLabel()
- favList = UtilityFavorites.setupFavMenuSref(
+ favList = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.srefFav,
om.displayData.param[om.curImg]
)
diff --git a/app/src/main/java/joshuatee/wx/models/UtilityModelESRLInputOutput.kt b/app/src/main/java/joshuatee/wx/models/UtilityModelESRLInputOutput.kt
index e44032b8..96fd5784 100644
--- a/app/src/main/java/joshuatee/wx/models/UtilityModelESRLInputOutput.kt
+++ b/app/src/main/java/joshuatee/wx/models/UtilityModelESRLInputOutput.kt
@@ -38,7 +38,7 @@ internal object UtilityModelEsrlInputOutput {
fun getRunTime(model: String, param: String): RunTimeData {
val runData = RunTimeData()
- val htmlRunstatus: String = when (model) {
+ val htmlRunStatus: String = when (model) {
"HRRR_AK" -> ("$urlBase/alaska/").getHtml()
// https://rapidrefresh.noaa.gov/RAP/Welcome.cgi?dsKey=rap_jet&domain=full&run_time=23+Nov+2018+-+08Z
"RAP_NCEP" -> ("$urlBase/RAP/Welcome.cgi?dsKey=" + model.toLowerCase(Locale.US)
@@ -50,8 +50,8 @@ internal object UtilityModelEsrlInputOutput {
+ model.toLowerCase(Locale.US) + "_jet&domain=full").getHtml()
}
val oldRunTimes: List
- var html = htmlRunstatus.parse(RegExp.eslHrrrPattern1)
- oldRunTimes = htmlRunstatus.parseColumn(RegExp.eslHrrrPattern2)
+ var html = htmlRunStatus.parse(RegExp.eslHrrrPattern1)
+ oldRunTimes = htmlRunStatus.parseColumn(RegExp.eslHrrrPattern2)
var year = html.parse(RegExp.eslHrrrPattern3)
var day = html.parse(RegExp.eslHrrrPattern4)
var hour = html.parse(RegExp.eslHrrrPattern5)
@@ -71,7 +71,7 @@ internal object UtilityModelEsrlInputOutput {
html = year + monthStr + day + hour
runData.listRunAdd(html)
runData.mostRecentRun = html
- runData.imageCompleteInt = UtilityString.parseAndCount(htmlRunstatus, ".($param).") - 3
+ runData.imageCompleteInt = UtilityString.parseAndCount(htmlRunStatus, ".($param).") - 3
runData.imageCompleteStr = runData.imageCompleteInt.toString()
if (html != "") {
var i = 0
@@ -181,8 +181,9 @@ internal object UtilityModelEsrlInputOutput {
fun getAnimation(context: Context, om: ObjectModel): AnimationDrawable {
if (om.spinnerTimeValue == -1) return AnimationDrawable()
- val bmAl = (om.spinnerTimeValue until om.spTime.list.size).mapTo(mutableListOf()) {
- getImage(om, om.spTime.list[it].split(" ").getOrNull(0) ?: "")
+ val timeList = om.spTime.list.toMutableList()
+ val bmAl = (om.spinnerTimeValue until timeList.size).mapTo(mutableListOf()) {
+ getImage(om, timeList[it].split(" ").getOrNull(0) ?: "")
}
return UtilityImgAnim.getAnimationDrawableFromBMList(context, bmAl)
}
diff --git a/app/src/main/java/joshuatee/wx/models/UtilityModelNCEPInputOutput.kt b/app/src/main/java/joshuatee/wx/models/UtilityModelNCEPInputOutput.kt
index 475f9a09..6392cb0f 100644
--- a/app/src/main/java/joshuatee/wx/models/UtilityModelNCEPInputOutput.kt
+++ b/app/src/main/java/joshuatee/wx/models/UtilityModelNCEPInputOutput.kt
@@ -45,7 +45,6 @@ internal object UtilityModelNcepInputOutput {
+ model.toUpperCase(Locale.US) + "&area=" + spinnerSectorCurrent + "&ps=area",
RegExp.ncepPattern2
)
- //html = html.replace("UTC selected_cell", "Z")
html = html.replace("UTC", "Z").replace(" ", "")
runCompletionDataStr.append(html.replace("Z", " UTC"))
if (runCompletionDataStr.length > 8) {
diff --git a/app/src/main/java/joshuatee/wx/models/UtilityModels.kt b/app/src/main/java/joshuatee/wx/models/UtilityModels.kt
index daac5fb0..014651ea 100644
--- a/app/src/main/java/joshuatee/wx/models/UtilityModels.kt
+++ b/app/src/main/java/joshuatee/wx/models/UtilityModels.kt
@@ -277,22 +277,24 @@ object UtilityModels {
fun setSubtitleRestoreIMGXYZOOM(
img: MutableList,
toolbar: Toolbar,
- str: String
+ string: String
) {
val x = FloatArray(img.size)
val y = FloatArray(img.size)
val z = FloatArray(img.size)
- val poi = mutableListOf()
+ val point = mutableListOf()
if (img.size > 0) {
(0 until img.size).forEach {
z[it] = img[it].currentZoom
if (img[it].scrollPosition != null) {
- poi.add(img[it].scrollPosition)
+ point.add(img[it].scrollPosition)
+ } else {
+ point.add(PointF(0.5f, 0.5f))
}
- x[it] = poi[it].x
- y[it] = poi[it].y
+ x[it] = point[it].x
+ y[it] = point[it].y
}
- toolbar.subtitle = str
+ toolbar.subtitle = string
(0 until img.size)
.filter { !x[it].isNaN() && !y[it].isNaN() }
.forEach { img[it].setZoom(z[it], x[it], y[it]) }
diff --git a/app/src/main/java/joshuatee/wx/notifications/UtilityNotification.kt b/app/src/main/java/joshuatee/wx/notifications/UtilityNotification.kt
index 52649caf..661ed19b 100644
--- a/app/src/main/java/joshuatee/wx/notifications/UtilityNotification.kt
+++ b/app/src/main/java/joshuatee/wx/notifications/UtilityNotification.kt
@@ -147,11 +147,7 @@ object UtilityNotification {
val url2: String
var nws1StateCurrent = ""
if (Location.isUS(locNumInt)) {
- val nwsLocation = Utility.readPref(
- context,
- "NWS_LOCATION_" + MyApplication.locations[locNumInt].wfo,
- ""
- )
+ val nwsLocation = Utility.getWfoSiteName(MyApplication.locations[locNumInt].wfo)
val nwsLocationArr = MyApplication.comma.split(nwsLocation)
nws1StateCurrent = nwsLocationArr[0]
}
@@ -171,11 +167,9 @@ object UtilityNotification {
""
)
}
- locLabelStr = "(" + Location.getName(locNumInt) + ") " +
- Location.getRid(locNumInt) + " Radar"
+ locLabelStr = "(" + Location.getName(locNumInt) + ") " + Location.getRid(locNumInt) + " Radar"
noMain = locLabelStr
- val notifier2 =
- context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+ val notifier2 = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val noti2: Notification
val resultIntent2: Intent
if (Location.isUS(locNumInt)) {
@@ -521,7 +515,7 @@ object UtilityNotification {
val notifCurrent = "true"
val txt: String
txt = if (notifCurrent.startsWith("t")) {
- val tabStr = UtilitySpc.checkSpc(context)
+ val tabStr = UtilitySpc.checkSpc()
"" + tabStr[0] + " " + tabStr[1].replace("MISC", "")
} else {
""
diff --git a/app/src/main/java/joshuatee/wx/objects/PolygonWarningType.kt b/app/src/main/java/joshuatee/wx/objects/PolygonWarningType.kt
index 06793484..a54a0d74 100644
--- a/app/src/main/java/joshuatee/wx/objects/PolygonWarningType.kt
+++ b/app/src/main/java/joshuatee/wx/objects/PolygonWarningType.kt
@@ -30,12 +30,7 @@ import android.graphics.Color
// TODO setup datastructures in myApp that are Maps based for example a Map of PolygonWarningType: boolean ( for enablement )
// NWS default colors: https://www.weather.gov/bro/mapcolors
-// BETTER NWS default colors: https://www.weather.gov/help-map
-
-// TODO DSW Dust%20Storm%20Warning
-// TODO SQW Snow%20Squall%20Warning
-//
-
+// NWS default colors: https://www.weather.gov/help-map
enum class PolygonWarningType constructor(
var productCode: String,
var urlToken: String,
diff --git a/app/src/main/java/joshuatee/wx/radar/USNWSMosaicActivity.kt b/app/src/main/java/joshuatee/wx/radar/USNWSMosaicActivity.kt
index 7313764e..b523abab 100644
--- a/app/src/main/java/joshuatee/wx/radar/USNWSMosaicActivity.kt
+++ b/app/src/main/java/joshuatee/wx/radar/USNWSMosaicActivity.kt
@@ -75,26 +75,21 @@ class USNwsMosaicActivity : VideoRecordActivity(), Toolbar.OnMenuItemClickListen
} else {
if (activityArguments.isNotEmpty() && activityArguments[0] == "location") {
val rid1 = Location.rid
- val ridLoc = Utility.readPref(this, "RID_LOC_$rid1", "")
+ val ridLoc = Utility.getRadarSiteName(rid1)
val nwsLocationArr = ridLoc.split(",").dropLastWhile { it.isEmpty() }
val state = nwsLocationArr.getOrNull(0) ?: ""
- nwsRadarMosaicSectorLabelCurrent =
- UtilityUSImgNwsMosaic.getSectorFromState(state)
- nwsRadarMosaicSectorLabelCurrent = UtilityUSImgNwsMosaic.getSectorLabelFromCode(
- nwsRadarMosaicSectorLabelCurrent
- )
+ nwsRadarMosaicSectorLabelCurrent = UtilityUSImgNwsMosaic.getSectorFromState(state)
+ nwsRadarMosaicSectorLabelCurrent = UtilityUSImgNwsMosaic.getSectorLabelFromCode(nwsRadarMosaicSectorLabelCurrent)
doNotSavePref = true
} else if (activityArguments.isNotEmpty() && activityArguments[0] == "widget") {
val widgetLocNum = Utility.readPref(this, "WIDGET_LOCATION", "1")
val rid1 = Location.getRid(this, widgetLocNum)
- val ridLoc = Utility.readPref(this, "RID_LOC_$rid1", "")
+ val ridLoc = Utility.getRadarSiteName(rid1)
val nwsLocationArr = ridLoc.split(",").dropLastWhile { it.isEmpty() }
- val state = Utility.readPref(this, "STATE_CODE_" + nwsLocationArr.getOrNull(0), "")
- nwsRadarMosaicSectorLabelCurrent =
- UtilityUSImgNwsMosaic.getSectorFromState(state)
- nwsRadarMosaicSectorLabelCurrent = UtilityUSImgNwsMosaic.getSectorLabelFromCode(
- nwsRadarMosaicSectorLabelCurrent
- )
+ //val state = Utility.readPref(this, "STATE_CODE_" + nwsLocationArr.getOrNull(0), "")
+ val state = nwsLocationArr.getOrNull(0) ?: ""
+ nwsRadarMosaicSectorLabelCurrent = UtilityUSImgNwsMosaic.getSectorFromState(state)
+ nwsRadarMosaicSectorLabelCurrent = UtilityUSImgNwsMosaic.getSectorLabelFromCode(nwsRadarMosaicSectorLabelCurrent)
} else {
nwsRadarMosaicSectorLabelCurrent = Utility.readPref(
this,
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityCanvasStormInfo.kt b/app/src/main/java/joshuatee/wx/radar/UtilityCanvasStormInfo.kt
index 488e63eb..d4acf70d 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityCanvasStormInfo.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityCanvasStormInfo.kt
@@ -70,7 +70,7 @@ object UtilityCanvasStormInfo {
val stormList = mutableListOf()
val stormListArr: FloatArray
val retStr: String
- val location = UtilityLocation.getSiteLocation(context, radarSite)
+ val location = UtilityLocation.getSiteLocation(radarSite)
try {
val dis = UCARRandomAccessFile(UtilityIO.getFilePath(context, stiBaseFn + ""))
dis.bigEndian = true
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityDownloadWarnings.kt b/app/src/main/java/joshuatee/wx/radar/UtilityDownloadWarnings.kt
index ec6e6827..94a4629d 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityDownloadWarnings.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityDownloadWarnings.kt
@@ -34,7 +34,7 @@ internal object UtilityDownloadWarnings {
var timer = DownloadTimer(type)
private const val baseUrl = "https://api.weather.gov/alerts/active?event="
- private const val tstormUrl = baseUrl + "Severe%20Thunderstorm%20Warning"
+ private const val tStormUrl = baseUrl + "Severe%20Thunderstorm%20Warning"
private const val ffwUrl = baseUrl + "Flash%20Flood%20Warning"
private const val tornadoUrl = baseUrl + "Tornado%20Warning"
// Below is for testing
@@ -42,9 +42,17 @@ internal object UtilityDownloadWarnings {
fun get(context: Context) {
if (timer.isRefreshNeeded(context)) {
+ //UtilityLog.d("wx", "DOWNLOAD WARNINGS")
if (PolygonType.TST.pref) {
getPolygonVtec(context)
}
+ MyApplication.radarWarningPolygons.forEach {
+ if (it.isEnabled) {
+ it.storage.valueSet(context, getVtecByType(it.type))
+ } else {
+ it.storage.valueSet(context, "")
+ }
+ }
}
}
@@ -63,7 +71,7 @@ internal object UtilityDownloadWarnings {
}
private fun getPolygonVtec(context: Context) {
- val tstData = UtilityDownloadNws.getStringFromUrlNoAcceptHeader(tstormUrl)
+ val tstData = UtilityDownloadNws.getStringFromUrlNoAcceptHeader(tStormUrl)
if (tstData != "") {
MyApplication.severeDashboardTst.valueSet(context, tstData)
}
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityMetar.kt b/app/src/main/java/joshuatee/wx/radar/UtilityMetar.kt
index 640b4461..a339f91c 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityMetar.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityMetar.kt
@@ -332,8 +332,8 @@ internal object UtilityMetar {
// Used for nexrad radar when obs site is turn on
//
//
- private fun getObservationSites(context: Context, rid: String): String {
- val radarLocation = UtilityLocation.getSiteLocation(context, rid)
+ private fun getObservationSites(context: Context, radarSite: String): String {
+ val radarLocation = UtilityLocation.getSiteLocation(radarSite)
val obsListSb = StringBuilder(100)
readMetarData(context)
/*val text = UtilityIO.readTextFileFromRaw(context.resources, R.raw.us_metar3)
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityRadar.kt b/app/src/main/java/joshuatee/wx/radar/UtilityRadar.kt
index d28d742c..5f5f0cb7 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityRadar.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityRadar.kt
@@ -25,7 +25,7 @@ object UtilityRadar {
// grep NWS_LOC UtilityPref.dart |sed "s/Utility.writePref(.NWS_LOCATION_/\"/" | sed 's/",/" to/' | sed "s/);/,/"
- /*val soundingIdToName = mapOf(
+ val soundingIdToName = mapOf(
"VBG" to "CA, Vandenberg AFB",
"1Y7" to "AZ, Yuma",
"76405" to "MX, La Paz",
@@ -52,7 +52,7 @@ object UtilityRadar {
"TLH" to "FL, Tallahassee",
"WPL" to "ON, Pickle Lake",
"DNR" to "CO, Denver"
- )*/
+ )
val wfoIdToName = mapOf(
"AFC" to "AK, Anchorage",
@@ -389,12 +389,9 @@ object UtilityRadar {
"TDCA" to "MD, Washington National",
"TPBI" to "FL, West Palm Beach",
"TICT" to "KS, Wichita"
-
-
-
)
- val wfoSitetoLat = mapOf(
+ val wfoSiteToLat = mapOf(
"ABC" to "60.79278",
"ABQ" to "35.1027",
"ABR" to "45.45583",
@@ -612,7 +609,7 @@ object UtilityRadar {
"YUX" to "32.49528"
)
- val wfoSitetoLon = mapOf(
+ val wfoSiteToLon = mapOf(
"ABC" to "-161.87417",
"ABQ" to "-106.6276",
"ABR" to "-98.41306",
@@ -1268,200 +1265,200 @@ object UtilityRadar {
)
- /* val soundingSiteToLat = mapOf(
- "76225" to "28.70",
- "76405" to "24.07",
- "76458" to "23.18",
- "ABE" to "60.78",
- "ABQ" to "35.03",
- "ABR" to "45.45",
- "ACD" to "55.20",
- "ADQ" to "57.75",
- "AFA" to "64.82",
- "AKN" to "58.68",
- "ALB" to "42.75",
- "AMA" to "35.23",
- "AMC" to "62.95",
- "ANC" to "61.17",
- "ANT" to "55.03",
- "AOM" to "64.52",
- "AOT" to "66.87",
- "APX" to "44.90",
- "ASN" to "57.15",
- "ASY" to "52.72",
- "AYA" to "59.52",
- "BIS" to "46.77",
- "BMX" to "33.17",
- "BNA" to "36.12",
- "BOI" to "43.57",
- "BRO" to "25.90",
- "BUF" to "42.93",
- "CAR" to "46.87",
- "CHH" to "41.67",
- "CHS" to "32.90",
- "CRP" to "27.77",
- "DDC" to "37.77",
- "DNR" to "39.75",
- "DRA" to "36.62",
- "DRT" to "29.37",
- "DTX" to "42.68",
- "DVN" to "41.60",
- "EPZ" to "31.90",
- "EYW" to "24.55",
- "FFC" to "33.36",
- "FLG" to "35.23",
- "FWD" to "32.80",
- "GGW" to "48.21",
- "GJT" to "39.12",
- "GRB" to "44.48",
- "GSO" to "36.08",
- "GYX" to "43.89",
- "IAD" to "39.083667",
- "ILN" to "39.42",
- "ILX" to "40.10",
- "INL" to "48.57",
- "JAN" to "32.32",
- "JAX" to "30.43",
- "KEY" to "24.55",
- "LBF" to "41.13",
- "LCH" to "30.12",
- "LIX" to "30.337",
- "LKN" to "40.87",
- "LWX" to "38.98",
- "LZK" to "34.83",
- "MAF" to "31.95",
- "MFL" to "25.75",
- "MFR" to "42.37",
- "MFX" to "25.80",
- "MHX" to "34.70",
- "MPX" to "44.85",
- "NJM" to "34.69",
- "NKX" to "32.73",
- "OAK" to "37.73",
- "OAX" to "41.32",
- "OKX" to "40.86",
- "OTX" to "47.68",
- "OUN" to "35.23",
- "PIT" to "40.50",
- "REV" to "39.57",
- "RIW" to "43.00",
- "RNK" to "37.21",
- "SGF" to "37.14",
- "SHV" to "32.45",
- "SIL" to "30.25",
- "SLC" to "40.78",
- "SLE" to "44.92",
- "TBW" to "27.70",
- "TFX" to "47.45",
- "TLH" to "30.56",
- "TOP" to "39.07",
- "TUS" to "32.12",
- "UIL" to "47.95",
- "UNR" to "44.07",
- "VBG" to "34.72",
- "WAL" to "37.85",
- "WMW" to "46.0",
- "WPL" to "51.47",
- "YLW" to "49.97",
- "YMO" to "51.27"
- )
+ val soundingSiteToLat = mapOf(
+ "76225" to "28.70",
+ "76405" to "24.07",
+ "76458" to "23.18",
+ "ABE" to "60.78",
+ "ABQ" to "35.03",
+ "ABR" to "45.45",
+ "ACD" to "55.20",
+ "ADQ" to "57.75",
+ "AFA" to "64.82",
+ "AKN" to "58.68",
+ "ALB" to "42.75",
+ "AMA" to "35.23",
+ "AMC" to "62.95",
+ "ANC" to "61.17",
+ "ANT" to "55.03",
+ "AOM" to "64.52",
+ "AOT" to "66.87",
+ "APX" to "44.90",
+ "ASN" to "57.15",
+ "ASY" to "52.72",
+ "AYA" to "59.52",
+ "BIS" to "46.77",
+ "BMX" to "33.17",
+ "BNA" to "36.12",
+ "BOI" to "43.57",
+ "BRO" to "25.90",
+ "BUF" to "42.93",
+ "CAR" to "46.87",
+ "CHH" to "41.67",
+ "CHS" to "32.90",
+ "CRP" to "27.77",
+ "DDC" to "37.77",
+ "DNR" to "39.75",
+ "DRA" to "36.62",
+ "DRT" to "29.37",
+ "DTX" to "42.68",
+ "DVN" to "41.60",
+ "EPZ" to "31.90",
+ "EYW" to "24.55",
+ "FFC" to "33.36",
+ "FLG" to "35.23",
+ "FWD" to "32.80",
+ "GGW" to "48.21",
+ "GJT" to "39.12",
+ "GRB" to "44.48",
+ "GSO" to "36.08",
+ "GYX" to "43.89",
+ "IAD" to "39.083667",
+ "ILN" to "39.42",
+ "ILX" to "40.10",
+ "INL" to "48.57",
+ "JAN" to "32.32",
+ "JAX" to "30.43",
+ "KEY" to "24.55",
+ "LBF" to "41.13",
+ "LCH" to "30.12",
+ "LIX" to "30.337",
+ "LKN" to "40.87",
+ "LWX" to "38.98",
+ "LZK" to "34.83",
+ "MAF" to "31.95",
+ "MFL" to "25.75",
+ "MFR" to "42.37",
+ "MFX" to "25.80",
+ "MHX" to "34.70",
+ "MPX" to "44.85",
+ "NJM" to "34.69",
+ "NKX" to "32.73",
+ "OAK" to "37.73",
+ "OAX" to "41.32",
+ "OKX" to "40.86",
+ "OTX" to "47.68",
+ "OUN" to "35.23",
+ "PIT" to "40.50",
+ "REV" to "39.57",
+ "RIW" to "43.00",
+ "RNK" to "37.21",
+ "SGF" to "37.14",
+ "SHV" to "32.45",
+ "SIL" to "30.25",
+ "SLC" to "40.78",
+ "SLE" to "44.92",
+ "TBW" to "27.70",
+ "TFX" to "47.45",
+ "TLH" to "30.56",
+ "TOP" to "39.07",
+ "TUS" to "32.12",
+ "UIL" to "47.95",
+ "UNR" to "44.07",
+ "VBG" to "34.72",
+ "WAL" to "37.85",
+ "WMW" to "46.0",
+ "WPL" to "51.47",
+ "YLW" to "49.97",
+ "YMO" to "51.27"
+ )
- val soundingSiteToLon = mapOf(
- "1Y7" to "114.40",
- "76225" to "106.07",
- "76405" to "110.33",
- "76458" to "106.42",
- "ABE" to "161.80",
- "ABQ" to "106.62",
- "ABR" to "98.41",
- "ACD" to "162.73",
- "ADQ" to "152.50",
- "AFA" to "147.87",
- "AKN" to "156.65",
- "ALB" to "73.80",
- "AMA" to "101.70",
- "AMC" to "155.60",
- "ANC" to "150.02",
- "ANT" to "131.57",
- "AOM" to "165.45",
- "AOT" to "162.63",
- "APX" to "84.72",
- "ASN" to "170.22",
- "ASY" to "174.12",
- "AYA" to "139.67",
- "BIS" to "100.75",
- "BMX" to "86.77",
- "BNA" to "86.68",
- "BOI" to "116.22",
- "BRO" to "97.43",
- "BUF" to "78.73",
- "CAR" to "68.02",
- "CHH" to "69.97",
- "CHS" to "80.03",
- "CRP" to "97.50",
- "DDC" to "99.97",
- "DNR" to "104.87",
- "DRA" to "116.02",
- "DRT" to "100.92",
- "DTX" to "83.47",
- "DVN" to "90.60",
- "EPZ" to "106.70",
- "EYW" to "81.75",
- "FFC" to "84.56",
- "FLG" to "111.82",
- "FWD" to "97.30",
- "GGW" to "106.63",
- "GJT" to "108.53",
- "GRB" to "88.13",
- "GSO" to "79.95",
- "GYX" to "70.25",
- "IAD" to "77.529224",
- "ILN" to "83.82",
- "ILX" to "89.30",
- "INL" to "93.38",
- "JAN" to "90.08",
- "JAX" to "81.61",
- "KEY" to "81.75",
- "LBF" to "100.68",
- "LCH" to "93.22",
- "LIX" to "89.825",
- "LKN" to "115.73",
- "LWX" to "77.47",
- "LZK" to "92.25",
- "MAF" to "102.18",
- "MFL" to "80.38",
- "MFR" to "122.87",
- "MFX" to "80.38",
- "MHX" to "76.80",
- "MPX" to "93.57",
- "NJM" to "77.03",
- "NKX" to "117.17",
- "OAK" to "122.22",
- "OAX" to "96.37",
- "OKX" to "72.86",
- "OTX" to "117.63",
- "OUN" to "97.47",
- "PIT" to "80.22",
- "REV" to "119.80",
- "RIW" to "108.50",
- "RNK" to "80.41",
- "SGF" to "93.23",
- "SHV" to "93.83",
- "SIL" to "89.77",
- "SLC" to "111.97",
- "SLE" to "123.00",
- "TBW" to "82.40",
- "TFX" to "111.38",
- "TLH" to "84.45",
- "TOP" to "95.62",
- "TUS" to "110.93",
- "UIL" to "124.55",
- "UNR" to "103.21",
- "VBG" to "120.57",
- "WAL" to "75.48",
- "WMW" to "76.87",
- "WPL" to "90.20",
- "YLW" to "119.38",
- "YMO" to "80.65"
- )*/
+ val soundingSiteToLon = mapOf(
+ "1Y7" to "114.40",
+ "76225" to "106.07",
+ "76405" to "110.33",
+ "76458" to "106.42",
+ "ABE" to "161.80",
+ "ABQ" to "106.62",
+ "ABR" to "98.41",
+ "ACD" to "162.73",
+ "ADQ" to "152.50",
+ "AFA" to "147.87",
+ "AKN" to "156.65",
+ "ALB" to "73.80",
+ "AMA" to "101.70",
+ "AMC" to "155.60",
+ "ANC" to "150.02",
+ "ANT" to "131.57",
+ "AOM" to "165.45",
+ "AOT" to "162.63",
+ "APX" to "84.72",
+ "ASN" to "170.22",
+ "ASY" to "174.12",
+ "AYA" to "139.67",
+ "BIS" to "100.75",
+ "BMX" to "86.77",
+ "BNA" to "86.68",
+ "BOI" to "116.22",
+ "BRO" to "97.43",
+ "BUF" to "78.73",
+ "CAR" to "68.02",
+ "CHH" to "69.97",
+ "CHS" to "80.03",
+ "CRP" to "97.50",
+ "DDC" to "99.97",
+ "DNR" to "104.87",
+ "DRA" to "116.02",
+ "DRT" to "100.92",
+ "DTX" to "83.47",
+ "DVN" to "90.60",
+ "EPZ" to "106.70",
+ "EYW" to "81.75",
+ "FFC" to "84.56",
+ "FLG" to "111.82",
+ "FWD" to "97.30",
+ "GGW" to "106.63",
+ "GJT" to "108.53",
+ "GRB" to "88.13",
+ "GSO" to "79.95",
+ "GYX" to "70.25",
+ "IAD" to "77.529224",
+ "ILN" to "83.82",
+ "ILX" to "89.30",
+ "INL" to "93.38",
+ "JAN" to "90.08",
+ "JAX" to "81.61",
+ "KEY" to "81.75",
+ "LBF" to "100.68",
+ "LCH" to "93.22",
+ "LIX" to "89.825",
+ "LKN" to "115.73",
+ "LWX" to "77.47",
+ "LZK" to "92.25",
+ "MAF" to "102.18",
+ "MFL" to "80.38",
+ "MFR" to "122.87",
+ "MFX" to "80.38",
+ "MHX" to "76.80",
+ "MPX" to "93.57",
+ "NJM" to "77.03",
+ "NKX" to "117.17",
+ "OAK" to "122.22",
+ "OAX" to "96.37",
+ "OKX" to "72.86",
+ "OTX" to "117.63",
+ "OUN" to "97.47",
+ "PIT" to "80.22",
+ "REV" to "119.80",
+ "RIW" to "108.50",
+ "RNK" to "80.41",
+ "SGF" to "93.23",
+ "SHV" to "93.83",
+ "SIL" to "89.77",
+ "SLC" to "111.97",
+ "SLE" to "123.00",
+ "TBW" to "82.40",
+ "TFX" to "111.38",
+ "TLH" to "84.45",
+ "TOP" to "95.62",
+ "TUS" to "110.93",
+ "UIL" to "124.55",
+ "UNR" to "103.21",
+ "VBG" to "120.57",
+ "WAL" to "75.48",
+ "WMW" to "76.87",
+ "WPL" to "90.20",
+ "YLW" to "119.38",
+ "YMO" to "80.65"
+ )
}
\ No newline at end of file
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityRadarUI.kt b/app/src/main/java/joshuatee/wx/radar/UtilityRadarUI.kt
index 0eb07049..c75aa16e 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityRadarUI.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityRadarUI.kt
@@ -219,7 +219,7 @@ internal object UtilityRadarUI {
alertDialogRadarLongpressAl.add("Show Spotter Info")
}
alertDialogRadarLongpressAl.add("Show current radar status message: " + wxglRender.rid)
- val getridpoint: String = UtilityLocation.getNearestRadarSite(context, LatLon(pointX.toString(), pointY.toString()))
+ val getridpoint: String = UtilityLocation.getNearestRadarSite(LatLon(pointX.toString(), pointY.toString()))
alertDialogRadarLongpressAl.add("Show nearest radar status message: " + getridpoint)
alertDialogRadarLongpressAl.add("userpoint info: " + latLonTitle)
alertDialogRadarLongpressAl.add("Add userpoint for: " + latLonTitle)
@@ -614,7 +614,7 @@ internal object UtilityRadarUI {
var radarStatus = withContext(Dispatchers.IO) {
val pointX = glview.newY.toDouble()
val pointY = glview.newX * -1.0
- getrid = UtilityLocation.getNearestRadarSite(context, LatLon(pointX.toString(), pointY.toString())
+ getrid = UtilityLocation.getNearestRadarSite(LatLon(pointX.toString(), pointY.toString())
)
UtilityLog.d("wx", "point: x: "+pointX+ "y: "+pointY)
UtilityLog.d("wx", "radar status on point: "+getrid)
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilitySWOD1.kt b/app/src/main/java/joshuatee/wx/radar/UtilitySWOD1.kt
index 2be140c2..ebc46d34 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilitySWOD1.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilitySWOD1.kt
@@ -59,8 +59,7 @@ internal object UtilitySwoD1 {
&&*/
val threatList = listOf("HIGH", "MDT", "ENH", "SLGT", "MRGL")
val day = 1
- val urlBlob =
- "${MyApplication.nwsSPCwebsitePrefix}/products/outlook/KWNSPTSDY" + day.toString() + ".txt"
+ val urlBlob = "${MyApplication.nwsSPCwebsitePrefix}/products/outlook/KWNSPTSDY" + day.toString() + ".txt"
val html = urlBlob.getHtmlSep()
val htmlBlob = html.parse("... CATEGORICAL ...(.*?&)&") // was (.*?)&&
threatList.indices.forEach { it ->
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityUSImgWX.kt b/app/src/main/java/joshuatee/wx/radar/UtilityUSImgWX.kt
index 11edf7af..50fdbfd6 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityUSImgWX.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityUSImgWX.kt
@@ -42,7 +42,7 @@ import joshuatee.wx.util.UtilityIO
import joshuatee.wx.util.UtilityImg
import joshuatee.wx.util.UtilityLog
-import joshuatee.wx.NEXRAD_PRODUCT_STRING
+import joshuatee.wx.GlobalDictionaries
import joshuatee.wx.R
object UtilityUSImgWX {
@@ -73,7 +73,7 @@ object UtilityUSImgWX {
inputStream = UtilityDownload.getInputStreamFromUrl(
MyApplication.NWS_RADAR_PUB
+ "SL.us008001/DF.of/DC.radar/"
- + NEXRAD_PRODUCT_STRING[product]
+ + GlobalDictionaries.NEXRAD_PRODUCT_STRING[product]
+ "/SI." + ridPrefix + radarSite.toLowerCase(
Locale.US
) + "/sn.last"
@@ -162,10 +162,7 @@ object UtilityUSImgWX {
val colorDrawable = ColorDrawable(MyApplication.nexradRadarBackgroundColor)
var bitmapCanvas = Bitmap.createBitmap(CANVAS_X, CANVAS_Y, Config.ARGB_8888)
if (!prod.contains("L2")) {
- if (prod.contains("N0R") || prod.contains("N0S") || prod.contains("N0V") || prod.contains(
- "TR"
- )
- ) {
+ if (prod.contains("N0R") || prod.contains("N0S") || prod.contains("N0V") || prod.contains("TR")) {
UtilityNexradRadial4Bit.decodeAndPlot(
context,
bitmapCanvas,
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityWXGLTextObject.kt b/app/src/main/java/joshuatee/wx/radar/UtilityWXGLTextObject.kt
index f07f56d8..2f79a042 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityWXGLTextObject.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityWXGLTextObject.kt
@@ -26,24 +26,21 @@ object UtilityWXGLTextObject {
// FIXME naming and use more
fun hideTV(numPanes: Int, textObjects: MutableList): Unit =
- (0 until numPanes).forEach { textObjects[it].hideTextLabels() }
+ (0 until numPanes).forEach {
+ textObjects[it].hideTextLabels()
+ }
fun showTV(numPanes: Int, textObjects: MutableList): Unit =
- (0 until numPanes).forEach { textObjects[it].addTextLabels() }
+ (0 until numPanes).forEach {
+ textObjects[it].addTextLabels()
+ }
fun updateSpotterLabels(numPanes: Int, textObjects: MutableList) {
(0 until numPanes).forEach {
- ///textObjects[it].initTVSpottersLabels() //is this needed???? test for bugs
textObjects[it].addTextLabelsSpottersLabels()
}
}
- fun updateHailLabels(numPanes: Int, textObjects: MutableList) {
- (0 until numPanes).forEach {
- textObjects[it].initTVHailLabels()
- textObjects[it].addTVHailLabels()
- }
- }
fun updateObs(numPanes: Int, textObjects: MutableList) {
(0 until numPanes).forEach {
textObjects[it].initializeTextLabelsObservations()
@@ -56,4 +53,12 @@ object UtilityWXGLTextObject {
textObjects[it].addWpcPressureCenters()
}
}
+
+ fun updateHailLabels(numPanes: Int, textObjects: MutableList) {
+ (0 until numPanes).forEach {
+ textObjects[it].initTVHailLabels()
+ textObjects[it].addTVHailLabels()
+ }
+ }
+
}
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityWXOGL.kt b/app/src/main/java/joshuatee/wx/radar/UtilityWXOGL.kt
index 7a63029a..9ca6dcd1 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityWXOGL.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityWXOGL.kt
@@ -38,7 +38,7 @@ import joshuatee.wx.util.UtilityLog
import joshuatee.wx.Extensions.*
-import joshuatee.wx.NEXRAD_PRODUCT_STRING
+import joshuatee.wx.GlobalDictionaries
import joshuatee.wx.RegExp
object UtilityWXOGL {
@@ -80,9 +80,9 @@ object UtilityWXOGL {
val ridPrefix = getRidPrefix(radarSite, product)
val file: File
val inputStream = UtilityDownload.getInputStreamFromUrl(
- MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" + NEXRAD_PRODUCT_STRING[product] + "/SI." + ridPrefix + radarSite.toLowerCase(
- Locale.US
- ) + "/sn.last"
+ MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/"
+ + GlobalDictionaries.NEXRAD_PRODUCT_STRING[product]
+ + "/SI." + ridPrefix + radarSite.toLowerCase(Locale.US) + "/sn.last"
)
if (inputStream != null) {
UtilityIO.saveInputStream(context, inputStream, l3BaseFn + indexString + "_d")
diff --git a/app/src/main/java/joshuatee/wx/radar/UtilityWpcFronts.kt b/app/src/main/java/joshuatee/wx/radar/UtilityWpcFronts.kt
index b82f4f63..30723a63 100644
--- a/app/src/main/java/joshuatee/wx/radar/UtilityWpcFronts.kt
+++ b/app/src/main/java/joshuatee/wx/radar/UtilityWpcFronts.kt
@@ -91,7 +91,6 @@ object UtilityWpcFronts {
val numberOfTriangles = floor(distance / length).toInt()
// construct two lines which will consist of adding 4 points
for (pointNumber in 1 until numberOfTriangles step 2) {
- //for (int pointNumber = 1; pointNumber < numberOfTriangles; pointNumber += 2) {
val x1 = coordinates[0] + ((coordinates2[0] - coordinates[0]) * length * pointNumber) / distance
val y1 = coordinates[1] + ((coordinates2[1] - coordinates[1]) * length * pointNumber) / distance
val x3 = coordinates[0] + ((coordinates2[0] - coordinates[0]) * length * (pointNumber + 1)) / distance
@@ -118,7 +117,6 @@ object UtilityWpcFronts {
length = 0.2
}
for (index in startIndex until tokens.size step indexIncrement) {
- //for (int index = startIndex; index < tokens.length; index += indexIncrement) {
val coordinates = parseLatLon(tokens[index])
if (index < (tokens.size - 1)) {
val coordinates2 = parseLatLon(tokens[index + 1])
@@ -126,7 +124,6 @@ object UtilityWpcFronts {
val numberOfTriangles = floor(distance / length).toInt()
// construct two lines which will consist of adding 4 points
for (pointNumber in 1 until numberOfTriangles step 4) {
- //for (int pointNumber = 1; pointNumber < numberOfTriangles; pointNumber += 4) {
val x1 = coordinates[0] + ((coordinates2[0] - coordinates[0]) * length * pointNumber) / distance
val y1 = coordinates[1] + ((coordinates2[1] - coordinates[1]) * length * pointNumber) / distance
val center1 = coordinates[0] + ((coordinates2[0] - coordinates[0]) * length * (pointNumber + 0.5)) / distance
@@ -142,7 +139,6 @@ object UtilityWpcFronts {
val angle = atan2(yDiff, xDiff) * 180.0 / PI
val sliceStart = ((slices * angle) / 180.0).toInt()
for (i in sliceStart until slices + sliceStart + 1 step 1) {
- //for (int i = sliceStart; i <= slices + sliceStart; i++) {
val x = rotation * length * cos(step * i) + center1
val y = rotation * length * sin(step * i) + center2
front.coordinates.add(LatLon(x, y))
@@ -195,14 +191,11 @@ object UtilityWpcFronts {
return if (string.length != 7) {
listOf(0.0, 0.0)
} else {
- val lat = (string.substring(0, 2) + "." + string.substring(2, 3)).toDoubleOrNull()
- ?: 0.0
+ val lat = (string.substring(0, 2) + "." + string.substring(2, 3)).toDoubleOrNull() ?: 0.0
val lon: Double = if (string[3] == '0') {
- (string.substring(4, 6) + "." + string.substring(6, 7)).toDoubleOrNull()
- ?: 0.0
+ (string.substring(4, 6) + "." + string.substring(6, 7)).toDoubleOrNull() ?: 0.0
} else {
- (string.substring(3, 6) + "." + string.substring(6, 7)).toDoubleOrNull()
- ?: 0.0
+ (string.substring(3, 6) + "." + string.substring(6, 7)).toDoubleOrNull() ?: 0.0
}
listOf(lat, lon)
}
@@ -224,9 +217,7 @@ object UtilityWpcFronts {
MyApplication.sep)
html = html.replace(MyApplication.sep, MyApplication.newline)
val lines = html.split(MyApplication.newline).toMutableList()
- //lines.indices.forEach { index ->
for (index in lines.indices) {
- //var data = lines[index]
if (index < lines.size - 1) {
// Handle lines that wrap around, check to see if lines don't start
// with a known character
@@ -266,7 +257,6 @@ object UtilityWpcFronts {
}
}
"LOWS" -> {
- //for (int index = 0; index < tokens.length; index += 2) {
for (typeIndex in 0 until tokens.size step 2) {
if (typeIndex + 1 < tokens.size) {
val coordinates = parseLatLon(tokens[typeIndex + 1])
@@ -278,9 +268,7 @@ object UtilityWpcFronts {
"COLD" -> {
val front = Fronts(FrontTypeEnum.COLD)
addFrontData(front, tokens)
- //UtilityLog.d("Wx", front.toString())
addColdFrontTriangles(front, tokens)
- //addWarmFrontSemicircles(front, tokens)
fronts.add(front)
}
"STNRY" -> {
@@ -313,9 +301,6 @@ object UtilityWpcFronts {
}
}
}
- //initialized = true
- //val currentTime = UtilityTime.currentTimeMillis()
- //lastRefresh = currentTime / 1000
}
}
}
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLDownload.kt b/app/src/main/java/joshuatee/wx/radar/WXGLDownload.kt
index ca35c145..3df2809d 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLDownload.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLDownload.kt
@@ -36,7 +36,7 @@ import okhttp3.Request
import joshuatee.wx.Extensions.*
-import joshuatee.wx.NEXRAD_PRODUCT_STRING
+import joshuatee.wx.GlobalDictionaries
import joshuatee.wx.RegExp
class WXGLDownload {
@@ -58,7 +58,8 @@ class WXGLDownload {
if (!product.contains("L2")) {
val inputStream = UtilityDownload.getInputStreamFromUrl(
MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" +
- NEXRAD_PRODUCT_STRING[product] + "/SI." + ridPrefix + radarSite.toLowerCase(Locale.US) + "/sn.last"
+ GlobalDictionaries.NEXRAD_PRODUCT_STRING[product] + "/SI."
+ + ridPrefix + radarSite.toLowerCase(Locale.US) + "/sn.last"
)
val l3BaseFn = "nids"
inputStream?.let {
@@ -120,14 +121,16 @@ class WXGLDownload {
): List {
val fileList = mutableListOf()
var htmlOut =
- (MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" + NEXRAD_PRODUCT_STRING[prod] + "/SI." + ridPrefix + radarSite.toLowerCase(
- Locale.US
- ) + "/").getHtml()
+ (MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/"
+ + GlobalDictionaries.NEXRAD_PRODUCT_STRING[prod] + "/SI."
+ + ridPrefix + radarSite.toLowerCase(Locale.US) + "/").getHtml()
var snFiles = htmlOut.parseColumn(RegExp.utilnxanimPattern1)
var snDates = htmlOut.parseColumn(RegExp.utilnxanimPattern2)
if (snDates.isEmpty()) {
htmlOut =
- (MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" + NEXRAD_PRODUCT_STRING[prod] + "/SI." + ridPrefix + radarSite.toLowerCase(
+ (MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/"
+ + GlobalDictionaries.NEXRAD_PRODUCT_STRING[prod]
+ + "/SI." + ridPrefix + radarSite.toLowerCase(
Locale.US
) + "/").getHtml()
snFiles = htmlOut.parseColumn(RegExp.utilnxanimPattern1)
@@ -135,9 +138,9 @@ class WXGLDownload {
}
if (snDates.isEmpty()) {
htmlOut =
- (MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" + NEXRAD_PRODUCT_STRING[prod] + "/SI." + ridPrefix + radarSite.toLowerCase(
- Locale.US
- ) + "/").getHtml()
+ (MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/"
+ + GlobalDictionaries.NEXRAD_PRODUCT_STRING[prod]
+ + "/SI." + ridPrefix + radarSite.toLowerCase(Locale.US) + "/").getHtml()
snFiles = htmlOut.parseColumn(RegExp.utilnxanimPattern1)
snDates = htmlOut.parseColumn(RegExp.utilnxanimPattern2)
}
@@ -165,9 +168,8 @@ class WXGLDownload {
while (j < fileList.size) {
val inputStream = UtilityDownload.getInputStreamFromUrl(
MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" +
- NEXRAD_PRODUCT_STRING[prod] + "/SI." + ridPrefix + radarSite.toLowerCase(
- Locale.US
- ) + "/" + fileList[j]
+ GlobalDictionaries.NEXRAD_PRODUCT_STRING[prod]
+ + "/SI." + ridPrefix + radarSite.toLowerCase(Locale.US) + "/" + fileList[j]
)
inputStream?.let { UtilityIO.saveInputStream(context, inputStream, fileList[j]) }
j += 1
@@ -259,10 +261,9 @@ class WXGLDownload {
companion object {
fun getNidsTab(context: Context, product: String, radarSite: String, fileName: String) {
val ridPrefix = UtilityWXOGL.getRidPrefix(radarSite, false)
- val url =
- MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" +
- (NEXRAD_PRODUCT_STRING[product] ?: "") + "/SI." + ridPrefix +
- radarSite.toLowerCase(Locale.US) + "/sn.last"
+ val url = MyApplication.NWS_RADAR_PUB + "SL.us008001/DF.of/DC.radar/" +
+ (GlobalDictionaries.NEXRAD_PRODUCT_STRING[product] ?: "") + "/SI." +
+ ridPrefix + radarSite.toLowerCase(Locale.US) + "/sn.last"
val inputStream = UtilityDownload.getInputStreamFromUrl(url)
inputStream?.let { UtilityIO.saveInputStream(context, it, fileName) }
}
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3HailIndex.kt b/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3HailIndex.kt
index 192354eb..b4a51927 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3HailIndex.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3HailIndex.kt
@@ -76,14 +76,14 @@ object WXGLNexradLevel3HailIndex {
}
*/
- fun decodeAndPlot(context: Context, rid: String, fnSuffix: String): List {
+ fun decodeAndPlot(context: Context, radarSite: String, fnSuffix: String): List {
val stormList = mutableListOf()
val retStr: String
- val location = UtilityLocation.getSiteLocation(context, rid)
+ val location = UtilityLocation.getSiteLocation(radarSite)
//make sure we clear the list or we get duplicate texts
hailList.clear()
//File("/sdcard/wX/hail2").copyTo(File("/data/user/0/joshuatee.wx/files/nids_hi_tab0"), true);
- WXGLDownload.getNidsTab(context, "HI", rid, hiBaseFn + fnSuffix)
+ WXGLDownload.getNidsTab(context, "HI", radarSite, hiBaseFn + fnSuffix)
val dis: UCARRandomAccessFile
val posn: List
val hailPercent: List
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3StormInfo.kt b/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3StormInfo.kt
index 115ffcaa..52421b29 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3StormInfo.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3StormInfo.kt
@@ -41,13 +41,13 @@ internal object WXGLNexradLevel3StormInfo {
fun decodeAndPlot(
context: Context,
fnSuffix: String,
- rid: String,
+ radarSite: String,
projectionType: ProjectionType
): List {
val stormList = mutableListOf()
val retStr: String
- val location = UtilityLocation.getSiteLocation(context, rid)
- val pn = ProjectionNumbers(rid, projectionType)
+ val location = UtilityLocation.getSiteLocation(radarSite)
+ val pn = ProjectionNumbers(radarSite, projectionType)
WXGLDownload.getNidsTab(context, "STI", pn.radarSite.toLowerCase(Locale.US), stiBaseFn + fnSuffix)
val dis: UCARRandomAccessFile
val posn: List
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3TVS.kt b/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3TVS.kt
index 390fc2fb..a5b02aa2 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3TVS.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLNexradLevel3TVS.kt
@@ -39,10 +39,10 @@ internal object WXGLNexradLevel3TVS {
private const val tvsBaseFn = "nids_tvs_tab"
- fun decodeAndPlot(context: Context, rid: String, fnSuffix: String): List {
+ fun decodeAndPlot(context: Context, radarSite: String, fnSuffix: String): List {
val stormList = mutableListOf()
- val location = UtilityLocation.getSiteLocation(context, rid)
- WXGLDownload.getNidsTab(context, "TVS", rid, tvsBaseFn + fnSuffix)
+ val location = UtilityLocation.getSiteLocation(radarSite)
+ WXGLDownload.getNidsTab(context, "TVS", radarSite, tvsBaseFn + fnSuffix)
val dis: UCARRandomAccessFile
try {
dis = UCARRandomAccessFile(UtilityIO.getFilePath(context, tvsBaseFn + fnSuffix))
@@ -64,9 +64,9 @@ internal object WXGLNexradLevel3TVS {
val bearing = DoubleArray(2)
var start: ExternalGlobalCoordinates
var ec: ExternalGlobalCoordinates
- tvs.indices.forEach {
+ tvs.forEach {
val ecc = ExternalGeodeticCalculator()
- tmpStr = tvs[it].parse(RegExp.tvsPattern2)
+ tmpStr = it.parse(RegExp.tvsPattern2)
tmpStrArr = MyApplication.slash.split(tmpStr)
retStr += tmpStr
degree = tmpStrArr[0].replace(" ", "").toIntOrNull() ?: 0
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivity.kt b/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivity.kt
index 5fb1650a..9960509b 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivity.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivity.kt
@@ -66,6 +66,7 @@ import joshuatee.wx.Extensions.*
import joshuatee.wx.UIPreferences
import joshuatee.wx.GlobalArrays
+import joshuatee.wx.activitiesmisc.SevereDashboardActivity
import joshuatee.wx.objects.ObjectIntent
import joshuatee.wx.objects.PolygonType
import joshuatee.wx.util.*
@@ -137,7 +138,6 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
private lateinit var l2Menu: MenuItem
private lateinit var tdwrMenu: MenuItem
private var delay = 0
- private val prefTokenLocation = "RID_LOC_"
private val prefToken = "RID_FAV"
private var frameCountGlobal = 0
private var locXCurrent = ""
@@ -287,7 +287,6 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
this,
MyApplication.ridFav,
oglr.rid,
- prefTokenLocation,
prefToken
)
sp = ObjectSpinner(this, this, this, R.id.spinner1, ridArrLoc)
@@ -334,7 +333,6 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
this,
MyApplication.ridFav,
oglr.rid,
- prefTokenLocation,
prefToken
)
sp.refreshData(this@WXGLRadarActivity, ridArrLoc)
@@ -491,7 +489,12 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
if (!oglr.product.startsWith("2")) {
UtilityRadarUI.plotWarningPolygons(glview, oglr, archiveMode)
}
-
+ val tstCount = UtilityVtec.getStormCount(MyApplication.severeDashboardTst.value)
+ val torCount = UtilityVtec.getStormCount(MyApplication.severeDashboardTor.value)
+ val ffwCount = UtilityVtec.getStormCount(MyApplication.severeDashboardFfw.value)
+ if (MyApplication.radarWarnings) {
+ title = oglr.product + " (" + tstCount.toString() + "," + torCount.toString() + "," + ffwCount.toString() + ")"
+ }
if (PolygonType.MCD.pref && !archiveMode) {
withContext(Dispatchers.IO) {
UtilityDownloadMcd.get(this@WXGLRadarActivity)
@@ -685,22 +688,14 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
)
UtilityShare.shareAnimGif(
this,
- oglr.rid + " (" + Utility.readPref(
- this@WXGLRadarActivity,
- "RID_LOC_" + oglr.rid,
- ""
- ) + ") " + oglr.product,
+ oglr.rid + " (" + Utility.getRadarSiteName(oglr.rid) + ") " + oglr.product,
animDrawable
)
} else {
UtilityShare.shareBitmap(
this,
this,
- oglr.rid + " (" + Utility.readPref(
- this@WXGLRadarActivity,
- "RID_LOC_" + oglr.rid,
- ""
- ) + ") " + oglr.product,
+ oglr.rid + " (" + Utility.getRadarSiteName(oglr.rid) + ") " + oglr.product,
UtilityUSImgWX.layeredImgFromFile(
applicationContext,
oglr.rid,
@@ -821,7 +816,6 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
this,
MyApplication.ridFav,
oglr.rid,
- prefTokenLocation,
prefToken
)
adjustTiltMenu()
@@ -830,8 +824,7 @@ class WXGLRadarActivity : VideoRecordActivity(), OnItemSelectedListener, OnMenuI
private fun toggleFavorite() {
val ridFav = UtilityFavorites.toggleFavoriteString(this, oglr.rid, star, prefToken)
- ridArrLoc =
- UtilityFavorites.setupFavMenu(this, ridFav, oglr.rid, prefTokenLocation, prefToken)
+ ridArrLoc = UtilityFavorites.setupFavMenu(this, ridFav, oglr.rid, prefToken)
sp.refreshData(this@WXGLRadarActivity, ridArrLoc)
}
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivityMultiPane.kt b/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivityMultiPane.kt
index 9d56dadb..d218ce60 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivityMultiPane.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLRadarActivityMultiPane.kt
@@ -97,7 +97,6 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
private var restartedZoom = false
private var inOglAnim = false
private var inOglAnimPaused = false
- private var infoArr = Array(2) { "" }
private var oglInView = true
private var oglrArr = mutableListOf()
private var glviewArr = mutableListOf()
@@ -111,12 +110,6 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
private var frameCountGlobal = 0
private var locXCurrent = ""
private var locYCurrent = ""
- private var infoAnim = Array(2) { "" }
- private var tmpArr1 = Array(2) { "" }
- private var tmpArr2 = Array(2) { "" }
- private var tmpArr3 = Array(2) { "" }
- private var tmpArr4 = Array(2) { "" }
- private val latlonArr = mutableListOf("", "")
private var latD = 0.0
private var lonD = 0.0
private var locationManager: LocationManager? = null
@@ -129,7 +122,7 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
private var wxgltextArr = mutableListOf()
private lateinit var act: Activity
private var alertDialogRadarLongPress: ObjectDialogue? = null
- private var dontSavePref = false
+ private var doNotSavePref = false
private var useSinglePanePref = false
private var landScape = false
private var isGetContentInProgress = false
@@ -144,7 +137,7 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
val activityArguments = intent.getStringArrayExtra(RID)
if (activityArguments != null && activityArguments.size > 3 ) {
if (activityArguments[3] == "true") {
- dontSavePref = true
+ doNotSavePref = true
useSinglePanePref = true
}
}
@@ -200,9 +193,7 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
UtilityUI.immersiveMode(this as Activity)
locXCurrent = joshuatee.wx.settings.Location.x
locYCurrent = joshuatee.wx.settings.Location.y
- infoAnim = Array(numPanes) { "" }
oldRidArr = Array(numPanes) { "" }
- infoArr = Array(numPanes) { "" }
if (numPanes == 4) {
widthDivider = 2
prefPrefix = "WXOGL_QUADPANE"
@@ -759,11 +750,7 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
)
UtilityShare.shareAnimGif(
this,
- oglrArr[curRadar].rid + " (" + Utility.readPref(
- this,
- "RID_LOC_" + oglrArr[curRadar].rid,
- ""
- )
+ oglrArr[curRadar].rid + " (" + Utility.getRadarSiteName(oglrArr[curRadar].rid)
+ ") " + oglrArr[curRadar].product, animDrawable
)
} else {
@@ -771,11 +758,7 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
this,
this,
oglrArr[curRadar].rid +
- " (" + Utility.readPref(
- this,
- "RID_LOC_" + oglrArr[curRadar].rid,
- ""
- ) + ") "
+ " (" + Utility.getRadarSiteName(oglrArr[curRadar].rid) + ") "
+ oglrArr[curRadar].product,
UtilityUSImgWX.layeredImgFromFile(
applicationContext,
@@ -879,7 +862,7 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
}
}
R.id.action_radar_4 -> {
- if (!dontSavePref) {
+ if (!doNotSavePref) {
numPanesArr.forEach { WXGLNexrad.savePrefs(this, prefPrefix, it + 1, oglrArr[it]) }
} else {
numPanesArr.forEach { WXGLNexrad.saveProductPrefs(this, prefPrefix, it + 1, oglrArr[it]) }
@@ -980,10 +963,14 @@ class WXGLRadarActivityMultiPane : VideoRecordActivity(), OnMenuItemClickListene
override fun onStop() {
super.onStop()
- if (!dontSavePref) {
- numPanesArr.forEach { WXGLNexrad.savePrefs(this, prefPrefix, it + 1, oglrArr[it]) }
+ if (!doNotSavePref) {
+ numPanesArr.forEach {
+ WXGLNexrad.savePrefs(this, prefPrefix, it + 1, oglrArr[it])
+ }
} else {
- numPanesArr.forEach { WXGLNexrad.saveProductPrefs(this, prefPrefix, it + 1, oglrArr[it]) }
+ numPanesArr.forEach {
+ WXGLNexrad.saveProductPrefs(this, prefPrefix, it + 1, oglrArr[it])
+ }
}
// otherwise cpu will spin with no fix but to kill app
inOglAnim = false
diff --git a/app/src/main/java/joshuatee/wx/radar/WXGLSurfaceView.kt b/app/src/main/java/joshuatee/wx/radar/WXGLSurfaceView.kt
index d9127fa0..9231006a 100644
--- a/app/src/main/java/joshuatee/wx/radar/WXGLSurfaceView.kt
+++ b/app/src/main/java/joshuatee/wx/radar/WXGLSurfaceView.kt
@@ -223,7 +223,6 @@ class WXGLSurfaceView : GLSurfaceView, GestureDetector.OnGestureListener,
newY = test2.toFloat() + (-oglrCurrent.y / mScaleFactor + diffY) / ppd
newY = (180 / PI * (2 * atan(exp(newY * PI / 180)) - PI / 2)).toFloat()
oglrCurrent.ridNewList = UtilityLocation.getNearestRid(
- context,
LatLon(newY.toString(), (newX * -1).toString()),
5
)
diff --git a/app/src/main/java/joshuatee/wx/settings/FavAddActivity.kt b/app/src/main/java/joshuatee/wx/settings/FavAddActivity.kt
index 4133ade1..e52ba191 100644
--- a/app/src/main/java/joshuatee/wx/settings/FavAddActivity.kt
+++ b/app/src/main/java/joshuatee/wx/settings/FavAddActivity.kt
@@ -34,6 +34,7 @@ import joshuatee.wx.ui.BaseActivity
import joshuatee.wx.spc.UtilitySpcMeso
import joshuatee.wx.ui.ObjectRecyclerView
import joshuatee.wx.util.Utility
+import joshuatee.wx.util.UtilityFavorites
import joshuatee.wx.wpc.UtilityWpcText
class FavAddActivity : BaseActivity() {
@@ -56,19 +57,11 @@ class FavAddActivity : BaseActivity() {
when (type) {
"SND" -> {
prefToken = "SND_FAV"
- val tmpArr = mutableListOf()
- GlobalArrays.soundingSites.indices.forEach {
- var tmpLoc = Utility.readPref(this, "NWS_LOCATION_" + GlobalArrays.soundingSites[it], "")
- if (tmpLoc == "") {
- tmpLoc = Utility.readPref(
- this,
- "NWS_SOUNDINGLOCATION_" + GlobalArrays.soundingSites[it],
- ""
- )
- }
- tmpArr.add(GlobalArrays.soundingSites[it] + " " + tmpLoc)
+ val list = mutableListOf()
+ GlobalArrays.soundingSites.forEach {
+ list.add("$it " + Utility.getSoundingSiteName(it))
}
- data = tmpArr.toList()
+ data = list.toList()
}
"RIDCA" -> {
prefToken = "RID_CA_FAV"
@@ -102,30 +95,30 @@ class FavAddActivity : BaseActivity() {
private fun itemClicked(position: Int) {
val item = data[position]
- var ridFav = Utility.readPref(this, prefToken, " : : :")
+ var ridFav = Utility.readPref(this, prefToken, UtilityFavorites.initialValue)
var ridFavLabel = ""
- val tmpArr: Array
+ val tmpArr: List
when (type) {
"SPCMESO" -> {
- ridFavLabel = Utility.readPref(this, prefTokenLabel, " : : :")
+ ridFavLabel = Utility.readPref(this, prefTokenLabel, UtilityFavorites.initialValue)
tmpArr = if (dataTokens[position].contains(":")) {
- MyApplication.colon.split(dataTokens[position])
+ dataTokens[position].split(":").dropLastWhile { it.isEmpty() }
} else {
- MyApplication.space.split(dataTokens[position])
+ dataTokens[position].split(" ").dropLastWhile { it.isEmpty() }
}
}
"SND" -> {
tmpArr = if (GlobalArrays.soundingSites[position].contains(":")) {
- MyApplication.colon.split(GlobalArrays.soundingSites[position])
+ GlobalArrays.soundingSites[position].split(":").dropLastWhile { it.isEmpty() }
} else {
- MyApplication.space.split(GlobalArrays.soundingSites[position])
+ GlobalArrays.soundingSites[position].split(" ").dropLastWhile { it.isEmpty() }
}
}
else -> {
tmpArr = if (data[position].contains(":")) {
- MyApplication.colon.split(data[position])
+ data[position].split(":").dropLastWhile { it.isEmpty() }
} else {
- MyApplication.space.split(data[position])
+ data[position].split(" ").dropLastWhile { it.isEmpty() }
}
}
}
diff --git a/app/src/main/java/joshuatee/wx/settings/FavRemoveActivity.kt b/app/src/main/java/joshuatee/wx/settings/FavRemoveActivity.kt
index 1e690960..158836fe 100644
--- a/app/src/main/java/joshuatee/wx/settings/FavRemoveActivity.kt
+++ b/app/src/main/java/joshuatee/wx/settings/FavRemoveActivity.kt
@@ -37,10 +37,12 @@ import joshuatee.wx.wpc.UtilityWpcText
class FavRemoveActivity : BaseActivity() {
+ //
// called from various activities that need favorite management,
// allows one to remove from list of favorite sites and reorder
//
// arg1: type such as SND WFO RID
+ //
companion object {
const val TYPE: String = ""
@@ -56,6 +58,7 @@ class FavRemoveActivity : BaseActivity() {
private var ridArrLabel = mutableListOf()
private lateinit var recyclerView: ObjectRecyclerView
private var type = ""
+ private val initialValue = " : : "
@SuppressLint("MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
@@ -89,7 +92,7 @@ class FavRemoveActivity : BaseActivity() {
prefTokenLabel = "SPCMESO_LABEL_FAV"
}
}
- ridFav = Utility.readPref(this, prefToken, " : : :")
+ ridFav = Utility.readPref(this, prefToken, UtilityFavorites.initialValue)
title = "Modify $type"
toolbar.subtitle = "Tap item to delete or move."
updateList()
@@ -101,13 +104,13 @@ class FavRemoveActivity : BaseActivity() {
ridArr.clear()
(3 until tempList.size).mapTo(ridArr) { tempList[it] }
ridArrLabel = mutableListOf()
- ridArr.indices.forEach {
+ ridArr.forEach {
when (type) {
- "NWSTEXT" -> ridArrLabel.add(getFullString(ridArr[it]))
- "SREF" -> ridArrLabel.add(ridArr[it])
- "RIDCA" -> ridArrLabel.add(findCanadaRadarSiteLabel(ridArr[it]))
- "SPCMESO" -> ridArrLabel.add(findSpcMesoLabel(ridArr[it]))
- else -> ridArrLabel.add(getFullString(ridArr[it]))
+ "NWSTEXT" -> ridArrLabel.add(getFullString(it))
+ "SREF" -> ridArrLabel.add(it)
+ "RIDCA" -> ridArrLabel.add(findCanadaRadarSiteLabel(it))
+ "SPCMESO" -> ridArrLabel.add(findSpcMesoLabel(it))
+ else -> ridArrLabel.add(getFullString(it))
}
}
}
@@ -134,16 +137,20 @@ class FavRemoveActivity : BaseActivity() {
}
when (type) {
"SPCMESO" -> {
- ridFav = " : : "
- ridArr.indices.forEach { ridFav += ":" + ridArr[it] }
+ ridFav = initialValue
+ ridArr.forEach {
+ ridFav += ":$it"
+ }
Utility.writePref(this, prefToken, "$ridFav:")
- ridFavLabel = " : : "
+ ridFavLabel = initialValue
ridFavLabel += recyclerView.toString()
Utility.writePref(this, prefTokenLabel, ridFavLabel)
}
else -> {
- ridFav = " : : "
- ridArr.indices.forEach { ridFav += ":" + ridArr[it] }
+ ridFav = initialValue
+ ridArr.forEach {
+ ridFav += ":$it"
+ }
Utility.writePref(this, prefToken, "$ridFav:")
}
}
@@ -168,12 +175,14 @@ class FavRemoveActivity : BaseActivity() {
ridArr[ridArr.lastIndex] = tmp
recyclerView.setItem(ridArr.lastIndex, getFullString(tmp))
}
- ridFav = " : : "
- ridArr.indices.forEach { ridFav = ridFav + ":" + ridArr[it] }
+ ridFav = initialValue
+ ridArr.forEach {
+ ridFav += ":$it"
+ }
Utility.writePref(this, prefToken, "$ridFav:")
when (type) {
"SPCMESO" -> {
- ridFavLabel = " : : "
+ ridFavLabel = initialValue
ridFavLabel += recyclerView.toString()
Utility.writePref(this, prefTokenLabel, ridFavLabel)
}
@@ -181,27 +190,17 @@ class FavRemoveActivity : BaseActivity() {
}
private fun getFullString(shortCode: String): String {
- var tmpLoc = ""
+ var fullName = ""
when (type) {
- "SND" -> {
- tmpLoc = Utility.readPref(this, "NWS_LOCATION_$shortCode", "")
- tmpLoc = if (tmpLoc == "") {
- shortCode + ": " + Utility.readPref(this, "NWS_SOUNDINGLOCATION_$shortCode", "")
- } else {
- "$shortCode: $tmpLoc"
- }
- }
- "WFO" -> tmpLoc = shortCode + ": " +
- Utility.readPref(this, prefTokenLocation + shortCode, "")
- "RID" -> tmpLoc = shortCode + ": " +
- Utility.readPref(this, prefTokenLocation + shortCode, "")
- "NWSTEXT" -> tmpLoc =
- UtilityWpcText.labels[UtilityFavorites.findPositionNwsText(shortCode)]
- "SREF" -> tmpLoc = shortCode
- "RIDCA" -> tmpLoc = findCanadaRadarSiteLabel(shortCode)
- "SPCMESO" -> tmpLoc = findSpcMesoLabel(shortCode)
+ "SND" -> fullName = Utility.getSoundingSiteName(shortCode)
+ "WFO" -> fullName = shortCode + ": " + Utility.getWfoSiteName(shortCode)
+ "RID" -> fullName = shortCode + ": " + Utility.getRadarSiteName(shortCode)
+ "NWSTEXT" -> fullName = UtilityWpcText.labels[UtilityFavorites.findPositionNwsText(shortCode)]
+ "SREF" -> fullName = shortCode
+ "RIDCA" -> fullName = findCanadaRadarSiteLabel(shortCode)
+ "SPCMESO" -> fullName = findSpcMesoLabel(shortCode)
}
- return tmpLoc
+ return fullName
}
private fun saveMyApp(fav: String, favLabel: String) {
@@ -251,7 +250,7 @@ class FavRemoveActivity : BaseActivity() {
ridFav = Utility.readPref(this, prefToken, " : :")
ridFav = ridFav.replace(ridArr[position] + ":", "")
recyclerView.deleteItem(position)
- ridFavLabel = " : : "
+ ridFavLabel = initialValue
ridFavLabel += recyclerView.toString()
Utility.writePref(this, prefToken, ridFav)
Utility.writePref(this, prefTokenLabel, ridFavLabel)
diff --git a/app/src/main/java/joshuatee/wx/settings/Location.kt b/app/src/main/java/joshuatee/wx/settings/Location.kt
index db1bafd8..4ec9479b 100644
--- a/app/src/main/java/joshuatee/wx/settings/Location.kt
+++ b/app/src/main/java/joshuatee/wx/settings/Location.kt
@@ -27,9 +27,9 @@ import joshuatee.wx.canada.UtilityCanada
import joshuatee.wx.objects.LatLonStr
import joshuatee.wx.radar.LatLon
import joshuatee.wx.util.Utility
-import joshuatee.wx.util.UtilityLog
import java.util.*
import joshuatee.wx.Extensions.*
+import joshuatee.wx.GlobalDictionaries
import joshuatee.wx.util.UtilityString
// implement up/down mini fab in settings
@@ -88,7 +88,7 @@ class Location(val context: Context, locNumInt: Int) {
alertNotificationWpcmpdCurrent = Utility.readPref(context, "ALERT_NOTIFICATION_WPCMPD$jStr", "false")
raw = Utility.readPref(context, "LOC" + jStr + "_TIMERAW", "")
dst = Utility.readPref(context, "LOC" + jStr + "_TIMEDST", "")
- state = Utility.readPref(context, "NWS_LOCATION_$wfo", "").split(",")[0]
+ state = Utility.getWfoSiteName(wfo).split(",")[0]
observation = Utility.readPref(context, "LOC" + jStr + "_OBSERVATION", "")
isUS = us(x)
addToListOfNames(name)
@@ -282,35 +282,22 @@ class Location(val context: Context, locNumInt: Int) {
var radarSite = ""
if (us(xStr)) {
setNumLocations(context, locNumToSave)
- try {
- val wfoAndRadar = getWfoRadarSiteFromPoint(LatLon(xStr, yStr))
- wfo = wfoAndRadar[0]
- radarSite = wfoAndRadar[1]
- if (wfo == "") {
- wfo =
- UtilityLocation.getNearestOffice(context, "WFO", LatLon(xStr, yStr))
- .toLowerCase(Locale.US)
- }
- if (radarSite == "") {
- radarSite = UtilityLocation.getNearestOffice(context, "RADAR", LatLon(xStr, yStr))
- }
- // CT shows mosaic not nexrad so the old way is needed
- if (radarSite == "") {
- radarSite = Utility.readPref(
- context,
- "NWS_RID_" + wfo.toUpperCase(Locale.US),
- ""
- )
- }
- Utility.writePref(context, "RID$locNum", radarSite.toUpperCase(Locale.US))
- Utility.writePref(
- context,
- "NWS$locNum",
- wfo.toUpperCase(Locale.US)
- )
- } catch (e: Exception) {
- UtilityLog.handleException(e)
+ val wfoAndRadar = getWfoRadarSiteFromPoint(LatLon(xStr, yStr))
+ wfo = wfoAndRadar[0]
+ radarSite = wfoAndRadar[1]
+ if (wfo == "") {
+ wfo = UtilityLocation.getNearestOffice( "WFO", LatLon(xStr, yStr)).toLowerCase(Locale.US)
}
+ if (radarSite == "") {
+ radarSite = UtilityLocation.getNearestOffice( "RADAR", LatLon(xStr, yStr))
+ }
+ // CT shows mosaic not nexrad so the old way is needed
+ if (radarSite == "") {
+ radarSite = GlobalDictionaries.wfoToRadarSite[wfo.toUpperCase(Locale.US)] ?: ""
+ }
+ Utility.writePref(context, "RID$locNum", radarSite.toUpperCase(Locale.US))
+ Utility.writePref(context, "NWS$locNum", wfo.toUpperCase(Locale.US)
+ )
} else if (xStr.contains("CANADA")) {
var tmpLatLon = LatLonStr()
if (xStr.length < 12) {
@@ -326,7 +313,9 @@ class Location(val context: Context, locNumInt: Int) {
if (parseProv.isNotEmpty()) prov = parseProv[1]
var id = ""
val parseId = yStr.split(":").dropLastWhile { it.isEmpty() }
- if (parseId.isNotEmpty()) id = parseId[0]
+ if (parseId.isNotEmpty()) {
+ id = parseId[0]
+ }
if (xStr.length > 12) {
tmpLatLon.latStr = parseProv[2]
tmpLatLon.lonStr = parseId[1]
diff --git a/app/src/main/java/joshuatee/wx/settings/SettingsAboutActivity.kt b/app/src/main/java/joshuatee/wx/settings/SettingsAboutActivity.kt
index 95db60b5..13e8d17c 100644
--- a/app/src/main/java/joshuatee/wx/settings/SettingsAboutActivity.kt
+++ b/app/src/main/java/joshuatee/wx/settings/SettingsAboutActivity.kt
@@ -31,7 +31,7 @@ import android.view.View
import androidx.appcompat.widget.Toolbar.OnMenuItemClickListener
import joshuatee.wx.R
import joshuatee.wx.UIPreferences
-import joshuatee.wx.activitiesmisc.WebscreenAB
+import joshuatee.wx.activitiesmisc.WebView
import joshuatee.wx.audio.AudioPlayActivity
import joshuatee.wx.objects.ObjectIntent
import joshuatee.wx.ui.ObjectCardText
@@ -68,8 +68,8 @@ class SettingsAboutActivity : AudioPlayActivity(), OnMenuItemClickListener {
faqButton.setOnClickListener(View.OnClickListener {
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(faqUrl, "wX Frequently Asked Questions")
)
})
@@ -79,8 +79,8 @@ class SettingsAboutActivity : AudioPlayActivity(), OnMenuItemClickListener {
releaseNotesButton.setOnClickListener(View.OnClickListener {
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(releaseNotesUrl, "wX Frequently Asked Questions")
)
})
@@ -100,8 +100,8 @@ class SettingsAboutActivity : AudioPlayActivity(), OnMenuItemClickListener {
iOSVersion.setOnClickListener(View.OnClickListener {
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(iOSUrl, "wXL23 for iOS")
)
})
diff --git a/app/src/main/java/joshuatee/wx/settings/SettingsHomeScreenActivity.kt b/app/src/main/java/joshuatee/wx/settings/SettingsHomeScreenActivity.kt
index ad1ef27f..f7a074cc 100644
--- a/app/src/main/java/joshuatee/wx/settings/SettingsHomeScreenActivity.kt
+++ b/app/src/main/java/joshuatee/wx/settings/SettingsHomeScreenActivity.kt
@@ -36,12 +36,10 @@ import joshuatee.wx.util.UtilityAlertDialog
import joshuatee.wx.wpc.UtilityWpcText
import java.util.*
-
class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListener {
- // FIXME var naming
- private var ridArr = mutableListOf()
- private var ridFav = ""
+ private var favoriteList = mutableListOf()
+ private var favoriteString = ""
private val prefToken = "HOMESCREEN_FAV"
private var labels = mutableListOf()
private var homeScreenFavOrig = ""
@@ -60,8 +58,8 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
true
)
toolbarBottom.setOnMenuItemClickListener(this)
- ridFav = MyApplication.homescreenFav
- homeScreenFavOrig = ridFav
+ favoriteString = MyApplication.homescreenFav
+ homeScreenFavOrig = favoriteString
toolbar.subtitle = "Tap item to delete or move."
UtilityToolbar.fullScreenMode(toolbar, false)
ObjectFab(
@@ -69,7 +67,8 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
this,
R.id.fab,
MyApplication.ICON_ADD,
- View.OnClickListener { dialogueMain.show() })
+ View.OnClickListener { dialogueMain.show() }
+ )
updateList(true)
recyclerView = ObjectRecyclerView(this, this, R.id.card_list, labels, ::prodClicked)
dialogueMain = ObjectDialogue(
@@ -119,51 +118,52 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
}
private fun updateList(firstTime: Boolean = false) {
- ridFav = ridFav.replace("^:".toRegex(), "")
- MyApplication.homescreenFav = ridFav
- Utility.writePref(this, prefToken, ridFav)
- val tempList = ridFav.split(":").dropLastWhile { it.isEmpty() }
- if (ridFav != "") {
- ridArr.clear()
- tempList.indices.forEach { ridArr.add(tempList[it]) }
+ favoriteString = favoriteString.replace("^:".toRegex(), "")
+ saveHomescreenList()
+ val tempList = favoriteString.split(":").dropLastWhile { it.isEmpty() }
+ if (favoriteString != "") {
+ favoriteList.clear()
+ tempList.forEach {
+ favoriteList.add(it)
+ }
if (firstTime) {
labels = mutableListOf()
}
- ridArr.indices.forEach { k ->
+ favoriteList.indices.forEach { k ->
if (!firstTime) {
- labels[k] = findPositionAFD(ridArr[k])
+ labels[k] = findPositionAFD(favoriteList[k])
} else {
- labels.add(findPositionAFD(ridArr[k]))
+ labels.add(findPositionAFD(favoriteList[k]))
}
if (labels[k] == "") {
- labels[k] = findPositionTEXT(ridArr[k])
+ labels[k] = findPositionTEXT(favoriteList[k])
}
if (labels[k] == "") {
- labels[k] = findPositionIMG(ridArr[k])
+ labels[k] = findPositionIMG(favoriteList[k])
}
if (labels[k] == "") {
- labels[k] = findPositionTEXTLOCAL(ridArr[k])
+ labels[k] = findPositionTEXTLOCAL(favoriteList[k])
}
if (labels[k] == "") {
- labels[k] = findPositionIMG2(ridArr[k])
+ labels[k] = findPositionIMG2(favoriteList[k])
}
if (labels[k] == "") {
- labels[k] = findPositionRadarNexrad(ridArr[k])
+ labels[k] = findPositionRadarNexrad(favoriteList[k])
}
if (labels[k] == "") {
- labels[k] = findPositionRadarTdwr(ridArr[k])
+ labels[k] = findPositionRadarTdwr(favoriteList[k])
}
if (labels[k] == "") {
- labels[k] = ridArr[k]
+ labels[k] = favoriteList[k]
}
}
} else {
if (!firstTime) {
labels.clear()
- ridArr.clear()
+ favoriteList.clear()
} else {
labels = mutableListOf()
- ridArr = mutableListOf()
+ favoriteList = mutableListOf()
}
}
if (!firstTime) {
@@ -179,15 +179,13 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
R.id.action_help -> showHelpText(resources.getString(R.string.homescreen_help_label))
R.id.action_reset -> {
MyApplication.homescreenFav = MyApplication.HOMESCREEN_FAV_DEFAULT
- Utility.writePref(this, prefToken, MyApplication.homescreenFav)
- ridFav = MyApplication.homescreenFav
+ favoriteString = MyApplication.homescreenFav
updateList(true)
recyclerView.refreshList(labels)
}
R.id.action_reset_ca -> {
MyApplication.homescreenFav = MyApplication.HOMESCREEN_FAV_DEFAULT_CA
- Utility.writePref(this, prefToken, MyApplication.homescreenFav)
- ridFav = MyApplication.homescreenFav
+ favoriteString = MyApplication.homescreenFav
updateList(true)
recyclerView.refreshList(labels)
}
@@ -201,43 +199,46 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
}
private fun moveUp(pos: Int) {
- ridFav = MyApplication.homescreenFav
- val tempList = MyApplication.colon.split(ridFav)
- ridArr.clear()
- tempList.indices.forEach { ridArr.add(tempList[it]) }
+ favoriteString = MyApplication.homescreenFav
+ favoriteList = favoriteString.split(":").dropLastWhile { it.isEmpty() }.toMutableList()
if (pos != 0) {
- val tmp = ridArr[pos - 1]
- ridArr[pos - 1] = ridArr[pos]
- ridArr[pos] = tmp
+ val tmp = favoriteList[pos - 1]
+ favoriteList[pos - 1] = favoriteList[pos]
+ favoriteList[pos] = tmp
} else {
- val tmp = ridArr.last()
- ridArr[ridArr.lastIndex] = ridArr[pos]
- ridArr[0] = tmp
+ val tmp = favoriteList.last()
+ favoriteList[favoriteList.lastIndex] = favoriteList[pos]
+ favoriteList[0] = tmp
+ }
+ favoriteString = ""
+ favoriteList.forEach {
+ favoriteString += ":$it"
}
- ridFav = ""
- ridArr.indices.forEach { ridFav = ridFav + ":" + ridArr[it] }
- ridFav = ridFav.replace("^:".toRegex(), "")
- Utility.writePref(this, prefToken, ridFav)
+ updateList()
}
private fun moveDown(pos: Int) {
- ridFav = MyApplication.homescreenFav
- val tempList = MyApplication.colon.split(ridFav)
- ridArr.clear()
- tempList.indices.forEach { ridArr.add(tempList[it]) }
- if (pos != ridArr.lastIndex) {
- val tmp = ridArr[pos + 1]
- ridArr[pos + 1] = ridArr[pos]
- ridArr[pos] = tmp
+ favoriteString = MyApplication.homescreenFav
+ favoriteList = favoriteString.split(":").dropLastWhile { it.isEmpty() }.toMutableList()
+ if (pos != favoriteList.lastIndex) {
+ val tmp = favoriteList[pos + 1]
+ favoriteList[pos + 1] = favoriteList[pos]
+ favoriteList[pos] = tmp
} else {
- val tmp = ridArr[0]
- ridArr[0] = ridArr[pos]
- ridArr[ridArr.lastIndex] = tmp
+ val tmp = favoriteList[0]
+ favoriteList[0] = favoriteList[pos]
+ favoriteList[favoriteList.lastIndex] = tmp
+ }
+ favoriteString = ""
+ favoriteList.forEach {
+ favoriteString += ":$it"
}
- ridFav = ""
- ridArr.indices.forEach { ridFav = ridFav + ":" + ridArr[it] }
- ridFav = ridFav.replace("^:".toRegex(), "")
- Utility.writePref(this, prefToken, ridFav)
+ updateList()
+ }
+
+ private fun saveHomescreenList() {
+ Utility.writePref(this, prefToken, favoriteString)
+ MyApplication.homescreenFav = favoriteString
}
private fun findPositionTEXT(key: String) = (UtilityWpcText.labels.indices)
@@ -296,7 +297,7 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
}
override fun onBackPressed() {
- if (ridFav != homeScreenFavOrig) {
+ if (favoriteString != homeScreenFavOrig) {
UtilityAlertDialog.restart()
} else {
super.onBackPressed()
@@ -307,33 +308,19 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
val bottomSheetFragment = BottomSheetFragment()
bottomSheetFragment.position = position
bottomSheetFragment.usedForLocation = false
- bottomSheetFragment.fnList = listOf(::deleteItem, ::moveUpItem, ::moveDownItem)
+ bottomSheetFragment.fnList = listOf(::deleteItem, ::moveUp, ::moveDown)
bottomSheetFragment.labelList = listOf("Delete Item", "Move Up", "Move Down")
bottomSheetFragment.actContext = this
bottomSheetFragment.topLabel = recyclerView.getItem(position)
bottomSheetFragment.show(supportFragmentManager, bottomSheetFragment.tag)
}
- private fun moveUpItem(position: Int) {
- moveUp(position)
- MyApplication.homescreenFav = ridFav
- updateList()
- }
-
- private fun moveDownItem(position: Int) {
- moveDown(position)
- MyApplication.homescreenFav = ridFav
- updateList()
- }
-
private fun deleteItem(position: Int) {
- if (position < ridArr.size) {
- ridFav = MyApplication.homescreenFav
- ridFav += ":"
- ridFav = ridFav.replace(ridArr[position] + ":", "")
- ridFav = ridFav.replace(":$".toRegex(), "")
- Utility.writePref(this, prefToken, ridFav)
- MyApplication.homescreenFav = ridFav
+ if (position < favoriteList.size) {
+ favoriteString = MyApplication.homescreenFav
+ favoriteString += ":"
+ favoriteString = favoriteString.replace(favoriteList[position] + ":", "")
+ favoriteString = favoriteString.replace(":$".toRegex(), "")
recyclerView.deleteItem(position)
recyclerView.notifyDataSetChanged()
updateList()
@@ -350,12 +337,12 @@ class SettingsHomeScreenActivity : BaseActivity(), Toolbar.OnMenuItemClickListen
"OGL-" + textProduct.toUpperCase(Locale.US)
}
}
- ridFav = MyApplication.homescreenFav
- val homeScreenList = ridFav.split(":")
+ favoriteString = MyApplication.homescreenFav
+ val homeScreenList = favoriteString.split(":")
if (!homeScreenList.contains(textProduct)) {
- ridFav = "$ridFav:$textProduct"
- Utility.writePref(this, prefToken, ridFav)
- MyApplication.homescreenFav = ridFav
+ favoriteString = "$favoriteString:$textProduct"
+ Utility.writePref(this, prefToken, favoriteString)
+ MyApplication.homescreenFav = favoriteString
labels.add(textProduct)
updateList()
recyclerView.notifyDataSetChanged()
diff --git a/app/src/main/java/joshuatee/wx/settings/SettingsLocationGenericActivity.kt b/app/src/main/java/joshuatee/wx/settings/SettingsLocationGenericActivity.kt
index a143fe46..463cfecd 100644
--- a/app/src/main/java/joshuatee/wx/settings/SettingsLocationGenericActivity.kt
+++ b/app/src/main/java/joshuatee/wx/settings/SettingsLocationGenericActivity.kt
@@ -45,7 +45,7 @@ import joshuatee.wx.R
import joshuatee.wx.canada.UtilityCitiesCanada
import joshuatee.wx.MyApplication
import joshuatee.wx.UIPreferences
-import joshuatee.wx.activitiesmisc.WebscreenAB
+import joshuatee.wx.activitiesmisc.WebView
import joshuatee.wx.notifications.UtilityWXJobService
import joshuatee.wx.objects.ObjectIntent
import joshuatee.wx.radar.UtilityCitiesExtended
@@ -479,16 +479,16 @@ class SettingsLocationGenericActivity : BaseActivity(),
if (Location.us(xStr)) {
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(UtilityMap.getMapUrl(xStr, yStr, "9"), "wX")
)
} else {
val addressForMap = locLabelEt.text.toString()
ObjectIntent(
this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(UtilityMap.getMapUrlFromStreetAddress(addressForMap), "wX")
)
}
diff --git a/app/src/main/java/joshuatee/wx/settings/UtilityLocation.kt b/app/src/main/java/joshuatee/wx/settings/UtilityLocation.kt
index 9a4cca63..ebfe2db2 100644
--- a/app/src/main/java/joshuatee/wx/settings/UtilityLocation.kt
+++ b/app/src/main/java/joshuatee/wx/settings/UtilityLocation.kt
@@ -22,7 +22,6 @@
package joshuatee.wx.settings
-import java.util.Collections
import android.content.Context
import android.content.pm.PackageManager
import android.location.Location
@@ -111,7 +110,7 @@ object UtilityLocation {
return gps
}
- fun getNearestOffice(context: Context, officeType: String, location: LatLon): String {
+ fun getNearestOffice(officeType: String, location: LatLon): String {
var officeArray = GlobalArrays.radars
var prefToken = "RID"
if (officeType == "WFO") {
@@ -121,7 +120,7 @@ object UtilityLocation {
val sites = mutableListOf()
officeArray.forEach {
val labelArr = it.split(":")
- sites.add(RID(labelArr[0], getSiteLocation(context, labelArr[0], prefToken)))
+ sites.add(RID(labelArr[0], getSiteLocation(labelArr[0], prefToken)))
}
var shortestDistance = 30000.00
var currentDistance: Double
@@ -136,15 +135,15 @@ object UtilityLocation {
return sites[bestRid].name
}
- fun getNearestRid(context: Context, location: LatLon, cnt: Int): List {
+ fun getNearestRid(location: LatLon, count: Int): List {
val radarSites = mutableListOf()
GlobalArrays.radars.forEach {
val labels = it.split(":")
- radarSites.add(RID(labels[0], getSiteLocation(context, labels[0])))
+ radarSites.add(RID(labels[0], getSiteLocation(labels[0])))
}
GlobalArrays.tdwrRadars.forEach {
val labels = it.split(" ")
- radarSites.add(RID(labels[0], getSiteLocation(context, labels[0])))
+ radarSites.add(RID(labels[0], getSiteLocation(labels[0])))
}
var currentDistance: Double
radarSites.forEach {
@@ -152,18 +151,18 @@ object UtilityLocation {
it.distance = currentDistance.toInt()
}
Collections.sort(radarSites, RID.DESCENDING_COMPARATOR)
- return radarSites.subList(0, cnt)
+ return radarSites.subList(0, count)
}
- fun getNearestRadarSite(context: Context, location: LatLon): String {
+ fun getNearestRadarSite(location: LatLon): String {
val radarSites = mutableListOf()
GlobalArrays.radars.forEach {
val labels = it.split(":")
- radarSites.add(RID(labels[0], getSiteLocation(context, labels[0])))
+ radarSites.add(RID(labels[0], getSiteLocation(labels[0])))
}
GlobalArrays.tdwrRadars.forEach {
val labels = it.split(" ")
- radarSites.add(RID(labels[0], getSiteLocation(context, labels[0])))
+ radarSites.add(RID(labels[0], getSiteLocation(labels[0])))
}
var shortestDistance = 10000.00
var currentDistance: Double
@@ -180,8 +179,8 @@ object UtilityLocation {
return radarSites[bestRid].name
}
- fun getNearestSnd(context: Context, location: LatLon): String {
- val sites = GlobalArrays.soundingSites.map { RID(it, getSiteLocation(context, it, "SND")) }
+ fun getNearestSnd(location: LatLon): String {
+ val sites = GlobalArrays.soundingSites.map { RID(it, getSiteLocation(it, "SND")) }
var shortestDistance = 1000.00
var currentDistance: Double
var bestRid = -1
@@ -197,20 +196,31 @@ object UtilityLocation {
return sites[bestRid].name
}
- fun getSiteLocation(context: Context, site: String, officeType: String = "RID"): LatLon {
+ fun getSiteLocation(site: String, officeType: String = "RID"): LatLon {
+ // SND, NWS, or RID
var addChar = "-"
if (officeType == "NWS") {
addChar = ""
} // WFO
val x: String
val y: String
- if (officeType == "RID") {
- x = Utility.getRadarSiteX(site.toUpperCase(Locale.US))
- y = addChar + Utility.getRadarSiteY(site.toUpperCase(Locale.US))
- } else {
- x = Utility.readPref(context, officeType + "_" + site.toUpperCase(Locale.US) + "_X", "0.0")
- y =
- addChar + Utility.readPref(context, officeType + "_" + site.toUpperCase(Locale.US) + "_Y", "0.0")
+ when (officeType) {
+ "RID" -> {
+ x = Utility.getRadarSiteX(site.toUpperCase(Locale.US))
+ y = addChar + Utility.getRadarSiteY(site.toUpperCase(Locale.US))
+ }
+ "NWS" -> {
+ x = Utility.getWfoSiteX(site.toUpperCase(Locale.US))
+ y = addChar + Utility.getWfoSiteY(site.toUpperCase(Locale.US))
+ }
+ "SND" -> {
+ x = Utility.getSoundingSiteX(site.toUpperCase(Locale.US))
+ y = addChar + Utility.getSoundingSiteY(site.toUpperCase(Locale.US))
+ }
+ else -> {
+ x = "0.0"
+ y = "-0.0"
+ }
}
return LatLon(x, y)
}
@@ -247,14 +257,14 @@ object UtilityLocation {
linearLayout: LinearLayout,
uiDispatcher: CoroutineDispatcher
) = GlobalScope.launch(uiDispatcher) {
- var toastStr = ""
+ var toastString = ""
withContext(Dispatchers.IO) {
val locNumIntCurrent = joshuatee.wx.settings.Location.numLocations + 1
val locNumToSaveStr = locNumIntCurrent.toString()
- val loc = Utility.readPref(context, "NWS_LOCATION_$nwsOffice", "")
- val addrSend = loc.replace(" ", "+")
- val xyStr = getXYFromAddressOsm(addrSend)
- toastStr = joshuatee.wx.settings.Location.locationSave(
+ val loc = Utility.getWfoSiteName(nwsOffice)
+ val addressToSend = loc.replace(" ", "+")
+ val xyStr = getXYFromAddressOsm(addressToSend)
+ toastString = joshuatee.wx.settings.Location.locationSave(
context,
locNumToSaveStr,
xyStr[0],
@@ -262,7 +272,7 @@ object UtilityLocation {
loc
)
}
- UtilityUI.makeSnackBar(linearLayout, toastStr)
+ UtilityUI.makeSnackBar(linearLayout, toastString)
}
fun hasAlerts(locNum: Int): Boolean = MyApplication.locations[locNum].notification
diff --git a/app/src/main/java/joshuatee/wx/settings/UtilityPref.kt b/app/src/main/java/joshuatee/wx/settings/UtilityPref.kt
deleted file mode 100644
index 031a5c33..00000000
--- a/app/src/main/java/joshuatee/wx/settings/UtilityPref.kt
+++ /dev/null
@@ -1,1389 +0,0 @@
-/*
-
- Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 joshua.tee@gmail.com
-
- This file is part of wX.
-
- wX is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- wX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with wX. If not, see .
-
- */
-
-package joshuatee.wx.settings
-
-import android.content.Context
-import androidx.preference.PreferenceManager
-
-object UtilityPref {
-
- fun prefInitNWSLoc(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("NWS_LOCATION_JSJ", null)
- if (value == null) {
- editor.putString("NWS_LOCATION_AFC", "AK, Anchorage")
- editor.putString("NWS_LOCATION_AFG", "AK, Fairbanks")
- editor.putString("NWS_LOCATION_AJK", "AK, Juneau")
- editor.putString("NWS_LOCATION_ANC", "AK, Anchorage")
- editor.putString("NWS_LOCATION_BMX", "AL, Birmingham")
- editor.putString("NWS_LOCATION_HUN", "AL, Huntsville")
- editor.putString("NWS_LOCATION_MOB", "AL, Mobile")
- editor.putString("NWS_LOCATION_LZK", "AR, Little Rock")
- editor.putString("NWS_LOCATION_FGZ", "AZ, Flagstaff")
- editor.putString("NWS_LOCATION_PSR", "AZ, Phoenix")
- editor.putString("NWS_LOCATION_TWC", "AZ, Tucson")
- editor.putString("NWS_LOCATION_EKA", "CA, Eureka")
- editor.putString("NWS_LOCATION_HNX", "CA, Hanford")
- editor.putString("NWS_LOCATION_LOX", "CA, Los Angeles")
- editor.putString("NWS_LOCATION_MTR", "CA, San Francisco")
- editor.putString("NWS_LOCATION_SGX", "CA, San Diego")
- editor.putString("NWS_LOCATION_STO", "CA, Sacramento")
- editor.putString("NWS_LOCATION_BOU", "CO, Denver/Boulder")
- editor.putString("NWS_LOCATION_GJT", "CO, Grand Junction")
- editor.putString("NWS_LOCATION_PUB", "CO, Pueblo")
- editor.putString("NWS_LOCATION_JAX", "FL, Jacksonville")
- editor.putString("NWS_LOCATION_KEY", "FL, Key West")
- editor.putString("NWS_LOCATION_MFL", "FL, Miami")
- editor.putString("NWS_LOCATION_MLB", "FL, Melbourne")
- editor.putString("NWS_LOCATION_TAE", "FL, Tallahassee")
- editor.putString("NWS_LOCATION_TBW", "FL, Tampa Bay")
- editor.putString("NWS_LOCATION_FFC", "GA, Atlanta")
- editor.putString("NWS_LOCATION_GUM", "GU, Guam")
- editor.putString("NWS_LOCATION_HFO", "HI, Honolulu")
- editor.putString("NWS_LOCATION_DMX", "IA, Des Moines")
- editor.putString("NWS_LOCATION_DVN", "IA, Quad Cities")
- editor.putString("NWS_LOCATION_BOI", "ID, Boise")
- editor.putString("NWS_LOCATION_PIH", "ID, Pocatello")
- editor.putString("NWS_LOCATION_ILX", "IL, Lincoln")
- editor.putString("NWS_LOCATION_LOT", "IL, Chicago")
- editor.putString("NWS_LOCATION_IND", "IN, Indianapolis")
- editor.putString("NWS_LOCATION_IWX", "IN, Nrn. Indiana")
- editor.putString("NWS_LOCATION_DDC", "KS, Dodge City")
- editor.putString("NWS_LOCATION_GLD", "KS, Goodland")
- editor.putString("NWS_LOCATION_ICT", "KS, Wichita")
- editor.putString("NWS_LOCATION_TOP", "KS, Topeka")
- editor.putString("NWS_LOCATION_JKL", "KY, Jackson")
- editor.putString("NWS_LOCATION_LMK", "KY, Louisville")
- editor.putString("NWS_LOCATION_PAH", "KY, Paducah")
- editor.putString("NWS_LOCATION_LCH", "LA, Lake Charles")
- editor.putString("NWS_LOCATION_LIX", "LA, New Orleans")
- editor.putString("NWS_LOCATION_SHV", "LA, Shreveport")
- editor.putString("NWS_LOCATION_BOX", "MA, Boston")
- editor.putString("NWS_LOCATION_CAR", "ME, Caribou")
- editor.putString("NWS_LOCATION_GYX", "ME, Gray")
- editor.putString("NWS_LOCATION_APX", "MI, Gaylord")
- editor.putString("NWS_LOCATION_DTX", "MI, Detroit")
- editor.putString("NWS_LOCATION_GRR", "MI, Grand Rapids")
- editor.putString("NWS_LOCATION_MQT", "MI, Marquette")
- editor.putString("NWS_LOCATION_DLH", "MN, Duluth")
- editor.putString("NWS_LOCATION_MPX", "MN, Twin Cities")
- editor.putString("NWS_LOCATION_EAX", "MO, Kansas City")
- editor.putString("NWS_LOCATION_LSX", "MO, St. Louis")
- editor.putString("NWS_LOCATION_SGF", "MO, Springfield")
- editor.putString("NWS_LOCATION_JAN", "MS, Jackson")
- editor.putString("NWS_LOCATION_BYZ", "MT, Billings")
- editor.putString("NWS_LOCATION_GGW", "MT, Glasgow")
- editor.putString("NWS_LOCATION_MSO", "MT, Missoula")
- editor.putString("NWS_LOCATION_TFX", "MT, Great Falls")
- editor.putString("NWS_LOCATION_ILM", "NC, Wilmington")
- editor.putString("NWS_LOCATION_MHX", "NC, Morehead City")
- editor.putString("NWS_LOCATION_RAH", "NC, Raleigh")
- editor.putString("NWS_LOCATION_BIS", "ND, Bismarck")
- editor.putString("NWS_LOCATION_FGF", "ND, Grand Forks")
- editor.putString("NWS_LOCATION_GID", "NE, Hastings")
- editor.putString("NWS_LOCATION_LBF", "NE, North Platte")
- editor.putString("NWS_LOCATION_OAX", "NE, Omaha")
- editor.putString("NWS_LOCATION_PHI", "NJ, Mount Holly")
- editor.putString("NWS_LOCATION_ABQ", "NM, Albuquerque")
- editor.putString("NWS_LOCATION_LKN", "NV, Elko")
- editor.putString("NWS_LOCATION_REV", "NV, Reno")
- editor.putString("NWS_LOCATION_VEF", "NV, Las Vegas")
- editor.putString("NWS_LOCATION_ALY", "NY, Albany")
- editor.putString("NWS_LOCATION_BGM", "NY, Binghamton")
- editor.putString("NWS_LOCATION_BUF", "NY, Buffalo")
- editor.putString("NWS_LOCATION_OKX", "NY, New York City")
- editor.putString("NWS_LOCATION_CLE", "OH, Cleveland")
- editor.putString("NWS_LOCATION_ILN", "OH, Wilmington")
- editor.putString("NWS_LOCATION_OUN", "OK, Norman")
- editor.putString("NWS_LOCATION_TSA", "OK, Tulsa")
- editor.putString("NWS_LOCATION_MFR", "OR, Medford")
- editor.putString("NWS_LOCATION_PDT", "OR, Pendleton")
- editor.putString("NWS_LOCATION_PQR", "OR, Portland")
- editor.putString("NWS_LOCATION_CTP", "PA, State College")
- editor.putString("NWS_LOCATION_PBZ", "PA, Pittsburgh")
- editor.putString("NWS_LOCATION_SJU", "PR, San Juan")
- editor.putString("NWS_LOCATION_JSJ", "PR, San Juan")
- editor.putString("NWS_LOCATION_CAE", "SC, Columbia")
- editor.putString("NWS_LOCATION_CHS", "SC, Charleston")
- editor.putString("NWS_LOCATION_GSP", "SC, Greer")
- editor.putString("NWS_LOCATION_ABR", "SD, Aberdeen")
- editor.putString("NWS_LOCATION_FSD", "SD, Sioux Falls")
- editor.putString("NWS_LOCATION_UNR", "SD, Rapid City")
- editor.putString("NWS_LOCATION_MEG", "TN, Memphis")
- editor.putString("NWS_LOCATION_MRX", "TN, Morristown")
- editor.putString("NWS_LOCATION_OHX", "TN, Nashville")
- editor.putString("NWS_LOCATION_AMA", "TX, Amarillo")
- editor.putString("NWS_LOCATION_BRO", "TX, Brownsville")
- editor.putString("NWS_LOCATION_CRP", "TX, Corpus Christi")
- editor.putString("NWS_LOCATION_EPZ", "TX, El Paso")
- editor.putString("NWS_LOCATION_EWX", "TX, Austin")
- editor.putString("NWS_LOCATION_FWD", "TX, Dallas")
- editor.putString("NWS_LOCATION_HGX", "TX, Houston")
- editor.putString("NWS_LOCATION_LUB", "TX, Lubbock")
- editor.putString("NWS_LOCATION_MAF", "TX, Midland")
- editor.putString("NWS_LOCATION_SJT", "TX, San Angelo")
- editor.putString("NWS_LOCATION_SLC", "UT, Salt Lake City")
- editor.putString("NWS_LOCATION_AKQ", "VA, Wakefield")
- editor.putString("NWS_LOCATION_LWX", "VA, Sterling")
- editor.putString("NWS_LOCATION_RNK", "VA, Blacksburg")
- editor.putString("NWS_LOCATION_BTV", "VT, Burlington")
- editor.putString("NWS_LOCATION_OTX", "WA, Spokane")
- editor.putString("NWS_LOCATION_SEW", "WA, Seattle")
- editor.putString("NWS_LOCATION_ARX", "WI, La Crosse")
- editor.putString("NWS_LOCATION_GRB", "WI, Green Bay")
- editor.putString("NWS_LOCATION_MKX", "WI, Milwaukee")
- editor.putString("NWS_LOCATION_RLX", "WV, Charleston")
- editor.putString("NWS_LOCATION_CYS", "WY, Cheyenne")
- editor.putString("NWS_LOCATION_RIW", "WY, Riverton")
- editor.apply()
- }
- }
-
- fun prefInitBig(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("NWS_RID_JSJ", null)
- if (value == null) {
- editor.putString("NWS_RID_ABQ", "ABX")
- editor.putString("NWS_RID_ABR", "ABR")
- editor.putString("NWS_RID_AFC", "AHG")
- editor.putString("NWS_RID_AFG", "APD")
- editor.putString("NWS_RID_AJK", "ACG")
- editor.putString("NWS_RID_AKQ", "AKQ")
- editor.putString("NWS_RID_ALY", "ENX")
- editor.putString("NWS_RID_AMA", "AMA")
- editor.putString("NWS_RID_ANC", "ANC")
- editor.putString("NWS_RID_APX", "APX")
- editor.putString("NWS_RID_ARX", "ARX")
- editor.putString("NWS_RID_BGM", "BGM")
- editor.putString("NWS_RID_BIS", "BIS")
- editor.putString("NWS_RID_BMX", "BMX")
- editor.putString("NWS_RID_BOI", "CBX")
- editor.putString("NWS_RID_BOU", "FTG")
- editor.putString("NWS_RID_BOX", "BOX")
- editor.putString("NWS_RID_BRO", "BRO")
- editor.putString("NWS_RID_BTV", "CXX")
- editor.putString("NWS_RID_BUF", "BUF")
- editor.putString("NWS_RID_BYZ", "BLX")
- editor.putString("NWS_RID_CAE", "CAE")
- editor.putString("NWS_RID_CAR", "CBW")
- editor.putString("NWS_RID_CHS", "CLX")
- editor.putString("NWS_RID_CLE", "CLE")
- editor.putString("NWS_RID_CRP", "CRP")
- editor.putString("NWS_RID_CTP", "CCX")
- editor.putString("NWS_RID_CYS", "CYS")
- editor.putString("NWS_RID_DDC", "DDC")
- editor.putString("NWS_RID_DLH", "DLH")
- editor.putString("NWS_RID_DMX", "DMX")
- editor.putString("NWS_RID_DTX", "DTX")
- editor.putString("NWS_RID_DVN", "DVN")
- editor.putString("NWS_RID_EAX", "EAX")
- editor.putString("NWS_RID_EKA", "BHX")
- editor.putString("NWS_RID_EPZ", "EPZ")
- editor.putString("NWS_RID_EWX", "EWX")
- editor.putString("NWS_RID_FFC", "FFC")
- editor.putString("NWS_RID_FGF", "MVX")
- editor.putString("NWS_RID_FGZ", "FSX")
- editor.putString("NWS_RID_FSD", "FSD")
- editor.putString("NWS_RID_FWD", "FWS")
- editor.putString("NWS_RID_GGW", "GGW")
- editor.putString("NWS_RID_GID", "UEX")
- editor.putString("NWS_RID_GJT", "GJX")
- editor.putString("NWS_RID_GLD", "GLD")
- editor.putString("NWS_RID_GRB", "GRB")
- editor.putString("NWS_RID_GRR", "GRR")
- editor.putString("NWS_RID_GSP", "GSP")
- editor.putString("NWS_RID_GUM", "GUA")
- editor.putString("NWS_RID_GYX", "GYX")
- editor.putString("NWS_RID_HFO", "HMO")
- editor.putString("NWS_RID_HGX", "HGX")
- editor.putString("NWS_RID_HNX", "HNX")
- editor.putString("NWS_RID_HUN", "HTX")
- editor.putString("NWS_RID_ICT", "ICT")
- editor.putString("NWS_RID_ILM", "LTX")
- editor.putString("NWS_RID_ILN", "ILN")
- editor.putString("NWS_RID_ILX", "ILX")
- editor.putString("NWS_RID_IND", "IND")
- editor.putString("NWS_RID_IWX", "IWX")
- editor.putString("NWS_RID_JAN", "DGX")
- editor.putString("NWS_RID_JAX", "JAX")
- editor.putString("NWS_RID_JKL", "JKL")
- editor.putString("NWS_RID_KEY", "BYX")
- editor.putString("NWS_RID_LBF", "LNX")
- editor.putString("NWS_RID_LCH", "LCH")
- editor.putString("NWS_RID_LIX", "LIX")
- editor.putString("NWS_RID_LKN", "LRX")
- editor.putString("NWS_RID_LMK", "LVX")
- editor.putString("NWS_RID_LOT", "LOT")
- editor.putString("NWS_RID_LOX", "VTX")
- editor.putString("NWS_RID_LSX", "LSX")
- editor.putString("NWS_RID_LUB", "LBB")
- editor.putString("NWS_RID_LWX", "LWX")
- editor.putString("NWS_RID_LZK", "LZK")
- editor.putString("NWS_RID_MAF", "MAF")
- editor.putString("NWS_RID_MEG", "NQA")
- editor.putString("NWS_RID_MFL", "AMX")
- editor.putString("NWS_RID_MFR", "MAX")
- editor.putString("NWS_RID_MHX", "MHX")
- editor.putString("NWS_RID_MKX", "MKX")
- editor.putString("NWS_RID_MLB", "MLB")
- editor.putString("NWS_RID_MOB", "MOB")
- editor.putString("NWS_RID_MPX", "MPX")
- editor.putString("NWS_RID_MQT", "MQT")
- editor.putString("NWS_RID_MRX", "MRX")
- editor.putString("NWS_RID_MSO", "MSX")
- editor.putString("NWS_RID_MTR", "MUX")
- editor.putString("NWS_RID_OAX", "OAX")
- editor.putString("NWS_RID_OHX", "OHX")
- editor.putString("NWS_RID_OKX", "OKX")
- editor.putString("NWS_RID_OTX", "OTX")
- editor.putString("NWS_RID_OUN", "TLX")
- editor.putString("NWS_RID_PAH", "PAH")
- editor.putString("NWS_RID_PBZ", "PBZ")
- editor.putString("NWS_RID_PDT", "PDT")
- editor.putString("NWS_RID_PHI", "DIX")
- editor.putString("NWS_RID_PIH", "SFX")
- editor.putString("NWS_RID_PQR", "RTX")
- editor.putString("NWS_RID_PSR", "IWA")
- editor.putString("NWS_RID_PUB", "PUX")
- editor.putString("NWS_RID_RAH", "RAX")
- editor.putString("NWS_RID_REV", "RGX")
- editor.putString("NWS_RID_RIW", "RIW")
- editor.putString("NWS_RID_RLX", "RLX")
- editor.putString("NWS_RID_RNK", "FCX")
- editor.putString("NWS_RID_SEW", "ATX")
- editor.putString("NWS_RID_SGF", "SGF")
- editor.putString("NWS_RID_SGX", "NKX")
- editor.putString("NWS_RID_SHV", "SHV")
- editor.putString("NWS_RID_SJT", "SJT")
- editor.putString("NWS_RID_SJU", "JUA")
- editor.putString("NWS_RID_JSJ", "JUA")
- editor.putString("NWS_RID_SLC", "MTX")
- editor.putString("NWS_RID_STO", "DAX")
- editor.putString("NWS_RID_TAE", "TLH")
- editor.putString("NWS_RID_TBW", "TBW")
- editor.putString("NWS_RID_TFX", "TFX")
- editor.putString("NWS_RID_TOP", "TWX")
- editor.putString("NWS_RID_TSA", "INX")
- editor.putString("NWS_RID_TWC", "EMX")
- editor.putString("NWS_RID_UNR", "UDX")
- editor.putString("NWS_RID_VEF", "ESX")
- editor.putString("STATE_TW_ID_AL", "410946082747596800")
- editor.putString("STATE_TW_ID_AK", "410946674685509632")
- editor.putString("STATE_TW_ID_AZ", "410946812913008640")
- editor.putString("STATE_TW_ID_AR", "410946983583428608")
- editor.putString("STATE_TW_ID_CA", "410947133554966530")
- editor.putString("STATE_TW_ID_CO", "410947263117004802")
- editor.putString("STATE_TW_ID_CT", "410947401004773376")
- editor.putString("STATE_TW_ID_DE", "410947531611185153")
- editor.putString("STATE_TW_ID_FL", "410947683067498496")
- editor.putString("STATE_TW_ID_GA", "410947813162225664")
- editor.putString("STATE_TW_ID_HI", "410947943412137984")
- editor.putString("STATE_TW_ID_ID", "410948063646076928")
- editor.putString("STATE_TW_ID_IL", "410948185452838912")
- editor.putString("STATE_TW_ID_IN", "410948324535988224")
- editor.putString("STATE_TW_ID_IA", "410948449949847553")
- editor.putString("STATE_TW_ID_KS", "410948583387459584")
- editor.putString("STATE_TW_ID_KY", "410948713557663746")
- editor.putString("STATE_TW_ID_LA", "410948840821239810")
- editor.putString("STATE_TW_ID_ME", "410948966411300865")
- editor.putString("STATE_TW_ID_MD", "410949089140813824")
- editor.putString("STATE_TW_ID_MA", "410949206115762176")
- editor.putString("STATE_TW_ID_MI", "406095836829855744")
- editor.putString("STATE_TW_ID_MN", "410949323623395329")
- editor.putString("STATE_TW_ID_MS", "410949449737703424")
- editor.putString("STATE_TW_ID_MO", "410949571464806400")
- editor.putString("STATE_TW_ID_MT", "410949718403842048")
- editor.putString("STATE_TW_ID_NE", "410949838730035200")
- editor.putString("STATE_TW_ID_NV", "410949972331212800")
- editor.putString("STATE_TW_ID_NH", "410950086571474944")
- editor.putString("STATE_TW_ID_NJ", "410950242838646785")
- editor.putString("STATE_TW_ID_NM", "410950366134419457")
- editor.putString("STATE_TW_ID_NY", "410950487198793728")
- editor.putString("STATE_TW_ID_NC", "410950603993411584")
- editor.putString("STATE_TW_ID_ND", "410950714639138816")
- editor.putString("STATE_TW_ID_OH", "410950826153099264")
- editor.putString("STATE_TW_ID_OK", "410950956541415424")
- editor.putString("STATE_TW_ID_OR", "410951075554803712")
- editor.putString("STATE_TW_ID_PA", "410951192261316608")
- editor.putString("STATE_TW_ID_RI", "410951324608385026")
- editor.putString("STATE_TW_ID_SC", "410951462919745537")
- editor.putString("STATE_TW_ID_SD", "410951576107237376")
- editor.putString("STATE_TW_ID_TN", "410951698291507202")
- editor.putString("STATE_TW_ID_TX", "410951810052939777")
- editor.putString("STATE_TW_ID_UT", "410951924230279168")
- editor.putString("STATE_TW_ID_VT", "410952117885472768")
- editor.putString("STATE_TW_ID_VA", "410952264191205376")
- editor.putString("STATE_TW_ID_WA", "410952480776667136")
- editor.putString("STATE_TW_ID_WV", "410952602067550208")
- editor.putString("STATE_TW_ID_WI", "410952736549502977")
- editor.putString("STATE_TW_ID_WY", "410952874370162688")
- editor.apply()
- }
- }
-
- fun prefInitTwitterCA(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- var value = preferences.getString("STATE_TW_ID_bcstorm", null)
- if (value == null) {
- editor.putString("STATE_TW_ID_bcstorm", "489578049524879360")
- editor.putString("STATE_TW_ID_abstorm", "489578415377231872")
- editor.putString("STATE_TW_ID_skstorm", "489578619665014784")
- editor.putString("STATE_TW_ID_mbstorm", "489578784731848704")
- editor.putString("STATE_TW_ID_onstorm", "489710428696481795")
- editor.putString("STATE_TW_ID_nbstorm", "489711021922066432")
- editor.putString("STATE_TW_ID_pestorm", "489710770200932352")
- editor.putString("STATE_TW_ID_nsstorm", "489711312742522882")
- editor.putString("STATE_TW_ID_nlwx", "489711657912782848")
- editor.putString("STATE_TW_ID_ntstorm", "489754447413641217")
- editor.putString("STATE_TW_ID_meteoqc", "489754142907170816")
- editor.apply()
- }
- value = preferences.getString("STATE_TW_ID_st", null)
- if (value == null) {
- editor.putString("STATE_TW_ID_st", "611565983380164608")
- editor.apply()
- }
- }
-
- fun prefInitStateCodeLookup(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("STATE_LOOKUP_District+of+Columbia", null)
- if (value == null) {
- editor.putString("STATE_LOOKUP_Alabama", "AL")
- editor.putString("STATE_LOOKUP_Alaska", "AK")
- editor.putString("STATE_LOOKUP_Arizona", "AZ")
- editor.putString("STATE_LOOKUP_Arkansas", "AR")
- editor.putString("STATE_LOOKUP_California", "CA")
- editor.putString("STATE_LOOKUP_Colorado", "CO")
- editor.putString("STATE_LOOKUP_Connecticut", "CT")
- editor.putString("STATE_LOOKUP_Delaware", "DE")
- editor.putString("STATE_LOOKUP_District+of+Columbia", "DC")
- editor.putString("STATE_LOOKUP_Florida", "FL")
- editor.putString("STATE_LOOKUP_Georgia", "GA")
- editor.putString("STATE_LOOKUP_Hawaii", "HI")
- editor.putString("STATE_LOOKUP_Idaho", "ID")
- editor.putString("STATE_LOOKUP_Illinois", "IL")
- editor.putString("STATE_LOOKUP_Indiana", "IN")
- editor.putString("STATE_LOOKUP_Iowa", "IA")
- editor.putString("STATE_LOOKUP_Kansas", "KS")
- editor.putString("STATE_LOOKUP_Kentucky", "KY")
- editor.putString("STATE_LOOKUP_Louisiana", "LA")
- editor.putString("STATE_LOOKUP_Maine", "ME")
- editor.putString("STATE_LOOKUP_Maryland", "MD")
- editor.putString("STATE_LOOKUP_Massachusetts", "MA")
- editor.putString("STATE_LOOKUP_Michigan", "MI")
- editor.putString("STATE_LOOKUP_Minnesota", "MN")
- editor.putString("STATE_LOOKUP_Mississippi", "MS")
- editor.putString("STATE_LOOKUP_Missouri", "MO")
- editor.putString("STATE_LOOKUP_Montana", "MT")
- editor.putString("STATE_LOOKUP_Nebraska", "NE")
- editor.putString("STATE_LOOKUP_Nevada", "NV")
- editor.putString("STATE_LOOKUP_New+Hampshire", "NH")
- editor.putString("STATE_LOOKUP_New+Jersey", "NJ")
- editor.putString("STATE_LOOKUP_New+Mexico", "NM")
- editor.putString("STATE_LOOKUP_New+York", "NY")
- editor.putString("STATE_LOOKUP_North+Carolina", "NC")
- editor.putString("STATE_LOOKUP_North+Dakota", "ND")
- editor.putString("STATE_LOOKUP_Ohio", "OH")
- editor.putString("STATE_LOOKUP_Oklahoma", "OK")
- editor.putString("STATE_LOOKUP_Oregon", "OR")
- editor.putString("STATE_LOOKUP_Pennsylvania", "PA")
- editor.putString("STATE_LOOKUP_Rhode+Island", "RI")
- editor.putString("STATE_LOOKUP_South+Carolina", "SC")
- editor.putString("STATE_LOOKUP_South+Dakota", "SD")
- editor.putString("STATE_LOOKUP_Tennessee", "TN")
- editor.putString("STATE_LOOKUP_Texas", "TX")
- editor.putString("STATE_LOOKUP_Utah", "UT")
- editor.putString("STATE_LOOKUP_Vermont", "VT")
- editor.putString("STATE_LOOKUP_Virginia", "VA")
- editor.putString("STATE_LOOKUP_Washington", "WA")
- editor.putString("STATE_LOOKUP_West+Virginia", "WV")
- editor.putString("STATE_LOOKUP_Wisconsin", "WI")
- editor.putString("STATE_LOOKUP_Wyoming", "WY")
- editor.apply()
- }
- }
-
- fun prefInitStateCode(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("STATE_CODE_AL", null)
- if (value == null) {
- editor.putString("STATE_CODE_AL", "MS")
- editor.putString("STATE_CODE_AK", "AK")
- editor.putString("STATE_CODE_AZ", "NM")
- editor.putString("STATE_CODE_AR", "MS")
- editor.putString("STATE_CODE_CA", "NV")
- editor.putString("STATE_CODE_CO", "CO_UT")
- editor.putString("STATE_CODE_CT", "NY")
- editor.putString("STATE_CODE_DE", "VA_WV")
- editor.putString("STATE_CODE_FL", "FL")
- editor.putString("STATE_CODE_GA", "SC")
- editor.putString("STATE_CODE_HI", "HI")
- editor.putString("STATE_CODE_ID", "OR_ID")
- editor.putString("STATE_CODE_IL", "IL_IN")
- editor.putString("STATE_CODE_IN", "IL_IN")
- editor.putString("STATE_CODE_IA", "IL")
- editor.putString("STATE_CODE_KS", "KS")
- editor.putString("STATE_CODE_KY", "IL_IN")
- editor.putString("STATE_CODE_LA", "Gulf_Coast")
- editor.putString("STATE_CODE_ME", "NY")
- editor.putString("STATE_CODE_MD", "VA_WV")
- editor.putString("STATE_CODE_MA", "NY")
- editor.putString("STATE_CODE_MI", "MI")
- editor.putString("STATE_CODE_MN", "SD")
- editor.putString("STATE_CODE_MS", "MS")
- editor.putString("STATE_CODE_MO", "KS")
- editor.putString("STATE_CODE_MT", "MT")
- editor.putString("STATE_CODE_NE", "KS")
- editor.putString("STATE_CODE_NV", "NV")
- editor.putString("STATE_CODE_NH", "NY")
- editor.putString("STATE_CODE_NJ", "NY")
- editor.putString("STATE_CODE_NM", "NM")
- editor.putString("STATE_CODE_NY", "NY")
- editor.putString("STATE_CODE_NC", "SC")
- editor.putString("STATE_CODE_ND", "ND")
- editor.putString("STATE_CODE_OH", "IL_IN")
- editor.putString("STATE_CODE_OK", "TX")
- editor.putString("STATE_CODE_OR", "OR_ID")
- editor.putString("STATE_CODE_PA", "NY")
- editor.putString("STATE_CODE_RI", "NY")
- editor.putString("STATE_CODE_SC", "SC")
- editor.putString("STATE_CODE_SD", "SD")
- editor.putString("STATE_CODE_TN", "IL_IN")
- editor.putString("STATE_CODE_TX", "TX")
- editor.putString("STATE_CODE_UT", "CO_UT")
- editor.putString("STATE_CODE_VT", "NY")
- editor.putString("STATE_CODE_VA", "VA_WV")
- editor.putString("STATE_CODE_WA", "WA_ID")
- editor.putString("STATE_CODE_WV", "VA_WV")
- editor.putString("STATE_CODE_WI", "MI")
- editor.putString("STATE_CODE_WY", "CO_UT")
- editor.apply()
- }
- }
-
- fun prefInitNWSXY(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("NWS_UNR_X", null)
- if (value == null) {
- editor.putString("NWS_ABC_X", "60.79278")
- editor.putString("NWS_ABC_Y", "-161.87417")
- editor.putString("NWS_ABQ_X", "35.1027")
- editor.putString("NWS_ABQ_Y", "-106.6276")
- editor.putString("NWS_ABR_X", "45.45583")
- editor.putString("NWS_ABR_Y", "-98.41306")
- editor.putString("NWS_ABX_X", "35.14972")
- editor.putString("NWS_ABX_Y", "-106.82333")
- editor.putString("NWS_ACG_X", "56.85278")
- editor.putString("NWS_ACG_Y", "-135.52917")
- editor.putString("NWS_AEC_X", "64.51139")
- editor.putString("NWS_AEC_Y", "-165.295")
- editor.putString("NWS_AFC_X", "61.2060")
- editor.putString("NWS_AFC_Y", "-149.7855")
- editor.putString("NWS_AFG_X", "64.8396")
- editor.putString("NWS_AFG_Y", "-147.7434")
- editor.putString("NWS_AHG_X", "60.725914")
- editor.putString("NWS_AHG_Y", "-151.35146")
- editor.putString("NWS_AIH_X", "59.46194")
- editor.putString("NWS_AIH_Y", "-146.30111")
- editor.putString("NWS_AJK_X", "58.3023")
- editor.putString("NWS_AJK_Y", "-134.4139")
- editor.putString("NWS_AKC_X", "58.67944")
- editor.putString("NWS_AKC_Y", "-156.62944")
- editor.putString("NWS_AKQ_X", "36.98389")
- editor.putString("NWS_AKQ_Y", "-77.0075")
- editor.putString("NWS_ALY_X", "42.6825")
- editor.putString("NWS_ALY_Y", "-73.7899")
- editor.putString("NWS_AMA_X", "35.23333")
- editor.putString("NWS_AMA_Y", "-101.70889")
- editor.putString("NWS_AMX_X", "25.61056")
- editor.putString("NWS_AMX_Y", "-80.41306")
- editor.putString("NWS_APD_X", "65.03556")
- editor.putString("NWS_APD_Y", "-147.49917")
- editor.putString("NWS_APX_X", "44.90722")
- editor.putString("NWS_APX_Y", "-84.71972")
- editor.putString("NWS_ARX_X", "43.82278")
- editor.putString("NWS_ARX_Y", "-91.19111")
- editor.putString("NWS_ATX_X", "48.19472")
- editor.putString("NWS_ATX_Y", "-122.49444")
- editor.putString("NWS_BBX_X", "39.49611")
- editor.putString("NWS_BBX_Y", "-121.63167")
- editor.putString("NWS_BGM_X", "42.19972")
- editor.putString("NWS_BGM_Y", "-75.985")
- editor.putString("NWS_BHX_X", "40.49833")
- editor.putString("NWS_BHX_Y", "-124.29194")
- editor.putString("NWS_BIS_X", "46.77083")
- editor.putString("NWS_BIS_Y", "-100.76028")
- editor.putString("NWS_BLX_X", "45.85389")
- editor.putString("NWS_BLX_Y", "-108.60611")
- editor.putString("NWS_BMX_X", "33.17194")
- editor.putString("NWS_BMX_Y", "-86.76972")
- editor.putString("NWS_BOI_X", "43.5994")
- editor.putString("NWS_BOI_Y", "-116.2645")
- editor.putString("NWS_BOU_X", "40.0107")
- editor.putString("NWS_BOU_Y", "-105.2584")
- editor.putString("NWS_BOX_X", "41.95583")
- editor.putString("NWS_BOX_Y", "-71.1375")
- editor.putString("NWS_BRO_X", "25.91556")
- editor.putString("NWS_BRO_Y", "-97.41861")
- editor.putString("NWS_BTV_X", "44.4686")
- editor.putString("NWS_BTV_Y", "-73.1901")
- editor.putString("NWS_BUF_X", "42.94861")
- editor.putString("NWS_BUF_Y", "-78.73694")
- editor.putString("NWS_BYX_X", "24.59694")
- editor.putString("NWS_BYX_Y", "-81.70333")
- editor.putString("NWS_BYZ_X", "45.7778")
- editor.putString("NWS_BYZ_Y", "-108.5429")
- editor.putString("NWS_CAE_X", "33.94861")
- editor.putString("NWS_CAE_Y", "-81.11861")
- editor.putString("NWS_CAR_X", "46.85897")
- editor.putString("NWS_CAR_Y", "-68.01895")
- editor.putString("NWS_CBW_X", "46.03917")
- editor.putString("NWS_CBW_Y", "-67.80694")
- editor.putString("NWS_CBX_X", "43.49083")
- editor.putString("NWS_CBX_Y", "-116.23444")
- editor.putString("NWS_CCX_X", "40.92306")
- editor.putString("NWS_CCX_Y", "-78.00389")
- editor.putString("NWS_CHS_X", "32.7942")
- editor.putString("NWS_CHS_Y", "-79.9419")
- editor.putString("NWS_CLE_X", "41.41306")
- editor.putString("NWS_CLE_Y", "-81.86")
- editor.putString("NWS_CLX_X", "32.65556")
- editor.putString("NWS_CLX_Y", "-81.04222")
- editor.putString("NWS_CRI_X", "35.2383")
- editor.putString("NWS_CRI_Y", "-97.4602")
- editor.putString("NWS_CRP_X", "27.78389")
- editor.putString("NWS_CRP_Y", "-97.51083")
- editor.putString("NWS_CTP_X", "40.7878")
- editor.putString("NWS_CTP_Y", "-77.8526")
- editor.putString("NWS_CXX_X", "44.51111")
- editor.putString("NWS_CXX_Y", "-73.16639")
- editor.putString("NWS_CYS_X", "41.15194")
- editor.putString("NWS_CYS_Y", "-104.80611")
- editor.putString("NWS_DAX_X", "38.50111")
- editor.putString("NWS_DAX_Y", "-121.67667")
- editor.putString("NWS_DDC_X", "37.76083")
- editor.putString("NWS_DDC_Y", "-99.96833")
- editor.putString("NWS_DFX_X", "29.2725")
- editor.putString("NWS_DFX_Y", "-100.28028")
- editor.putString("NWS_DGX_X", "32.28")
- editor.putString("NWS_DGX_Y", "-89.98444")
- editor.putString("NWS_DIX_X", "39.94694")
- editor.putString("NWS_DIX_Y", "-74.41111")
- editor.putString("NWS_DLH_X", "46.83694")
- editor.putString("NWS_DLH_Y", "-92.20972")
- editor.putString("NWS_DMX_X", "41.73111")
- editor.putString("NWS_DMX_Y", "-93.72278")
- editor.putString("NWS_DOX_X", "38.82556")
- editor.putString("NWS_DOX_Y", "-75.44")
- editor.putString("NWS_DTX_X", "42.69972")
- editor.putString("NWS_DTX_Y", "-83.47167")
- editor.putString("NWS_DVN_X", "41.61167")
- editor.putString("NWS_DVN_Y", "-90.58083")
- editor.putString("NWS_DYX_X", "32.53833")
- editor.putString("NWS_DYX_Y", "-99.25417")
- editor.putString("NWS_EAX_X", "38.81028")
- editor.putString("NWS_EAX_Y", "-94.26417")
- editor.putString("NWS_EKA_X", "40.7852")
- editor.putString("NWS_EKA_Y", "-124.1540")
- editor.putString("NWS_EMX_X", "31.89361")
- editor.putString("NWS_EMX_Y", "-110.63028")
- editor.putString("NWS_ENX_X", "42.58639")
- editor.putString("NWS_ENX_Y", "-74.06444")
- editor.putString("NWS_EOX_X", "31.46028")
- editor.putString("NWS_EOX_Y", "-85.45944")
- editor.putString("NWS_EPZ_X", "31.87306")
- editor.putString("NWS_EPZ_Y", "-106.6975")
- editor.putString("NWS_ESX_X", "35.70111")
- editor.putString("NWS_ESX_Y", "-114.89139")
- editor.putString("NWS_EVX_X", "30.56417")
- editor.putString("NWS_EVX_Y", "-85.92139")
- editor.putString("NWS_EWX_X", "29.70361")
- editor.putString("NWS_EWX_Y", "-98.02806")
- editor.putString("NWS_EYX_X", "35.09778")
- editor.putString("NWS_EYX_Y", "-117.56")
- editor.putString("NWS_FCX_X", "37.02417")
- editor.putString("NWS_FCX_Y", "-80.27417")
- editor.putString("NWS_FDR_X", "34.36222")
- editor.putString("NWS_FDR_Y", "-98.97611")
- editor.putString("NWS_FDX_X", "34.63528")
- editor.putString("NWS_FDX_Y", "-103.62944")
- editor.putString("NWS_FFC_X", "33.36333")
- editor.putString("NWS_FFC_Y", "-84.56583")
- editor.putString("NWS_FGF_X", "47.9069")
- editor.putString("NWS_FGF_Y", "-97.0602")
- editor.putString("NWS_FGZ_X", "35.19502")
- editor.putString("NWS_FGZ_Y", "-111.65310")
- editor.putString("NWS_FSD_X", "43.58778")
- editor.putString("NWS_FSD_Y", "-96.72889")
- editor.putString("NWS_FSX_X", "34.57444")
- editor.putString("NWS_FSX_Y", "-111.19833")
- editor.putString("NWS_FTG_X", "39.78667")
- editor.putString("NWS_FTG_Y", "-104.54528")
- editor.putString("NWS_FWD_X", "32.6963")
- editor.putString("NWS_FWD_Y", "-97.0827")
- editor.putString("NWS_FWS_X", "32.57278")
- editor.putString("NWS_FWS_Y", "-97.30278")
- editor.putString("NWS_GGW_X", "48.20639")
- editor.putString("NWS_GGW_Y", "-106.62417")
- editor.putString("NWS_GID_X", "40.9114")
- editor.putString("NWS_GID_Y", "-98.3601")
- editor.putString("NWS_GJT_X", "39.0836")
- editor.putString("NWS_GJT_Y", "-108.5638")
- editor.putString("NWS_GJX_X", "39.06222")
- editor.putString("NWS_GJX_Y", "-108.21306")
- editor.putString("NWS_GLD_X", "39.36694")
- editor.putString("NWS_GLD_Y", "-101.7")
- editor.putString("NWS_GRB_X", "44.49833")
- editor.putString("NWS_GRB_Y", "-88.11111")
- editor.putString("NWS_GRK_X", "30.72167")
- editor.putString("NWS_GRK_Y", "-97.38278")
- editor.putString("NWS_GRR_X", "42.89389")
- editor.putString("NWS_GRR_Y", "-85.54472")
- editor.putString("NWS_GSP_X", "34.88306")
- editor.putString("NWS_GSP_Y", "-82.22028")
- editor.putString("NWS_GUA_X", "13.45444")
- editor.putString("NWS_GUA_Y", "144.80833")
- editor.putString("NWS_GUM_X", "13.484")
- editor.putString("NWS_GUM_Y", "144.7967")
- editor.putString("NWS_GWX_X", "33.89667")
- editor.putString("NWS_GWX_Y", "-88.32889")
- editor.putString("NWS_GYX_X", "43.89139")
- editor.putString("NWS_GYX_Y", "-70.25694")
- editor.putString("NWS_HDX_X", "33.07639")
- editor.putString("NWS_HDX_Y", "-106.12222")
- editor.putString("NWS_HFO_X", "21.30256")
- editor.putString("NWS_HFO_Y", "-157.84428")
- editor.putString("NWS_HGX_X", "29.47194")
- editor.putString("NWS_HGX_Y", "-95.07889")
- editor.putString("NWS_HKI_X", "21.89417")
- editor.putString("NWS_HKI_Y", "-159.55222")
- editor.putString("NWS_HKM_X", "20.12556")
- editor.putString("NWS_HKM_Y", "-155.77778")
- editor.putString("NWS_HMO_X", "21.13278")
- editor.putString("NWS_HMO_Y", "-157.18")
- editor.putString("NWS_HNX_X", "36.31417")
- editor.putString("NWS_HNX_Y", "-119.63111")
- editor.putString("NWS_HPX_X", "36.73667")
- editor.putString("NWS_HPX_Y", "-87.285")
- editor.putString("NWS_HTX_X", "34.93056")
- editor.putString("NWS_HTX_Y", "-86.08361")
- editor.putString("NWS_HUN_X", "34.6448")
- editor.putString("NWS_HUN_Y", "-86.6672")
- editor.putString("NWS_HWA_X", "19.095")
- editor.putString("NWS_HWA_Y", "-155.56889")
- editor.putString("NWS_ICT_X", "37.65444")
- editor.putString("NWS_ICT_Y", "-97.4425")
- editor.putString("NWS_ICX_X", "37.59083")
- editor.putString("NWS_ICX_Y", "-112.86222")
- editor.putString("NWS_ILM_X", "39.2072")
- editor.putString("NWS_ILM_Y", "-77.8719")
- editor.putString("NWS_ILN_X", "39.42028")
- editor.putString("NWS_ILN_Y", "-83.82167")
- editor.putString("NWS_ILX_X", "40.15056")
- editor.putString("NWS_ILX_Y", "-89.33667")
- editor.putString("NWS_IND_X", "39.7075")
- editor.putString("NWS_IND_Y", "-86.28028")
- editor.putString("NWS_INX_X", "36.175")
- editor.putString("NWS_INX_Y", "-95.56444")
- editor.putString("NWS_IWA_X", "33.28917")
- editor.putString("NWS_IWA_Y", "-111.66917")
- editor.putString("NWS_IWX_X", "41.40861")
- editor.putString("NWS_IWX_Y", "-85.7")
- editor.putString("NWS_JAN_X", "32.3104")
- editor.putString("NWS_JAN_Y", "-90.1890")
- editor.putString("NWS_JAX_X", "30.3453")
- editor.putString("NWS_JAX_X", "30.48444")
- editor.putString("NWS_JAX_Y", "-81.6831")
- editor.putString("NWS_JAX_Y", "-81.70194")
- editor.putString("NWS_JGX_X", "32.675")
- editor.putString("NWS_JGX_Y", "-83.35111")
- editor.putString("NWS_JKL_X", "37.59083")
- editor.putString("NWS_JKL_Y", "-83.31306")
- editor.putString("NWS_JUA_X", "18.1175")
- editor.putString("NWS_JUA_Y", "-66.07861")
- editor.putString("NWS_KEY_X", "24.5627")
- editor.putString("NWS_KEY_Y", "-81.7724")
- editor.putString("NWS_KJK_X", "35.92417")
- editor.putString("NWS_KJK_Y", "126.62222")
- editor.putString("NWS_KSG_X", "36.95972")
- editor.putString("NWS_KSG_Y", "127.01833")
- editor.putString("NWS_LBB_X", "33.65417")
- editor.putString("NWS_LBB_Y", "-101.81361")
- editor.putString("NWS_LBF_X", "41.1431")
- editor.putString("NWS_LBF_Y", "-100.7710")
- editor.putString("NWS_LCH_X", "30.125")
- editor.putString("NWS_LCH_Y", "-93.21583")
- editor.putString("NWS_LGX_X", "47.1158")
- editor.putString("NWS_LGX_Y", "-124.1069")
- editor.putString("NWS_LIX_X", "30.33667")
- editor.putString("NWS_LIX_Y", "-89.82528")
- editor.putString("NWS_LKN_X", "40.8396")
- editor.putString("NWS_LKN_Y", "-115.7587")
- editor.putString("NWS_LMK_X", "38.1722")
- editor.putString("NWS_LMK_Y", "-85.7162")
- editor.putString("NWS_LNX_X", "41.95778")
- editor.putString("NWS_LNX_Y", "-100.57583")
- editor.putString("NWS_LOT_X", "41.60444")
- editor.putString("NWS_LOT_Y", "-88.08472")
- editor.putString("NWS_LOX_X", "33.8228")
- editor.putString("NWS_LOX_Y", "-117.9561")
- editor.putString("NWS_LRX_X", "40.73972")
- editor.putString("NWS_LRX_Y", "-116.80278")
- editor.putString("NWS_LSX_X", "38.69889")
- editor.putString("NWS_LSX_Y", "-90.68278")
- editor.putString("NWS_LTX_X", "33.98917")
- editor.putString("NWS_LTX_Y", "-78.42917")
- editor.putString("NWS_LUB_X", "33.5850")
- editor.putString("NWS_LUB_Y", "-101.8904")
- editor.putString("NWS_LVX_X", "37.97528")
- editor.putString("NWS_LVX_Y", "-85.94389")
- editor.putString("NWS_LWX_X", "38.97628")
- editor.putString("NWS_LWX_Y", "-77.48751")
- editor.putString("NWS_LZK_X", "34.83639")
- editor.putString("NWS_LZK_Y", "-92.26194")
- editor.putString("NWS_MAF_X", "31.94333")
- editor.putString("NWS_MAF_Y", "-102.18889")
- editor.putString("NWS_MAX_X", "42.08111")
- editor.putString("NWS_MAX_Y", "-122.71611")
- editor.putString("NWS_MBX_X", "48.3925")
- editor.putString("NWS_MBX_Y", "-100.86444")
- editor.putString("NWS_MEG_X", "35.1491")
- editor.putString("NWS_MEG_Y", "-90.0151")
- editor.putString("NWS_MFL_X", "25.7744")
- editor.putString("NWS_MFL_Y", "-80.1937")
- editor.putString("NWS_MFR_X", "42.3294")
- editor.putString("NWS_MFR_Y", "-122.8524")
- editor.putString("NWS_MHX_X", "34.77583")
- editor.putString("NWS_MHX_Y", "-76.87639")
- editor.putString("NWS_MKX_X", "42.96778")
- editor.putString("NWS_MKX_Y", "-88.55056")
- editor.putString("NWS_MLB_X", "28.11306")
- editor.putString("NWS_MLB_Y", "-80.65444")
- editor.putString("NWS_MOB_X", "30.67944")
- editor.putString("NWS_MOB_Y", "-88.23972")
- editor.putString("NWS_MPX_X", "44.84889")
- editor.putString("NWS_MPX_Y", "-93.56528")
- editor.putString("NWS_MQT_X", "46.53111")
- editor.putString("NWS_MQT_Y", "-87.54833")
- editor.putString("NWS_MRX_X", "36.16833")
- editor.putString("NWS_MRX_Y", "-83.40194")
- editor.putString("NWS_MSO_X", "46.8685")
- editor.putString("NWS_MSO_Y", "-114.0090")
- editor.putString("NWS_MSX_X", "47.04111")
- editor.putString("NWS_MSX_Y", "-113.98611")
- editor.putString("NWS_MTR_X", "37.7213")
- editor.putString("NWS_MTR_Y", "-122.4369")
- editor.putString("NWS_MTX_X", "41.26278")
- editor.putString("NWS_MTX_Y", "-112.44694")
- editor.putString("NWS_MUX_X", "37.15528")
- editor.putString("NWS_MUX_Y", "-121.8975")
- editor.putString("NWS_MVX_X", "47.52806")
- editor.putString("NWS_MVX_Y", "-97.325")
- editor.putString("NWS_MXX_X", "32.53667")
- editor.putString("NWS_MXX_Y", "-85.78972")
- editor.putString("NWS_NKX_X", "32.91889")
- editor.putString("NWS_NKX_Y", "-117.04194")
- editor.putString("NWS_NQA_X", "35.34472")
- editor.putString("NWS_NQA_Y", "-89.87333")
- editor.putString("NWS_OAX_X", "41.32028")
- editor.putString("NWS_OAX_Y", "-96.36639")
- editor.putString("NWS_ODN_X", "26.30194")
- editor.putString("NWS_ODN_Y", "127.90972")
- editor.putString("NWS_OHX_X", "36.24722")
- editor.putString("NWS_OHX_Y", "-86.5625")
- editor.putString("NWS_OKX_X", "40.86556")
- editor.putString("NWS_OKX_Y", "-72.86444")
- editor.putString("NWS_OTX_X", "47.68056")
- editor.putString("NWS_OTX_Y", "-117.62583")
- editor.putString("NWS_OUN_X", "35.4449")
- editor.putString("NWS_OUN_Y", "-97.5219")
- editor.putString("NWS_PAH_X", "37.06833")
- editor.putString("NWS_PAH_Y", "-88.77194")
- editor.putString("NWS_PBZ_X", "40.53167")
- editor.putString("NWS_PBZ_Y", "-80.21833")
- editor.putString("NWS_PDT_X", "45.69056")
- editor.putString("NWS_PDT_Y", "-118.85278")
- editor.putString("NWS_PHI_X", "39.9754")
- editor.putString("NWS_PHI_Y", "-75.1386")
- editor.putString("NWS_PIH_X", "42.8947")
- editor.putString("NWS_PIH_Y", "-112.4420")
- editor.putString("NWS_PLA_X", "38.73028")
- editor.putString("NWS_PLA_Y", "-27.32167")
- editor.putString("NWS_POE_X", "31.15528")
- editor.putString("NWS_POE_Y", "-92.97583")
- editor.putString("NWS_PQR_X", "45.5031")
- editor.putString("NWS_PQR_Y", "-122.6251")
- editor.putString("NWS_PSR_X", "33.4050")
- editor.putString("NWS_PSR_Y", "-112.0325")
- editor.putString("NWS_PUB_X", "38.2641")
- editor.putString("NWS_PUB_Y", "-104.61483")
- editor.putString("NWS_PUX_X", "38.45944")
- editor.putString("NWS_PUX_Y", "-104.18139")
- editor.putString("NWS_RAH_X", "35.77399")
- editor.putString("NWS_RAH_Y", "-78.64008")
- editor.putString("NWS_RAX_X", "35.66528")
- editor.putString("NWS_RAX_Y", "-78.49")
- editor.putString("NWS_REV_X", "39.5223")
- editor.putString("NWS_REV_Y", "-119.8127")
- editor.putString("NWS_RGX_X", "39.75417")
- editor.putString("NWS_RGX_Y", "-119.46111")
- editor.putString("NWS_RIW_X", "43.06611")
- editor.putString("NWS_RIW_Y", "-108.47667")
- editor.putString("NWS_RLX_X", "38.31194")
- editor.putString("NWS_RLX_Y", "-81.72389")
- editor.putString("NWS_RNK_X", "37.2283")
- editor.putString("NWS_RNK_Y", "-80.4212")
- editor.putString("NWS_RTX_X", "45.715")
- editor.putString("NWS_RTX_Y", "-122.96417")
- editor.putString("NWS_SEW_X", "47.4724")
- editor.putString("NWS_SEW_Y", "-122.3141")
- editor.putString("NWS_SFX_X", "43.10583")
- editor.putString("NWS_SFX_Y", "-112.68528")
- editor.putString("NWS_SGF_X", "37.23528")
- editor.putString("NWS_SGF_Y", "-93.40028")
- editor.putString("NWS_SGX_X", "32.7416")
- editor.putString("NWS_SGX_Y", "-117.1294")
- editor.putString("NWS_SHV_X", "32.45056")
- editor.putString("NWS_SHV_Y", "-93.84111")
- editor.putString("NWS_SJT_X", "31.37111")
- editor.putString("NWS_SJT_Y", "-100.49222")
- editor.putString("NWS_SJU_X", "18.4129")
- editor.putString("NWS_SJU_Y", "-66.0989")
- editor.putString("NWS_SLC_X", "40.7482")
- editor.putString("NWS_SLC_Y", "-111.9155")
- editor.putString("NWS_SOX_X", "33.81778")
- editor.putString("NWS_SOX_Y", "-117.635")
- editor.putString("NWS_SRX_X", "35.29056")
- editor.putString("NWS_SRX_Y", "-94.36167")
- editor.putString("NWS_STO_X", "38.5678")
- editor.putString("NWS_STO_Y", "-121.5007")
- editor.putString("NWS_TAE_X", "30.4293")
- editor.putString("NWS_TAE_Y", "-84.2906")
- editor.putString("NWS_TBW_X", "27.70528")
- editor.putString("NWS_TBW_Y", "-82.40194")
- editor.putString("NWS_TFX_X", "47.45972")
- editor.putString("NWS_TFX_Y", "-111.38444")
- editor.putString("NWS_TLH_X", "30.3975")
- editor.putString("NWS_TLH_Y", "-84.32889")
- editor.putString("NWS_TLX_X", "35.33306")
- editor.putString("NWS_TLX_Y", "-97.2775")
- editor.putString("NWS_TOP_X", "39.0134")
- editor.putString("NWS_TOP_Y", "-95.7071")
- editor.putString("NWS_TSA_X", "36.0961")
- editor.putString("NWS_TSA_Y", "-95.9419")
- editor.putString("NWS_TWC_X", "32.1965")
- editor.putString("NWS_TWC_Y", "-110.9025")
- editor.putString("NWS_TWX_X", "38.99694")
- editor.putString("NWS_TWX_Y", "-96.2325")
- editor.putString("NWS_TYX_X", "43.75583")
- editor.putString("NWS_TYX_Y", "-75.68")
- editor.putString("NWS_UDX_X", "44.125")
- editor.putString("NWS_UDX_Y", "-102.82944")
- editor.putString("NWS_UEX_X", "40.32083")
- editor.putString("NWS_UEX_Y", "-98.44167")
- editor.putString("NWS_UNR_X", "44.0734")
- editor.putString("NWS_UNR_Y", "-103.2259")
- editor.putString("NWS_VAX_X", "30.89")
- editor.putString("NWS_VAX_Y", "-83.00194")
- editor.putString("NWS_VBX_X", "34.83806")
- editor.putString("NWS_VBX_Y", "-120.39583")
- editor.putString("NWS_VEF_X", "36.1273")
- editor.putString("NWS_VEF_Y", "-115.1712")
- editor.putString("NWS_VNX_X", "36.74083")
- editor.putString("NWS_VNX_Y", "-98.1275")
- editor.putString("NWS_VTX_X", "34.41167")
- editor.putString("NWS_VTX_Y", "-119.17861")
- editor.putString("NWS_VWX_X", "38.26")
- editor.putString("NWS_VWX_Y", "-87.7247")
- editor.putString("NWS_YUX_X", "32.49528")
- editor.putString("NWS_YUX_Y", "-114.65583")
- editor.apply()
- }
- }
-
- fun prefInitRIDXY(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("RID_ABR_Xmay14_2", null)
- if (value == null) {
- editor.putString("RID_ABR_Xmay14_2", "45.451")
- editor.putString("RID_TYX_X", "43.756")
- editor.putString("RID_TYX_Y", "75.68")
- editor.putString("RID_ABR_X", "45.456")
- editor.putString("RID_ABR_Y", "98.413")
- editor.putString("RID_ENX_X", "42.586")
- editor.putString("RID_ENX_Y", "74.064")
- editor.putString("RID_ABX_X", "35.15")
- editor.putString("RID_ABX_Y", "106.824")
- editor.putString("RID_FDR_X", "34.362")
- editor.putString("RID_FDR_Y", "98.977")
- editor.putString("RID_AMA_X", "35.233")
- editor.putString("RID_AMA_Y", "101.709")
- editor.putString("RID_AHG_X", "60.726")
- editor.putString("RID_AHG_Y", "151.351")
- editor.putString("RID_GUA_X", "13.456")
- editor.putString("RID_GUA_Y", "144.811")
- editor.putString("RID_FFC_X", "33.363")
- editor.putString("RID_FFC_Y", "84.566")
- editor.putString("RID_EWX_X", "29.704")
- editor.putString("RID_EWX_Y", "98.029")
- editor.putString("RID_BBX_X", "39.496")
- editor.putString("RID_BBX_Y", "121.632")
- editor.putString("RID_ABC_X", "60.792")
- editor.putString("RID_ABC_Y", "161.876")
- editor.putString("RID_BLX_X", "45.854")
- editor.putString("RID_BLX_Y", "108.607")
- editor.putString("RID_BGM_X", "42.2")
- editor.putString("RID_BGM_Y", "75.985")
- editor.putString("RID_BMX_X", "33.171")
- editor.putString("RID_BMX_Y", "86.77")
- editor.putString("RID_BIS_X", "46.771")
- editor.putString("RID_BIS_Y", "100.76")
- editor.putString("RID_CBX_X", "43.49")
- editor.putString("RID_CBX_Y", "116.236")
- editor.putString("RID_BOX_X", "41.956")
- editor.putString("RID_BOX_Y", "71.137")
- editor.putString("RID_BRO_X", "25.916")
- editor.putString("RID_BRO_Y", "97.419")
- editor.putString("RID_BUF_X", "42.949")
- editor.putString("RID_BUF_Y", "78.737")
- editor.putString("RID_CXX_X", "44.511")
- editor.putString("RID_CXX_Y", "73.166")
- editor.putString("RID_FDX_X", "34.634")
- editor.putString("RID_FDX_Y", "103.619")
- editor.putString("RID_ICX_X", "37.591")
- editor.putString("RID_ICX_Y", "112.862")
- editor.putString("RID_CLX_X", "32.655")
- editor.putString("RID_CLX_Y", "81.042")
- editor.putString("RID_RLX_X", "38.311")
- editor.putString("RID_RLX_Y", "81.723")
- editor.putString("RID_CYS_X", "41.152")
- editor.putString("RID_CYS_Y", "104.806")
- editor.putString("RID_LOT_X", "41.604")
- editor.putString("RID_LOT_Y", "88.085")
- editor.putString("RID_ILN_X", "39.42")
- editor.putString("RID_ILN_Y", "83.822")
- editor.putString("RID_CLE_X", "41.413")
- editor.putString("RID_CLE_Y", "81.86")
- editor.putString("RID_CAE_X", "33.949")
- editor.putString("RID_CAE_Y", "81.119")
- editor.putString("RID_GWX_X", "33.897")
- editor.putString("RID_GWX_Y", "88.329")
- editor.putString("RID_CRP_X", "27.784")
- editor.putString("RID_CRP_Y", "97.511")
- editor.putString("RID_FWS_X", "32.573")
- editor.putString("RID_FWS_Y", "97.303")
- editor.putString("RID_DVN_X", "41.612")
- editor.putString("RID_DVN_Y", "90.581")
- editor.putString("RID_FTG_X", "39.786")
- editor.putString("RID_FTG_Y", "104.546")
- editor.putString("RID_DMX_X", "41.731")
- editor.putString("RID_DMX_Y", "93.723")
- editor.putString("RID_DTX_X", "42.7")
- editor.putString("RID_DTX_Y", "83.472")
- editor.putString("RID_DDC_X", "37.761")
- editor.putString("RID_DDC_Y", "99.969")
- editor.putString("RID_DOX_X", "38.826")
- editor.putString("RID_DOX_Y", "75.44")
- editor.putString("RID_DLH_X", "46.837")
- editor.putString("RID_DLH_Y", "92.21")
- editor.putString("RID_DYX_X", "32.538")
- editor.putString("RID_DYX_Y", "99.254")
- editor.putString("RID_EYX_X", "35.098")
- editor.putString("RID_EYX_Y", "117.561")
- editor.putString("RID_EVX_X", "30.565")
- editor.putString("RID_EVX_Y", "85.922")
- editor.putString("RID_EPZ_X", "31.873")
- editor.putString("RID_EPZ_Y", "106.698")
- editor.putString("RID_LRX_X", "40.74")
- editor.putString("RID_LRX_Y", "116.803")
- editor.putString("RID_BHX_X", "40.499")
- editor.putString("RID_BHX_Y", "124.292")
- editor.putString("RID_APD_X", "65.035")
- editor.putString("RID_APD_Y", "147.501")
- editor.putString("RID_FSX_X", "34.574")
- editor.putString("RID_FSX_Y", "111.198")
- editor.putString("RID_HPX_X", "36.737")
- editor.putString("RID_HPX_Y", "87.285")
- editor.putString("RID_GRK_X", "30.722")
- editor.putString("RID_GRK_Y", "97.383")
- editor.putString("RID_POE_X", "31.155")
- editor.putString("RID_POE_Y", "92.976")
- editor.putString("RID_EOX_X", "31.46")
- editor.putString("RID_EOX_Y", "85.459")
- editor.putString("RID_SRX_X", "35.29")
- editor.putString("RID_SRX_Y", "94.362")
- editor.putString("RID_IWX_X", "41.359")
- editor.putString("RID_IWX_Y", "85.7")
- editor.putString("RID_APX_X", "44.906")
- editor.putString("RID_APX_Y", "84.72")
- editor.putString("RID_GGW_X", "48.206")
- editor.putString("RID_GGW_Y", "106.625")
- editor.putString("RID_GLD_X", "39.367")
- editor.putString("RID_GLD_Y", "101.7")
- editor.putString("RID_MVX_X", "47.528")
- editor.putString("RID_MVX_Y", "97.325")
- editor.putString("RID_GJX_X", "39.062")
- editor.putString("RID_GJX_Y", "108.214")
- editor.putString("RID_GRR_X", "42.894")
- editor.putString("RID_GRR_Y", "85.545")
- editor.putString("RID_TFX_X", "47.46")
- editor.putString("RID_TFX_Y", "111.385")
- editor.putString("RID_GRB_X", "44.499")
- editor.putString("RID_GRB_Y", "88.111")
- editor.putString("RID_GSP_X", "34.883") // "34.879"
- editor.putString("RID_GSP_Y", "82.22") // "82.216"
- editor.putString("RID_UEX_X", "40.321")
- editor.putString("RID_UEX_Y", "98.442")
- editor.putString("RID_HDX_X", "33.077")
- editor.putString("RID_HDX_Y", "106.12")
- editor.putString("RID_CBW_X", "46.039")
- editor.putString("RID_CBW_Y", "67.806")
- editor.putString("RID_HGX_X", "29.472")
- editor.putString("RID_HGX_Y", "95.079")
- editor.putString("RID_HTX_X", "34.931")
- editor.putString("RID_HTX_Y", "86.084")
- editor.putString("RID_IND_X", "39.708")
- editor.putString("RID_IND_Y", "86.28")
- editor.putString("RID_JKL_X", "37.591")
- editor.putString("RID_JKL_Y", "83.313")
- editor.putString("RID_JAX_X", "30.485")
- editor.putString("RID_JAX_Y", "81.702")
- editor.putString("RID_EAX_X", "38.81")
- editor.putString("RID_EAX_Y", "94.264")
- editor.putString("RID_BYX_X", "24.597")
- editor.putString("RID_BYX_Y", "81.703")
- editor.putString("RID_AKC_X", "58.68")
- editor.putString("RID_AKC_Y", "156.627")
- editor.putString("RID_MRX_X", "36.168")
- editor.putString("RID_MRX_Y", "83.402")
- editor.putString("RID_ARX_X", "43.823")
- editor.putString("RID_ARX_Y", "91.191")
- editor.putString("RID_LCH_X", "30.125")
- editor.putString("RID_LCH_Y", "93.216")
- editor.putString("RID_ESX_X", "35.701")
- editor.putString("RID_ESX_Y", "114.891")
- editor.putString("RID_DFX_X", "29.273")
- editor.putString("RID_DFX_Y", "100.28")
- editor.putString("RID_ILX_X", "40.15")
- editor.putString("RID_ILX_Y", "89.337")
- editor.putString("RID_LZK_X", "34.836")
- editor.putString("RID_LZK_Y", "92.262")
- editor.putString("RID_VTX_X", "34.412")
- editor.putString("RID_VTX_Y", "119.179")
- editor.putString("RID_LVX_X", "37.975")
- editor.putString("RID_LVX_Y", "85.944")
- editor.putString("RID_LBB_X", "33.654")
- editor.putString("RID_LBB_Y", "101.814")
- editor.putString("RID_MQT_X", "46.531") // 46.31
- editor.putString("RID_MQT_Y", "87.548") // 87.32
- editor.putString("RID_MXX_X", "32.537")
- editor.putString("RID_MXX_Y", "85.79")
- editor.putString("RID_MAX_X", "42.081")
- editor.putString("RID_MAX_Y", "122.717")
- editor.putString("RID_MLB_X", "28.113")
- editor.putString("RID_MLB_Y", "80.654")
- editor.putString("RID_NQA_X", "35.345")
- editor.putString("RID_NQA_Y", "89.873")
- editor.putString("RID_AMX_X", "25.611")
- editor.putString("RID_AMX_Y", "80.413")
- editor.putString("RID_AIH_X", "59.46")
- editor.putString("RID_AIH_Y", "146.303")
- editor.putString("RID_MAF_X", "31.943")
- editor.putString("RID_MAF_Y", "102.189")
- editor.putString("RID_MKX_X", "42.968")
- editor.putString("RID_MKX_Y", "88.551")
- editor.putString("RID_MPX_X", "44.849") // was .845
- editor.putString("RID_MPX_Y", "93.565") // was .560
- editor.putString("RID_MBX_X", "48.393")
- editor.putString("RID_MBX_Y", "100.864")
- editor.putString("RID_MSX_X", "47.041")
- editor.putString("RID_MSX_Y", "113.986")
- editor.putString("RID_MOB_X", "30.679")
- editor.putString("RID_MOB_Y", "88.24")
- editor.putString("RID_HMO_X", "21.133")
- editor.putString("RID_HMO_Y", "157.18")
- editor.putString("RID_VAX_X", "30.89")
- editor.putString("RID_VAX_Y", "83.002")
- editor.putString("RID_MHX_X", "34.776")
- editor.putString("RID_MHX_Y", "76.876")
- editor.putString("RID_OHX_X", "36.247")
- editor.putString("RID_OHX_Y", "86.563")
- editor.putString("RID_LIX_X", "30.337")
- editor.putString("RID_LIX_Y", "89.825")
- editor.putString("RID_OKX_X", "40.865")
- editor.putString("RID_OKX_Y", "72.864")
- editor.putString("RID_AEC_X", "64.512")
- editor.putString("RID_AEC_Y", "165.293")
- editor.putString("RID_AKQ_X", "36.984")
- editor.putString("RID_AKQ_Y", "77.008")
- editor.putString("RID_LNX_X", "41.958")
- editor.putString("RID_LNX_Y", "100.576")
- editor.putString("RID_TLX_X", "35.333")
- editor.putString("RID_TLX_Y", "97.278")
- editor.putString("RID_OAX_X", "41.32")
- editor.putString("RID_OAX_Y", "96.367")
- editor.putString("RID_PAH_X", "37.068")
- editor.putString("RID_PAH_Y", "88.772")
- editor.putString("RID_PDT_X", "45.691")
- editor.putString("RID_PDT_Y", "118.853")
- editor.putString("RID_DIX_X", "39.947")
- editor.putString("RID_DIX_Y", "74.411")
- editor.putString("RID_IWA_X", "33.289")
- editor.putString("RID_IWA_Y", "111.67")
- editor.putString("RID_PBZ_X", "40.532")
- editor.putString("RID_PBZ_Y", "80.218")
- editor.putString("RID_SFX_X", "43.106")
- editor.putString("RID_SFX_Y", "112.686")
- editor.putString("RID_GYX_X", "43.891")
- editor.putString("RID_GYX_Y", "70.256")
- editor.putString("RID_RTX_X", "45.715")
- editor.putString("RID_RTX_Y", "122.965")
- editor.putString("RID_PUX_X", "38.46")
- editor.putString("RID_PUX_Y", "104.181")
- editor.putString("RID_RAX_X", "35.665")
- editor.putString("RID_RAX_Y", "78.49")
- editor.putString("RID_UDX_X", "44.125")
- editor.putString("RID_UDX_Y", "102.83")
- editor.putString("RID_RGX_X", "39.754")
- editor.putString("RID_RGX_Y", "119.462")
- editor.putString("RID_RIW_X", "43.066")
- editor.putString("RID_RIW_Y", "108.477")
- editor.putString("RID_FCX_X", "37.024")
- editor.putString("RID_FCX_Y", "80.274")
- editor.putString("RID_JGX_X", "32.675")
- editor.putString("RID_JGX_Y", "83.351")
- editor.putString("RID_DAX_X", "38.501")
- editor.putString("RID_DAX_Y", "121.678")
- editor.putString("RID_LSX_X", "38.699")
- editor.putString("RID_LSX_Y", "90.683")
- editor.putString("RID_MTX_X", "41.263")
- editor.putString("RID_MTX_Y", "112.448")
- editor.putString("RID_SJT_X", "31.371")
- editor.putString("RID_SJT_Y", "100.492")
- editor.putString("RID_NKX_X", "32.919")
- editor.putString("RID_NKX_Y", "117.041")
- editor.putString("RID_MUX_X", "37.155")
- editor.putString("RID_MUX_Y", "121.898")
- editor.putString("RID_HNX_X", "36.314")
- editor.putString("RID_HNX_Y", "119.632")
- editor.putString("RID_JUA_X", "18.116")
- editor.putString("RID_JUA_Y", "66.078")
- editor.putString("RID_SOX_X", "33.818")
- editor.putString("RID_SOX_Y", "117.636")
- editor.putString("RID_ATX_X", "48.195")
- editor.putString("RID_ATX_Y", "122.496")
- editor.putString("RID_SHV_X", "32.451")
- editor.putString("RID_SHV_Y", "93.841")
- editor.putString("RID_FSD_X", "43.588")
- editor.putString("RID_FSD_Y", "96.729")
- editor.putString("RID_ACG_X", "56.853")
- editor.putString("RID_ACG_Y", "135.528")
- editor.putString("RID_HKI_X", "21.894")
- editor.putString("RID_HKI_Y", "159.552")
- editor.putString("RID_HWA_X", "19.095")
- editor.putString("RID_HWA_Y", "155.569")
- editor.putString("RID_OTX_X", "47.681")
- editor.putString("RID_OTX_Y", "117.626")
- editor.putString("RID_SGF_X", "37.235")
- editor.putString("RID_SGF_Y", "93.4")
- editor.putString("RID_CCX_X", "40.923")
- editor.putString("RID_CCX_Y", "78.004")
- editor.putString("RID_LWX_X", "38.976")
- editor.putString("RID_LWX_Y", "77.487")
- editor.putString("RID_TLH_X", "30.398") // orig 30.2351
- editor.putString("RID_TLH_Y", "84.329") // orig 84.1944
- editor.putString("RID_TBW_X", "27.705")
- editor.putString("RID_TBW_Y", "82.402")
- editor.putString("RID_TWX_X", "38.997")
- editor.putString("RID_TWX_Y", "96.232")
- editor.putString("RID_EMX_X", "31.894")
- editor.putString("RID_EMX_Y", "110.63")
- editor.putString("RID_INX_X", "36.175") // "36.171"
- editor.putString("RID_INX_Y", "95.564") // "95.560"
- editor.putString("RID_VNX_X", "36.741")
- editor.putString("RID_VNX_Y", "98.128")
- editor.putString("RID_VBX_X", "34.839")
- editor.putString("RID_VBX_Y", "120.398")
- editor.putString("RID_ICT_X", "37.654")
- editor.putString("RID_ICT_Y", "97.443")
- editor.putString("RID_LTX_X", "33.989")
- editor.putString("RID_LTX_Y", "78.429")
- editor.putString("RID_YUX_X", "32.495")
- editor.putString("RID_YUX_Y", "114.656")
- editor.putString("RID_LGX_X", "47.116")
- editor.putString("RID_LGX_Y", "124.107")
- editor.putString("RID_DGX_X", "32.28")
- editor.putString("RID_DGX_Y", "89.984")
- editor.putString("RID_VWX_X", "38.26")
- editor.putString("RID_VWX_Y", "87.724")
- editor.putString("RID_HKM_X", "20.125")
- editor.putString("RID_HKM_Y", "155.778")
- editor.apply()
- }
- }
-
-
- fun prefInitRIDXY2(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("RID_TATL_Y", null)
- if (value == null) {
- editor.putString("RID_aug12_4_X", "aug112014") // nws conus
- editor.putString("RID_latest_X", "36.105") // nws conus
- editor.putString("RID_latest_Y", "97.141")
- editor.putString("RID_centgrtlakes_X", "42.127")
- editor.putString("RID_centgrtlakes_Y", "84.544")
- editor.putString("RID_uppermissvly_X", "42.75")
- editor.putString("RID_uppermissvly_Y", "97.10")
- editor.putString("RID_northrockies_X", "42.75")
- editor.putString("RID_northrockies_Y", "108.60")
- editor.putString("RID_northeast_X", "42.425")
- editor.putString("RID_northeast_Y", "74.10")
- editor.putString("RID_pacnorthwest_X", "42.425")
- editor.putString("RID_pacnorthwest_Y", "120.10")
- editor.putString("RID_pacsouthwest_X", "35.15")
- editor.putString("RID_pacsouthwest_Y", "120.15")
- editor.putString("RID_southrockies_X", "32.5")
- editor.putString("RID_southrockies_Y", "110.50")
- editor.putString("RID_southplains_X", "31.6")
- editor.putString("RID_southplains_Y", "100.00")
- editor.putString("RID_southmissvly_X", "31.6")
- editor.putString("RID_southmissvly_Y", "90.00")
- editor.putString("RID_southeast_X", "29.86")
- editor.putString("RID_southeast_Y", "82.658")
- editor.putString("RID_hawaii_X", "19.91")
- editor.putString("RID_hawaii_Y", "157.55")
- editor.putString("RID_iowa_conus_mosaic_X", "37.00")
- editor.putString("RID_iowa_conus_mosaic_Y", "96.00")
- editor.putString("RID_iowa_mosaic_USCOMP_X", "37.00")
- editor.putString("RID_iowa_mosaic_USCOMP_Y", "96.00")
- editor.putString("RID_iowa_mosaic_AKCOMP_X", "60.77") // original scale factor is 100
- editor.putString("RID_iowa_mosaic_AKCOMP_Y", "150.36")
- editor.putString("RID_iowa_mosaic_HICOMP_X", "19.928") // original scale factor is 200
- editor.putString("RID_iowa_mosaic_HICOMP_Y", "156.94")
- editor.putString("RID_iowa_mosaic_PRCOMP_X", "18.205")
- editor.putString("RID_iowa_mosaic_PRCOMP_Y", "66.158")
- editor.putString("RID_TDTW_X", "42.11111") // Detroit (DTW), MI TDTW DTX 772
- editor.putString("RID_TDTW_Y", "83.515")
- editor.putString("RID_TADW_X", "5") // Andrews Air Force Base (ADW), MD TADW LWX 346
- editor.putString("RID_TADW_Y", "5")
- editor.putString("RID_TATL_X", "33.646193") // Atlanta (ATL), GA TATL FFC 1,075
- editor.putString("RID_TATL_Y", "84.262233")
- editor.putString("RID_TBNA_X", "35.979079") // Nashville (BNA), TN TBNA OHX 817
- editor.putString("RID_TBNA_Y", "86.661691")
- editor.putString("RID_TBOS_X", "42.15806") // Boston (BOS), MA TBOS BOX 264
- editor.putString("RID_TBOS_Y", "70.93389")
- editor.putString("RID_TBWI_X", "39.09056") // Baltimore/Wash (BWI), MD TBWI LWX 342
- editor.putString("RID_TBWI_Y", "76.63")
- editor.putString("RID_TLVE_X", "41.289372") // Cleveland (CLE), OH TLVE CLE 931
- editor.putString("RID_TLVE_Y", "82.007419")
- editor.putString("RID_TCLT_X", "35.337269") // Charlotte (CLT), NC TCLT GSP 871
- editor.putString("RID_TCLT_Y", "80.885006")
- editor.putString("RID_TCMH_X", "40.00611") // Columbus (CMH), OH TCMH ILN 1,148
- editor.putString("RID_TCMH_Y", "82.71556")
- editor.putString("RID_TCVG_X", "38.89778") // Covington (CVG), OH TCVG ILN 1,053
- editor.putString("RID_TCVG_Y", "84.58028")
- editor.putString("RID_TDAL_X", "32.92494") // Dallas Love Field (DAL), TX TDAL FWD 622
- editor.putString("RID_TDAL_Y", "96.968473")
- editor.putString("RID_TDAY_X", "40.021376") // Dayton (DAY), OH TDAY ILN 1,019
- editor.putString("RID_TDAY_Y", "84.123077")
- editor.putString("RID_TDCA_X", "38.758853") // Washington National (DCA), MD TDCA LWX 345
- editor.putString("RID_TDCA_Y", "76.961837")
- editor.putString("RID_TDEN_X", "39.72722") // Denver (DEN), CO TDEN BOU 5,701
- editor.putString("RID_TDEN_Y", "104.52639")
- editor.putString("RID_TDFW_X", "33.064286") // Dallas/Ft. Worth (DFW), TX TDFW FWD 585
- editor.putString("RID_TDFW_Y", "96.915554")
- editor.putString("RID_TEWR_X", "40.593397") // Newark (EWR), NJ TEWR OKX 136
- editor.putString("RID_TEWR_Y", "74.270164")
- editor.putString("RID_TFLL_X", "26.142601") // Fort Lauderdale (FLL), FL TFLL MFL 120
- editor.putString("RID_TFLL_Y", "80.34382")
- editor.putString("RID_THOU_X", "29.515852") // Houston Hobby (HOU), TX THOU HGX 116
- editor.putString("RID_THOU_Y", "95.241692")
- editor.putString("RID_TIAD_X", "39.083667") // Dulles (IAD), VA TIAD LWX 473
- editor.putString("RID_TIAD_Y", "77.529224")
- editor.putString("RID_TIAH_X", "30.06472") // Houston International (IAH), TX TIAH HGX 253
- editor.putString("RID_TIAH_Y", "95.5675")
- editor.putString("RID_TICT_X", "37.506844") // Wichita (ICT), KS TICH ICT 1,350
- editor.putString("RID_TICT_Y", "97.437228")
- editor.putString("RID_TIDS_X", "39.636556") // Indianapolis (IND), IN TIDS IND 847
- editor.putString("RID_TIDS_Y", "86.435286")
- editor.putString("RID_TJFK_X", "40.588633") // New York City (JFK), NY TJFK OKX 112
- editor.putString("RID_TJFK_Y", "73.880303") // NY FLOYD BENNETT FIELD 40.588633, -73.880303 5647
- editor.putString("RID_TLAS_X", "36.144") // Las Vegas (LAS), NV TLAS VEF 2,058
- editor.putString("RID_TLAS_Y", "115.007")
- editor.putString("RID_TMCI_X", "39.49861") // Kansas City (MCI), MO TMCI EAX 1,090
- editor.putString("RID_TMCI_Y", "94.74167")
- editor.putString("RID_TMCO_X", "28.343125") // Orlando International (MCO), FL TMCO MLB 169
- editor.putString("RID_TMCO_Y", "81.324674")
- editor.putString("RID_TMDW_X", "41.6514") // Chicago Midway (MDW), IL TMDW LOT 763
- editor.putString("RID_TMDW_Y", "87.7294")
- editor.putString("RID_TMEM_X", "34.896044") // Memphis (MEM), TN TMEM MEG 483
- editor.putString("RID_TMEM_Y", "89.992727")
- editor.putString("RID_TMIA_X", "25.757083") // Miami (MIA), FL TMIA MFL 125
- editor.putString("RID_TMIA_Y", "80.491076")
- editor.putString("RID_TMKE_X", "42.81944") // Milwaukee (MKE), WI TMKE MKX 933
- editor.putString("RID_TMKE_Y", "88.04611")
- editor.putString("RID_TMSP_X", "44.870902") // Minneapolis (MSP), MN TMSP MPX 1,120
- editor.putString("RID_TMSP_Y", "92.932257")
- editor.putString("RID_TMSY_X", "30.021389") // New Orleans (MSY), LA TMSY LIX 99
- editor.putString("RID_TMSY_Y", "90.402919")
- editor.putString("RID_TOKC_X", "35.27611") // Oklahoma City (OKC), OK TOKC OUN 1,308
- editor.putString("RID_TOKC_Y", "97.51")
- editor.putString("RID_TORD_X", "41.796589") // Chicago O'Hare (ORD), IL TORD LOT 744
- editor.putString("RID_TORD_Y", "87.857628")
- editor.putString("RID_TPBI_X", "26.687812") // West Palm Beach (PBI), FL TPBI MFL 133
- editor.putString("RID_TPBI_Y", "80.272931")
- editor.putString("RID_TPHL_X", "39.950061") // Philadelphia (PHL), PA TPHL PHI 153
- editor.putString("RID_TPHL_Y", "75.069979")
- editor.putString("RID_TPHX_X", "33.420352") // Phoenix (PHX), AZ TPHX PSR 1,089
- editor.putString("RID_TPHX_Y", "112.16318")
- editor.putString("RID_TPIT_X", "40.501066") // Pittsburgh (PIT), PA TPIT PBZ 1,386
- editor.putString("RID_TPIT_Y", "80.486586")
- editor.putString("RID_TRDU_X", "36.001401") // Raleigh Durham (RDU), NC TRDU RAH 515
- editor.putString("RID_TRDU_Y", "78.697942")
- editor.putString("RID_TSDF_X", "38.04581") // Louisville (SDF), KY TSDF LMK 731
- editor.putString("RID_TSDF_Y", "85.610641")
- editor.putString("RID_TSJU_X", "18.47394") // San Juan (SJU), PR TSJU SJU 157
- editor.putString("RID_TSJU_Y", "66.17891")
- editor.putString("RID_TSLC_X", "40.967222") // Salt Lake City (SLC), UT TSLC SLC 4,295
- editor.putString("RID_TSLC_Y", "111.929722")
- editor.putString("RID_TSTL_X", "38.804691") // St Louis (STL), MO TSTL LSX 647
- editor.putString("RID_TSTL_Y", "90.488558")
- editor.putString("RID_TTPA_X", "27.85867") // Tampa Bay (TPA), FL TTPA TBW 93
- editor.putString("RID_TTPA_Y", "82.51755")
- editor.putString("RID_TTUL_X", "36.070184") // Tulsa (TUL), OK TTUL TSA 823
- editor.putString("RID_TTUL_Y", "95.826313")
- editor.apply()
- }
- }
-}
-
-
-
diff --git a/app/src/main/java/joshuatee/wx/settings/UtilityPref3.kt b/app/src/main/java/joshuatee/wx/settings/UtilityPref3.kt
deleted file mode 100644
index 9dcfb680..00000000
--- a/app/src/main/java/joshuatee/wx/settings/UtilityPref3.kt
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
-
- Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 joshua.tee@gmail.com
-
- This file is part of wX.
-
- wX is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- wX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with wX. If not, see .
-
- */
-
-package joshuatee.wx.settings
-
-import android.content.Context
-import androidx.preference.PreferenceManager
-
-object UtilityPref3 {
-
- fun prefInitRIDLoc(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("RID_LOC_TLVE", null)
- if (value == null) {
- editor.putString("RID_LOC_iowa_mosaic_AKCOMP", "AK, ")
- editor.putString("RID_LOC_iowa_mosaic_PRCOMP", "PR, ")
- editor.putString("RID_LOC_iowa_mosaic_HICOMP", "HI, ")
- editor.putString("RID_LOC_iowa_mosaic_USCOMP", "CONUS, ")
- editor.putString("RID_LOC_alaska", "AK, ")
- editor.putString("RID_LOC_NATAK", "AK, ")
- editor.putString("RID_LOC_hawaii", "HI, ")
- editor.putString("RID_LOC_NATPR", "HI, ")
- editor.putString("RID_LOC_pacsouthwest", "pacsouthwest, ")
- editor.putString("RID_LOC_pacnorthwest", "pacnorthwest, ")
- editor.putString("RID_LOC_southrockies", "southrockies, ")
- editor.putString("RID_LOC_northrockies", "northrockies, ")
- editor.putString("RID_LOC_southplains", "southplains, ")
- editor.putString("RID_LOC_centgrtlakes", "centgrtlakes, ")
- editor.putString("RID_LOC_southmissvly", "southmissvly, ")
- editor.putString("RID_LOC_uppermissvly", "uppermissvly, ")
- editor.putString("RID_LOC_southeast", "southeast, ")
- editor.putString("RID_LOC_southeast", "southeast, ")
- editor.putString("RID_LOC_conus", "CONUS, ")
- editor.putString("RID_LOC_latest", "CONUS, ")
- editor.putString("RID_LOC_NAT", "CONUS, ")
- editor.putString("RID_LOC_TLVE", "OH, Cleveland")
- editor.putString("RID_LOC_TADW", "MD, Andrews Air Force Base")
- editor.putString("RID_LOC_TATL", "GA, Atlanta")
- editor.putString("RID_LOC_TBWI", "MD, Baltimore/Wash")
- editor.putString("RID_LOC_TBOS", "MA, Boston")
- editor.putString("RID_LOC_TCLT", "NC, Charlotte")
- editor.putString("RID_LOC_TMDW", "IL, Chicago Midway")
- editor.putString("RID_LOC_TORD", "IL, Chicago O'Hare")
- editor.putString("RID_LOC_TCLE", "OH, Cleveland")
- editor.putString("RID_LOC_TCMH", "OH, Columbus")
- editor.putString("RID_LOC_TCVG", "OH, Covington")
- editor.putString("RID_LOC_TDAL", "TX, Dallas Love Field")
- editor.putString("RID_LOC_TDFW", "TX, Dallas/Ft. Worth")
- editor.putString("RID_LOC_TDAY", "OH, Dayton")
- editor.putString("RID_LOC_TDEN", "CO, Denver")
- editor.putString("RID_LOC_TDTW", "MI, Detroit")
- editor.putString("RID_LOC_TIAD", "VA, Dulles")
- editor.putString("RID_LOC_TFLL", "FL, Fort Lauderdale")
- editor.putString("RID_LOC_THOU", "TX, Houston Hobby")
- editor.putString("RID_LOC_TIAH", "TX, Houston International")
- editor.putString("RID_LOC_TIDS", "IN, Indianapolis") // was IDS
- editor.putString("RID_LOC_TMCI", "MO, Kansas City")
- editor.putString("RID_LOC_TLAS", "NV, Las Vegas")
- editor.putString("RID_LOC_TSDF", "KY, Louisville")
- editor.putString("RID_LOC_TMEM", "TN, Memphis")
- editor.putString("RID_LOC_TMIA", "FL, Miami")
- editor.putString("RID_LOC_TMKE", "WI, Milwaukee")
- editor.putString("RID_LOC_TMSP", "MN, Minneapolis")
- editor.putString("RID_LOC_TBNA", "TN, Nashville")
- editor.putString("RID_LOC_TMSY", "LA, New Orleans")
- editor.putString("RID_LOC_TJFK", "NY, New York City")
- editor.putString("RID_LOC_TEWR", "NJ, Newark")
- editor.putString("RID_LOC_TOKC", "OK, Oklahoma City")
- editor.putString("RID_LOC_TMCO", "FL, Orlando International")
- editor.putString("RID_LOC_TPHL", "PA, Philadelphia")
- editor.putString("RID_LOC_TPHX", "AZ, Phoenix")
- editor.putString("RID_LOC_TPIT", "PA, Pittsburgh")
- editor.putString("RID_LOC_TRDU", "NC, Raleigh Durham")
- editor.putString("RID_LOC_TSLC", "UT, Salt Lake City")
- editor.putString("RID_LOC_TSJU", "PR, San Juan")
- editor.putString("RID_LOC_TSTL", "MO, St Louis")
- editor.putString("RID_LOC_TTPA", "FL, Tampa Bay")
- editor.putString("RID_LOC_TTUL", "OK, Tulsa")
- editor.putString("RID_LOC_TDCA", "MD, Washington National")
- editor.putString("RID_LOC_TPBI", "FL, West Palm Beach")
- editor.putString("RID_LOC_TICT", "KS, Wichita")
- editor.putString("RID_LOC_JUA", "PR, San Juan")
- editor.putString("RID_LOC_CBW", "ME, Loring AFB")
- editor.putString("RID_LOC_GYX", "ME, Portland")
- editor.putString("RID_LOC_CXX", "VT, Burlington")
- editor.putString("RID_LOC_BOX", "MA, Boston")
- editor.putString("RID_LOC_ENX", "NY, Albany")
- editor.putString("RID_LOC_BGM", "NY, Binghamton")
- editor.putString("RID_LOC_BUF", "NY, Buffalo")
- editor.putString("RID_LOC_TYX", "NY, Montague")
- editor.putString("RID_LOC_OKX", "NY, New York City")
- editor.putString("RID_LOC_DOX", "DE, Dover AFB")
- editor.putString("RID_LOC_DIX", "PA, Philadelphia")
- editor.putString("RID_LOC_PBZ", "PA, Pittsburgh")
- editor.putString("RID_LOC_CCX", "PA, State College")
- editor.putString("RID_LOC_RLX", "WV, Charleston")
- editor.putString("RID_LOC_AKQ", "VA, Norfolk/Richmond")
- editor.putString("RID_LOC_FCX", "VA, Roanoke")
- editor.putString("RID_LOC_LWX", "VA, Sterling")
- editor.putString("RID_LOC_MHX", "NC, Morehead City")
- editor.putString("RID_LOC_RAX", "NC, Raleigh/Durham")
- editor.putString("RID_LOC_LTX", "NC, Wilmington")
- editor.putString("RID_LOC_CLX", "SC, Charleston")
- editor.putString("RID_LOC_CAE", "SC, Columbia")
- editor.putString("RID_LOC_GSP", "SC, Greer")
- editor.putString("RID_LOC_FFC", "GA, Atlanta")
- editor.putString("RID_LOC_VAX", "GA, Moody AFB")
- editor.putString("RID_LOC_JGX", "GA, Robins AFB")
- editor.putString("RID_LOC_EVX", "FL, Eglin AFB")
- editor.putString("RID_LOC_JAX", "FL, Jacksonville")
- editor.putString("RID_LOC_BYX", "FL, Key West")
- editor.putString("RID_LOC_MLB", "FL, Melbourne")
- editor.putString("RID_LOC_AMX", "FL, Miami")
- editor.putString("RID_LOC_TLH", "FL, Tallahassee")
- editor.putString("RID_LOC_TBW", "FL, Tampa")
- editor.putString("RID_LOC_BMX", "AL, Birmingham")
- editor.putString("RID_LOC_EOX", "AL, Fort Rucker")
- editor.putString("RID_LOC_HTX", "AL, Huntsville")
- editor.putString("RID_LOC_MXX", "AL, Maxwell AFB")
- editor.putString("RID_LOC_MOB", "AL, Mobile")
- editor.putString("RID_LOC_DGX", "MS, Brandon/Jackson")
- editor.putString("RID_LOC_GWX", "MS, Columbus AFB")
- editor.putString("RID_LOC_MRX", "TN, Knoxville/Tri Cities")
- editor.putString("RID_LOC_NQA", "TN, Memphis")
- editor.putString("RID_LOC_OHX", "TN, Nashville")
- editor.putString("RID_LOC_HPX", "KY, Fort Campbell")
- editor.putString("RID_LOC_JKL", "KY, Jackson")
- editor.putString("RID_LOC_LVX", "KY, Louisville")
- editor.putString("RID_LOC_PAH", "KY, Paducah")
- editor.putString("RID_LOC_ILN", "OH, Wilmington")
- editor.putString("RID_LOC_CLE", "OH, Cleveland")
- editor.putString("RID_LOC_DTX", "MI, Detroit/Pontiac")
- editor.putString("RID_LOC_APX", "MI, Gaylord")
- editor.putString("RID_LOC_GRR", "MI, Grand Rapids")
- editor.putString("RID_LOC_MQT", "MI, Marquette")
- editor.putString("RID_LOC_VWX", "IN, Evansville")
- editor.putString("RID_LOC_IND", "IN, Indianapolis")
- editor.putString("RID_LOC_IWX", "IN, North Webster")
- editor.putString("RID_LOC_LOT", "IL, Chicago")
- editor.putString("RID_LOC_ILX", "IL, Lincoln")
- editor.putString("RID_LOC_GRB", "WI, Green Bay")
- editor.putString("RID_LOC_ARX", "WI, La Crosse")
- editor.putString("RID_LOC_MKX", "WI, Milwaukee")
- editor.putString("RID_LOC_DLH", "MN, Duluth")
- editor.putString("RID_LOC_MPX", "MN, Minneapolis/St. Paul")
- editor.putString("RID_LOC_DVN", "IA, Davenport")
- editor.putString("RID_LOC_DMX", "IA, Des Moines")
- editor.putString("RID_LOC_EAX", "MO, Kansas City")
- editor.putString("RID_LOC_SGF", "MO, Springfield")
- editor.putString("RID_LOC_LSX", "MO, St. Louis")
- editor.putString("RID_LOC_SRX", "AR, Fort Smith")
- editor.putString("RID_LOC_LZK", "AR, Little Rock")
- editor.putString("RID_LOC_POE", "LA, Fort Polk")
- editor.putString("RID_LOC_LCH", "LA, Lake Charles")
- editor.putString("RID_LOC_LIX", "LA, New Orleans")
- editor.putString("RID_LOC_SHV", "LA, Shreveport")
- editor.putString("RID_LOC_AMA", "TX, Amarillo")
- editor.putString("RID_LOC_EWX", "TX, Austin/San Antonio")
- editor.putString("RID_LOC_BRO", "TX, Brownsville")
- editor.putString("RID_LOC_CRP", "TX, Corpus Christi")
- editor.putString("RID_LOC_FWS", "TX, Dallas/Ft. Worth")
- editor.putString("RID_LOC_DYX", "TX, Dyess AFB")
- editor.putString("RID_LOC_EPZ", "TX, El Paso")
- editor.putString("RID_LOC_GRK", "TX, Fort Hood")
- editor.putString("RID_LOC_HGX", "TX, Houston/Galveston")
- editor.putString("RID_LOC_DFX", "TX, Laughlin AFB")
- editor.putString("RID_LOC_LBB", "TX, Lubbock")
- editor.putString("RID_LOC_MAF", "TX, Midland/Odessa")
- editor.putString("RID_LOC_SJT", "TX, San Angelo")
- editor.putString("RID_LOC_FDR", "OK, Frederick")
- editor.putString("RID_LOC_TLX", "OK, Oklahoma City")
- editor.putString("RID_LOC_INX", "OK, Tulsa")
- editor.putString("RID_LOC_VNX", "OK, Vance AFB")
- editor.putString("RID_LOC_DDC", "KS, Dodge City")
- editor.putString("RID_LOC_GLD", "KS, Goodland")
- editor.putString("RID_LOC_TWX", "KS, Topeka")
- editor.putString("RID_LOC_ICT", "KS, Wichita")
- editor.putString("RID_LOC_UEX", "NE, Grand Island/Hastings")
- editor.putString("RID_LOC_LNX", "NE, North Platte")
- editor.putString("RID_LOC_OAX", "NE, Omaha")
- editor.putString("RID_LOC_ABR", "SD, Aberdeen")
- editor.putString("RID_LOC_UDX", "SD, Rapid City")
- editor.putString("RID_LOC_FSD", "SD, Sioux Falls")
- editor.putString("RID_LOC_BIS", "ND, Bismarck")
- editor.putString("RID_LOC_MVX", "ND, Grand Forks (Mayville)")
- editor.putString("RID_LOC_MBX", "ND, Minot AFB")
- editor.putString("RID_LOC_BLX", "MT, Billings")
- editor.putString("RID_LOC_GGW", "MT, Glasgow")
- editor.putString("RID_LOC_TFX", "MT, Great Falls")
- editor.putString("RID_LOC_MSX", "MT, Missoula")
- editor.putString("RID_LOC_CYS", "WY, Cheyenne")
- editor.putString("RID_LOC_RIW", "WY, Riverton")
- editor.putString("RID_LOC_FTG", "CO, Denver")
- editor.putString("RID_LOC_GJX", "CO, Grand Junction")
- editor.putString("RID_LOC_PUX", "CO, Pueblo")
- editor.putString("RID_LOC_ABX", "NM, Albuquerque")
- editor.putString("RID_LOC_FDX", "NM, Cannon AFB")
- editor.putString("RID_LOC_HDX", "NM, Holloman AFB")
- editor.putString("RID_LOC_FSX", "AZ, Flagstaff")
- editor.putString("RID_LOC_IWA", "AZ, Phoenix")
- editor.putString("RID_LOC_EMX", "AZ, Tucson")
- editor.putString("RID_LOC_YUX", "AZ, Yuma")
- editor.putString("RID_LOC_ICX", "UT, Cedar City")
- editor.putString("RID_LOC_MTX", "UT, Salt Lake City")
- editor.putString("RID_LOC_CBX", "ID, Boise")
- editor.putString("RID_LOC_SFX", "ID, Pocatello/Idaho Falls")
- editor.putString("RID_LOC_LRX", "NV, Elko")
- editor.putString("RID_LOC_ESX", "NV, Las Vegas")
- editor.putString("RID_LOC_RGX", "NV, Reno")
- editor.putString("RID_LOC_BBX", "CA, Beale AFB")
- editor.putString("RID_LOC_EYX", "CA, Edwards AFB")
- editor.putString("RID_LOC_BHX", "CA, Eureka")
- editor.putString("RID_LOC_VTX", "CA, Los Angeles")
- editor.putString("RID_LOC_DAX", "CA, Sacramento")
- editor.putString("RID_LOC_NKX", "CA, San Diego")
- editor.putString("RID_LOC_MUX", "CA, San Francisco")
- editor.putString("RID_LOC_HNX", "CA, San Joaquin Valley")
- editor.putString("RID_LOC_SOX", "CA, Santa Ana Mountains")
- editor.putString("RID_LOC_VBX", "CA, Vandenberg AFB")
- editor.putString("RID_LOC_HKI", "HI, Kauai")
- editor.putString("RID_LOC_HKM", "HI, Kohala")
- editor.putString("RID_LOC_HMO", "HI, Molokai")
- editor.putString("RID_LOC_HWA", "HI, South Shore")
- editor.putString("RID_LOC_MAX", "OR, Medford")
- editor.putString("RID_LOC_PDT", "OR, Pendleton")
- editor.putString("RID_LOC_RTX", "OR, Portland")
- editor.putString("RID_LOC_LGX", "WA, Langley Hill")
- editor.putString("RID_LOC_ATX", "WA, Seattle/Tacoma")
- editor.putString("RID_LOC_OTX", "WA, Spokane")
- editor.putString("RID_LOC_ABC", "AK, Bethel")
- editor.putString("RID_LOC_APD", "AK, Fairbanks/Pedro Dome")
- editor.putString("RID_LOC_AHG", "AK, Kenai")
- editor.putString("RID_LOC_AKC", "AK, King Salmon")
- editor.putString("RID_LOC_AIH", "AK, Middleton Island")
- editor.putString("RID_LOC_AEC", "AK, Nome")
- editor.putString("RID_LOC_ACG", "AK, Sitka/Biorka Island")
- editor.putString("RID_LOC_GUA", "GU, Andersen AFB")
- editor.putString("RID_LOC_PLA", "NA, Lajes Field, Azores")
- editor.putString("RID_LOC_KJK", "NA, Kunsan Air Base, South Korea")
- editor.putString("RID_LOC_KSG", "NA, Camp Humphreys, South Korea")
- editor.putString("RID_LOC_ODN", "NA, Kadena Air Base, Japan")
- editor.apply()
- }
- }
-}
diff --git a/app/src/main/java/joshuatee/wx/settings/UtilityPref4.kt b/app/src/main/java/joshuatee/wx/settings/UtilityPref4.kt
deleted file mode 100644
index 17477466..00000000
--- a/app/src/main/java/joshuatee/wx/settings/UtilityPref4.kt
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
-
- Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 joshua.tee@gmail.com
-
- This file is part of wX.
-
- wX is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- wX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with wX. If not, see .
-
- */
-
-package joshuatee.wx.settings
-
-import android.content.Context
-import androidx.preference.PreferenceManager
-
-object UtilityPref4 {
-
- fun prefInitSoundingSitesLoc(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("SND_LIX_X", null)
- if (value == null) {
- // thanks http://web.stcloudstate.edu/raweisman/courses/upperair.txt
- // http://www.esrl.noaa.gov/raobs/intl/intl2000.wmo
- editor.putString("SND_1Y7_X", "32.87")
- editor.putString("SND_1Y7_Y", "114.40")
- editor.putString("SND_76405_X", "24.07")
- editor.putString("SND_76405_Y", "110.33")
- editor.putString("SND_76458_X", "23.18")
- editor.putString("SND_76458_Y", "106.42")
- editor.putString("SND_VBG_X", "34.72")
- editor.putString("SND_VBG_Y", "120.57")
- editor.putString("SND_ABR_X", "45.45")
- editor.putString("SND_ABR_Y", "98.41")
- editor.putString("SND_ALB_X", "42.75")
- editor.putString("SND_ALB_Y", "73.80")
- editor.putString("SND_ABQ_X", "35.03")
- editor.putString("SND_ABQ_Y", "106.62")
- editor.putString("SND_AMA_X", "35.23")
- editor.putString("SND_AMA_Y", "101.70")
- editor.putString("SND_BIS_X", "46.77")
- editor.putString("SND_BIS_Y", "100.75")
- editor.putString("SND_RNK_X", "37.21")
- editor.putString("SND_RNK_Y", "80.41")
- editor.putString("SND_BOI_X", "43.57")
- editor.putString("SND_BOI_Y", "116.22")
- editor.putString("SND_BRO_X", "25.90")
- editor.putString("SND_BRO_Y", "97.43")
- editor.putString("SND_BUF_X", "42.93")
- editor.putString("SND_BUF_Y", "78.73")
- editor.putString("SND_CAR_X", "46.87")
- editor.putString("SND_CAR_Y", "68.02")
- editor.putString("SND_ILX_X", "40.10")
- editor.putString("SND_ILX_Y", "89.30")
- editor.putString("SND_CHS_X", "32.90")
- editor.putString("SND_CHS_Y", "80.03")
- editor.putString("SND_MPX_X", "44.85")
- editor.putString("SND_MPX_Y", "93.57")
- editor.putString("SND_CHH_X", "41.67")
- editor.putString("SND_CHH_Y", "69.97")
- editor.putString("SND_CRP_X", "27.77")
- editor.putString("SND_CRP_Y", "97.50")
- editor.putString("SND_DRT_X", "29.37")
- editor.putString("SND_DRT_Y", "100.92")
- editor.putString("SND_DRA_X", "36.62")
- editor.putString("SND_DRA_Y", "116.02")
- editor.putString("SND_DNR_X", "39.75")
- editor.putString("SND_DNR_Y", "104.87")
- editor.putString("SND_DDC_X", "37.77")
- editor.putString("SND_DDC_Y", "99.97")
- editor.putString("SND_LKN_X", "40.87")
- editor.putString("SND_LKN_Y", "115.73")
- editor.putString("SND_EPZ_X", "31.90")
- editor.putString("SND_EPZ_Y", "106.70")
- editor.putString("SND_FLG_X", "35.23")
- editor.putString("SND_FLG_Y", "111.82")
- editor.putString("SND_FWD_X", "32.80")
- editor.putString("SND_FWD_Y", "97.30")
- editor.putString("SND_APX_X", "44.90")
- editor.putString("SND_APX_Y", "84.72")
- editor.putString("SND_GGW_X", "48.21")
- editor.putString("SND_GGW_Y", "106.63")
- editor.putString("SND_GJT_X", "39.12")
- editor.putString("SND_GJT_Y", "108.53")
- editor.putString("SND_GYX_X", "43.89")
- editor.putString("SND_GYX_Y", "70.25")
- editor.putString("SND_TFX_X", "47.45")
- editor.putString("SND_TFX_Y", "111.38")
- editor.putString("SND_GRB_X", "44.48")
- editor.putString("SND_GRB_Y", "88.13")
- editor.putString("SND_GSO_X", "36.08")
- editor.putString("SND_GSO_Y", "79.95")
- editor.putString("SND_INL_X", "48.57")
- editor.putString("SND_INL_Y", "93.38")
- editor.putString("SND_JAN_X", "32.32")
- editor.putString("SND_JAN_Y", "90.08")
- editor.putString("SND_JAX_X", "30.43")
- editor.putString("SND_JAX_Y", "81.61")
- editor.putString("SND_EYW_X", "24.55")
- editor.putString("SND_EYW_Y", "81.75")
- editor.putString("SND_LCH_X", "30.12")
- editor.putString("SND_LCH_Y", "93.22")
- editor.putString("SND_LZK_X", "34.83")
- editor.putString("SND_LZK_Y", "92.25")
- editor.putString("SND_MFR_X", "42.37")
- editor.putString("SND_MFR_Y", "122.87")
- editor.putString("SND_MFX_X", "25.80")
- editor.putString("SND_MFX_Y", "80.38")
- editor.putString("SND_MAF_X", "31.95")
- editor.putString("SND_MAF_Y", "102.18")
- editor.putString("SND_BNA_X", "36.12")
- editor.putString("SND_BNA_Y", "86.68")
- editor.putString("SND_MHX_X", "34.70")
- editor.putString("SND_MHX_Y", "76.80")
- editor.putString("SND_OUN_X", "35.23")
- editor.putString("SND_OUN_Y", "97.47")
- editor.putString("SND_LBF_X", "41.13")
- editor.putString("SND_LBF_Y", "100.68")
- editor.putString("SND_OAK_X", "37.73")
- editor.putString("SND_OAK_Y", "122.22")
- editor.putString("SND_FFC_X", "33.36")
- editor.putString("SND_FFC_Y", "84.56")
- editor.putString("SND_PIT_X", "40.50")
- editor.putString("SND_PIT_Y", "80.22")
- editor.putString("SND_DVN_X", "41.60")
- editor.putString("SND_DVN_Y", "90.60")
- editor.putString("SND_UIL_X", "47.95")
- editor.putString("SND_UIL_Y", "124.55")
- editor.putString("SND_UNR_X", "44.07")
- editor.putString("SND_UNR_Y", "103.21")
- editor.putString("SND_REV_X", "39.57")
- editor.putString("SND_REV_Y", "119.80")
- editor.putString("SND_RIW_X", "43.00")
- editor.putString("SND_RIW_Y", "108.50")
- editor.putString("SND_SLE_X", "44.92")
- editor.putString("SND_SLE_Y", "123.00")
- editor.putString("SND_SLC_X", "40.78")
- editor.putString("SND_SLC_Y", "111.97")
- editor.putString("SND_NKX_X", "32.73")
- editor.putString("SND_NKX_Y", "117.17")
- editor.putString("SND_BMX_X", "33.17")
- editor.putString("SND_BMX_Y", "86.77")
- editor.putString("SND_SHV_X", "32.45")
- editor.putString("SND_SHV_Y", "93.83")
- editor.putString("SND_SIL_X", "30.25")
- editor.putString("SND_SIL_Y", "89.77")
- editor.putString("SND_OTX_X", "47.68")
- editor.putString("SND_OTX_Y", "117.63")
- editor.putString("SND_SGF_X", "37.14")
- editor.putString("SND_SGF_Y", "93.23")
- editor.putString("SND_LWX_X", "38.98")
- editor.putString("SND_LWX_Y", "77.47")
- editor.putString("SND_NJM_X", "34.69")
- editor.putString("SND_NJM_Y", "77.03")
- editor.putString("SND_TLH_X", "30.56")
- editor.putString("SND_TLH_Y", "84.45")
- editor.putString("SND_TBW_X", "27.70")
- editor.putString("SND_TBW_Y", "82.40")
- editor.putString("SND_TOP_X", "39.07")
- editor.putString("SND_TOP_Y", "95.62")
- editor.putString("SND_TUS_X", "32.12")
- editor.putString("SND_TUS_Y", "110.93")
- editor.putString("SND_OKX_X", "40.86")
- editor.putString("SND_OKX_Y", "72.86")
- editor.putString("SND_OAX_X", "41.32")
- editor.putString("SND_OAX_Y", "96.37")
- editor.putString("SND_WAL_X", "37.85")
- editor.putString("SND_WAL_Y", "75.48")
- editor.putString("SND_DTX_X", "42.68")
- editor.putString("SND_DTX_Y", "83.47")
- editor.putString("SND_ILN_X", "39.42")
- editor.putString("SND_ILN_Y", "83.82")
-
- editor.putString("SND_ASY_X", "52.72")
- editor.putString("SND_ASY_Y", "174.12")
-
- editor.putString("SND_ASN_X", "57.15")
- editor.putString("SND_ASN_Y", "170.22")
-
- editor.putString("SND_ACD_X", "55.20")
- editor.putString("SND_ACD_Y", "162.73")
-
- editor.putString("SND_ANT_X", "55.03")
- editor.putString("SND_ANT_Y", "131.57")
-
- editor.putString("SND_AYA_X", "59.52")
- editor.putString("SND_AYA_Y", "139.67")
-
- editor.putString("SND_ANC_X", "61.17")
- editor.putString("SND_ANC_Y", "150.02")
-
- editor.putString("SND_ADQ_X", "57.75")
- editor.putString("SND_ADQ_Y", "152.50")
-
- editor.putString("SND_AKN_X", "58.68")
- editor.putString("SND_AKN_Y", "156.65")
-
- editor.putString("SND_ABE_X", "60.78")
- editor.putString("SND_ABE_Y", "161.80")
-
- editor.putString("SND_AMC_X", "62.95")
- editor.putString("SND_AMC_Y", "155.60")
-
- editor.putString("SND_AFA_X", "64.82")
- editor.putString("SND_AFA_Y", "147.87")
-
- editor.putString("SND_AOM_X", "64.52")
- editor.putString("SND_AOM_Y", "165.45")
-
- editor.putString("SND_AOT_X", "66.87")
- editor.putString("SND_AOT_Y", "162.63")
-
- editor.putString("SND_LIX_X", "30.33667")
- editor.putString("SND_LIX_Y", "89.82528")
- editor.apply()
- }
- }
-
- fun prefInitSoundingSites(context: Context) {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- val editor = preferences.edit()
- val value = preferences.getString("NWS_SOUNDINGLOCATION_VBG", null)
- if (value == null) {
- // thanks http://web.stcloudstate.edu/raweisman/courses/upperair.txt
- editor.putString("NWS_SOUNDINGLOCATION_VBG", "CA, Vandenberg AFB")
- editor.putString("NWS_SOUNDINGLOCATION_1Y7", "AZ, Yuma")
- editor.putString("NWS_SOUNDINGLOCATION_76405", "MX, La Paz")
- editor.putString("NWS_SOUNDINGLOCATION_76458", "MX, Mazatlan")
- editor.putString("NWS_SOUNDINGLOCATION_SLE", "OR, Salem")
- editor.putString("NWS_SOUNDINGLOCATION_UIL", "WA, Quillayute")
- editor.putString("NWS_SOUNDINGLOCATION_YLW", ", KELOWNA APT")
- editor.putString("NWS_SOUNDINGLOCATION_OAK", "CA, Oakland")
- editor.putString("NWS_SOUNDINGLOCATION_NKX", "CA, San Diego")
- editor.putString("NWS_SOUNDINGLOCATION_TUS", "AZ, Tucson")
- editor.putString("NWS_SOUNDINGLOCATION_DRT", "TX, Del Rio")
- editor.putString("NWS_SOUNDINGLOCATION_RAP", "SD, Rapid City")
- editor.putString("NWS_SOUNDINGLOCATION_INL", "MN, International Falls")
- editor.putString("NWS_SOUNDINGLOCATION_BNA", "TN, Nashville")
- editor.putString("NWS_SOUNDINGLOCATION_YMO", ", MOOSONEE")
- editor.putString("NWS_SOUNDINGLOCATION_GSO", "NC, Greensboro")
- editor.putString("NWS_SOUNDINGLOCATION_WAL", "VA, Wallops Island")
- editor.putString("NWS_SOUNDINGLOCATION_IAD", "DC, Washington")
- editor.putString("NWS_SOUNDINGLOCATION_PIT", "PA, Pittsburgh")
- editor.putString("NWS_SOUNDINGLOCATION_ALB", "NY, Albany")
- editor.putString("NWS_SOUNDINGLOCATION_CHH", "MA, Chatham")
- editor.putString("NWS_SOUNDINGLOCATION_YQI", "Nova Scotia, Yarmouth")
- editor.putString("NWS_SOUNDINGLOCATION_XMR", "FL, Cape Canaveral")
- editor.putString("NWS_SOUNDINGLOCATION_TLH", "FL, Tallahassee")
- editor.putString("NWS_SOUNDINGLOCATION_WPL", "ON, Pickle Lake")
- editor.putString("NWS_SOUNDINGLOCATION_DNR", "CO, Denver")
- editor.apply()
- }
- }
-}
-
-
diff --git a/app/src/main/java/joshuatee/wx/settings/UtilityPref2.kt b/app/src/main/java/joshuatee/wx/settings/UtilityStorePreferences.kt
similarity index 98%
rename from app/src/main/java/joshuatee/wx/settings/UtilityPref2.kt
rename to app/src/main/java/joshuatee/wx/settings/UtilityStorePreferences.kt
index 5ed839d9..285d4751 100644
--- a/app/src/main/java/joshuatee/wx/settings/UtilityPref2.kt
+++ b/app/src/main/java/joshuatee/wx/settings/UtilityStorePreferences.kt
@@ -24,9 +24,9 @@ package joshuatee.wx.settings
import android.content.Context
import androidx.preference.PreferenceManager
-object UtilityPref2 {
+object UtilityStorePreferences {
- fun prefInitSetDefaults(context: Context) {
+ fun setDefaults(context: Context) {
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
val editor = preferences.edit()
val value = preferences.getString("ALERT1_NOTIFICATION", null)
diff --git a/app/src/main/java/joshuatee/wx/spc/LSRbyWFOActivity.kt b/app/src/main/java/joshuatee/wx/spc/LSRbyWFOActivity.kt
index 4d157cf1..caad934a 100644
--- a/app/src/main/java/joshuatee/wx/spc/LSRbyWFOActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/LSRbyWFOActivity.kt
@@ -69,7 +69,6 @@ class LsrByWfoActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItem
private var mapShown = false
private lateinit var star: MenuItem
private var locations = listOf()
- private val prefTokenLocation = "NWS_LOCATION_"
private val prefToken = "WFO_FAV"
private var ridFavOld = ""
private var wfoProd = listOf()
@@ -90,13 +89,7 @@ class LsrByWfoActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItem
else
activityArguments[1]
toolbar.title = prod
- locations = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.wfoFav,
- wfo,
- prefTokenLocation,
- prefToken
- )
+ locations = UtilityFavorites.setupFavMenu(this, MyApplication.wfoFav, wfo, prefToken)
sp = ObjectSpinner(this, this, this, R.id.spinner1, locations)
imageMap = ObjectImageMap(this, this, R.id.map, toolbar, toolbarBottom, listOf(scrollView))
imageMap.addClickHandler(::mapSwitch, UtilityImageMap::mapToWfo)
@@ -104,13 +97,7 @@ class LsrByWfoActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItem
override fun onRestart() {
if (ridFavOld != MyApplication.wfoFav) {
- locations = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.wfoFav,
- wfo,
- prefTokenLocation,
- prefToken
- )
+ locations = UtilityFavorites.setupFavMenu(this, MyApplication.wfoFav, wfo, prefToken)
sp.refreshData(this@LsrByWfoActivity, locations)
}
super.onRestart()
@@ -137,19 +124,13 @@ class LsrByWfoActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItem
scrollView.visibility = View.VISIBLE
wfo = loc.toUpperCase(Locale.US)
mapShown = false
- locations = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.wfoFav,
- wfo,
- prefTokenLocation,
- prefToken
- )
+ locations = UtilityFavorites.setupFavMenu(this, MyApplication.wfoFav, wfo, prefToken)
sp.refreshData(this@LsrByWfoActivity, locations)
}
private fun toggleFavorite() {
val ridFav = UtilityFavorites.toggleFavoriteString(this, wfo, star, prefToken)
- locations = UtilityFavorites.setupFavMenu(this, ridFav, wfo, prefTokenLocation, prefToken)
+ locations = UtilityFavorites.setupFavMenu(this, ridFav, wfo, prefToken)
sp.refreshData(this@LsrByWfoActivity, locations)
}
@@ -194,26 +175,26 @@ class LsrByWfoActivity : AudioPlayActivity(), OnItemSelectedListener, OnMenuItem
private val lsrFromWfo: List
get() {
- val lsrs = mutableListOf()
+ val localStormReports = mutableListOf()
val numberLSR = UtilityString.getHtmlAndParseLastMatch(
"https://forecast.weather.gov/product.php?site=$wfo&issuedby=$wfo&product=LSR&format=txt&version=1&glossary=0",
"product=LSR&format=TXT&version=(.*?)&glossary"
)
if (numberLSR == "") {
- lsrs.add("None issued by this office recently.")
+ localStormReports.add("None issued by this office recently.")
} else {
var maxVersions = numberLSR.toIntOrNull() ?: 0
if (maxVersions > 30) {
maxVersions = 30
}
- (1..maxVersions + 1 step 2).mapTo(lsrs) {
+ (1..maxVersions + 1 step 2).mapTo(localStormReports) {
UtilityDownload.getTextProduct(
"LSR$wfo",
it
)
}
}
- return lsrs
+ return localStormReports
}
}
diff --git a/app/src/main/java/joshuatee/wx/spc/SPCMesoActivity.kt b/app/src/main/java/joshuatee/wx/spc/SPCMesoActivity.kt
index 51f97004..e41ab2f8 100644
--- a/app/src/main/java/joshuatee/wx/spc/SPCMesoActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SPCMesoActivity.kt
@@ -194,11 +194,11 @@ class SpcMesoActivity : VideoRecordActivity(), OnMenuItemClickListener,
}
})
}
- favListLabel = UtilityFavorites.setupFavMenuSpcMeso(
+ favListLabel = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcmesoLabelFav,
displayData.paramLabel[curImg]
)
- favListParm = UtilityFavorites.setupFavMenuSpcMeso(
+ favListParm = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcMesoFav,
displayData.param[curImg]
)
@@ -224,11 +224,11 @@ class SpcMesoActivity : VideoRecordActivity(), OnMenuItemClickListener,
}
override fun onRestart() {
- favListLabel = UtilityFavorites.setupFavMenuSpcMeso(
+ favListLabel = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcmesoLabelFav,
displayData.paramLabel[curImg]
)
- favListParm = UtilityFavorites.setupFavMenuSpcMeso(
+ favListParm = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcMesoFav,
displayData.param[curImg]
)
@@ -505,11 +505,11 @@ class SpcMesoActivity : VideoRecordActivity(), OnMenuItemClickListener,
displayData.paramLabel[curImg],
star
)
- favListLabel = UtilityFavorites.setupFavMenuSpcMeso(
+ favListLabel = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcmesoLabelFav,
displayData.paramLabel[curImg]
)
- favListParm = UtilityFavorites.setupFavMenuSpcMeso(
+ favListParm = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcMesoFav,
displayData.param[curImg]
)
@@ -553,11 +553,11 @@ class SpcMesoActivity : VideoRecordActivity(), OnMenuItemClickListener,
override fun onNothingSelected(parent: AdapterView<*>) {}
private fun refreshSpinner() {
- favListLabel = UtilityFavorites.setupFavMenuSpcMeso(
+ favListLabel = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcmesoLabelFav,
displayData.paramLabel[curImg]
)
- favListParm = UtilityFavorites.setupFavMenuSpcMeso(
+ favListParm = UtilityFavorites.setupFavoriteMenuSpc(
MyApplication.spcMesoFav,
displayData.param[curImg]
)
diff --git a/app/src/main/java/joshuatee/wx/spc/SPCSWOActivity.kt b/app/src/main/java/joshuatee/wx/spc/SPCSWOActivity.kt
index 3f05db7c..e9f0d450 100644
--- a/app/src/main/java/joshuatee/wx/spc/SPCSWOActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SPCSWOActivity.kt
@@ -104,7 +104,7 @@ class SpcSwoActivity : AudioPlayActivity(), OnMenuItemClickListener {
miDay6Img.isVisible = false
miDay7Img.isVisible = false
miDay8Img.isVisible = false
- if (day == "1") {
+ if (day == "1" || day == "2") {
miProbabilistic.isVisible = false
} else {
miTornado.isVisible = false
@@ -152,19 +152,13 @@ class SpcSwoActivity : AudioPlayActivity(), OnMenuItemClickListener {
UtilityTts.synthesizeTextAndPlay(applicationContext, html, "spcswo")
}
when (day) {
- "1" -> {
+ "1", "2" -> {
setImageAndClickAction(0, urls, textUrl)
setImageAndClickAction(1, urls, textUrl)
setImageAndClickAction(2, urls, textUrl)
setImageAndClickAction(3, urls, textUrl)
objectCardImageList[4].visibility = View.GONE
}
- "2" -> {
- setImageAndClickAction(0, urls, textUrl)
- setImageAndClickAction(1, urls, textUrl)
- for (index in 2..4)
- objectCardImageList[index].visibility = View.GONE
- }
"3" -> {
setImageAndClickAction(0, urls, textUrl)
setImageAndClickAction(1, urls, textUrl)
diff --git a/app/src/main/java/joshuatee/wx/spc/SPCSWOStateGraphicsActivity.kt b/app/src/main/java/joshuatee/wx/spc/SPCSWOStateGraphicsActivity.kt
index 9393938c..7a84f35d 100644
--- a/app/src/main/java/joshuatee/wx/spc/SPCSWOStateGraphicsActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SPCSWOStateGraphicsActivity.kt
@@ -73,7 +73,7 @@ class SpcSwoStateGraphicsActivity : VideoRecordActivity(), OnItemSelectedListene
)
toolbarBottom.setOnMenuItemClickListener(this)
day = intent.getStringArrayExtra(NO)!![0]
- state = Utility.readPref(this, "NWS_LOCATION_${Location.wfo}", "").split(",")[0]
+ state = Utility.getWfoSiteName(Location.wfo).split(",")[0]
img = ObjectTouchImageView(this, this, toolbar, toolbarBottom, R.id.iv)
ObjectSpinner(this, this, this, R.id.spinner1, GlobalArrays.states, state)
}
diff --git a/app/src/main/java/joshuatee/wx/spc/SPCSoundingsActivity.kt b/app/src/main/java/joshuatee/wx/spc/SPCSoundingsActivity.kt
index ca75a5ce..f624d7ae 100644
--- a/app/src/main/java/joshuatee/wx/spc/SPCSoundingsActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SPCSoundingsActivity.kt
@@ -31,7 +31,7 @@ import androidx.appcompat.widget.Toolbar.OnMenuItemClickListener
import joshuatee.wx.R
import joshuatee.wx.MyApplication
-import joshuatee.wx.activitiesmisc.WebscreenAB
+import joshuatee.wx.activitiesmisc.WebView
import joshuatee.wx.objects.ObjectIntent
import joshuatee.wx.settings.*
import joshuatee.wx.ui.*
@@ -39,7 +39,7 @@ import joshuatee.wx.util.*
import kotlinx.coroutines.*
class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
- OnMenuItemClickListener {
+ OnMenuItemClickListener {
companion object {
const val URL: String = ""
@@ -54,7 +54,6 @@ class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
private var firstTime = true
private lateinit var star: MenuItem
private var locations = listOf()
- private val prefTokenLocation = "NWS_LOCATION_"
private val prefToken = "SND_FAV"
private var upperAir = ""
private var bitmap = UtilityImg.getBlankBitmap()
@@ -63,35 +62,23 @@ class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
@SuppressLint("MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(
- savedInstanceState,
- R.layout.activity_spcsoundings,
- R.menu.spcsoundings,
- true
+ savedInstanceState,
+ R.layout.activity_spcsoundings,
+ R.menu.spcsoundings,
+ true
)
toolbarBottom.setOnMenuItemClickListener(this)
star = toolbarBottom.menu.findItem(R.id.action_fav)
img = ObjectTouchImageView(this, this, toolbar, toolbarBottom, R.id.iv)
- nwsOffice = UtilityLocation.getNearestSnd(this, Location.latLon)
- locations = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.sndFav,
- nwsOffice,
- prefTokenLocation,
- prefToken
- )
+ nwsOffice = UtilityLocation.getNearestSnd(Location.latLon)
+ locations = UtilityFavorites.setupFavMenu(this, MyApplication.sndFav, nwsOffice, prefToken)
objectSpinner = ObjectSpinner(this, this, this, R.id.spinner1, locations)
imageMap = ObjectImageMap(this, this, R.id.map, toolbar, toolbarBottom, listOf(img.img))
imageMap.addClickHandler(::mapSwitch, UtilityImageMap::mapToSnd)
}
override fun onRestart() {
- locations = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.sndFav,
- nwsOffice,
- prefTokenLocation,
- prefToken
- )
+ locations = UtilityFavorites.setupFavMenu(this, MyApplication.sndFav, nwsOffice, prefToken)
objectSpinner.refreshData(this, locations)
super.onRestart()
}
@@ -115,8 +102,8 @@ class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
imgUrl = "${MyApplication.nwsSPCwebsitePrefix}/obswx/maps/$upperAir"
withContext(Dispatchers.IO) {
val date = UtilityString.getHtmlAndParse(
- "${MyApplication.nwsSPCwebsitePrefix}/obswx/maps/",
- "/obswx/maps/" + upperAir + "_([0-9]{6}_[0-9]{2}).gif"
+ "${MyApplication.nwsSPCwebsitePrefix}/obswx/maps/",
+ "/obswx/maps/" + upperAir + "_([0-9]{6}_[0-9]{2}).gif"
)
bitmap = UtilityImg.getBitmapAddWhiteBG(this@SpcSoundingsActivity, imgUrl + "_" + date + ".gif")
}
@@ -138,13 +125,13 @@ class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
R.id.action_map -> imageMap.toggleMap()
R.id.action_fav -> toggleFavorite()
R.id.action_spc_help -> ObjectIntent(
- this,
- WebscreenAB::class.java,
- WebscreenAB.URL,
- arrayOf(
- "${MyApplication.nwsSPCwebsitePrefix}/exper/mesoanalysis/help/begin.html",
- nwsOffice
- )
+ this,
+ WebView::class.java,
+ WebView.URL,
+ arrayOf(
+ "${MyApplication.nwsSPCwebsitePrefix}/exper/mesoanalysis/help/begin.html",
+ nwsOffice
+ )
)
else -> return super.onOptionsItemSelected(item)
}
@@ -159,20 +146,14 @@ class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
private fun mapSwitch(loc: String) {
nwsOffice = loc
mapShown = false
- locations = UtilityFavorites.setupFavMenu(
- this,
- MyApplication.sndFav,
- nwsOffice,
- prefTokenLocation,
- prefToken
- )
+ locations = UtilityFavorites.setupFavMenu(this, MyApplication.sndFav, nwsOffice, prefToken)
objectSpinner.refreshData(this, locations)
img.resetZoom()
}
private fun toggleFavorite() {
val ridFav = UtilityFavorites.toggleFavoriteString(this, nwsOffice, star, prefToken)
- locations = UtilityFavorites.setupFavMenu(this, ridFav, nwsOffice, prefTokenLocation, prefToken)
+ locations = UtilityFavorites.setupFavMenu(this, ridFav, nwsOffice, prefToken)
objectSpinner.refreshData(this, locations)
}
@@ -184,16 +165,16 @@ class SpcSoundingsActivity : BaseActivity(), OnItemSelectedListener,
}
when (pos) {
1 -> ObjectIntent(
- this,
- FavAddActivity::class.java,
- FavAddActivity.TYPE,
- arrayOf("SND")
+ this,
+ FavAddActivity::class.java,
+ FavAddActivity.TYPE,
+ arrayOf("SND")
)
2 -> ObjectIntent(
- this,
- FavRemoveActivity::class.java,
- FavRemoveActivity.TYPE,
- arrayOf("SND")
+ this,
+ FavRemoveActivity::class.java,
+ FavRemoveActivity.TYPE,
+ arrayOf("SND")
)
else -> {
nwsOffice = locations[pos].split(" ").getOrNull(0) ?: ""
diff --git a/app/src/main/java/joshuatee/wx/spc/SPCStormReportsActivity.kt b/app/src/main/java/joshuatee/wx/spc/SPCStormReportsActivity.kt
index 9a9a5fe4..ebcf48c3 100644
--- a/app/src/main/java/joshuatee/wx/spc/SPCStormReportsActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SPCStormReportsActivity.kt
@@ -52,7 +52,7 @@ import joshuatee.wx.ui.ObjectCardText
import joshuatee.wx.ui.ObjectNavDrawer
import joshuatee.wx.radar.WXGLNexrad
import joshuatee.wx.radar.LatLon
-import joshuatee.wx.activitiesmisc.WebscreenAB
+import joshuatee.wx.activitiesmisc.WebView
import joshuatee.wx.objects.ObjectIntent
import joshuatee.wx.objects.PolygonType
import joshuatee.wx.settings.Location
@@ -208,8 +208,8 @@ class SpcStormReportsActivity : AudioPlayActivity(), OnMenuItemClickListener {
stormCard.setListener(View.OnClickListener {
ObjectIntent(
this@SpcStormReportsActivity,
- WebscreenAB::class.java,
- WebscreenAB.URL,
+ WebView::class.java,
+ WebView.URL,
arrayOf(UtilityMap.getMapUrl(xStr, yStr, "10"), "$xStr,$yStr")
)
})
@@ -286,7 +286,7 @@ class SpcStormReportsActivity : AudioPlayActivity(), OnMenuItemClickListener {
val index = v.id
val x = storms[index].lat
val y = storms[index].lon
- val radarSite = UtilityLocation.getNearestOffice(this, "RADAR", LatLon(x, y))
+ val radarSite = UtilityLocation.getNearestOffice("RADAR", LatLon(x, y))
menu.add(0, v.id, 0, "Show L2REF from $radarSite")
menu.add(0, v.id, 0, "Show L2VEL from $radarSite")
}
@@ -304,7 +304,7 @@ class SpcStormReportsActivity : AudioPlayActivity(), OnMenuItemClickListener {
var x = storms[id].lat
var y = storms[id].lon
var time = storms[id].time
- var radarSite = UtilityLocation.getNearestOffice(this, "RADAR", LatLon(x, y))
+ var radarSite = UtilityLocation.getNearestOffice("RADAR", LatLon(x, y))
time = UtilityStringExternal.truncate(time, 3)
if (prod == "TR0" || prod == "TV0") {
radarSite = WXGLNexrad.getTdwrFromRid(radarSite)
diff --git a/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowActivity.kt b/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowActivity.kt
index 88aefbc3..0dbb4388 100644
--- a/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowActivity.kt
@@ -113,11 +113,7 @@ class SpcMcdWatchShowActivity : AudioPlayActivity(), OnMenuItemClickListener {
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenuInfo?) {
super.onCreateContextMenu(menu, v, menuInfo)
objectWatchProduct.wfos.forEach {
- menu.add(0, v.id, 0, "Add location: $it - " + Utility.readPref(
- this,
- "NWS_LOCATION_$it",
- ""
- )
+ menu.add(0, v.id, 0, "Add location: $it - " + Utility.getWfoSiteName(it)
)
}
}
diff --git a/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowSummaryActivity.kt b/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowSummaryActivity.kt
index 06317218..739c0b72 100644
--- a/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowSummaryActivity.kt
+++ b/app/src/main/java/joshuatee/wx/spc/SpcMcdWatchShowSummaryActivity.kt
@@ -193,12 +193,7 @@ class SpcMcdWatchShowSummaryActivity : AudioPlayActivity(), OnMenuItemClickListe
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenuInfo?) {
super.onCreateContextMenu(menu, v, menuInfo)
wfos.filter{ !it.contains("
") }.forEach {
- menu.add(0, v.id, 0, "Add location: $it - " + Utility.readPref(
- this,
- "NWS_LOCATION_$it",
- ""
- )
- )
+ menu.add(0, v.id, 0, "Add location: $it - " + Utility.getWfoSiteName(it))
}
}
diff --git a/app/src/main/java/joshuatee/wx/spc/UtilitySPC.kt b/app/src/main/java/joshuatee/wx/spc/UtilitySPC.kt
index 50814fc2..05d67e20 100644
--- a/app/src/main/java/joshuatee/wx/spc/UtilitySPC.kt
+++ b/app/src/main/java/joshuatee/wx/spc/UtilitySPC.kt
@@ -33,8 +33,7 @@ import joshuatee.wx.RegExp
object UtilitySpc {
- fun getStormReportsTodayUrl(): String =
- "${MyApplication.nwsSPCwebsitePrefix}/climo/reports/" + "today" + ".gif"
+ fun getStormReportsTodayUrl(): String = "${MyApplication.nwsSPCwebsitePrefix}/climo/reports/" + "today" + ".gif"
internal val thunderStormOutlookImages: List
get() {
@@ -75,7 +74,7 @@ object UtilitySpc {
return listOf(returnStr, html)
}
- fun checkSpc(context: Context): List {
+ fun checkSpc(): List {
var tabStr = ""
val tabStrSpc: String
var mdPresent = false
@@ -90,17 +89,19 @@ object UtilitySpc {
if (MyApplication.checkspc) {
if (!MyApplication.severeDashboardMcd.value.contains(MyApplication.MD_COMP)) {
mdPresent = true
- val al = MyApplication.severeDashboardMcd.value
- .parseColumn(RegExp.mcdPatternUtilspc)
+ val al = MyApplication.severeDashboardMcd.value.parseColumn(RegExp.mcdPatternUtilspc)
mdCount = al.size
- al.forEach { dashboardStrMcd += ":$it" }
+ al.forEach {
+ dashboardStrMcd += ":$it"
+ }
}
if (!MyApplication.severeDashboardWat.value.contains(MyApplication.WATCH_COMP)) {
watchPresent = true
- val al =
- MyApplication.severeDashboardWat.value.parseColumn(RegExp.watchPattern)
+ val al = MyApplication.severeDashboardWat.value.parseColumn(RegExp.watchPattern)
watchCount = al.size
- al.forEach { dashboardStrWat += ":$it" }
+ al.forEach {
+ dashboardStrWat += ":$it"
+ }
}
}
if (MyApplication.checkwpc) {
@@ -108,38 +109,44 @@ object UtilitySpc {
mpdPresent = true
val al = MyApplication.severeDashboardMpd.value.parseColumn(RegExp.mpdPattern)
mpdCount = al.size
- al.forEach { dashboardStrMpd += ":$it" }
+ al.forEach {
+ dashboardStrMpd += ":$it"
+ }
}
}
var label = MyApplication.tabHeaders[1]
if (watchPresent || mdPresent || mpdPresent) {
- if (watchPresent)
- label = "$label W($watchCount)"
- if (mdPresent)
- label = "$label M($mdCount)"
- if (mpdPresent)
- label = "$label P($mpdCount)"
+ if (watchPresent) {
+ label += " W($watchCount)"
+ }
+ if (mdPresent) {
+ label += " M($mdCount)"
+ }
+ if (mpdPresent) {
+ label += " P($mpdCount)"
+ }
tabStrSpc = label
} else {
tabStrSpc = MyApplication.tabHeaders[1]
}
// US Warn
- var uswarnPresent = false
+ var usWarnPresent = false
var torCount = 0
- var tstormCount = 0
+ var tStormCount = 0
var floodCount = 0
if (MyApplication.checktor) {
- tstormCount = UtilityVtec.getStormCount(context, MyApplication.severeDashboardTst.value)
- torCount = UtilityVtec.getStormCount(context, MyApplication.severeDashboardTor.value)
- floodCount = UtilityVtec.getStormCount(context, MyApplication.severeDashboardFfw.value)
- if (tstormCount > 0 || torCount > 0 || floodCount > 0) {
- uswarnPresent = true
+ tStormCount = UtilityVtec.getStormCount(MyApplication.severeDashboardTst.value)
+ torCount = UtilityVtec.getStormCount(MyApplication.severeDashboardTor.value)
+ floodCount = UtilityVtec.getStormCount(MyApplication.severeDashboardFfw.value)
+ if (tStormCount > 0 || torCount > 0 || floodCount > 0) {
+ usWarnPresent = true
}
}
- tabStr = if (uswarnPresent)
- tabStr + " " + MyApplication.tabHeaders[2] + " W(" + tstormCount + "," + torCount + "," + floodCount + ")"
- else
+ tabStr = if (usWarnPresent) {
+ tabStr + " " + MyApplication.tabHeaders[2] + " W(" + tStormCount + "," + torCount + "," + floodCount + ")"
+ } else {
MyApplication.tabHeaders[2]
+ }
return listOf(tabStrSpc, tabStr)
}
}
diff --git a/app/src/main/java/joshuatee/wx/spc/UtilitySPCSWO.kt b/app/src/main/java/joshuatee/wx/spc/UtilitySPCSWO.kt
index fa0a0ea5..c036a02c 100644
--- a/app/src/main/java/joshuatee/wx/spc/UtilitySPCSWO.kt
+++ b/app/src/main/java/joshuatee/wx/spc/UtilitySPCSWO.kt
@@ -43,15 +43,11 @@ internal object UtilitySpcSwo {
val html = ("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day" + day + "otlk.html").getHtml()
val time = html.parse("show_tab\\(.otlk_([0-9]{4}).\\)")
when (day) {
- "1" -> {
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1otlk_$time.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1probotlk_" + time + "_torn.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1probotlk_" + time + "_hail.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1probotlk_" + time + "_wind.gif")
- }
- "2" -> {
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day2otlk_$time.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day2probotlk_" + time + "_any.gif")
+ "1", "2" -> {
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}otlk_$time.gif")
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}probotlk_" + time + "_torn.gif")
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}probotlk_" + time + "_hail.gif")
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}probotlk_" + time + "_wind.gif")
}
"3" -> {
imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day3otlk_$time.gif")
@@ -71,21 +67,19 @@ internal object UtilitySpcSwo {
fun getUrls(day: String): List {
val imgUrls = mutableListOf()
if (day == "4-8" || day == "48" || day == "4") {
- (4..8).forEach { imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/exper/day4-8/day" + it.toString() + "prob.gif") }
+ (4..8).forEach {
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/exper/day4-8/day" + it.toString() + "prob.gif")
+ }
return imgUrls
}
val html = ("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day" + day + "otlk.html").getHtml()
val time = html.parse("show_tab\\(.otlk_([0-9]{4}).\\)")
when (day) {
- "1" -> {
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1otlk_$time.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1probotlk_" + time + "_torn.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1probotlk_" + time + "_hail.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day1probotlk_" + time + "_wind.gif")
- }
- "2" -> {
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day2otlk_$time.gif")
- imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day2probotlk_" + time + "_any.gif")
+ "1", "2" -> {
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}otlk_$time.gif")
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}probotlk_" + time + "_torn.gif")
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}probotlk_" + time + "_hail.gif")
+ imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day${day}probotlk_" + time + "_wind.gif")
}
"3" -> {
imgUrls.add("${MyApplication.nwsSPCwebsitePrefix}/products/outlook/day3otlk_$time.gif")
diff --git a/app/src/main/java/joshuatee/wx/ui/ObjectAlertSummary.kt b/app/src/main/java/joshuatee/wx/ui/ObjectAlertSummary.kt
index 4d3b4a38..2fd42f8c 100644
--- a/app/src/main/java/joshuatee/wx/ui/ObjectAlertSummary.kt
+++ b/app/src/main/java/joshuatee/wx/ui/ObjectAlertSummary.kt
@@ -121,7 +121,7 @@ class ObjectAlertSummary(
val nwsLoc: String
if (cc.vtec.length > 15 && cc.event != "Special Weather Statement") {
nwsOffice = cc.vtec.substring(8, 11)
- nwsLoc = Utility.readPref(context, "NWS_LOCATION_$nwsOffice", "MI")
+ nwsLoc = Utility.getWfoSiteName(nwsOffice)
} else {
nwsOffice = ""
nwsLoc = ""
diff --git a/app/src/main/java/joshuatee/wx/ui/ObjectWidgetCCLegacy.kt b/app/src/main/java/joshuatee/wx/ui/ObjectWidgetCCLegacy.kt
index 217489ba..0075d35a 100644
--- a/app/src/main/java/joshuatee/wx/ui/ObjectWidgetCCLegacy.kt
+++ b/app/src/main/java/joshuatee/wx/ui/ObjectWidgetCCLegacy.kt
@@ -274,7 +274,7 @@ class ObjectWidgetCCLegacy(context: Context, allWidgetIds: IntArray) {
val pendingIntentWidgetTime =
PendingIntent.getBroadcast(context, 0, updateIntent, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews.setOnClickPendingIntent(R.id.widget_time, pendingIntentWidgetTime)
- val tabStr = UtilitySpc.checkSpc(context)
+ val tabStr = UtilitySpc.checkSpc()
remoteViews.setViewVisibility(R.id.tab, View.VISIBLE)
remoteViews.setTextViewText(R.id.tab, tabStr[0] + " " + tabStr[1])
}
diff --git a/app/src/main/java/joshuatee/wx/util/Utility.kt b/app/src/main/java/joshuatee/wx/util/Utility.kt
index 98b02e29..b3a4b607 100644
--- a/app/src/main/java/joshuatee/wx/util/Utility.kt
+++ b/app/src/main/java/joshuatee/wx/util/Utility.kt
@@ -73,10 +73,26 @@ object Utility {
return UtilityRadar.radarSiteToLon[radarSite] ?: ""
}
+ fun getWfoSiteX(site: String): String {
+ return UtilityRadar.wfoSiteToLat[site] ?: ""
+ }
+
+ fun getWfoSiteY(site: String): String {
+ return UtilityRadar.wfoSiteToLon[site] ?: ""
+ }
+
fun getWfoSiteName(wfo: String): String {
return UtilityRadar.wfoIdToName[wfo] ?: ""
}
+ fun getSoundingSiteX(site: String): String {
+ return UtilityRadar.soundingSiteToLat[site] ?: ""
+ }
+
+ fun getSoundingSiteY(site: String): String {
+ return UtilityRadar.soundingSiteToLon[site] ?: ""
+ }
+
/* fun getWfoSiteLatLon(wfo: String): LatLon {
val lat = UtilityRadar.wfoSitetoLat[wfo] ?: ""
val lon = UtilityRadar.wfoSitetoLon[wfo] ?: ""
@@ -89,7 +105,7 @@ object Utility {
return LatLon(lat, lon)
}*/
- /* fun getSoundingSiteName(wfo: String): String {
+ fun getSoundingSiteName(wfo: String): String {
var site = UtilityRadar.wfoIdToName[wfo] ?: ""
if (site == "") {
site = UtilityRadar.soundingIdToName[wfo] ?: ""
@@ -97,14 +113,14 @@ object Utility {
return site
}
- fun generateSoundingNameList(): List {
- val list = mutableListOf()
- GlobalArrays.soundingSites.sorted()
- GlobalArrays.soundingSites.forEach {
- list.add(it + ": " + getSoundingSiteName(it))
- }
- return list
- }*/
+ /* fun generateSoundingNameList(): List {
+ val list = mutableListOf()
+ GlobalArrays.soundingSites.sorted()
+ GlobalArrays.soundingSites.forEach {
+ list.add(it + ": " + getSoundingSiteName(it))
+ }
+ return list
+ }*/
fun getVersion(context: Context): String {
var version = ""
diff --git a/app/src/main/java/joshuatee/wx/util/UtilityAlertDialog.kt b/app/src/main/java/joshuatee/wx/util/UtilityAlertDialog.kt
index c216e448..b483748b 100644
--- a/app/src/main/java/joshuatee/wx/util/UtilityAlertDialog.kt
+++ b/app/src/main/java/joshuatee/wx/util/UtilityAlertDialog.kt
@@ -67,24 +67,6 @@ object UtilityAlertDialog {
alert.setNegativeButton("Close") { dialog, _ -> dialog.dismiss() }
alert.show()
}
- //I want to keep this ELY M.//
- fun showVersion(context: Context, activity: Activity): String {
- var version = ""
- try {
- version = activity.packageManager.getPackageInfo(activity.packageName, 0).versionName
- } catch (e: Exception) {
- UtilityLog.handleException(e)
- }
- var string = activity.resources.getString(R.string.about_wx) + MyApplication.newline + version
- string += MyApplication.newline + Utility.readPref(
- context,
- "JOBSERVICE_TIME_LAST_RAN",
- ""
- ) + " Last background update" + MyApplication.newline
- string += UtilityRadarUI.getLastRadarTime(context) + " Last radar update" + MyApplication.newline
- string += Utility.showDiagnostics(context)
- return string
- }
fun showDialogueWithContext(str: String, context: Context) {
val alertDialogBuilder = AlertDialog.Builder(context)
diff --git a/app/src/main/java/joshuatee/wx/util/UtilityDownload.kt b/app/src/main/java/joshuatee/wx/util/UtilityDownload.kt
index 931e1a1f..d3e9fc9a 100644
--- a/app/src/main/java/joshuatee/wx/util/UtilityDownload.kt
+++ b/app/src/main/java/joshuatee/wx/util/UtilityDownload.kt
@@ -63,7 +63,7 @@ object UtilityDownload {
var bitmap: Bitmap = UtilityImg.getBlankBitmap()
try {
if (!UIPreferences.useAwcRadarMosaic) {
- val ridLoc = Utility.readPref(context, "RID_LOC_$radarSite", "")
+ val ridLoc = Utility.getRadarSiteName(radarSite)
val nwsLocationArr = ridLoc.split(",").dropLastWhile { it.isEmpty() }
val state = nwsLocationArr[0]
var k = Utility.readPref(context, "WIDGET_RADAR_LEVEL", "1km")
@@ -311,10 +311,7 @@ object UtilityDownload {
}
"SND" -> {
needsBitmap = false
- bm = UtilitySpcSoundings.getImage(
- context,
- UtilityLocation.getNearestSnd(context, Location.latLon)
- )
+ bm = UtilitySpcSoundings.getImage(context, UtilityLocation.getNearestSnd(Location.latLon))
}
"STRPT" -> url = UtilitySpc.getStormReportsTodayUrl()
else -> {
diff --git a/app/src/main/java/joshuatee/wx/util/UtilityFavorites.kt b/app/src/main/java/joshuatee/wx/util/UtilityFavorites.kt
index 469491de..bbc2e9d2 100644
--- a/app/src/main/java/joshuatee/wx/util/UtilityFavorites.kt
+++ b/app/src/main/java/joshuatee/wx/util/UtilityFavorites.kt
@@ -34,185 +34,169 @@ object UtilityFavorites {
private const val DELIM_TOKEN = " "
private const val ADD_STR = "Add..."
private const val MODIFY_STR = "Modify..."
+ const val initialValue = " : : :"
- private fun checkAndCorrectFav(context: Context, fav: String, prefToken: String) {
- if (fav.contains("::")) {
- val newFav = fav.replace(":{2,}".toRegex(), ":")
+ // TODO refactor method/var names
+
+ private fun checkAndCorrectFavorites(context: Context, value: String, prefToken: String) {
+ if (value.contains("::")) {
+ val newFav = value.replace(":{2,}".toRegex(), ":")
savePref(context, newFav, prefToken)
}
- if (!fav.contains(MyApplication.prefSeparator)) {
- val newFav = MyApplication.prefSeparator + fav.trimStart()
+ if (!value.contains(MyApplication.prefSeparator)) {
+ val newFav = MyApplication.prefSeparator + value.trimStart()
savePref(context, newFav, prefToken)
}
}
- private fun savePref(context: Context, newFav: String, prefToken: String) {
- Utility.writePref(context, prefToken, newFav)
+ private fun savePref(context: Context, value: String, prefToken: String) {
+ Utility.writePref(context, prefToken, value)
when (prefToken) {
- "WFO_FAV" -> MyApplication.wfoFav = newFav
- "RID_FAV" -> MyApplication.ridFav = newFav
- "SND_FAV" -> MyApplication.sndFav = newFav
+ "WFO_FAV" -> MyApplication.wfoFav = value
+ "RID_FAV" -> MyApplication.ridFav = value
+ "SND_FAV" -> MyApplication.sndFav = value
}
}
fun setupFavMenu(
context: Context,
- ridFav: String,
- nwsOffice: String,
- prefTokenLocation: String,
+ favoriteString: String,
+ value: String,
prefToken: String
): List {
- checkAndCorrectFav(context, ridFav, prefToken)
- var ridArr = MyApplication.colon.split(ridFav)
- ridArr[0] = nwsOffice
- if (ridArr.size > 2) {
- ridArr[1] = ADD_STR
- ridArr[2] = MODIFY_STR
- } else {
- ridArr = Array(3) { "" }
- ridArr[1] = ADD_STR
- ridArr[2] = MODIFY_STR
- }
- val ridArrLoc = MutableList(ridArr.size) { "" }
- var ridLoc: String
- ridArr.indices.forEach { k ->
- ridLoc = Utility.readPref(context, prefTokenLocation + ridArr[k], "")
- if (ridLoc == "")
- ridLoc = Utility.readPref(context, "NWS_SOUNDINGLOCATION_" + ridArr[k], "")
- if (k == 1 || k == 2)
- ridArrLoc[k] = ridArr[k]
- else
- ridArrLoc[k] = ridArr[k] + DELIM_TOKEN + ridLoc
+ checkAndCorrectFavorites(context, favoriteString, prefToken)
+ var favorites = favoriteString.split(":").dropLastWhile { it.isEmpty() }.toMutableList()
+ if (favorites.size < 3) {
+ favorites = MutableList(3) { "" }
+ }
+ favorites[0] = value
+ favorites[1] = ADD_STR
+ favorites[2] = MODIFY_STR
+ val returnList = MutableList(favorites.size) { "" }
+ var name: String
+ favorites.indices.forEach { k ->
+ name = when (prefToken) {
+ "RID_FAV" -> Utility.getRadarSiteName(favorites[k])
+ "WFO_FAV" -> Utility.getWfoSiteName(favorites[k])
+ "SND_FAV" -> Utility.getSoundingSiteName(favorites[k])
+ else -> "FIXME"
+ }
+ if (k == 1 || k == 2) {
+ returnList[k] = favorites[k]
+ } else {
+ returnList[k] = favorites[k] + DELIM_TOKEN + name
+ }
}
- return ridArrLoc.toList()
+ return returnList.toList()
}
fun setupFavMenuCanada(ridFav: String, nwsOffice: String): List {
- val ridArr = MyApplication.colon.split(ridFav)
- ridArr[0] = nwsOffice
- ridArr[1] = ADD_STR
- ridArr[2] = MODIFY_STR
- val ridArrLoc = MutableList(ridArr.size) { "" }
- ridArr.indices.forEach { k ->
- GlobalArrays.canadaRadars.indices.filter { GlobalArrays.canadaRadars[it].contains(ridArr[k]) }
- .forEach { ridArrLoc[k] = GlobalArrays.canadaRadars[it].replace(":", "") }
+ val favorites = MyApplication.colon.split(ridFav)
+ favorites[0] = nwsOffice
+ favorites[1] = ADD_STR
+ favorites[2] = MODIFY_STR
+ val returnList = MutableList(favorites.size) { "" }
+ favorites.indices.forEach { k ->
+ GlobalArrays.canadaRadars.indices.filter { GlobalArrays.canadaRadars[it].contains(favorites[k]) }
+ .forEach { returnList[k] = GlobalArrays.canadaRadars[it].replace(":", "") }
if (k == 1 || k == 2) {
- ridArrLoc[k] = ridArr[k]
+ returnList[k] = favorites[k]
}
}
- return ridArrLoc.toList()
+ return returnList.toList()
}
- fun toggleFavorite(context: Context, rid: String, star: MenuItem, prefToken: String) {
- var ridFav = Utility.readPref(context, prefToken, " : : :")
- if (ridFav.contains(rid)) {
- ridFav = ridFav.replace("$rid:", "")
+ fun toggleFavorite(context: Context, value: String, star: MenuItem, prefToken: String) {
+ var favoriteString = Utility.readPref(context, prefToken, initialValue)
+ if (favoriteString.contains(value)) {
+ favoriteString = favoriteString.replace("$value:", "")
star.setIcon(MyApplication.STAR_OUTLINE_ICON)
} else {
- ridFav = "$ridFav$rid:"
+ favoriteString = "$favoriteString$value:"
star.setIcon(MyApplication.STAR_ICON)
}
- Utility.writePref(context, prefToken, ridFav)
+ Utility.writePref(context, prefToken, favoriteString)
when (prefToken) {
- "RID_FAV" -> MyApplication.ridFav = ridFav
- "WFO_FAV" -> MyApplication.wfoFav = ridFav
- "SND_FAV" -> MyApplication.sndFav = ridFav
- "SREF_FAV" -> MyApplication.srefFav = ridFav
- "NWS_TEXT_FAV" -> MyApplication.nwsTextFav = ridFav
+ "RID_FAV" -> MyApplication.ridFav = favoriteString
+ "WFO_FAV" -> MyApplication.wfoFav = favoriteString
+ "SND_FAV" -> MyApplication.sndFav = favoriteString
+ "SREF_FAV" -> MyApplication.srefFav = favoriteString
+ "NWS_TEXT_FAV" -> MyApplication.nwsTextFav = favoriteString
}
}
// mirror of method above save it returns the string
fun toggleFavoriteString(
context: Context,
- rid: String,
+ value: String,
star: MenuItem,
prefToken: String
): String {
- var ridFav = Utility.readPref(context, prefToken, " : : :")
- if (ridFav.contains(rid)) {
- ridFav = ridFav.replace("$rid:", "")
+ var favoriteString = Utility.readPref(context, prefToken, initialValue)
+ if (favoriteString.contains(value)) {
+ favoriteString = favoriteString.replace("$value:", "")
star.setIcon(MyApplication.STAR_OUTLINE_ICON)
} else {
- ridFav = "$ridFav$rid:"
+ favoriteString = "$favoriteString$value:"
star.setIcon(MyApplication.STAR_ICON)
}
- Utility.writePref(context, prefToken, ridFav)
+ Utility.writePref(context, prefToken, favoriteString)
when (prefToken) {
- "RID_FAV" -> MyApplication.ridFav = ridFav
- "WFO_FAV" -> MyApplication.wfoFav = ridFav
- "SND_FAV" -> MyApplication.sndFav = ridFav
- "SREF_FAV" -> MyApplication.srefFav = ridFav
- "NWS_TEXT_FAV" -> MyApplication.nwsTextFav = ridFav
+ "RID_FAV" -> MyApplication.ridFav = favoriteString
+ "WFO_FAV" -> MyApplication.wfoFav = favoriteString
+ "SND_FAV" -> MyApplication.sndFav = favoriteString
+ "SREF_FAV" -> MyApplication.srefFav = favoriteString
+ "NWS_TEXT_FAV" -> MyApplication.nwsTextFav = favoriteString
}
- return ridFav
+ return favoriteString
}
- fun toggleFavoriteSpcMeso(context: Context, rid: String, label: String, star: MenuItem) {
- var ridFav = Utility.readPref(context, "SPCMESO_FAV", " : : :")
- var ridFavLabel = Utility.readPref(context, "SPCMESO_LABEL_FAV", " : : :")
- if (ridFav.contains(rid)) {
- ridFav = ridFav.replace("$rid:", "")
- ridFavLabel = ridFavLabel.replace("$label:", "")
+ fun toggleFavoriteSpcMeso(context: Context, value: String, label: String, star: MenuItem) {
+ var favoriteString = Utility.readPref(context, "SPCMESO_FAV", initialValue)
+ var favoriteLabelString = Utility.readPref(context, "SPCMESO_LABEL_FAV", initialValue)
+ if (favoriteString.contains(value)) {
+ favoriteString = favoriteString.replace("$value:", "")
+ favoriteLabelString = favoriteLabelString.replace("$label:", "")
star.setIcon(MyApplication.STAR_OUTLINE_ICON)
} else {
- ridFav = "$ridFav$rid:"
- ridFavLabel = "$ridFavLabel$label:"
+ favoriteString = "$favoriteString$value:"
+ favoriteLabelString = "$favoriteLabelString$label:"
star.setIcon(MyApplication.STAR_ICON)
}
- Utility.writePref(context, "SPCMESO_FAV", ridFav)
- Utility.writePref(context, "SPCMESO_LABEL_FAV", ridFavLabel)
- MyApplication.spcMesoFav = ridFav
- MyApplication.spcmesoLabelFav = ridFavLabel
- }
-
- fun setupFavMenuSref(ridFav: String, param: String): List {
- val ridArr = MyApplication.colon.split(ridFav)
- ridArr[0] = param
- ridArr[1] = ADD_STR
- ridArr[2] = MODIFY_STR
- val ridArrLoc = MutableList(ridArr.size) { "" }
- ridArr.indices.forEach {
- if (it == 1 || it == 2)
- ridArrLoc[it] = ridArr[it]
- else
- ridArrLoc[it] = ridArr[it]
- }
- return ridArrLoc.toList()
+ Utility.writePref(context, "SPCMESO_FAV", favoriteString)
+ Utility.writePref(context, "SPCMESO_LABEL_FAV", favoriteLabelString)
+ MyApplication.spcMesoFav = favoriteString
+ MyApplication.spcmesoLabelFav = favoriteLabelString
}
- fun setupFavMenuSpcMeso(ridFav: String, param: String): List {
- var ridArr = MyApplication.colon.split(ridFav)
- // bug experienced where somehow size was below 3
- if (ridArr.size < 3) {
- ridArr = Array(3) { "" }
- }
- ridArr[0] = param
- ridArr[1] = ADD_STR
- ridArr[2] = MODIFY_STR
- val ridArrLoc = MutableList(ridArr.size) { "" }
- ridArr.indices.forEach {
- if (it == 1 || it == 2)
- ridArrLoc[it] = ridArr[it]
- else
- ridArrLoc[it] = ridArr[it]
- }
- return ridArrLoc.toList()
+ // Takes a value and a colon separated string
+ // returns a List with the value at the start followed by two constant values (add/modify)
+ // followed by each token in the string as list items
+ // If somehow the input colon separated string is to small correct it in this method
+ fun setupFavoriteMenuSpc(favoriteString: String, value: String): List {
+ var favorites = favoriteString.split(":").dropLastWhile { it.isEmpty() }.toMutableList()
+ if (favorites.size < 3) {
+ favorites = MutableList(3) { "" }
+ }
+ favorites[0] = value
+ favorites[1] = ADD_STR
+ favorites[2] = MODIFY_STR
+ return favorites.toList()
}
- fun setupFavMenuNwsText(ridFav: String, param: String): List {
- val ridArr = MyApplication.colon.split(ridFav)
- ridArr[0] = param
- ridArr[1] = ADD_STR
- ridArr[2] = MODIFY_STR
- val ridArrLoc = MutableList(ridArr.size) { "" }
- ridArr.indices.forEach {
+ fun setupFavMenuNwsText(favoriteString: String, value: String): List {
+ val favorites = favoriteString.split(":").dropLastWhile { it.isEmpty() }.toMutableList()
+ favorites[0] = value
+ favorites[1] = ADD_STR
+ favorites[2] = MODIFY_STR
+ val returnList = MutableList(favorites.size) { "" }
+ favorites.indices.forEach {
if (it == 1 || it == 2)
- ridArrLoc[it] = ridArr[it]
+ returnList[it] = favorites[it]
else
- ridArrLoc[it] = UtilityWpcText.labels[findPositionNwsText(ridArr[it])]
+ returnList[it] = UtilityWpcText.labels[findPositionNwsText(favorites[it])]
}
- return ridArrLoc.toList()
+ return returnList.toList()
}
fun findPositionNwsText(key: String): Int =
diff --git a/app/src/main/java/joshuatee/wx/util/UtilityVTEC.kt b/app/src/main/java/joshuatee/wx/util/UtilityVTEC.kt
index bc90751f..2e550106 100644
--- a/app/src/main/java/joshuatee/wx/util/UtilityVTEC.kt
+++ b/app/src/main/java/joshuatee/wx/util/UtilityVTEC.kt
@@ -21,7 +21,6 @@
package joshuatee.wx.util
-import android.content.Context
import joshuatee.wx.MyApplication
// FIXME see if this external can be removed
import joshuatee.wx.external.ExternalDuplicateRemover
@@ -30,10 +29,10 @@ import joshuatee.wx.Extensions.*
object UtilityVtec {
- fun getStormCount(context: Context, textTor: String): Int {
+ fun getStormCount(textTor: String): Int {
var dashboardStrTor = ""
var nwsLoc = ""
- var wfos: List
+ var offices: List
var wfo: String
val vtecPattern = "([A-Z0]{1}\\.[A-Z]{3}\\.[A-Z]{4}\\.[A-Z]{2}\\.[A-Z]\\.[0-9]{4}\\.[0-9]{6}T[0-9]{4}Z\\-[0-9]{6}T[0-9]{4}Z)"
val stormList = textTor.parseColumn(vtecPattern)
@@ -41,11 +40,11 @@ object UtilityVtec {
val vtecIsCurrent = UtilityTime.isVtecCurrent(it)
if (!it.startsWith("O.EXP") && vtecIsCurrent) {
dashboardStrTor += it
- wfos = it.split(".")
- if (wfos.size > 1) {
- wfo = wfos[2]
+ offices = it.split(".")
+ if (offices.size > 1) {
+ wfo = offices[2]
wfo = wfo.replace("^[KP]".toRegex(), "")
- nwsLoc = Utility.readPref(context, "NWS_LOCATION_$wfo", "")
+ nwsLoc = Utility.getWfoSiteName(wfo)
}
dashboardStrTor += " " + nwsLoc + MyApplication.newline
}
diff --git a/app/src/main/java/joshuatee/wx/wpc/UtilityWPCText.kt b/app/src/main/java/joshuatee/wx/wpc/UtilityWPCText.kt
index 8042753b..47006588 100644
--- a/app/src/main/java/joshuatee/wx/wpc/UtilityWPCText.kt
+++ b/app/src/main/java/joshuatee/wx/wpc/UtilityWPCText.kt
@@ -29,7 +29,6 @@ import joshuatee.wx.ui.ObjectMenuTitle
internal object UtilityWpcText {
private val titles = listOf(
- //ObjectMenuTitle("General", 3),
ObjectMenuTitle("General Forecast Discussions", 11),
ObjectMenuTitle("Precipitation Discussions", 2),
ObjectMenuTitle("Hazards", 7),
diff --git a/app/src/main/java/joshuatee/wx/wpc/WPCImagesActivity.kt b/app/src/main/java/joshuatee/wx/wpc/WPCImagesActivity.kt
index 40552d60..686efe90 100644
--- a/app/src/main/java/joshuatee/wx/wpc/WPCImagesActivity.kt
+++ b/app/src/main/java/joshuatee/wx/wpc/WPCImagesActivity.kt
@@ -73,11 +73,15 @@ class WpcImagesActivity : VideoRecordActivity(), View.OnClickListener,
img.setOnClickListener(this)
img.setOnTouchListener(object : OnSwipeTouchListener(this) {
override fun onSwipeLeft() {
- if (img.currentZoom < 1.01f) showNextImg()
+ if (img.currentZoom < 1.01f) {
+ showNextImg()
+ }
}
override fun onSwipeRight() {
- if (img.currentZoom < 1.01f) showPrevImg()
+ if (img.currentZoom < 1.01f) {
+ showPrevImg()
+ }
}
})
activityArguments = intent.getStringArrayExtra(URL)!!
diff --git a/app/src/main/java/joshuatee/wx/wpc/WPCMPDShowSummaryActivity.kt b/app/src/main/java/joshuatee/wx/wpc/WPCMPDShowSummaryActivity.kt
index 8f3f3fe5..fac29dad 100644
--- a/app/src/main/java/joshuatee/wx/wpc/WPCMPDShowSummaryActivity.kt
+++ b/app/src/main/java/joshuatee/wx/wpc/WPCMPDShowSummaryActivity.kt
@@ -126,7 +126,7 @@ class WpcMpdShowSummaryActivity : AudioPlayActivity(), OnMenuItemClickListener {
override fun onCreateContextMenu(menu: ContextMenu, v: View, menuInfo: ContextMenuInfo) {
super.onCreateContextMenu(menu, v, menuInfo)
wfos.forEach {
- menu.add(0, v.id, 0, "Add location: $it" + " - " + Utility.readPref(this, "NWS_LOCATION_$it", "")
+ menu.add(0, v.id, 0, "Add location: $it" + " - " + Utility.getWfoSiteName(it)
)
}
}
diff --git a/app/src/main/java/joshuatee/wx/wpc/WPCTextProductsActivity.kt b/app/src/main/java/joshuatee/wx/wpc/WPCTextProductsActivity.kt
index 69904b69..1e74b566 100644
--- a/app/src/main/java/joshuatee/wx/wpc/WPCTextProductsActivity.kt
+++ b/app/src/main/java/joshuatee/wx/wpc/WPCTextProductsActivity.kt
@@ -69,7 +69,7 @@ class WpcTextProductsActivity : AudioPlayActivity(), OnMenuItemClickListener,
private var initProd = ""
private var products = listOf()
private lateinit var star: MenuItem
- private lateinit var notifToggle: MenuItem
+ private lateinit var notificationToggle: MenuItem
private var ridFavOld = ""
private lateinit var textCard: ObjectCardText
private lateinit var sp: ObjectSpinner
@@ -84,7 +84,7 @@ class WpcTextProductsActivity : AudioPlayActivity(), OnMenuItemClickListener,
)
toolbarBottom.setOnMenuItemClickListener(this)
star = toolbarBottom.menu.findItem(R.id.action_fav)
- notifToggle = toolbarBottom.menu.findItem(R.id.action_notif_text_prod)
+ notificationToggle = toolbarBottom.menu.findItem(R.id.action_notif_text_prod)
activityArguments = intent.getStringArrayExtra(URL)!!
if (activityArguments[0] == "pmdspd") {
prod = MyApplication.wpcTextFav
@@ -108,7 +108,7 @@ class WpcTextProductsActivity : AudioPlayActivity(), OnMenuItemClickListener,
}
private fun getContent() = GlobalScope.launch(uiDispatcher) {
- updateSubmenuNotifText()
+ updateSubmenuNotificationText()
scrollView.smoothScrollTo(0, 0)
if (MyApplication.nwsTextFav.contains(":$prod:")) {
star.setIcon(MyApplication.STAR_ICON)
@@ -140,7 +140,7 @@ class WpcTextProductsActivity : AudioPlayActivity(), OnMenuItemClickListener,
linearLayout,
prod.toUpperCase(Locale.US)
)
- updateSubmenuNotifText()
+ updateSubmenuNotificationText()
}
R.id.action_mpd -> ObjectIntent(this, WpcMpdShowSummaryActivity::class.java)
R.id.action_share -> UtilityShare.shareText(this, prod, Utility.fromHtml(html))
@@ -206,11 +206,11 @@ class WpcTextProductsActivity : AudioPlayActivity(), OnMenuItemClickListener,
sp.refreshData(this, products)
}
- private fun updateSubmenuNotifText() {
+ private fun updateSubmenuNotificationText() {
if (UtilityNotificationTextProduct.check(prod.toUpperCase(Locale.US))) {
- notifToggle.title = resources.getString(R.string.notif_remove)
+ notificationToggle.title = resources.getString(R.string.notif_remove)
} else {
- notifToggle.title = resources.getString(R.string.notif_add)
+ notificationToggle.title = resources.getString(R.string.notif_add)
}
}