ArcActivity

abstract class ArcActivity<viewBinding : ViewBinding>(@IdRes hostId: Int? = null) : AppCompatActivity, NavigationDelegate

ArcActivity define base class for Activity for project

Author

jimlyas

Since

16 Sep 2022

Parameters

viewBinding

ViewBinding class to be implemented for this class

Constructors

Link copied to clipboard
constructor(@IdRes hostId: Int? = null)

Functions

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

Function to check if application has permission

Link copied to clipboard
fun checkPermissions(permissions: List<String>): Boolean

Function to check if the application has permissions

fun checkPermissions(permissions: List<String>, onPermissionGranted: () -> Unit, onPermissionNotGranted: () -> Unit)

Function to check permission to the user

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
fun pickImageFromGallery(action: (Uri) -> Unit)

Function to pick image from gallery

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

Function to request permission to user

Link copied to clipboard
fun ArcActivity<*>.setupCameraX(view: PreviewView, lensFacing: Int = LENS_FACING_BACK): CameraXSetup

Function to configure CameraXSetup from given ArcActivity and also adding androidx.camera.core.Preview

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

Function to set ArcActivity's Toolbar

Link copied to clipboard
inline fun <activity : ArcActivity<*>> start(isFinished: Boolean = false, flags: List<Int> = listOf(), args: MutableMap<String, Serializable> = mutableMapOf())

Function start another ArcActivity within the application

Properties

Link copied to clipboard