ErrorFragment

class ErrorFragment : Fragment, GarbageView

Fragment displaying an error message to the user when a match request results in no matches.

Constructors

ErrorFragment
Link copied to clipboard
fun ErrorFragment()

Functions

clearGarbage
Link copied to clipboard
open override fun clearGarbage()

Set all listeners, ViewModels and shared references to null.

initViews
Link copied to clipboard
private fun initViews()

Initiates the views of this fragment and loads the image taken with the camera into mErrorImageView.

onCreate
Link copied to clipboard
open override fun onCreate(savedInstanceState: Bundle?)

Called when the fragment is created, initiates captureViewModel.

onCreateView
Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?

On view creation, returns an inflated view of this fragment.

onStop
Link copied to clipboard
open override fun onStop()
onViewCreated
Link copied to clipboard
open override fun onViewCreated(view: View, savedInstanceState: Bundle?)

Called after the view of this fragment has been created, calls initViews.

openFeedbackFragment
Link copied to clipboard
private fun openFeedbackFragment()
openResultsActivity
Link copied to clipboard
private fun openResultsActivity()
removeThisFragment
Link copied to clipboard
private fun removeThisFragment()

Removes this fragment.

Properties

captureViewModel
Link copied to clipboard
private var captureViewModel: CaptureViewModel? = null

The CaptureViewModel, used to access the server url and full camera image of the last match request

containerView
Link copied to clipboard
private var containerView: FrameLayout? = null

The container view holding this fragment

mBackButton
Link copied to clipboard
private lateinit var mBackButton: Button

The back button, calls removeThisFragment on click

mErrorImageView
Link copied to clipboard
private lateinit var mErrorImageView: ImageView

The image view displaying the image taken with the camera

mFeedbackButton
Link copied to clipboard
private lateinit var mFeedbackButton: Button

The feedback button, calls openFeedbackFragment on click

mFragmentBackground
Link copied to clipboard
private var mFragmentBackground: FrameLayout? = null

The dark background behind this fragment, calls removeThisFragment on click

mFullImageButton
Link copied to clipboard
private lateinit var mFullImageButton: Button

The full image button, calls openResultsActivity on click

resultsOpened
Link copied to clipboard
private var resultsOpened: Boolean = false

Whether the results activity was opened by this fragment or not