Skip to content

Commit

Permalink
big updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ELY3M committed May 21, 2019
1 parent 18d24fc commit 0820660
Show file tree
Hide file tree
Showing 152 changed files with 1,514 additions and 2,020 deletions.
29 changes: 26 additions & 3 deletions DOC/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
// TODO fix issue for precip radar products when there is no data
// TODO assess impact of scoped storage: https://developer.android.com/preview/privacy/scoped-storage
// TODO linesize - swo, wb, wbgusts, sti
// TODO dual pange split when rotated not optimal (Jim)
// TODO bottomsheet for spotters
// TODO SRM - ability to add custom palette
// TODO make location update interval configurable
// TODO add vtec end date check to tor notif
// TODO camelCase filenames in particular when acronyms longer then 2 chars exist
// TODO add user accessible debug log from try-catch data
// TODO remove unused prefs
// TODO don't display full precision in lat/lon in settings location edit

[ADD] - adding something new - method, file, etc. to the repo
[REM] - remove items
Expand All @@ -28,8 +30,29 @@
[REF] - refactor a method, group, variable, etc.
[MER] - merge

55190 2019_05_18 [IMP] add more whitespace around hazards on main screen
[IMP] don't squash whitespace in US alerts detail
[REF] camelCase and better naming
[IMP] change default warning line size from 4 to 5 (does not impact existing users). Remove default values from some help strings as
they are shown elsewhere
55189 2019_05_18 [REF] more work on 7day object
[REF] more work on cc object
55188 2019_05_18 [REF] more work on hazards object
55187 2019_05_18 [IMP] Left justify hourly text
[REF] camelCase and better naming
55186 2019_05_18 [IMP] add quad pane link in dual pane (Jim)
[IMP] in dual pane invoked from single pane save product changes (Jim)
[REF] change how ObjectForecastPackageHazards is used
55185 2019_05_17 [REF] camelCase and better naming
55184 2019_05_17 [REF] camelCase and better naming
55183 2019_05_16 [IMP] address or remove various minor FIXM/TOD
[REM] legacy GOES transformations code
55182 2019_05_16 [IMP] in location edit, if user taps GPS button save location automatically
[IMP] in severe dashboard show stats in subtitle like flutter port
55181 2019_05_15 [REM] remove county zoom change
[IMP] address or remove various minor FIXM/TOD
55180 2019_05_15 [IMP] in radar don't hide counties until zoomed out further (Craig)
[IMP] address or remove various minor FIXME/TODO
[IMP] address or remove various minor FIXM/TOD
[REF] various camelCase
55179 2019_05_14 [ADD] make radarLocationUpdateInterval (GPS) configurable
[BUG] SPC HREF from long press app icon was not working (crash)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ https://github.com/ELY3M/wX---modded-by-ELY-M/releases
#
## DONE!
====================================
updated the code with Joshua many changes and added in zoom setting for conus radar to zoom out to (5-20-19) (Tornado day in OK!)
all watch crash bugs should be gone, hopefully!
updated the code with Joshuas changes with the warnings mod/settings (4-20-19).
updated the code with Joshuas changes (4-13-19).
Now, you can change the radar legend text color in the color settings - it was requested by Mike T.
Expand Down
2 changes: 2 additions & 0 deletions TODOs.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#
## DONE!
====================================
updated the code with Joshua many changes and added in zoom setting for conus radar to zoom out to (5-20-19) (Tornado day in OK!)
all watch crash bugs should be gone, hopefully!
updated the code with Joshuas changes with the warnings mod/settings (4-20-19).
updated the code with Joshuas changes (4-13-19).
Now, you can change the radar legend text color in the color settings - it was requested by Mike T.
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="joshuatee.wx"
android:versionCode="55180"
android:versionName="55180"
android:versionCode="55190"
android:versionName="55190"
>

<uses-permission android:name="android.permission.INTERNET" />
Expand Down
30 changes: 15 additions & 15 deletions app/src/main/java/joshuatee/wx/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import joshuatee.wx.util.UtilityDownload
import joshuatee.wx.util.UtilityDownloadNws
import joshuatee.wx.external.UtilityStringExternal

fun String.parse(matchStr: String): String {
return UtilityString.parseS(this, matchStr)
fun String.parse(match: String): String {
return UtilityString.parse(this, match)
}

fun String.condenseSpace(): String {
Expand All @@ -42,16 +42,16 @@ fun String.truncate(size: Int): String {
return UtilityStringExternal.truncate(this, size)
}

fun String.parse(p: Pattern): String {
return UtilityString.parseS(this, p)
fun String.parse(pattern: Pattern): String {
return UtilityString.parse(this, pattern)
}

fun String.parseColumn(matchStr: String): List<String> {
return UtilityString.parseColumnS(this, matchStr)
fun String.parseColumn(match: String): List<String> {
return UtilityString.parseColumn(this, match)
}

fun String.parseColumn(p: Pattern): List<String> {
return UtilityString.parseColumnS(this, p)
fun String.parseColumn(pattern: Pattern): List<String> {
return UtilityString.parseColumn(this, pattern)
}

fun String.getImage(): Bitmap {
Expand All @@ -75,23 +75,23 @@ fun String.getHtmlUnsafe(): String {
}

fun String.getNwsHtml(): String {
return UtilityDownloadNws.getNwsStringFromUrl(this)
return UtilityDownloadNws.getStringFromUrl(this)
}

fun String.getHtmlSep(): String {
return UtilityDownload.getStringFromUrlWithSeparator(this)
}

fun String.parseColumnAll(p: Pattern): List<String> {
return UtilityString.parseColumnAllS(this, p)
fun String.parseColumnAll(pattern: Pattern): List<String> {
return UtilityString.parseColumnAll(this, pattern)
}

fun String.parseLastMatch(p: Pattern): String {
return UtilityString.parseLastMatchS(this, p)
fun String.parseLastMatch(pattern: Pattern): String {
return UtilityString.parseLastMatch(this, pattern)
}

fun String.parseLastMatch(matchStr: String): String {
return UtilityString.parseLastMatchS(this, matchStr)
fun String.parseLastMatch(match: String): String {
return UtilityString.parseLastMatch(this, match)
}


Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/joshuatee/wx/MyApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class MyApplication : Application() {
.readTimeout(15, TimeUnit.SECONDS)
.addInterceptor(okhttp3Interceptor)
.build()
UtilityTTS.initTTS(applicationContext)
UtilityTTS.initTts(applicationContext)
UtilityCities.initCitiesArray()
if (!loadedBuffers) {
initBuffers(this)
Expand Down Expand Up @@ -730,7 +730,7 @@ class MyApplication : Application() {
dis.close()
inputStream.close()
} catch (e: IOException) {
UtilityLog.HandleException(e)
UtilityLog.handleException(e)
}
}
}
Expand All @@ -744,8 +744,9 @@ class MyApplication : Application() {
const val NWS_CONUS_RADAR: String = "https://radar.weather.gov/ridge/Conus/RadarImg/latest_radaronly.gif";
const val NWS_CONUS_RADAR_GFW: String = "https://radar.weather.gov/ridge/Conus/RadarImg/latest_radaronly.gfw"
var radarConusRadar: Boolean = false
var radarConusRadarZoom: Int = 173
var radarWarnings: Boolean = false
var radarTorWarnings: Boolean = true
var radarTorWarnings: Boolean = true
var radarSvrWarnings: Boolean = true
var radarEwwWarnings: Boolean = true
var radarFfwWarnings: Boolean = true
Expand Down Expand Up @@ -810,6 +811,7 @@ class MyApplication : Application() {
private fun initRadarPreferences() {
radarLocationUpdateInterval = getInitialPreference("RADAR_LOCATION_UPDATE_INTERVAL", 10)
radarConusRadar = getInitialPreference("CONUS_RADAR", "false")
radarConusRadarZoom = getInitialPreference("CONUS_RADAR_ZOOM", 173)
radarWarnings = getInitialPreference("COD_WARNINGS_DEFAULT", "false")
radarTorWarnings = getInitialPreference("TOR_WARNINGS", "false")
radarSvrWarnings = getInitialPreference("SVR_WARNINGS", "false")
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/joshuatee/wx/UIPreferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ object UIPreferences {
var useAwcRadarMosaic: Boolean = false

fun initPreferences(context: Context) {

val normalTextSize = Utility.readPref(context, "TEXTVIEW_FONT_SIZE", 16) // 14 16 21
MyApplication.textSizeSmall = UtilityUI.spToPx(normalTextSize - 2, context)
MyApplication.textSizeNormal = UtilityUI.spToPx(normalTextSize, context)
Expand Down
46 changes: 21 additions & 25 deletions app/src/main/java/joshuatee/wx/UtilityWidget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object UtilityWidget {
.activityInfo.packageName
context.grantUriPermission(str, imgUri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
} catch (e: Exception) {
UtilityLog.HandleException(e)
UtilityLog.handleException(e)
}
return imgUri
}
Expand Down Expand Up @@ -143,20 +143,20 @@ object UtilityWidget {
val hazardRaw = objHazards.hazards
Utility.writePref(context, "HAZARD_WIDGET", objHazards.getHazardsShort())
Utility.writePref(context, "7DAY_WIDGET", objSevenDay.sevenDayShort)
if (objCc.data1 != "") {
Utility.writePref(context, "CC_WIDGET", objCc.data1)
if (objCc.data != "") {
Utility.writePref(context, "CC_WIDGET", objCc.data)
}
if (objCc.iconUrl != "") {
Utility.writePref(context, "CC_WIDGET_ICON_URL", objCc.iconUrl)
}
Utility.writePref(context, "UPDTIME_WIDGET", objCc.status)
if (objSevenDay.sevenDayExtStr != "") {
Utility.writePref(context, "7DAY_EXT_WIDGET", objSevenDay.sevenDayExtStr)
if (objSevenDay.sevenDayLong != "") {
Utility.writePref(context, "7DAY_EXT_WIDGET", objSevenDay.sevenDayLong)
}
Utility.writePref(context, "HAZARD_URL_WIDGET", objHazards.hazards)
Utility.writePref(context, "HAZARD_RAW_WIDGET", hazardRaw)
if (objSevenDay.iconstr != "") {
Utility.writePref(context, "7DAY_ICONS_WIDGET", objSevenDay.iconstr)
if (objSevenDay.iconsAsString != "") {
Utility.writePref(context, "7DAY_ICONS_WIDGET", objSevenDay.iconsAsString)
}
Utility.commitPref(context)
update(context, CCLegacy)
Expand All @@ -181,7 +181,6 @@ object UtilityWidget {
}
}

// FIXME create helper objects
fun setupIntent(
context: Context,
remoteViews: RemoteViews,
Expand All @@ -192,14 +191,13 @@ object UtilityWidget {
actionString: String
) {
val requestID = System.currentTimeMillis().toInt()
val intentAfd = Intent(context, activity)
intentAfd.putExtra(activityFlag, activityStringArr)
intentAfd.action = actionString
val intent = Intent(context, activity)
intent.putExtra(activityFlag, activityStringArr)
intent.action = actionString
val stackBuilder = TaskStackBuilder.create(context)
stackBuilder.addParentStack(activity)
stackBuilder.addNextIntent(intentAfd)
val pendingIntent =
stackBuilder.getPendingIntent(requestID, PendingIntent.FLAG_UPDATE_CURRENT)
stackBuilder.addNextIntent(intent)
val pendingIntent = stackBuilder.getPendingIntent(requestID, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews.setOnClickPendingIntent(layoutItem, pendingIntent)
}

Expand All @@ -213,14 +211,13 @@ object UtilityWidget {
actionString: String
) {
val requestID = System.currentTimeMillis().toInt()
val intentAfd = Intent(context, activity)
intentAfd.putExtra(activityFlag, activityString)
intentAfd.action = actionString
val intent = Intent(context, activity)
intent.putExtra(activityFlag, activityString)
intent.action = actionString
val stackBuilder = TaskStackBuilder.create(context)
stackBuilder.addParentStack(activity)
stackBuilder.addNextIntent(intentAfd)
val pendingIntent =
stackBuilder.getPendingIntent(requestID, PendingIntent.FLAG_UPDATE_CURRENT)
stackBuilder.addNextIntent(intent)
val pendingIntent = stackBuilder.getPendingIntent(requestID, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews.setOnClickPendingIntent(layoutItem, pendingIntent)
}

Expand All @@ -232,13 +229,12 @@ object UtilityWidget {
actionString: String
) {
val requestID = System.currentTimeMillis().toInt()
val intentAfd = Intent(context, activity)
intentAfd.action = actionString
val intent = Intent(context, activity)
intent.action = actionString
val stackBuilder = TaskStackBuilder.create(context)
stackBuilder.addParentStack(activity)
stackBuilder.addNextIntent(intentAfd)
val pendingIntent =
stackBuilder.getPendingIntent(requestID, PendingIntent.FLAG_UPDATE_CURRENT)
stackBuilder.addNextIntent(intent)
val pendingIntent = stackBuilder.getPendingIntent(requestID, PendingIntent.FLAG_UPDATE_CURRENT)
remoteViews.setOnClickPendingIntent(layoutItem, pendingIntent)
}

Expand Down
Loading

0 comments on commit 0820660

Please sign in to comment.