Skip to content

Commit

Permalink
Migrate to KSP
Browse files Browse the repository at this point in the history
  • Loading branch information
wisnukurniawan committed Dec 1, 2024
1 parent 0076eeb commit 107e410
Show file tree
Hide file tree
Showing 25 changed files with 2,738 additions and 2,644 deletions.
515 changes: 267 additions & 248 deletions app/build.gradle

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
package com.wisnu.kurniawan.wallee.features.dashboard.ui

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ReceiptLong
import androidx.compose.material.icons.rounded.Wallet
import androidx.lifecycle.viewModelScope
import com.wisnu.foundation.coreviewmodel.StatefulViewModel
import com.wisnu.kurniawan.wallee.R
import com.wisnu.kurniawan.wallee.runtime.navigation.home.BalanceSummaryFlow
import com.wisnu.kurniawan.wallee.runtime.navigation.home.TransactionSummaryFlow
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import kotlinx.coroutines.launch

@HiltViewModel
class DashboardHostViewModel @Inject constructor() : StatefulViewModel<DashboardHostState, Unit, Unit, Unit>(DashboardHostState(), Unit) {

init {
initTab()
}

override fun dispatch(action: Unit) {

}

private fun initTab() {
viewModelScope.launch {
setState { copy(sections = initial()) }
}
}

private fun initial(): List<DashboardSection> {
return listOf(
DashboardSection(
SectionType.TRANSACTION,
R.string.dashboard_transaction,
Icons.Rounded.ReceiptLong,
TransactionSummaryFlow.Root.route
),
DashboardSection(
SectionType.BALANCE,
R.string.dashboard_balance,
Icons.Rounded.Wallet,
BalanceSummaryFlow.Root.route
),
)
}

}
package com.wisnu.kurniawan.wallee.features.dashboard.ui

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ReceiptLong
import androidx.compose.material.icons.rounded.ReceiptLong
import androidx.compose.material.icons.rounded.Wallet
import androidx.lifecycle.viewModelScope
import com.wisnu.foundation.coreviewmodel.StatefulViewModel
import com.wisnu.kurniawan.wallee.R
import com.wisnu.kurniawan.wallee.runtime.navigation.home.BalanceSummaryFlow
import com.wisnu.kurniawan.wallee.runtime.navigation.home.TransactionSummaryFlow
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import kotlinx.coroutines.launch

@HiltViewModel
class DashboardHostViewModel @Inject constructor() : StatefulViewModel<DashboardHostState, Unit, Unit, Unit>(DashboardHostState(), Unit) {

init {
initTab()
}

override fun dispatch(action: Unit) {

}

private fun initTab() {
viewModelScope.launch {
setState { copy(sections = initial()) }
}
}

private fun initial(): List<DashboardSection> {
return listOf(
DashboardSection(
SectionType.TRANSACTION,
R.string.dashboard_transaction,
Icons.AutoMirrored.Rounded.ReceiptLong,
TransactionSummaryFlow.Root.route
),
DashboardSection(
SectionType.BALANCE,
R.string.dashboard_balance,
Icons.Rounded.Wallet,
BalanceSummaryFlow.Root.route
),
)
}

}
Loading

0 comments on commit 107e410

Please sign in to comment.