Skip to content

Commit

Permalink
55932-elys
Browse files Browse the repository at this point in the history
  • Loading branch information
ELY M committed Jan 10, 2025
1 parent b284981 commit 3fe3dce
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 7 deletions.
10 changes: 10 additions & 0 deletions DOC/Todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## Bugs

* [FIX] during recent AS updates

```
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
```

* [ADD] Color Pal - vel not well developed
* [FIX] Color Pal - have to select before delete even though subtitle shows
* [FIX] Beam height is truncated
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"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="55931"
android:versionName="55931-elys">
android:versionCode="55932"
android:versionName="55932-elys">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/joshuatee/wx/settings/UtilityHomeScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ package joshuatee.wx.settings
import android.content.Context
import android.content.Intent
import joshuatee.wx.MyApplication
import joshuatee.wx.misc.ImageShowActivity
import joshuatee.wx.misc.RtmaActivity
import joshuatee.wx.misc.USAlertsActivity
import joshuatee.wx.models.ModelsGenericActivity
Expand All @@ -37,6 +38,7 @@ import joshuatee.wx.spc.SpcMesoActivity
import joshuatee.wx.spc.SpcSoundingsActivity
import joshuatee.wx.spc.SpcThunderStormOutlookActivity
import joshuatee.wx.ui.CardHSImage
import joshuatee.wx.util.DownloadImage
import joshuatee.wx.util.SoundingSites
import joshuatee.wx.vis.GoesActivity
import joshuatee.wx.wpc.NationalImagesActivity
Expand Down Expand Up @@ -187,6 +189,10 @@ internal object UtilityHomeScreen {
classArgs["RAD_2KM"] = arrayOf("")
classId["RAD_2KM"] = RadarMosaicActivity.URL

// classes["WEATHERSTORY"] = ImageShowActivity::class.java
// classArgs["WEATHERSTORY"] = arrayOf(DownloadImage.byProduct(context, "WEATHERSTORY"), "Weather Story")
// classId["WEATHERSTORY"] = ImageShowActivity.URL

listOf(
"FMAP",
"FMAPD2",
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/joshuatee/wx/util/DownloadImage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ object DownloadImage {

"WEATHERSTORY" -> {
needsBitmap = false
bitmap =
("https://www.weather.gov/images/" + Location.wfo.lowercase(Locale.US) + "/wxstory/Tab2FileL.png").getImage()
bitmap = WeatherStory.getUrl().getImage()
// bitmap =
// ("https://www.weather.gov/images/" + Location.wfo.lowercase(Locale.US) + "/wxstory/Tab2FileL.png").getImage()
}

"WFOWARNINGS" -> {
Expand Down
76 changes: 76 additions & 0 deletions app/src/main/java/joshuatee/wx/util/WeatherStory.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 [email protected]
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 <http://www.gnu.org/licenses/>.
*/

package joshuatee.wx.util

import joshuatee.wx.settings.Location

object WeatherStory {

fun getUrl(): String {
var productUrl = ""
val site = Location.wfo.lowercase()
var url = "https://www.weather.gov/$site/weatherstory"
val html = UtilityIO.getHtml(url)
var scrapeUrl = UtilityString.parse(
html,
"src=.(https://www.weather.gov//images/.../wxstory/Tab.FileL.png). "
)
if (scrapeUrl.isNotEmpty()) {
productUrl = scrapeUrl
} else {
scrapeUrl =
UtilityString.parse(html, "a href=.(/images/\\w{3}/features/weatherstory.png).")
if (scrapeUrl.isNotEmpty()) {
productUrl = "https://www.weather.gov/$scrapeUrl"
} else {
url = "https://weather.gov/$site"
val html = UtilityIO.getHtml(url)
// <div class="image"><img src="http://www.weather.gov/images//mob/graphicast/image8.png" style="max-width: 100%;"></div>
// <div class="image"><img src="http://www.weather.gov/images/abq/graphicast/image1.gif" style="max-width: 100%;"></div>
var scrapeUrls = UtilityString.parseColumn(
html,
"src=.(https?://www.weather.gov/images/?/.../graphicast/\\S*?[0-9].png). "
)
if (scrapeUrls.isNotEmpty()) {
productUrl = scrapeUrls[0]
} else {
scrapeUrls = UtilityString.parseColumn(
html,
"src=.(https?://www.weather.gov/images/?/.../graphicast/\\S*?[0-9].gif). "
)
if (scrapeUrls.isNotEmpty()) {
productUrl = scrapeUrls[0]
} else {
scrapeUrls = UtilityString.parseColumn(
html,
"src=.(https?://www.weather.gov/?/images/?/.../WxStory/\\S*?[0-9].png). "
)
if (scrapeUrls.isNotEmpty()) {
productUrl = scrapeUrls[0]
}
}
}
}
}
return productUrl
}
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
classpath 'com.android.tools.build:gradle:8.8.0'
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21"
}
Expand Down
17 changes: 16 additions & 1 deletion doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,28 @@

# Developer ChangeLog

## 55931 2025_01_05
## 55932 2025_01_10

* [ADD]

## 55931 2025_01_10

* [ADD] Better "Weather Story" handling for image in homescreen (if configured and if your WFO
offers it)
* [ADD] geographic boundaries for Guam and the Commonwealth of the Northern Mariana Islands (CNMI) (
required float size change in CanvasMain.kt and RadarGeomInfo.kt). NOTE: most functions do not
work for Guam/CNMI due to insufficient LAT/LON adjustment, it's a WIP
* [ADD] 2 observations points in Guam/CNMI but they are not yet usable within the program, it's a
WIP
* [ADD] tooling update

```
- classpath 'com.android.tools.build:gradle:8.7.3'
+ classpath 'com.android.tools.build:gradle:8.8.0'
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
```

## 55930 2025_01_05

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

0 comments on commit 3fe3dce

Please sign in to comment.