ArcFragment

abstract class ArcFragment<viewBinding : ViewBinding> : Fragment, NavigationDelegate

ArcFragment Base class for implementing Fragment to project

Author

jimlyas

Since

16 Sep 2022

Parameters

viewBinding

ViewBinding class to be implemented for this class

Constructors

Link copied to clipboard
constructor()

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

Function to finish the ArcActivity that current ArcFragment is attached to

Link copied to clipboard
open override fun onAttach(context: Context)
Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View
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 ArcFragment<*>.setupCameraX(view: PreviewView, lensFacing: Int = LENS_FACING_BACK): CameraXSetup

Function to configure CameraXSetup from given ArcFragment 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 from ArcFragment