Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
U-METAL103\103 authored and U-METAL103\103 committed Mar 31, 2024
1 parent 341ad2d commit df3bda0
Show file tree
Hide file tree
Showing 46 changed files with 1,024 additions and 803 deletions.
41 changes: 21 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ android {
// }
//
// composeOptions {
// kotlinCompilerExtensionVersion = "1.5.4"
// // https://developer.android.com/jetpack/androidx/releases/compose-compiler
// kotlinCompilerExtensionVersion = "1.5.11"
// }

defaultConfig {
compileSdk 33
compileSdk 34
}

defaultConfig {
applicationId "joshuatee.wx"
// 2023-09-09 changed from 23 to 25
minSdkVersion 25
targetSdkVersion 33
targetSdkVersion 34
// Stops the Gradle plugin’s automatic rasterization of vectors (2016_02_25 add 23.2 )
// vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down Expand Up @@ -85,12 +86,12 @@ android {
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
// androidResources {
// additionalParameters '--no-version-vectors'
Expand All @@ -106,11 +107,11 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0'
// https://developer.android.com/jetpack/androidx/versions
implementation 'com.google.android.material:material:1.9.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
implementation 'com.google.android.material:material:1.11.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.media:media:1.7.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
// graphview source code was merged locally into project on 2023-12-30
Expand All @@ -132,20 +133,20 @@ dependencies {
implementation 'com.markodevcic:peko:3.0.1'
implementation 'org.shredzone.commons:commons-suncalc:3.5'

// def composeBom = platform('androidx.compose:compose-bom:2023.10.01')
// def composeBom = platform('androidx.compose:compose-bom:2024.03.00')
// implementation composeBom
//// androidTestImplementation composeBom
//
// // Choose one of the following:
// // Material Design 3
// implementation 'androidx.compose.material3:material3'
// // or Material Design 2
// implementation 'androidx.compose.material:material'
// // or skip Material Design and build directly on top of foundational components
// implementation 'androidx.compose.foundation:foundation'
// // or only import the main APIs for the underlying toolkit systems,
// // such as input and measurement/layout
// implementation 'androidx.compose.ui:ui'
//// // or Material Design 2
//// implementation 'androidx.compose.material:material'
//// // or skip Material Design and build directly on top of foundational components
//// implementation 'androidx.compose.foundation:foundation'
//// // or only import the main APIs for the underlying toolkit systems,
//// // such as input and measurement/layout
//// implementation 'androidx.compose.ui:ui'
//
// // Android Studio Preview support
// implementation 'androidx.compose.ui:ui-tooling-preview'
Expand All @@ -165,9 +166,9 @@ dependencies {
// implementation 'androidx.compose.material3:material3-window-size-class'
//
// // Optional - Integration with activities
// implementation 'androidx.activity:activity-compose:1.8.1'
// implementation 'androidx.activity:activity-compose:1.8.2'
// // Optional - Integration with ViewModels
// implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1'
// implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0'
//// // Optional - Integration with LiveData
//// implementation 'androidx.compose.runtime:runtime-livedata'
//// // Optional - Integration with RxJava
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<!-- modded by ELY M. -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="55874"
android:versionName="55874-elys">
android:versionCode="55878"
android:versionName="55878-elys">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Expand Down Expand Up @@ -543,7 +543,7 @@
android:exported="false"
android:grantUriPermissions="true" />

<!-- The content provider serving the (fake) weather data -->
<!-- The content provider serving the weather data -->
<provider
android:name="WeatherDataProvider"
android:exported="true"
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/joshuatee/wx/audio/AudioPlayActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import joshuatee.wx.common.GlobalVariables
import joshuatee.wx.ui.ObjectToolbar
import joshuatee.wx.ui.UtilityToolbar
import joshuatee.wx.ui.UtilityUI
import joshuatee.wx.util.Utility
import joshuatee.wx.util.UtilityLog

abstract class AudioPlayActivity : AppCompatActivity() {
Expand Down Expand Up @@ -72,7 +71,7 @@ abstract class AudioPlayActivity : AppCompatActivity() {
toolbar.setOnClickListener { toolbarBottom.showOverflowMenu() }
toolbarBottom.setOnClickListener { toolbarBottom.showOverflowMenu() }
UtilityToolbar.setElevation(toolbar)
pausePressedIcon = if (Utility.isThemeAllWhite()) {
pausePressedIcon = if (UtilityUI.isThemeAllWhite()) {
GlobalVariables.ICON_PAUSE_PRESSED_BLUE
} else {
GlobalVariables.ICON_PAUSE_PRESSED
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/joshuatee/wx/common/GlobalArrays.kt
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ object GlobalArrays {
"LVX: KY, Louisville",
"PAH: KY, Paducah",
"POE: LA, Fort Polk",
// "HDC: LA, Hammond", // to Begin NEXRAD Level III Product Dissemination on or around March 31, 2024 Service Change Notice 24-11
"HDC: LA, Hammond", // to Begin NEXRAD Level III Product Dissemination on or around March 31, 2024 Service Change Notice 24-11
"LCH: LA, Lake Charles",
"LIX: LA, New Orleans", // GONE as of late 2023
"SHV: LA, Shreveport",
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/joshuatee/wx/common/GlobalVariables.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object GlobalVariables {
val newline: String = System.lineSeparator()

const val PACKAGE_NAME = "joshuatee.wx"
const val PACKAGE_NAME_FILE = "joshuatee_wx"
// const val PACKAGE_NAME_FILE = "joshuatee_wx"
const val EMAIL = "[email protected]"
const val HTTP_USER_AGENT = "Android $PACKAGE_NAME $EMAIL"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ public static void main(String[] args) throws Exception {
}

// suggested replacement requires API26 FIXME TODO
//noinspection IOStreamConstructor
InputStream in = new UncompressInputStream(new FileInputStream(args[0]));

byte[] buf = new byte[100000];
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/joshuatee/wx/misc/SpottersActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import joshuatee.wx.settings.UtilityLocation
import joshuatee.wx.ui.BaseActivity
import joshuatee.wx.ui.FabExtended
import joshuatee.wx.ui.RecyclerViewGeneric
import joshuatee.wx.ui.UtilityUI
import joshuatee.wx.util.Utility
import joshuatee.wx.util.UtilityLog
import joshuatee.wx.util.UtilityMap
Expand Down Expand Up @@ -111,7 +112,7 @@ class SpottersActivity : BaseActivity() {
}

private fun changeSearchViewTextColor(view: View?) {
if (!Utility.isThemeAllWhite()) {
if (!UtilityUI.isThemeAllWhite()) {
if (view != null) {
if (view is TextView) {
view.setTextColor(Color.WHITE)
Expand Down
61 changes: 54 additions & 7 deletions app/src/main/java/joshuatee/wx/models/UtilityModelNCEPInterface.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ internal object UtilityModelNcepInterface {
"SOUTH-PAC",
"ARTIC",
"INDIA",
"US-SAMOA"
"US-SAMOA",
"PAC-REGION"
)

val sectorsNam = listOf(
Expand Down Expand Up @@ -704,7 +705,16 @@ internal object UtilityModelNcepInterface {
"850_temp",
"850_vort_ht",
"850_wnd",
"925_wnd"
"925_wnd",
"10th_percentile_10m_wnd",
"50th_percentile_10m_wnd",
"90th_percentile_10m_wnd",
"extreme_index_10m_wnd",
"10th_percentile_2m_temp",
"50th_percentile_2m_temp",
"90th_percentile_2m_temp",
"extreme_index_2m_temp",
"extreme_index_mslp",
)

val labelsNaefs = listOf(
Expand All @@ -722,7 +732,16 @@ internal object UtilityModelNcepInterface {
"850mb Temperature",
"850mb Vorticity and Height",
"850mb Winds",
"925mb Winds"
"925mb Winds",
"10th percentile 10m wind",
"50th percentile 10m wind",
"90th percentile 10m wind",
"extreme index 10m wind",
"10th percentile 2m temp",
"50th percentile 2m temp",
"90th percentile 2m temp",
"extreme index 2m temp",
"extreme index mslp",
)

val paramsPolar = listOf("ice_drift")
Expand Down Expand Up @@ -1092,8 +1111,8 @@ internal object UtilityModelNcepInterface {
"blend_mean_precip_p01",
"blend_mean_precip_p03",
"blend_mean_precip_ptot",
"pmm_refd_1km",
"pmm_refd_max",
"pmm_refd_1km_emsl",
"pmm_refd_max_emsl",
"prob_refd_40dbz",
"prob_refd_max_40dbz",
"prob_cref_40dbz",
Expand Down Expand Up @@ -1140,7 +1159,21 @@ internal object UtilityModelNcepInterface {
"prob_vwshr_30kt",
"prob_max_hlcy_25",
"prob_max_hlcy_75",
"prob_max_hlcy_100"
"prob_max_hlcy_100",
"eas_prob_1h_rain_0.01in",
"eas_prob_1h_rain_0.25in",
"eas_prob_1h_rain_0.50in",
"eas_prob_3h_rain_0.01in",
"eas_prob_3h_rain_0.25in",
"eas_prob_3h_rain_0.50in",
"eas_prob_1h_snow_0.1in",
"eas_prob_1h_snow_0.3in",
"eas_prob_3h_snow_0.1in",
"eas_prob_1h_snow_0.1in",
"lpmm_mean_precip_p01",
"lpmm_mean_precip_p03",
"lpmm_mean_precip_ptot",
"prob_lowIFR_IFR",
)

val labelsHref = listOf(
Expand Down Expand Up @@ -1198,7 +1231,21 @@ internal object UtilityModelNcepInterface {
"Probability of vertical wind shear greater than 30kts",
"Probability of max updraft helicity greater than 25m**2/s**2",
"Probability of max updraft helicity greater than 75m**2/s**2",
"Probability of max updraft helicity greater than 100m**2/s**2"
"Probability of max updraft helicity greater than 100m**2/s**2",
"Ensemble Agreement Scale probability of 0.01” rain in 1 hour",
"Ensemble Agreement Scale probability of 0.25” rain in 1 hour",
"Ensemble Agreement Scale probability of 0.50” rain in 1 hour",
"Ensemble Agreement Scale probability of 0.01” rain in 3 hours",
"Ensemble Agreement Scale probability of 0.25” rain in 3 hours",
"Ensemble Agreement Scale probability of 0.50” rain in 3 hours",
"Ensemble Agreement Scale probability of 0.1” snow in 1 hour",
"Ensemble Agreement Scale probability of 0.3” snow in 1 hour",
"Ensemble Agreement Scale probability of 0.1” snow in 3 hours",
"Ensemble Agreement Scale probability of 0.3” snow in 3 hours",
"Localized probability matched mean mean precip 1 hour plot",
"Localized probability matched mean mean precip 3 hour plot",
"Localized probability matched mean mean precip total hour plot",
"Probability Values for IFR/LIFR"
)

val paramsNbm = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object UtilityNotification {
// June 2019
// change NotificationManager.IMPORTANCE_DEFAULT and NotificationManager.IMPORTANCE_LOW to NotificationManager.IMPORTANCE_HIGH
// in attempt to automatically have notifications in Android Q show up in status bar
fun initChannels(context: Context) {
private fun initChannels(context: Context) {
if (Build.VERSION.SDK_INT < 26 || notificationChannelInitialized) {
return
}
Expand All @@ -64,7 +64,7 @@ object UtilityNotification {
}

private const val NOTIFICATION_CHANNEL_STRING = "default"
const val NOTIFICATION_CHANNEL_STRING_NO_SOUND = "defaultNoSound2"
private const val NOTIFICATION_CHANNEL_STRING_NO_SOUND = "defaultNoSound2"

fun createNotificationBigPicture(
context: Context,
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/joshuatee/wx/objects/URL.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ package joshuatee.wx.objects

import joshuatee.wx.common.GlobalVariables
import joshuatee.wx.MyApplication
import joshuatee.wx.util.Utility
import joshuatee.wx.util.UtilityLog
import okhttp3.Request

class URL(val url: String) {

@Suppress("unused")
fun getText(): String {
Utility.logDownload("getHtml $url")
UtilityLog.download("getHtml $url")
val out = StringBuilder(5000)
try {
val request = Request.Builder().url(url).build()
Expand All @@ -30,7 +29,7 @@ class URL(val url: String) {

@Suppress("unused")
fun getTextXmlAcceptHeader(): String {
Utility.logDownload("getStringFromUrlBaseNoHeader: $url")
UtilityLog.download("getStringFromUrlBaseNoHeader: $url")
val breakStr = "ABC123_456ZZ"
val out = StringBuilder(5000)
try {
Expand All @@ -49,7 +48,7 @@ class URL(val url: String) {
}

fun getBytes(): ByteArray {
Utility.logDownload("getByte $url")
UtilityLog.download("getByte $url")
return try {
val request = Request.Builder().url(url).build()
val response = MyApplication.httpClient.newCall(request).execute()
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/joshuatee/wx/radar/NexradDownload.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import joshuatee.wx.parseAcrossLines
import joshuatee.wx.common.GlobalDictionaries
import joshuatee.wx.common.GlobalVariables
import joshuatee.wx.util.To
import joshuatee.wx.util.Utility
import joshuatee.wx.util.UtilityFileManagement
import joshuatee.wx.util.UtilityIO
import joshuatee.wx.util.UtilityLog
Expand Down Expand Up @@ -190,7 +189,7 @@ class NexradDownload {
// experimentation has shown that L2REF and L2VEL lowest tiles are at the start of the
// file so "Range" HTTP header is used to download just what is needed based on prod
// requested
Utility.logDownload("getInputStreamFromUrlL2: $url")
UtilityLog.download("getInputStreamFromUrlL2: $url")
if (url == "") {
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class NexradRenderSurfaceView : GLSurfaceView, GestureDetector.OnGestureListener
override fun onDown(event: MotionEvent): Boolean = true

// API34 changed first arg to Optional
override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean = true
override fun onFling(event1: MotionEvent?, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean = true

override fun onLongPress(event: MotionEvent) {
if (fullScreen) {
Expand Down Expand Up @@ -227,7 +227,7 @@ class NexradRenderSurfaceView : GLSurfaceView, GestureDetector.OnGestureListener
}

// API34 changed first arg to Optional
override fun onScroll(e1: MotionEvent, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
override fun onScroll(e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
var panned = false
if (!locationFragment && !RadarPreferences.wxoglCenterOnLocation) {
if (abs(distanceX) > 0.001f) {
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/joshuatee/wx/radar/NexradSubmenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package joshuatee.wx.radar

import android.os.Build
import android.view.MenuItem
import joshuatee.wx.R
import joshuatee.wx.common.GlobalVariables
Expand Down Expand Up @@ -76,9 +75,7 @@ class NexradSubmenu(objectToolbarBottom: ObjectToolbar, private val nexradState:
// FIXME TODO disable new Level3 super-res until NWS is past deployment phase
objectToolbarBottom.hide(R.id.action_n0b)
objectToolbarBottom.hide(R.id.action_n0g)
if (Build.VERSION.SDK_INT > 32) {
objectToolbarBottom.find(R.id.action_share).title = "Drawing Tools"
}
objectToolbarBottom.find(R.id.action_share).title = "Drawing Tools"
}

fun adjustTiltAndProductMenus() {
Expand Down
Loading

0 comments on commit df3bda0

Please sign in to comment.