aboutsummaryrefslogtreecommitdiff
path: root/cashier
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2021-08-27 16:43:46 +0200
committerTorsten Grote <t@grobox.de>2021-08-27 16:43:46 +0200
commitb663081104dc38df462c30d7dfc90e435ef3cf6c (patch)
treefce942ffc2eedfdb2a32ef4aa4f838c9b65e25c6 /cashier
parent06f16a7477b337f07526285b65a7f3003b814d33 (diff)
downloadtaler-android-b663081104dc38df462c30d7dfc90e435ef3cf6c.tar.gz
taler-android-b663081104dc38df462c30d7dfc90e435ef3cf6c.tar.bz2
taler-android-b663081104dc38df462c30d7dfc90e435ef3cf6c.zip
Update libraries and do associated maintenance
Diffstat (limited to 'cashier')
-rw-r--r--cashier/build.gradle11
-rw-r--r--cashier/src/main/java/net/taler/cashier/Response.kt4
-rw-r--r--cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt2
-rw-r--r--cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt4
-rw-r--r--cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt12
5 files changed, 19 insertions, 14 deletions
diff --git a/cashier/build.gradle b/cashier/build.gradle
index 5d2bc10..54b2df7 100644
--- a/cashier/build.gradle
+++ b/cashier/build.gradle
@@ -46,6 +46,11 @@ android {
}
}
+ compileOptions {
+ sourceCompatibility = 1.8
+ targetCompatibility = 1.8
+ }
+
kotlinOptions {
jvmTarget = "1.8"
}
@@ -70,7 +75,7 @@ android {
dependencies {
implementation project(":taler-kotlin-android")
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
- implementation 'androidx.security:security-crypto:1.0.0-rc04' // requires minSdk 23
+ implementation 'androidx.security:security-crypto:1.0.0' // requires minSdk 23
implementation "com.google.android.material:material:$material_version"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
@@ -82,6 +87,6 @@ dependencies {
testImplementation "junit:junit:$junit_version"
- androidTestImplementation 'androidx.test.ext:junit:1.1.2'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
diff --git a/cashier/src/main/java/net/taler/cashier/Response.kt b/cashier/src/main/java/net/taler/cashier/Response.kt
index c5b1c32..6a72604 100644
--- a/cashier/src/main/java/net/taler/cashier/Response.kt
+++ b/cashier/src/main/java/net/taler/cashier/Response.kt
@@ -39,12 +39,12 @@ class Response<out T> private constructor(
}
private suspend fun getFailure(e: Throwable): Failure = when (e) {
- is ResponseException -> Failure(e, getExceptionString(e), e.response?.status)
+ is ResponseException -> Failure(e, getExceptionString(e), e.response.status)
else -> Failure(e, e.toString())
}
private suspend fun getExceptionString(e: ResponseException): String {
- val response = e.response ?: return e.toString()
+ val response = e.response
return try {
Log.e("TEST", "TRY RECEIVE $response")
val error: Error = response.receive()
diff --git a/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt b/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt
index 6498590..e6ac249 100644
--- a/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt
+++ b/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt
@@ -130,7 +130,7 @@ class ConfigFragment : Fragment() {
return true
}
- private val onConfigResult = Observer<ConfigResult> { result ->
+ private val onConfigResult = Observer<ConfigResult?> { result ->
if (result == null) return@Observer
when (result) {
is ConfigResult.Success -> {
diff --git a/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt b/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt
index e9f4117..0718963 100644
--- a/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt
+++ b/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt
@@ -75,8 +75,8 @@ class ConfigManager(
)
internal val currency: LiveData<String> = mCurrency
- private val mConfigResult = MutableLiveData<ConfigResult>()
- val configResult: LiveData<ConfigResult> = mConfigResult
+ private val mConfigResult = MutableLiveData<ConfigResult?>()
+ val configResult: LiveData<ConfigResult?> = mConfigResult
fun hasConfig() = config.bankUrl.isNotEmpty()
&& config.username.isNotEmpty()
diff --git a/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt b/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt
index 30ff3d8..5d34bba 100644
--- a/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt
+++ b/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt
@@ -61,14 +61,14 @@ class WithdrawManager(
private var withdrawStatusCheck: Job? = null
- private val mWithdrawAmount = MutableLiveData<Amount>()
- val withdrawAmount: LiveData<Amount> = mWithdrawAmount
+ private val mWithdrawAmount = MutableLiveData<Amount?>()
+ val withdrawAmount: LiveData<Amount?> = mWithdrawAmount
- private val mWithdrawResult = MutableLiveData<WithdrawResult>()
- val withdrawResult: LiveData<WithdrawResult> = mWithdrawResult
+ private val mWithdrawResult = MutableLiveData<WithdrawResult?>()
+ val withdrawResult: LiveData<WithdrawResult?> = mWithdrawResult
- private val mWithdrawStatus = MutableLiveData<WithdrawStatus>()
- val withdrawStatus: LiveData<WithdrawStatus> = mWithdrawStatus
+ private val mWithdrawStatus = MutableLiveData<WithdrawStatus?>()
+ val withdrawStatus: LiveData<WithdrawStatus?> = mWithdrawStatus
private val mLastTransaction = MutableLiveData<LastTransaction>()
val lastTransaction: LiveData<LastTransaction> = mLastTransaction