Skip to content

Commit

Permalink
55922-elys
Browse files Browse the repository at this point in the history
  • Loading branch information
ELY M committed Nov 17, 2024
1 parent e309e77 commit 0ccf621
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 165 deletions.
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="55921"
android:versionName="55921-elys">
android:versionCode="55922"
android:versionName="55922-elys">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Expand Down
201 changes: 104 additions & 97 deletions app/src/main/java/joshuatee/wx/fragments/MiscFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import joshuatee.wx.misc.WebView
import joshuatee.wx.misc.WebViewTwitter
import joshuatee.wx.models.ModelsGenericActivity
import joshuatee.wx.nhc.NhcActivity
import joshuatee.wx.radar.RadarMosaicNwsActivity
import joshuatee.wx.radar.RadarMosaicActivity
import joshuatee.wx.settings.Location
import joshuatee.wx.vis.GoesActivity
import joshuatee.wx.radar.WXGLRadarActivity
Expand All @@ -51,7 +51,11 @@ class MiscFragment : Fragment() {

private val hm = mutableMapOf<String, TileObject>()

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_recyclerview, container, false)
TabScreen(requireActivity(), view, "FRAGMENT_MISC_ORDER", tileObjects)
return view
Expand All @@ -60,68 +64,71 @@ class MiscFragment : Fragment() {
private val tileObjects: MutableList<TileObject>
get() {
hm["model_ncep"] = TileObject(
R.drawable.ncep,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "NCEP", "NCEP"),
"model_ncep", "NCEP"
R.drawable.ncep,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "NCEP", "NCEP"),
"model_ncep", "NCEP"
)
hm["model_hrrr"] = TileObject(
R.drawable.hrrrviewer,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "ESRL", "ESRL"),
"model_hrrr", "HRRR"
R.drawable.hrrrviewer,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "ESRL", "ESRL"),
"model_hrrr", "HRRR"
)

hm["uswarn"] = TileObject(
R.drawable.uswarn,
USAlertsActivity::class.java,
USAlertsActivity.URL,
arrayOf(".*?Tornado Warning.*?|.*?Severe Thunderstorm Warning.*?|.*?Flash Flood Warning.*?", "us"),
"uswarn", "US Warnings"
R.drawable.uswarn,
USAlertsActivity::class.java,
USAlertsActivity.URL,
arrayOf(
".*?Tornado Warning.*?|.*?Severe Thunderstorm Warning.*?|.*?Flash Flood Warning.*?",
"us"
),
"uswarn", "US Warnings"
)
hm["wpctext"] = TileObject(
R.drawable.srfd,
NationalTextActivity::class.java,
NationalTextActivity.URL,
arrayOf("pmdspd", "Short Range Forecast Discussion"),
"wpctext", "National text products"
R.drawable.srfd,
NationalTextActivity::class.java,
NationalTextActivity.URL,
arrayOf("pmdspd", "Short Range Forecast Discussion"),
"wpctext", "National text products"
)
hm["nhc"] = TileObject(
R.drawable.nhc,
NhcActivity::class.java,
"",
arrayOf(),
"nhc", "NHC"
R.drawable.nhc,
NhcActivity::class.java,
"",
arrayOf(),
"nhc", "NHC"
)
hm["nwsmosaic"] = TileObject(
R.drawable.nws_sector,
RadarMosaicNwsActivity::class.java,
RadarMosaicNwsActivity.URL,
arrayOf("sector"),
"nwsmosaic", "NWS Radar Mosaics"
R.drawable.nws_sector,
RadarMosaicActivity::class.java,
RadarMosaicActivity.URL,
arrayOf("sector"),
"nwsmosaic", "NWS Radar Mosaics"
)
hm["goes"] = TileObject(
R.drawable.goes,
GoesActivity::class.java,
GoesActivity.RID,
arrayOf("CONUS", "9"),
"goes", "GOES"
R.drawable.goes,
GoesActivity::class.java,
GoesActivity.RID,
arrayOf("CONUS", "9"),
"goes", "GOES"
)
hm["lightning"] = TileObject(
R.drawable.lightning,
GoesActivity::class.java,
GoesActivity.RID,
arrayOf("CONUS", "23"),
"lightning", "lightning"
R.drawable.lightning,
GoesActivity::class.java,
GoesActivity.RID,
arrayOf("CONUS", "23"),
"lightning", "lightning"
)
hm["wpcimages"] = TileObject(
R.drawable.fmap,
NationalImagesActivity::class.java,
"",
arrayOf(),
"wpcimages", "National Images"
R.drawable.fmap,
NationalImagesActivity::class.java,
"",
arrayOf(),
"wpcimages", "National Images"
)
//elys mod - keeping twitter
hm["twitter_state"] = TileObject(
Expand All @@ -137,78 +144,78 @@ class MiscFragment : Fragment() {
"twitter_tornado", "Twitter tornado"
)
hm["opc"] = TileObject(
R.drawable.opc,
ImageCollectionActivity::class.java,
ImageCollectionActivity.TYPE,
arrayOf("OPC"),
"opc", "OPC"
R.drawable.opc,
ImageCollectionActivity::class.java,
ImageCollectionActivity.TYPE,
arrayOf("OPC"),
"opc", "OPC"
)
hm["goesfulldisk"] = TileObject(
R.drawable.goesfulldisk,
ImageCollectionActivity::class.java,
ImageCollectionActivity.TYPE,
arrayOf("GOESFD"),
"goesfulldisk", "GOES Full Disk"
R.drawable.goesfulldisk,
ImageCollectionActivity::class.java,
ImageCollectionActivity.TYPE,
arrayOf("GOESFD"),
"goesfulldisk", "GOES Full Disk"
)
hm["nwsobs"] = TileObject(
R.drawable.nwsobssites,
NwsObsSitesActivity::class.java,
"",
arrayOf(),
"nwsobs", "Observation sites"
R.drawable.nwsobssites,
NwsObsSitesActivity::class.java,
"",
arrayOf(),
"nwsobs", "Observation sites"
)
if (!UIPreferences.dualpaneRadarIcon) {
hm["wxogl"] = TileObject(
R.drawable.wxogldualpane,
WXGLRadarActivityMultiPane::class.java,
WXGLRadarActivityMultiPane.RID,
arrayOf(Location.rid, "", "2"),
"wxogl", "Dual pane nexrad radar"
R.drawable.wxogldualpane,
WXGLRadarActivityMultiPane::class.java,
WXGLRadarActivityMultiPane.RID,
arrayOf(Location.rid, "", "2"),
"wxogl", "Dual pane nexrad radar"
)
} else {
hm["wxogl"] = TileObject(
R.drawable.wxoglsinglepane,
WXGLRadarActivity::class.java,
WXGLRadarActivity.RID,
arrayOf(Location.rid, ""),
"wxogl", "Single pane nexrad radar"
R.drawable.wxoglsinglepane,
WXGLRadarActivity::class.java,
WXGLRadarActivity.RID,
arrayOf(Location.rid, ""),
"wxogl", "Single pane nexrad radar"
)
}
Location.checkCurrentLocationValidity()
hm["wxoglquad"] = TileObject(
R.drawable.wxoglquadpane,
WXGLRadarActivityMultiPane::class.java,
WXGLRadarActivityMultiPane.RID,
arrayOf(Location.rid, "", "4"),
"wxoglquad", "Dual pane nexrad radar"
R.drawable.wxoglquadpane,
WXGLRadarActivityMultiPane::class.java,
WXGLRadarActivityMultiPane.RID,
arrayOf(Location.rid, "", "4"),
"wxoglquad", "Dual pane nexrad radar"
)
hm["model_nssl_wrf"] = TileObject(
R.drawable.nsslwrf,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "NSSL", "NSSL"),
"model_nssl_wrf", "WRF"
R.drawable.nsslwrf,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "NSSL", "NSSL"),
"model_nssl_wrf", "WRF"
)
hm["goes16"] = TileObject(
R.drawable.goes16,
GoesActivity::class.java,
GoesActivity.RID,
arrayOf(""),
"goes16", "GOES"
R.drawable.goes16,
GoesActivity::class.java,
GoesActivity.RID,
arrayOf(""),
"goes16", "GOES"
)
hm["wpcgefs"] = TileObject(
R.drawable.wpcgefs,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "WPCGEFS", "WPC"),
"wpcgefs", "WPC GEFS"
R.drawable.wpcgefs,
ModelsGenericActivity::class.java,
ModelsGenericActivity.INFO,
arrayOf("1", "WPCGEFS", "WPC"),
"wpcgefs", "WPC GEFS"
)
hm["wpc_rainfall"] = TileObject(
R.drawable.wpc_rainfall,
RainfallOutlookSummaryActivity::class.java,
"",
arrayOf(),
"wpc_rainfall", "WPC RAINFALL"
R.drawable.wpc_rainfall,
RainfallOutlookSummaryActivity::class.java,
"",
arrayOf(),
"wpc_rainfall", "WPC RAINFALL"
)
//elys mod
hm["aurora"] = TileObject(
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/joshuatee/wx/objects/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import joshuatee.wx.models.ModelsSpcHrefActivity
import joshuatee.wx.nhc.NhcActivity
import joshuatee.wx.nhc.NhcStormActivity
import joshuatee.wx.nhc.NhcStormDetails
import joshuatee.wx.radar.RadarMosaicNwsActivity
import joshuatee.wx.radar.RadarMosaicActivity
import joshuatee.wx.radar.WXGLRadarActivity
import joshuatee.wx.radar.WXGLRadarActivityMultiPane
import joshuatee.wx.settings.FavAddActivity
Expand Down Expand Up @@ -303,8 +303,8 @@ class Route() {
fun radarMosaic(context: Context) {
Route(
context,
RadarMosaicNwsActivity::class.java,
RadarMosaicNwsActivity.URL,
RadarMosaicActivity::class.java,
RadarMosaicActivity.URL,
arrayOf("")
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import joshuatee.wx.ui.TouchImage
import joshuatee.wx.util.Utility
import joshuatee.wx.util.UtilityShare

class RadarMosaicNwsActivity : VideoRecordActivity() {
class RadarMosaicActivity : VideoRecordActivity() {

//
// Provides native interface to NWS radar mosaics along with animations
Expand All @@ -57,7 +57,7 @@ class RadarMosaicNwsActivity : VideoRecordActivity() {
private lateinit var navDrawer: NavDrawer
private val prefImagePosition = "RADARMOSAICNWS"
private val prefTokenSector = "REMEMBER_NWSMOSAIC_SECTOR"
private var sector = UtilityNwsRadarMosaic.getNearest(Location.latLon)
private var sector = UtilityRadarMosaic.getNearest(Location.latLon)
private var saveLocation = false

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand All @@ -72,19 +72,25 @@ class RadarMosaicNwsActivity : VideoRecordActivity() {

@SuppressLint("MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState, R.layout.activity_image_show_navdrawer, R.menu.radarnwsmosaic, bottomToolbar = false)
super.onCreate(
savedInstanceState,
R.layout.activity_image_show_navdrawer,
R.menu.radarnwsmosaic,
bottomToolbar = false
)
val arguments = intent.getStringArrayExtra(URL)!!
setupUI()
if (arguments.isNotEmpty() && arguments[0] != "") {
sector = Utility.readPref(this, prefTokenSector, sector)
saveLocation = true
}
navDrawer.index = UtilityNwsRadarMosaic.sectors.indexOf(sector)
navDrawer.index = UtilityRadarMosaic.sectors.indexOf(sector)
getContent()
}

private fun setupUI() {
navDrawer = NavDrawer(this, UtilityNwsRadarMosaic.labels, UtilityNwsRadarMosaic.sectors) { getContent() }
navDrawer =
NavDrawer(this, UtilityRadarMosaic.labels, UtilityRadarMosaic.sectors) { getContent() }
touchImage = TouchImage(this, toolbar, R.id.iv, navDrawer, "")
objectAnimate = ObjectAnimate(this, touchImage)
objectToolbar.connectClick { navDrawer.open() }
Expand All @@ -100,7 +106,7 @@ class RadarMosaicNwsActivity : VideoRecordActivity() {
private fun getContent() {
objectAnimate.stop()
title = navDrawer.url
FutureBytes(UtilityNwsRadarMosaic.get(navDrawer.url), ::showImage)
FutureBytes(UtilityRadarMosaic.get(navDrawer.url), ::showImage)
}

private fun showImage(bitmap: Bitmap) {
Expand All @@ -126,7 +132,12 @@ class RadarMosaicNwsActivity : VideoRecordActivity() {
return true
}
when (item.itemId) {
R.id.action_animate -> objectAnimate.animateClicked(::getContent) { UtilityNwsRadarMosaic.getAnimation(navDrawer.url) }
R.id.action_animate -> objectAnimate.animateClicked(::getContent) {
UtilityRadarMosaic.getAnimation(
navDrawer.url
)
}

R.id.action_stop -> objectAnimate.stop()
R.id.action_pause -> objectAnimate.pause()
R.id.action_share -> if (UIPreferences.recordScreenShare && Build.VERSION.SDK_INT < 33) {
Expand Down
Loading

0 comments on commit 0ccf621

Please sign in to comment.