@@ -254,10 +254,10 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
254254 intent.data = Uri .fromFile(File (path))
255255
256256 val shortcut = ShortcutInfo .Builder (activity, path)
257- .setShortLabel(path.getFilenameFromPath())
258- .setIcon(Icon .createWithBitmap(drawable.convertToBitmap()))
259- .setIntent(intent)
260- .build()
257+ .setShortLabel(path.getFilenameFromPath())
258+ .setIcon(Icon .createWithBitmap(drawable.convertToBitmap()))
259+ .setIntent(intent)
260+ .build()
261261
262262 manager.requestPinShortcut(shortcut, null )
263263 }
@@ -272,25 +272,25 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
272272 } else {
273273 ensureBackgroundThread {
274274 val options = RequestOptions ()
275- .format(DecodeFormat .PREFER_ARGB_8888 )
276- .skipMemoryCache(true )
277- .diskCacheStrategy(DiskCacheStrategy .NONE )
278- .fitCenter()
275+ .format(DecodeFormat .PREFER_ARGB_8888 )
276+ .skipMemoryCache(true )
277+ .diskCacheStrategy(DiskCacheStrategy .NONE )
278+ .fitCenter()
279279
280280 val size = activity.resources.getDimension(R .dimen.shortcut_size).toInt()
281281 val builder = Glide .with (activity)
282- .asDrawable()
283- .load(getImagePathToLoad(path))
284- .apply (options)
285- .centerCrop()
286- .into(size, size)
282+ .asDrawable()
283+ .load(getImagePathToLoad(path))
284+ .apply (options)
285+ .centerCrop()
286+ .into(size, size)
287287
288288 try {
289289 val bitmap = builder.get()
290290 drawable.findDrawableByLayerId(R .id.shortcut_folder_background).applyColorFilter(0 )
291291 drawable.setDrawableByLayerId(R .id.shortcut_folder_image, bitmap)
292292 } catch (e: Exception ) {
293- val fileIcon = activity.resources.getDrawable(R .drawable.ic_file_vector )
293+ val fileIcon = activity.resources.getDrawable(R .drawable.ic_file_generic )
294294 drawable.setDrawableByLayerId(R .id.shortcut_folder_image, fileIcon)
295295 }
296296
@@ -336,11 +336,11 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
336336 private fun openAs () {
337337 val res = activity.resources
338338 val items = arrayListOf (
339- RadioItem (OPEN_AS_TEXT , res.getString(R .string.text_file)),
340- RadioItem (OPEN_AS_IMAGE , res.getString(R .string.image_file)),
341- RadioItem (OPEN_AS_AUDIO , res.getString(R .string.audio_file)),
342- RadioItem (OPEN_AS_VIDEO , res.getString(R .string.video_file)),
343- RadioItem (OPEN_AS_OTHER , res.getString(R .string.other_file)))
339+ RadioItem (OPEN_AS_TEXT , res.getString(R .string.text_file)),
340+ RadioItem (OPEN_AS_IMAGE , res.getString(R .string.image_file)),
341+ RadioItem (OPEN_AS_AUDIO , res.getString(R .string.audio_file)),
342+ RadioItem (OPEN_AS_VIDEO , res.getString(R .string.video_file)),
343+ RadioItem (OPEN_AS_OTHER , res.getString(R .string.other_file)))
344344
345345 RadioGroupDialog (activity, items) {
346346 activity.tryOpenPathIntent(getFirstSelectedItemPath(), false , it as Int )
@@ -713,18 +713,18 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
713713
714714 val drawable = fileDrawables.getOrElse(fileName.substringAfterLast(" ." ).toLowerCase(), { fileDrawable })
715715 val options = RequestOptions ()
716- .signature(listItem.mPath.getFileSignature())
717- .diskCacheStrategy(DiskCacheStrategy .RESOURCE )
718- .error(drawable)
719- .centerCrop()
716+ .signature(listItem.mPath.getFileSignature())
717+ .diskCacheStrategy(DiskCacheStrategy .RESOURCE )
718+ .error(drawable)
719+ .centerCrop()
720720
721721 val itemToLoad = getImagePathToLoad(listItem.path)
722722 if (! activity.isDestroyed) {
723723 Glide .with (activity)
724- .load(itemToLoad)
725- .transition(DrawableTransitionOptions .withCrossFade())
726- .apply (options)
727- .into(item_icon)
724+ .load(itemToLoad)
725+ .transition(DrawableTransitionOptions .withCrossFade())
726+ .apply (options)
727+ .into(item_icon)
728728 }
729729 }
730730 }
0 commit comments