Skip to content

Commit

Permalink
Merge pull request #24 from mvarnagiris/dev
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
mvarnagiris committed May 18, 2017
2 parents ace14c2 + 490fb16 commit 7b0492a
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v0.5.1
- `fix` Bug fixes.

### v0.5.0
- `new` Added trends report when you tap on it on home screen.
- `new` Added tags report when you tap on it on home screen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PremiumPresenter(
private val appUserSource: DataSource<AppUser>,
private val appUserWriter: DataWriter<AppUser>,
private val billingProductsService: BillingProductsService,
private val schedulers: RxSchedulers) : Presenter<PremiumPresenter.View>(), Destroyable {
private val schedulers: RxSchedulers) : Presenter<PremiumPresenter.View>() {

override fun onViewAttached(view: View) {
super.onViewAttached(view)
Expand Down Expand Up @@ -60,10 +60,6 @@ class PremiumPresenter(
.subscribeUntilDetached { updateToPremiumPaid(it) }
}

override fun onDestroy() {
billingProductsService.close()
}

private fun billingData(): Observable<BillingData> = combineLatest(appUserSource.data(), billingProductsService.billingProducts(), ::BillingData)

private fun View.showSubscriptionType(subscriptionType: SubscriptionType) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class TagsReportSource(
val amount = transaction.money.amount
totalAmount += amount
transaction.tags.forEach {
tagsAmountMap.compute(it) { _, currentAmount -> currentAmount?.let { it + amount } ?: amount }
val currentAmount = tagsAmountMap.getOrElse(it) { BigDecimal.ZERO }
tagsAmountMap.put(it, currentAmount + amount)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ class PremiumPresenterTest {
inOrder.verify(view).showBillingProducts(updatedBillingProducts)
}

@Test
fun `billing products provider is closed on destroy`() {
presenter.onDestroy()

verify(billingProductsService).close()
}

@Test
fun `successful premium purchase switches to premium paid`() {
setSubscriptionType(FREE)
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ android {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
multiDexEnabled true
versionCode 10
versionName "0.5.0"
versionCode 11
versionName "0.5.1"
manifestPlaceholders = [crashlytics: privateProperties['CRASHLYTICS']]
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_action_archive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportWidth="24">
<path
android:fillColor="#fff"
android:pathData="M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z" />
android:pathData="M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88 .21-1.16 .55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1 .9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z" />
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_action_currency.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportWidth="24">
<path
android:fillColor="#fff"
android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z" />
android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05 .82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86 .45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4 .68-2.4 1.64 0 .84 .65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z" />
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_action_date.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportWidth="24">
<path
android:fillColor="#fff"
android:pathData="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" />
android:pathData="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99 .9-1.99 2L3 19c0 1.1 .89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" />
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_action_reports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportWidth="24">
<path
android:fillColor="#fff"
android:pathData="M11 9.16V2c-5 .5-9 4.79-9 10s4 9.5 9 10v-7.16c-1-.41-2-1.52-2-2.84s1-2.43 2-2.84zM14.86 11H22c-.48-4.75-4-8.53-9-9v7.16c1 .3 1.52.98 1.86 1.84zM13 14.84V22c5-.47 8.52-4.25 9-9h-7.14c-.34.86-.86 1.54-1.86 1.84z" />
android:pathData="M11 9.16V2c-5 .5-9 4.79-9 10s4 9.5 9 10v-7.16c-1-.41-2-1.52-2-2.84s1-2.43 2-2.84zM14.86 11H22c-.48-4.75-4-8.53-9-9v7.16c1 .3 1.52 .98 1.86 1.84zM13 14.84V22c5-.47 8.52-4.25 9-9h-7.14c-.34 .86-.86 1.54-1.86 1.84z" />
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_action_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportWidth="24">
<path
android:fillColor="#fff"
android:pathData="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" />
android:pathData="M19.43 12.98c.04-.32 .07-.64 .07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15 .24-.42 .12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46 .18-.49 .42l-.38 2.65c-.61 .25-1.17 .59-1.69 .98l-2.49-1c-.23-.09-.49 0-.61 .22l-2 3.46c-.13 .22-.07 .49.12 .64l2.11 1.65c-.04 .32-.07 .65-.07 .98s.03 .66.07 .98l-2.11 1.65c-.19 .15-.24 .42-.12 .64l2 3.46c.12 .22.39 .3.61 .22l2.49-1c.52 .4 1.08 .73 1.69 .98l.38 2.65c.03 .24.24 .42.49 .42h4c.25 0 .46-.18 .49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23 .09.49 0 .61-.22l2-3.46c.12-.22 .07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" />
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_action_tag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
android:viewportWidth="24">
<path
android:fillColor="#fff"
android:pathData="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 0.9-2 2v7c0 0.55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-0.22 1.41-0.59l7-7c0.37-0.36.59-0.86.59-1.41 0-0.55-0.23-1.06-0.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z" />
android:pathData="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 0.9-2 2v7c0 0.55 .22 1.05 .59 1.42l9 9c.36 .36.86 .58 1.41 .58.55 0 1.05-0.22 1.41-0.59l7-7c0.37-0.36 .59-0.86 .59-1.41 0-0.55-0.23-1.06-0.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z" />
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ enum class ReportPeriod { MONTH;
val totalInterval = interval(groupedMoneys.keys.first().startMillis)
val splitIntervals = reportGroup.splitIntoGroupIntervals(totalInterval)
val defaultMoney = Money(BigDecimal.ZERO, currencyForZeroValues)
return splitIntervals.map { GroupedMoney(it, groupedMoneys.getOrDefault(it, defaultMoney)) }
return splitIntervals.map { GroupedMoney(it, groupedMoneys.getOrElse(it) { defaultMoney }) }
}
}

0 comments on commit 7b0492a

Please sign in to comment.