diff --git a/README.md b/README.md index 50399f8c..3b8361f5 100755 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The **M**obile **A**wareness **G**EOINT **E**nvironment, or MAGE, provides mobil The app remains functional if your mobile device loses its network connection, and will upload its local content when a connection is re-established. When disconnected from the network, MAGE will use local data layers to continue to provide relevant GEOINT. Data layers, including map tiles and vector data, can be stored on your mobile device and are available at all times. -MAGE is very customizable and can be tailored for you situation. +MAGE is very customizable and can be tailored for your situation. MAGE Android was developed at the National Geospatial-Intelligence Agency (NGA) in collaboration with BIT Systems. The government has "unlimited rights" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the Apache license. diff --git a/build.gradle b/build.gradle index 1b27cb37..a2b48b5c 100755 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { - id 'com.android.application' version '8.3.0' apply false - id 'com.android.library' version '8.3.0' apply false - id 'org.jetbrains.kotlin.android' version '1.9.10' apply false + id 'com.android.application' version '8.7.2' apply false + id 'com.android.library' version '8.7.2' apply false + id 'org.jetbrains.kotlin.android' version '1.9.25' apply false id 'com.google.dagger.hilt.android' version '2.51' apply false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3623dd93..f01a4242 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu May 06 13:38:17 MDT 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/mage/build.gradle b/mage/build.gradle index 207ab479..02dc878b 100644 --- a/mage/build.gradle +++ b/mage/build.gradle @@ -46,20 +46,16 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } kotlin { - jvmToolchain(11) - } - - kotlin { - jvmToolchain(17) + jvmToolchain(21) } kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" freeCompilerArgs = ["-Xcontext-receivers"] } @@ -69,7 +65,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion = "1.5.3" + kotlinCompilerExtensionVersion = "1.5.15" } packagingOptions { diff --git a/mage/src/main/java/mil/nga/giat/mage/di/NetworkModule.kt b/mage/src/main/java/mil/nga/giat/mage/di/NetworkModule.kt index 0939afe4..70c6a0c8 100644 --- a/mage/src/main/java/mil/nga/giat/mage/di/NetworkModule.kt +++ b/mage/src/main/java/mil/nga/giat/mage/di/NetworkModule.kt @@ -88,7 +88,7 @@ class NetworkModule { tokenProvider: TokenProvider, userAgentHeader: UserAgentHeader ): Interceptor { - val nonTokenRoutes = listOf("/auth/token", "/api/users/myself/password") + val nonTokenRoutes = listOf("/auth/token", "/api/users/myself/password", "/api/users/signups/verifications") return Interceptor { chain -> val builder = chain.request().newBuilder() diff --git a/mage/src/main/java/mil/nga/giat/mage/form/view/FormView.kt b/mage/src/main/java/mil/nga/giat/mage/form/view/FormView.kt index b7af5142..3d7c9590 100644 --- a/mage/src/main/java/mil/nga/giat/mage/form/view/FormView.kt +++ b/mage/src/main/java/mil/nga/giat/mage/form/view/FormView.kt @@ -389,7 +389,7 @@ fun fieldText( } is FieldValue.Date -> { val dateFormat = DateFormatFactory.format("yyyy-MM-dd HH:mm zz", Locale.getDefault(), context) - dateFormat.format(fieldValue) + dateFormat.format(fieldValue.date) } is FieldValue.Location -> { CoordinateFormatter(context).format(fieldValue.location.centroidLatLng) diff --git a/mage/src/main/java/mil/nga/giat/mage/login/SignupActivity.kt b/mage/src/main/java/mil/nga/giat/mage/login/SignupActivity.kt index a826bd14..d020a6c7 100644 --- a/mage/src/main/java/mil/nga/giat/mage/login/SignupActivity.kt +++ b/mage/src/main/java/mil/nga/giat/mage/login/SignupActivity.kt @@ -109,16 +109,22 @@ open class SignupActivity : AppCompatActivity() { val isActive = status.user!!.get("active").asBoolean showSignupSuccessDialog(isActive) } else { - if (status.error == SignupError.INVALID_USERNAME) { - binding.captchaText.setText("") - binding.usernameLayout.error = "Username not available" + when (status.error) { + SignupError.INVALID_USERNAME -> { + binding.captchaText.setText("") + binding.usernameLayout.error = "Username not available" + } + SignupError.INVALID_CAPTCHA -> { + binding.captchaTextLayout.error = "Invalid Captcha" + } + else -> { + AlertDialog.Builder(this) + .setTitle("Signup Failed") + .setMessage(status.errorMessage) + .setPositiveButton(android.R.string.ok, null) + .show() + } } - - AlertDialog.Builder(this) - .setTitle("Signup Failed") - .setMessage(status.errorMessage) - .setPositiveButton(android.R.string.ok, null) - .show() } } diff --git a/mage/src/main/java/mil/nga/giat/mage/login/SignupViewModel.kt b/mage/src/main/java/mil/nga/giat/mage/login/SignupViewModel.kt index e055bebc..987f8546 100644 --- a/mage/src/main/java/mil/nga/giat/mage/login/SignupViewModel.kt +++ b/mage/src/main/java/mil/nga/giat/mage/login/SignupViewModel.kt @@ -74,8 +74,11 @@ open class SignupViewModel @Inject constructor( open fun signup(account: Account, captchaText: String) { viewModelScope.launch { - val response = userRepository.verifyUser(account.displayName, account.email, account.phone, account.password, captchaText, captchaToken) + _signupStatus.value = null + _signupState.value = SignupState.LOADING + try { + val response = userRepository.verifyUser(account.displayName, account.email, account.phone, account.password, captchaText, captchaToken) if (response.isSuccessful) { _signupStatus.value = SignupStatus(true, response.body()) } else { @@ -88,14 +91,11 @@ open class SignupViewModel @Inject constructor( val error = if (response.code() == 409) SignupError.INVALID_USERNAME else SignupError.INVALID_CAPTCHA _signupStatus.value = SignupStatus(false, null, error, response.errorBody()?.string(), account.username) } - - _signupState.value = SignupState.COMPLETE } catch (e: Exception) { _signupStatus.value = SignupStatus(false, null, null, e.localizedMessage, account.username) } - _signupStatus.value = null - _signupState.value = SignupState.LOADING + _signupState.value = SignupState.COMPLETE } }