Skip to content

Commit

Permalink
Merge branch 'release/2.0.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitletondor committed Jul 14, 2019
2 parents 69f94b7 + a93164b commit ef6652d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Android/EasyBudget/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ android {
applicationId "com.benoitletondor.easybudgetapp"
minSdkVersion 21
targetSdkVersion 29
versionCode 65
versionName "2.0.12"
versionCode 66
versionName "2.0.13"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,9 @@ object BuildVersion {
* 13/07/2019
*/
const val VERSION_2_0_12 = 65
/**
* Bug fix for new balance parsing
* 13/07/2019
*/
const val VERSION_2_0_13 = 66
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.batch.android.BatchNotificationChannelsManager.DEFAULT_CHANNEL_ID
import com.batch.android.Config
import com.batch.android.PushNotificationType
import com.benoitletondor.easybudgetapp.BuildVersion.VERSION_2_0_10
import com.benoitletondor.easybudgetapp.BuildVersion.VERSION_2_0_12
import com.benoitletondor.easybudgetapp.BuildVersion.VERSION_2_0_13
import com.benoitletondor.easybudgetapp.db.DB
import com.benoitletondor.easybudgetapp.helper.*
import com.benoitletondor.easybudgetapp.iab.Iab
Expand Down Expand Up @@ -365,7 +365,7 @@ class EasyBudget : Application() {
private fun onUpdate(previousVersion: Int, @Suppress("SameParameterValue") newVersion: Int) {
Logger.debug("Update detected, from $previousVersion to $newVersion")

if( previousVersion < VERSION_2_0_10 && newVersion <= VERSION_2_0_12 && iab.isUserPremium() ) {
if( previousVersion < VERSION_2_0_10 && newVersion <= VERSION_2_0_13 && iab.isUserPremium() ) {
DarkThemeNotif.showDarkThemeNotif(this)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ import com.benoitletondor.easybudgetapp.view.settings.SettingsActivity.Companion
import com.benoitletondor.easybudgetapp.view.welcome.getOnboardingStep
import com.google.android.material.snackbar.BaseTransientBottomBar
import org.koin.android.viewmodel.ext.android.viewModel
import org.koin.java.KoinJavaComponent.get

import kotlinx.android.synthetic.main.activity_main.*
import org.koin.android.ext.android.inject

/**
* Main activity containing Calendar and List of expenses
Expand All @@ -93,7 +93,7 @@ class MainActivity : AppCompatActivity() {
private var lastStopDate: Date? = null

private val viewModel: MainViewModel by viewModel()
private val parameters = get(Parameters::class.java)
private val parameters: Parameters by inject()

// ------------------------------------------>

Expand Down Expand Up @@ -287,9 +287,12 @@ class MainActivity : AppCompatActivity() {
builder.setView(dialogView)
builder.setNegativeButton(R.string.cancel) { dialog, _ -> dialog.dismiss() }
builder.setPositiveButton(R.string.ok) { dialog, _ ->
val newBalance = java.lang.Double.valueOf(amountEditText.text.toString())

viewModel.onNewBalanceSelected(newBalance, getString(R.string.adjust_balance_expense_title))
try {
val newBalance = java.lang.Double.valueOf(amountEditText.text.toString())
viewModel.onNewBalanceSelected(newBalance, getString(R.string.adjust_balance_expense_title))
} catch (e: Exception) {
Logger.error("Error parsing new balance", e)
}

dialog.dismiss()
}
Expand Down

0 comments on commit ef6652d

Please sign in to comment.