Skip to content

Commit

Permalink
Fixed some small bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hwki committed Oct 28, 2022
1 parent 26e9617 commit 9cbd2de
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
14 changes: 7 additions & 7 deletions bitcoin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.brentpanther.bitcoinwidget"
minSdk 23
targetSdk 33
versionCode 312
versionName "8.3.2"
versionCode 313
versionName "8.3.3"

javaCompileOptions {
annotationProcessorOptions {
Expand Down Expand Up @@ -77,16 +77,16 @@ android {
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.code.gson:gson:2.10'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
implementation 'androidx.activity:activity-compose:1.6.0'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.2.1'
implementation 'androidx.compose.material:material:1.3.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1"
implementation "androidx.navigation:navigation-compose:2.5.2"
implementation 'androidx.navigation:navigation-compose:2.5.3'
implementation "io.coil-kt:coil-compose:2.2.2"
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.jayway.jsonpath:json-path:2.7.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ object Repository {

ExchangeHelper.getStream(url).use { stream ->
ByteArrayOutputStream().use { os ->
val image = BitmapFactory.decodeStream(stream)
image.compress(Bitmap.CompressFormat.PNG, 100, os)
file.writeBytes(os.toByteArray())
BitmapFactory.decodeStream(stream)?.let { image ->
image.compress(Bitmap.CompressFormat.PNG, 100, os)
file.writeBytes(os.toByteArray())
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class WidgetDataStrategy(val widgetId: Int) {
var widget : Widget?
get() {
_widget = _widget ?: dao.getByWidgetId(widgetId)
return _widget!!
return _widget
}
set(value) {
_widget = value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ fun ValueSettings(widget: Widget, settingsPriceViewModel: SettingsViewModel) {
},
value = widget.amountHeld.toString(),
onChange = {
settingsPriceViewModel.setAmountHeld(it.toDouble())
it.toDoubleOrNull()?.apply {
settingsPriceViewModel.setAmountHeld(this)
}
}
)
FormatSection(settingsPriceViewModel, widget)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

buildscript {
ext {
compose_ui_version = '1.3.0-rc01'
compose_ui_version = '1.3.0'
compose_compiler_version = '1.3.1'
}
ext.kotlin_version = '1.7.10'
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/313.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed some small bugs.

0 comments on commit 9cbd2de

Please sign in to comment.