Compare commits

...

3 Commits

Author SHA1 Message Date
Benoit Marty 562a02a796 Remove useless code. It is done elsewhere 2020-03-06 18:56:51 +01:00
Benoit Marty ac31bbdb1b Explicitely configure the pickers and disable thumbnail and preview Images 2020-03-06 18:53:41 +01:00
Benoit Marty 0fb6dd592e code smell 2020-03-06 18:33:24 +01:00
2 changed files with 14 additions and 5 deletions

View File

@ -97,19 +97,16 @@ class AttachmentsHelper private constructor(private val context: Context,
// Restorable
override fun onSaveInstanceState(outState: Bundle) {
capturePath?.also {
capturePath?.let {
outState.putString(CAPTURE_PATH_KEY, it)
}
pendingType?.also {
pendingType?.let {
outState.putSerializable(PENDING_TYPE_KEY, it)
}
}
override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
capturePath = savedInstanceState?.getString(CAPTURE_PATH_KEY)
if (capturePath != null) {
cameraImagePicker.reinitialize(capturePath)
}
pendingType = savedInstanceState?.getSerializable(PENDING_TYPE_KEY) as? AttachmentTypeSelectorView.Type
}

View File

@ -51,12 +51,16 @@ class ActivityPickerManagerFactory(private val activity: Activity, callback: Att
return ImagePicker(activity).also {
it.setImagePickerCallback(attachmentsPickerCallback)
it.allowMultiple()
it.shouldGenerateMetadata(true)
it.shouldGenerateThumbnails(false)
}
}
override fun createCameraImagePicker(): CameraImagePicker {
return CameraImagePicker(activity).also {
it.setImagePickerCallback(attachmentsPickerCallback)
it.shouldGenerateMetadata(true)
it.shouldGenerateThumbnails(false)
}
}
@ -64,6 +68,8 @@ class ActivityPickerManagerFactory(private val activity: Activity, callback: Att
return VideoPicker(activity).also {
it.setVideoPickerCallback(attachmentsPickerCallback)
it.allowMultiple()
it.shouldGenerateMetadata(true)
it.shouldGeneratePreviewImages(false)
}
}
@ -96,12 +102,16 @@ class FragmentPickerManagerFactory(private val fragment: Fragment, callback: Att
return ImagePicker(fragment).also {
it.setImagePickerCallback(attachmentsPickerCallback)
it.allowMultiple()
it.shouldGenerateMetadata(true)
it.shouldGenerateThumbnails(false)
}
}
override fun createCameraImagePicker(): CameraImagePicker {
return CameraImagePicker(fragment).also {
it.setImagePickerCallback(attachmentsPickerCallback)
it.shouldGenerateMetadata(true)
it.shouldGenerateThumbnails(false)
}
}
@ -109,6 +119,8 @@ class FragmentPickerManagerFactory(private val fragment: Fragment, callback: Att
return VideoPicker(fragment).also {
it.setVideoPickerCallback(attachmentsPickerCallback)
it.allowMultiple()
it.shouldGenerateMetadata(true)
it.shouldGeneratePreviewImages(false)
}
}