Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ELY3M committed Jul 21, 2022
1 parent 509b7be commit 270e0ff
Show file tree
Hide file tree
Showing 92 changed files with 716 additions and 639 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"
package="joshuatee.wx"
android:versionCode="55624"
android:versionName="55624-elys"
android:versionCode="55628"
android:versionName="55628-elys"
>

<uses-permission android:name="android.permission.INTERNET" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/joshuatee/wx/WX.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class WX : CommonActionBarFragment() {
val menu = toolbarBottom.menu
voiceRecognitionIcon = menu.findItem(R.id.action_vr)
voiceRecognitionIcon.isVisible = UIPreferences.vrButton
val fab = ObjectFab(this, this, R.id.fab, GlobalVariables.ICON_RADAR_WHITE) { openNexradRadar(this) }
val fab = ObjectFab(this, R.id.fab, GlobalVariables.ICON_RADAR_WHITE) { openNexradRadar(this) }
if (UIPreferences.mainScreenRadarFab) {
val radarMi = menu.findItem(R.id.action_radar)
radarMi.isVisible = false
Expand Down Expand Up @@ -281,7 +281,7 @@ class WX : CommonActionBarFragment() {
}
true
}
ObjectFab(this, this, R.id.fab2, GlobalVariables.ICON_ADD2) {
ObjectFab(this, R.id.fab2, GlobalVariables.ICON_ADD2) {
val headerSize: Float
val tabStr = UtilitySpc.checkSpc()
if (UIPreferences.checkspc || UIPreferences.checktor || UIPreferences.checkwpc && (tabStr[0] != "SPC" || tabStr[1] != "MISC")) {
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/java/joshuatee/wx/activitiesmisc/ForecastActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ class ForecastActivity : BaseActivity() {
}

private fun downloadCc() {
objectCurrentConditions = ObjectCurrentConditions(this@ForecastActivity, latLon)
objectCurrentConditions.timeCheck()
bitmapForCurrentCondition = UtilityForecastIcon.getIcon(this@ForecastActivity, objectCurrentConditions.iconUrl)
objectCurrentConditions = ObjectCurrentConditions(this, latLon)
objectCurrentConditions.timeCheck(this)
bitmapForCurrentCondition = UtilityForecastIcon.getIcon(this, objectCurrentConditions.iconUrl)
}

private fun updateCc() {
Expand All @@ -129,31 +129,31 @@ class ForecastActivity : BaseActivity() {

private fun download7Day() {
objectSevenDay = ObjectSevenDay(latLon)
bitmaps = objectSevenDay.icons.map { UtilityForecastIcon.getIcon(this@ForecastActivity, it) }
bitmaps = objectSevenDay.icons.map { UtilityForecastIcon.getIcon(this, it) }
}

private fun update7Day() {
linearLayoutForecast.removeAllViewsInLayout()
bitmaps.forEachIndexed { index, bitmap ->
val objectCard7Day = ObjectCard7Day(this@ForecastActivity, bitmap, true, index, objectSevenDay.forecastList)
val objectCard7Day = ObjectCard7Day(this, bitmap, true, index, objectSevenDay.forecastList)
objectCard7Day.setOnClickListener { scrollView.smoothScrollTo(0, 0) }
linearLayoutForecast.addView(objectCard7Day.get())
}
// sunrise card
val objectCardText = ObjectCardText(this@ForecastActivity)
val objectCardText = ObjectCardText(this)
objectCardText.center()
objectCardText.text = (UtilityTimeSunMoon.getSunriseSunset(this@ForecastActivity, Location.currentLocationStr, false) + GlobalVariables.newline + UtilityTime.gmtTime())
objectCardText.text = (UtilityTimeSunMoon.getSunriseSunset(this, Location.currentLocationStr, false) + GlobalVariables.newline + UtilityTime.gmtTime())
linearLayoutForecast.addView(objectCardText.get())
}

private fun setupHazardCards() {
linearLayoutHazards.removeAllViews()
hazardCards.clear()
objectHazards.titles.indices.forEach { z ->
hazardCards.add(ObjectCardText(this@ForecastActivity))
hazardCards.add(ObjectCardText(this))
hazardCards[z].setupHazard()
hazardCards[z].text = objectHazards.titles[z].uppercase(Locale.US)
hazardCards[z].setOnClickListener { ObjectIntent.showHazard(this@ForecastActivity, arrayOf(objectHazards.urls[z])) }
hazardCards[z].setOnClickListener { ObjectIntent.showHazard(this, arrayOf(objectHazards.urls[z])) }
linearLayoutHazards.addView(hazardCards[z].get())
}
}
Expand All @@ -167,7 +167,7 @@ class ForecastActivity : BaseActivity() {
}

private fun saveLocation() {
val message = Location.save(this@ForecastActivity, latLon)
val message = Location.save(this, latLon)
ObjectPopupMessage(linearLayout, message)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ImageCollectionActivity : VideoRecordActivity() {

private var bitmap = UtilityImg.getBlankBitmap()
private lateinit var img: ObjectTouchImageView
private lateinit var drw: ObjectNavDrawer
private lateinit var objectNavDrawer: ObjectNavDrawer
private lateinit var imageCollection: ObjectImagesCollection
private var animDrawable = AnimationDrawable()

Expand All @@ -63,7 +63,7 @@ class ImageCollectionActivity : VideoRecordActivity() {
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
val actionAnimate = menu.findItem(R.id.action_animate)
actionAnimate.isVisible = false
if (drw.url.contains("jma") && imageCollection.title == "GOESFD") {
if (objectNavDrawer.url.contains("jma") && imageCollection.title == "GOESFD") {
actionAnimate.isVisible = true
}
return super.onPrepareOptionsMenu(menu)
Expand All @@ -75,11 +75,11 @@ class ImageCollectionActivity : VideoRecordActivity() {
val activityArguments = intent.getStringArrayExtra(TYPE)!!
imageCollection = ObjectImagesCollection.imageCollectionMap[activityArguments[0]]!!
title = imageCollection.title
drw = ObjectNavDrawer(this, imageCollection.labels, imageCollection.urls, ::getContent)
img = ObjectTouchImageView(this, this, toolbar, toolbarBottom, R.id.iv, drw, imageCollection.prefTokenIdx)
img.setListener(this, drw, ::getContent)
drw.index = Utility.readPref(this, imageCollection.prefTokenIdx, 0)
toolbar.setOnClickListener { drw.drawerLayout.openDrawer(drw.listView) }
objectNavDrawer = ObjectNavDrawer(this, imageCollection.labels, imageCollection.urls, ::getContent)
img = ObjectTouchImageView(this, toolbar, R.id.iv, objectNavDrawer, imageCollection.prefTokenIdx)
img.setListener(objectNavDrawer, ::getContent)
objectNavDrawer.index = Utility.readPref(this, imageCollection.prefTokenIdx, 0)
toolbar.setOnClickListener { objectNavDrawer.open() }
getContent()
}

Expand All @@ -89,12 +89,12 @@ class ImageCollectionActivity : VideoRecordActivity() {
}

private fun getContent() {
toolbar.subtitle = drw.getLabel()
FutureVoid(this, { bitmap = drw.url.getImage() }, ::showImage)
toolbar.subtitle = objectNavDrawer.getLabel()
FutureVoid(this, { bitmap = objectNavDrawer.url.getImage() }, ::showImage)
}

private fun showImage() {
if (drw.url.contains("large_latestsfc.gif")) {
if (objectNavDrawer.url.contains("large_latestsfc.gif")) {
img.setMaxZoom(16.0f)
} else {
img.setMaxZoom(4.0f)
Expand All @@ -106,23 +106,25 @@ class ImageCollectionActivity : VideoRecordActivity() {

override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
drw.actionBarDrawerToggle.syncState()
objectNavDrawer.actionBarDrawerToggle.syncState()
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
drw.actionBarDrawerToggle.onConfigurationChanged(newConfig)
objectNavDrawer.actionBarDrawerToggle.onConfigurationChanged(newConfig)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (drw.actionBarDrawerToggle.onOptionsItemSelected(item)) return true
if (objectNavDrawer.actionBarDrawerToggle.onOptionsItemSelected(item)) {
return true
}
when (item.itemId) {
R.id.action_animate -> getAnimate()
R.id.action_share -> {
if (UIPreferences.recordScreenShare) {
checkOverlayPerms()
} else {
UtilityShare.bitmap(this, this, imageCollection.title, bitmap)
UtilityShare.bitmap(this, imageCollection.title, bitmap)
}
}
else -> return super.onOptionsItemSelected(item)
Expand All @@ -131,13 +133,13 @@ class ImageCollectionActivity : VideoRecordActivity() {
}

override fun onStop() {
img.imgSavePosnZoom(this, imageCollection.prefImagePosition)
img.imgSavePosnZoom(imageCollection.prefImagePosition)
super.onStop()
}

private fun getAnimate() {
FutureVoid(this@ImageCollectionActivity,
{ animDrawable = UtilityGoesFullDisk.getAnimation(this@ImageCollectionActivity, drw.url) })
FutureVoid(this,
{ animDrawable = UtilityGoesFullDisk.getAnimation(this, objectNavDrawer.url) })
{ UtilityImgAnim.startAnimation(animDrawable, img) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ImageShowActivity : BaseActivity() {
@SuppressLint("MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState, R.layout.activity_image_show, R.menu.image_show_activity, false)
img = ObjectTouchImageView(this, this, toolbar, R.id.iv)
img = ObjectTouchImageView(this, toolbar, R.id.iv)
val activityArguments: Array<String> = intent.getStringArrayExtra(URL)!!
url = activityArguments[0]
title = "Image Viewer"
Expand Down Expand Up @@ -101,18 +101,18 @@ class ImageShowActivity : BaseActivity() {

private fun showImage() {
if (needsWhiteBackground) {
bitmap = UtilityImg.addColorBackground(this@ImageShowActivity, bitmap, Color.WHITE)
bitmap = UtilityImg.addColorBackground(this, bitmap, Color.WHITE)
}
img.setBitmap(bitmap)
}

private fun getContentFromStorage() {
img.setBitmap(UtilityIO.bitmapFromInternalStorage(this@ImageShowActivity, urls[1]))
img.setBitmap(UtilityIO.bitmapFromInternalStorage(this, urls[1]))
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_share -> UtilityShare.bitmap(this, this, shareTitle, bitmap)
R.id.action_share -> UtilityShare.bitmap(this, shareTitle, bitmap)
else -> return super.onOptionsItemSelected(item)
}
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class LightningActivity : VideoRecordActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState, R.layout.activity_image_show_navdrawer, R.menu.lightning_activity, iconsEvenlySpaced = true, bottomToolbar = false)
objectNavDrawer = ObjectNavDrawer(this, UtilityLightning.labels, UtilityLightning.urls, ::getContent)
img = ObjectTouchImageView(this, this, toolbar, toolbarBottom, R.id.iv, objectNavDrawer, prefTokenIdx)
img = ObjectTouchImageView(this, toolbar, toolbarBottom, R.id.iv, objectNavDrawer, prefTokenIdx)
objectNavDrawer.index = Utility.readPref(this, prefTokenIdx, 0)
period = Utility.readPref(this, "LIGHTNING_PERIOD", period)
periodPretty = UtilityLightning.getTimePretty(period)
Expand Down Expand Up @@ -99,7 +99,7 @@ class LightningActivity : VideoRecordActivity() {
if (UIPreferences.recordScreenShare) {
checkOverlayPerms()
} else {
UtilityShare.bitmap(this, this, "Lightning Strikes " + objectNavDrawer.getLabel() + " $periodPretty", bitmap)
UtilityShare.bitmap(this, "Lightning Strikes " + objectNavDrawer.getLabel() + " $periodPretty", bitmap)
}
}
R.id.action_15min -> setPeriodGetContent("0.25")
Expand All @@ -119,7 +119,7 @@ class LightningActivity : VideoRecordActivity() {
}

override fun onStop() {
img.imgSavePosnZoom(this, "LIGHTNING")
img.imgSavePosnZoom("LIGHTNING")
super.onStop()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class NwsObsSitesActivity : BaseActivity() {
title = titleString
updateButton()
siteDisplay = false
objectRecyclerView = ObjectRecyclerView(this, this, R.id.card_list, GlobalArrays.states.toMutableList(), ::itemClicked)
objectRecyclerView = ObjectRecyclerView(this, R.id.card_list, GlobalArrays.states.toMutableList(), ::itemClicked)
}

private fun updateButton() {
Expand All @@ -94,7 +94,7 @@ class NwsObsSitesActivity : BaseActivity() {
private fun showObsSite(obsSite: String) {
Utility.writePref(prefToken, obsSite)
updateButton()
ObjectIntent.showWebView(this@NwsObsSitesActivity, arrayOf("https://www.weather.gov/wrh/timeseries?site=$obsSite", obsSite))
ObjectIntent.showWebView(this, arrayOf("https://www.weather.gov/wrh/timeseries?site=$obsSite", obsSite))
}

private fun stateSelected() {
Expand Down
Loading

0 comments on commit 270e0ff

Please sign in to comment.