🥄
One Library
  • 🤖onelib
  • 🏡Home
    • Overview
    • Setup Project
    • What's New
  • ☀️Fundamental
    • Basic Android
    • Data Flow
    • Dependency Injection
      • Hilt
      • Koin
  • 📿Layers
    • Data Layer
    • Domain Layer
    • Presentation Layer
  • 🪶Features
    • Views
      • Activity
      • Fragment
      • Bottom Sheet
      • Dialog
    • Adapters
      • Recycler Adapter
      • Filterable Adapter
      • Paging Adapter
      • Selectable Adapter
      • ViewPager Adapter
    • Firebase
      • One Firebase Auth
      • One Firebase Firestore
      • One Firebase Realtime
      • One Firebase Storage
    • Extension Functions
      • Any
      • Common
      • Context
      • Edittext
      • Image View
      • LiveData
      • OneMap
      • State Flow (Jetpack Compose)
      • View
    • Notification
    • One State View
    • Local Database
    • Permission
    • Validation
      • Passive Validator
      • Reactive Validator
      • Extension Validation
Powered by GitBook
On this page
  1. Features
  2. Views

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 1 year ago

🪶