Activity

An Activity in Android is a crucial component of an application. It represents a single screen with a user interface. In simpler terms, an Activity is the entry point for interacting with the user and is fundamental to the Android app experience.

Inside onelib, you just need to extend the BaseActivity and include the binding of the activity's view. For example:

class MainActivity : BaseActivity<ActivityMainBinding>() {

    override fun getViewBinding(): ActivityMainBinding =
        ActivityMainBinding.inflate(layoutInflater)

    override fun initIntent() {}

    override fun initUI() {
        // Hanle ui here, ex: set text and etc
    }

    override fun initAction() {
        // Handle action here, ex: onclick and etc
    }

    override fun initProcess() {
        // Handle Process here, ex: load data, etc
    }

    override fun initObservers() {
        // Handle Observers here, ex: LiveData, Flow, etc
    }
}

Last updated