show a hint about resuming photo preview with a click

This commit is contained in:
tibbi
2017-05-07 13:13:07 +02:00
parent 1ed076a8f7
commit 01b3f5e952
15 changed files with 21 additions and 0 deletions

View File

@ -61,4 +61,8 @@ class Config(context: Context) : BaseConfig(context) {
var frontVideoResIndex: Int
get() = prefs.getInt(FRONT_VIDEO_RESOLUTION_INDEX, 0)
set(frontVideoResIndex) = prefs.edit().putInt(FRONT_VIDEO_RESOLUTION_INDEX, frontVideoResIndex).apply()
var wasPhotoPreviewHintShown: Boolean
get() = prefs.getBoolean(PHOTO_PREVIEW_HINT_SHOWN, false)
set(wasPhotoPreviewHintShown) = prefs.edit().putBoolean(PHOTO_PREVIEW_HINT_SHOWN, wasPhotoPreviewHintShown).apply()
}

View File

@ -16,6 +16,7 @@ val BACK_PHOTO_RESOLUTION_INDEX = "back_photo_resolution_index"
val BACK_VIDEO_RESOLUTION_INDEX = "back_video_resolution_index"
val FRONT_PHOTO_RESOLUTION_INDEX = "front_photo_resolution_index"
val FRONT_VIDEO_RESOLUTION_INDEX = "front_video_resolution_index"
val PHOTO_PREVIEW_HINT_SHOWN = "photo_preview_hint_shown"
val FLASH_OFF = 0
val FLASH_ON = 1

View File

@ -297,6 +297,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
private val takePictureCallback = Camera.PictureCallback { data, cam ->
if (config.isShowPreviewEnabled) {
mIsPreviewShown = true
if (!config.wasPhotoPreviewHintShown) {
context.toast(R.string.click_to_resume_preview)
config.wasPhotoPreviewHintShown = true
}
} else {
Handler().postDelayed({
resumePreview()