ResultsActivity

class ResultsActivity : AppCompatActivity

Activity for displaying the results of a capture request.

Constructors

ResultsActivity
Link copied to clipboard
fun ResultsActivity()

Types

Consts
Link copied to clipboard
object Consts

Functions

activateFullScreenshotOnlyMode
Link copied to clipboard
private fun activateFullScreenshotOnlyMode(): Boolean

Activates full screenshot only mode.

downloadFullScreenshot
Link copied to clipboard
private fun downloadFullScreenshot()

Downloads the full screenshot from the server via the captureViewModel

goBackToCameraActivity
Link copied to clipboard
private fun goBackToCameraActivity()

Finishes this activity.

initViewModels
Link copied to clipboard
private fun initViewModels()

Initiates captureViewModel.

initViews
Link copied to clipboard
private fun initViews()

Initiates all views.

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

Initializes the activity and sets up the views as well as the CaptureViewModel.

onFullScreenshotDenied
Link copied to clipboard
private fun onFullScreenshotDenied()

Callback for onFullScreenshotDownloaded to notify the user that the full screenshot could not be loaded.

onFullScreenshotDownloaded
Link copied to clipboard
private fun onFullScreenshotDownloaded(screenshot: Bitmap?)

Callback for the captureViewModel to notify the this activity that the full screenshot has been loaded.

onFullScreenshotSuccess
Link copied to clipboard
private fun onFullScreenshotSuccess()

Callback for onFullScreenshotDownloaded to set the full screenshot as the image view save it to the phone gallery if shareIntentIsActive.

onPause
Link copied to clipboard
protected open override fun onPause()

Sends a log using sendLog and clears StudyLogger.hashMap

onResume
Link copied to clipboard
protected open override fun onResume()
saveBothImages
Link copied to clipboard
private fun saveBothImages()

Saves both the cropped and full screenshot to the phone gallery.

saveCurrentPreviewImage
Link copied to clipboard
private fun saveCurrentPreviewImage()

Saves the current preview image to the phone gallery.

saveImage
Link copied to clipboard
private fun saveImage(image: Bitmap, file: File)

Saves an image to a file and adds it to the gallery.

saveToAppDir
Link copied to clipboard
private fun saveToAppDir(croppedScreenshot: Bitmap?, fullScreenshot: Bitmap?)

Save the screenshots to the app directory.

setViewListeners
Link copied to clipboard
private fun setViewListeners()

Sets all view listeners.

shareImage
Link copied to clipboard
private fun shareImage()

Opens the share intent to share the current preview image.

togglePillNavigationSelection
Link copied to clipboard
private fun togglePillNavigationSelection()

Toggles the pill navigation state and changes the current preview image.

Properties

captureViewModel
Link copied to clipboard
private lateinit var captureViewModel: CaptureViewModel

The CaptureViewModel, used to access data of the current matching process

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

Whether the cropped screenshot has been downloaded or not (can't be downloaded if false, because no matching cropped screenshot is available)

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

Whether the observers for captureViewModel have been registered or not. Necessary to prevent calling evens when registering the observers.

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

Whether to only allow the user to view the full screenshot or both the cropped and full screenshots. Set to true if no cropped screenshot is available.

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

Whether the full screenshot has been downloaded or not (can be downloaded using downloadFullScreenshot)

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

Whether the user has shared/saved the image via mShareButton, mSaveOneButton or mSaveBothButton

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

Whether this activity is returning to the camera activity or not, set to true in goBackToCameraActivity

lastDateTime
Link copied to clipboard
private val lastDateTime: String

The date and time when this activity was created, used as a prefix for the file names when saving images

mBackButton
Link copied to clipboard
private lateinit var mBackButton: AppCompatImageButton

The back button, used to return to the previous activity

mCroppedImageFile
Link copied to clipboard
private lateinit var mCroppedImageFile: File

The file containing the cropped screenshot

mFullImageFile
Link copied to clipboard
private lateinit var mFullImageFile: File

The file containing the full screenshot

mImagePreviewNextButton
Link copied to clipboard
private lateinit var mImagePreviewNextButton: AppCompatImageButton

The next image button (right), used to navigate to the next image

mImagePreviewPreviousButton
Link copied to clipboard
private lateinit var mImagePreviewPreviousButton: AppCompatImageButton

The previous image button (left), used to navigate to the previous image

mPillNavigationButton1
Link copied to clipboard
private lateinit var mPillNavigationButton1: AppCompatButton

The first pill navigation button, used to navigate to the previous image

mPillNavigationButton2
Link copied to clipboard
private lateinit var mPillNavigationButton2: AppCompatButton

The second pill navigation button, used to navigate to the next image

mPillNavigationState
Link copied to clipboard
private var mPillNavigationState: Int

The current state of the pill navigation buttons, used to determine which pill navigation button is currently highlighted (0 = pill 1 = cropped screenshot, 1 = pill 2 = full screenshot)

mRetakeImageButton
Link copied to clipboard
private lateinit var mRetakeImageButton: AppCompatButton

The retake image button, used to return to the previous activity

mSaveBothButton
Link copied to clipboard
private lateinit var mSaveBothButton: AppCompatImageButton

The save both button, calls saveBothImages when clicked

mSaveOneButton
Link copied to clipboard
private lateinit var mSaveOneButton: AppCompatImageButton

The save one button, calls saveCurrentPreviewImage when clicked

mSaveOneButtonText
Link copied to clipboard
private lateinit var mSaveOneButtonText: TextView

The text view displaying the text beneath mSaveOneButton

mScreenshotImageView
Link copied to clipboard
private lateinit var mScreenshotImageView: ImageView

The image view displaying the screenshot (either cropped or full)

mShareButton
Link copied to clipboard
private lateinit var mShareButton: AppCompatImageButton

The share button, calls shareImage when clicked

mShareButtonText
Link copied to clipboard
private lateinit var mShareButtonText: TextView

The text view displaying the text beneath mShareButton

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

Whether a share intent is currently being processed or not

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

Whether this activity was started from BackgroundMatchingService or not