CameraActivityFragmentHandler

class CameraActivityFragmentHandler(a: Activity)

Helper class used to manage fragments of ResultsActivity.

TODO: Implement the class as a general fragment manager, which can also be used by other Activities

Parameters

a

The Activity, whose fragments should be managed. Must be of type CameraActivity.

Constructors

CameraActivityFragmentHandler
Link copied to clipboard
fun CameraActivityFragmentHandler(a: Activity)

Casts the provided Activity to a CameraActivity; Throws an exception if cast does not succeed.

Functions

closeSelectDeviceFragment
Link copied to clipboard
fun closeSelectDeviceFragment()
hasDifferentRotation
Link copied to clipboard
private fun hasDifferentRotation(rotationFragment: RotationFragment): Boolean

Helper function to determine whether a rotationFragment is in a different orientation than the device

openErrorFragment
Link copied to clipboard
fun openErrorFragment(uid: String)

Opens ErrorFragment in R.id.fragment_container_view.

openFragment
Link copied to clipboard
private fun openFragment(fragment: Fragment, containerID: Int, transition: Int? = null)

Launches a fragment in the given containerID with a transition

openGalleryFragment
Link copied to clipboard
fun openGalleryFragment(withTransition: Boolean = true)

Opens GalleryFragment in R.id.fragment_container_view

openGalleryPreviewFragment
Link copied to clipboard
private fun openGalleryPreviewFragment(firstImage: File?, secondImage: File?, withTransition: Boolean = true)

Opens GalleryPreviewFragment in R.id.gallery_fragment_body_layout.

openSelectDeviceFragment
Link copied to clipboard
fun openSelectDeviceFragment(withTransition: Boolean = true)

Opens SelectDeviceFragment in R.id.camera_activity_frameLayout

openSettingsFragment
Link copied to clipboard
fun openSettingsFragment()

Opens SettingsFragment in R.id.settings_fragment_container_view.

removeAllFragments
Link copied to clipboard
fun removeAllFragments(): Int

Closes & removes all currently attached fragments:

rotateAllRotatableFragments
Link copied to clipboard
fun rotateAllRotatableFragments()
rotateGalleryFragment
Link copied to clipboard
private fun rotateGalleryFragment()

Updates the rotation of GalleryFragment to match the device rotation:

rotateSelectDeviceFragment
Link copied to clipboard
private fun rotateSelectDeviceFragment()

Updates the rotation of SelectDeviceFragment to match the device rotation:

Properties

activity
Link copied to clipboard
private val activity: CameraActivity

The activity, whose fragments are being managed

fm
Link copied to clipboard
private var fm: FragmentManager

The Android FragmentManager, used to attach/detach/show/hide fragments

mFragmentDarkBackground
Link copied to clipboard
private var mFragmentDarkBackground: FrameLayout

The dark background behind a fragment