Activity Compat

abstract class ActivityCompat : AppCompatActivity, FormDelegate, DevView

Author

Jimly A.

Since

01-Dec-21

Constructors

Link copied to clipboard
fun ActivityCompat()

Functions

Link copied to clipboard
open override fun finishActivity()

Method to finish current activity

Link copied to clipboard
fun hasPermission(permission: String): Boolean

Method to check if application has permission

Link copied to clipboard
fun hasPermissions(permissions: Array<String>): Boolean

Method to check if the application has permissions

Link copied to clipboard
open fun initAction()

method to group action like click, gesture, from View

Link copied to clipboard
open fun initData()

method to group data initialization either from arguments, bundle, or intent

Link copied to clipboard
open fun initObserver()

method to group any kind of observer, either it MutableLiveData, RXEventBus, or else

Link copied to clipboard
open fun initUI()

method to group view initialization and configuration

Link copied to clipboard
open override fun onCreateOptionsMenu(menu: Menu): Boolean
Link copied to clipboard
open override fun onOptionsItemSelected(item: MenuItem): Boolean
Link copied to clipboard
open fun onViewReady()
Link copied to clipboard
fun pickImageFromCamera(uri: Uri, action: (Uri) -> Unit)

Method to start picking image from camera

Link copied to clipboard
fun pickImageFromGallery(action: (Uri) -> Unit)

Method to start picking image from gallery

Link copied to clipboard
fun requestPermissionsSafely(    permissions: Array<String>,     onPermissionGranted: () -> Unit? = null,     onPermissionNotGranted: () -> Unit? = null)

Method to request permission to user

Link copied to clipboard
fun setFragment(    viewRes: Int,     fragment: Fragment,     addToBackStack: Boolean)

Method to attach fragment to layout

Link copied to clipboard
open override fun setupToolbar(    toolbar: Toolbar?,     title: String?,     isChild: Boolean,     menu: Int?,     onMenuListener: (Int) -> Boolean?)

Method to set activity's toolbar

Link copied to clipboard
inline fun <activity : Activity> start(isFinished: Boolean = false, data: MutableMap<String, Serializable>? = null)

method to simply start activity

Inheritors

Link copied to clipboard
Link copied to clipboard

Sources

Link copied to clipboard