diff --git a/app/build.gradle b/app/build.gradle index b900311e7..4b3f28805 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.1.13' + implementation 'com.simplemobiletools:commons:3.2.0' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0' implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.0' implementation 'com.android.support:multidex:1.0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt index 5ea179dad..d83d10237 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt @@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs import android.content.DialogInterface import android.support.v7.app.AlertDialog -import android.view.LayoutInflater import android.view.View import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.beVisibleIf @@ -20,7 +19,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti private var view: View init { - view = LayoutInflater.from(activity).inflate(R.layout.dialog_change_sorting, null).apply { + view = activity.layoutInflater.inflate(R.layout.dialog_change_sorting, null).apply { use_for_this_folder_divider.beVisibleIf(showFolderCheckbox) sorting_dialog_use_for_this_folder.beVisibleIf(showFolderCheckbox) sorting_dialog_use_for_this_folder.isChecked = config.hasCustomSorting(path) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt index e676fe0ad..0721683e0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ExcludeFolderDialog.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog -import android.view.LayoutInflater import android.view.ViewGroup import android.widget.RadioButton import android.widget.RadioGroup @@ -18,7 +17,7 @@ class ExcludeFolderDialog(val activity: BaseSimpleActivity, val selectedPaths: L var radioGroup: RadioGroup? = null init { - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_exclude_folder, null).apply { + val view = activity.layoutInflater.inflate(R.layout.dialog_exclude_folder, null).apply { exclude_folder_parent.beVisibleIf(alternativePaths.size > 1) radioGroup = exclude_folder_radio_group diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt index ce20eae97..b1f10323f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/FilterMediaDialog.kt @@ -1,8 +1,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog -import android.view.LayoutInflater -import android.view.View import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R @@ -13,7 +11,7 @@ import com.simplemobiletools.gallery.helpers.VIDEOS import kotlinx.android.synthetic.main.dialog_filter_media.view.* class FilterMediaDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) { - private var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_filter_media, null) + private var view = activity.layoutInflater.inflate(R.layout.dialog_filter_media, null) init { val filterMedia = activity.config.filterMedia diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt index bbc70402a..812396346 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ManageExtendedDetailsDialog.kt @@ -1,18 +1,15 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog -import android.view.LayoutInflater -import android.view.View import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.gallery.R -import com.simplemobiletools.gallery.activities.SimpleActivity import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.helpers.* import kotlinx.android.synthetic.main.dialog_manage_extended_details.view.* class ManageExtendedDetailsDialog(val activity: BaseSimpleActivity, val callback: (result: Int) -> Unit) { - private var view: View = LayoutInflater.from(activity).inflate(R.layout.dialog_manage_extended_details, null) + private var view = activity.layoutInflater.inflate(R.layout.dialog_manage_extended_details, null) init { val details = activity.config.extendedDetails diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt index de25c42e2..cbaa30443 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog import android.support.v7.widget.GridLayoutManager -import android.view.LayoutInflater import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.dialogs.FilePickerDialog import com.simplemobiletools.commons.extensions.beGoneIf @@ -23,7 +22,7 @@ import kotlinx.android.synthetic.main.dialog_directory_picker.view.* class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: String, val callback: (path: String) -> Unit) { var dialog: AlertDialog var shownDirectories = ArrayList() - var view = LayoutInflater.from(activity).inflate(R.layout.dialog_directory_picker, null) + var view = activity.layoutInflater.inflate(R.layout.dialog_directory_picker, null) var isGridViewType = activity.config.viewTypeFolders == VIEW_TYPE_GRID init { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt index b24fbc62c..61264f169 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt @@ -2,7 +2,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog import android.support.v7.widget.GridLayoutManager -import android.view.LayoutInflater import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.extensions.beGoneIf import com.simplemobiletools.commons.extensions.beVisibleIf @@ -19,7 +18,7 @@ import kotlinx.android.synthetic.main.dialog_medium_picker.view.* class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val callback: (path: String) -> Unit) { var dialog: AlertDialog var shownMedia = ArrayList() - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_medium_picker, null) + val view = activity.layoutInflater.inflate(R.layout.dialog_medium_picker, null) var isGridViewType = activity.config.viewTypeFiles == VIEW_TYPE_GRID init { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt index 7486849d6..33737957c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ResizeDialog.kt @@ -4,7 +4,6 @@ import android.graphics.Point import android.support.v7.app.AlertDialog import android.text.Editable import android.text.TextWatcher -import android.view.LayoutInflater import android.view.WindowManager import android.widget.EditText import com.simplemobiletools.commons.activities.BaseSimpleActivity @@ -16,7 +15,7 @@ import kotlinx.android.synthetic.main.resize_image.view.* class ResizeDialog(val activity: BaseSimpleActivity, val size: Point, val callback: (newSize: Point) -> Unit) { init { - val view = LayoutInflater.from(activity).inflate(R.layout.resize_image, null) + val view = activity.layoutInflater.inflate(R.layout.resize_image, null) val widthView = view.image_width val heightView = view.image_height diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt index 8bd25c1ea..792ede406 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SaveAsDialog.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog -import android.view.LayoutInflater import android.view.WindowManager import com.simplemobiletools.commons.activities.BaseSimpleActivity import com.simplemobiletools.commons.dialogs.ConfirmationDialog @@ -15,7 +14,7 @@ class SaveAsDialog(val activity: BaseSimpleActivity, val path: String, val appen init { var realPath = File(path).parent.trimEnd('/') - val view = LayoutInflater.from(activity).inflate(R.layout.dialog_save_as, null).apply { + val view = activity.layoutInflater.inflate(R.layout.dialog_save_as, null).apply { save_as_path.text = activity.humanizePath(realPath) val fullName = path.getFilenameFromPath() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt index 5eda40879..2facd4654 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/SlideshowDialog.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.gallery.dialogs import android.support.v7.app.AlertDialog -import android.view.LayoutInflater import android.view.View import android.view.WindowManager import com.simplemobiletools.commons.activities.BaseSimpleActivity @@ -17,7 +16,7 @@ class SlideshowDialog(val activity: BaseSimpleActivity, val callback: () -> Unit val view: View init { - view = LayoutInflater.from(activity).inflate(R.layout.dialog_slideshow, null).apply { + view = activity.layoutInflater.inflate(R.layout.dialog_slideshow, null).apply { interval_value.setOnClickListener { val text = interval_value.text if (text.isNotEmpty()) {