Expense Component
The ExpenseComponent
shows the user's spend across categories in a neat donut chart, along with a list of recent transactions. Users are able to view data for previous months easily too.
To use this view, just call the ExpenseComponent
method of your LuneSDKManager
instance as shown in the example below.
// ExpenseView.kt
import io.lunedata.lunesdk.library.classes.LuneSDKManager
@Composable
fun ExpenseView(
luneSDK: LuneSDKManager
) {
luneSDK.ExpenseComponent()
}
To use this view in a project with Activities and Fragments, set the component
property of your view to LuneView.ExpenseComponent
, as shown in the example below.
// YourActivity.kt
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Grab our luneView and set the component property.
val luneView = findViewById<LuneCompatManager>(R.id.luneLayout)
luneView.component = LuneView.ExpenseComponent
}
ON THIS PAGE