From 318275590c796aadbce16327a21a3d9291c2fa11 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 29 May 2020 22:28:51 +0200 Subject: [PATCH] autoformating some files, no real change --- .../gallery/pro/activities/MediaActivity.kt | 32 +++++------ .../pro/activities/ViewPagerActivity.kt | 56 +++++++++---------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 632544e80..ba452bfb1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -393,7 +393,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { initZoomListener() val fastscroller = if (config.scrollHorizontally) media_horizontal_fastscroller else media_vertical_fastscroller MediaAdapter(this, mMedia.clone() as ArrayList, this, mIsGetImageIntent || mIsGetVideoIntent || mIsGetAnyIntent, - mAllowPickingMultiple, mPath, media_grid, fastscroller) { + mAllowPickingMultiple, mPath, media_grid, fastscroller) { if (it is Medium && !isFinishing) { itemClicked(it.path) } @@ -799,24 +799,24 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { val ratio = wantedWidth.toFloat() / wantedHeight val options = RequestOptions() - .override((wantedWidth * ratio).toInt(), wantedHeight) - .fitCenter() + .override((wantedWidth * ratio).toInt(), wantedHeight) + .fitCenter() Glide.with(this) - .asBitmap() - .load(File(path)) - .apply(options) - .into(object : SimpleTarget() { - override fun onResourceReady(resource: Bitmap, transition: Transition?) { - try { - WallpaperManager.getInstance(applicationContext).setBitmap(resource) - setResult(Activity.RESULT_OK) - } catch (ignored: IOException) { - } - - finish() + .asBitmap() + .load(File(path)) + .apply(options) + .into(object : SimpleTarget() { + override fun onResourceReady(resource: Bitmap, transition: Transition?) { + try { + WallpaperManager.getInstance(applicationContext).setBitmap(resource) + setResult(Activity.RESULT_OK) + } catch (ignored: IOException) { } - }) + + finish() + } + }) } else if (mIsGetImageIntent || mIsGetVideoIntent || mIsGetAnyIntent) { Intent().apply { data = Uri.parse(path) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index a29be1226..fc15c58c0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -187,11 +187,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View findItem(R.id.menu_change_orientation).isVisible = rotationDegrees == 0 && visibleBottomActions and BOTTOM_ACTION_CHANGE_ORIENTATION == 0 findItem(R.id.menu_change_orientation).icon = resources.getDrawable(getChangeOrientationIcon()) findItem(R.id.menu_rotate).setShowAsAction( - if (rotationDegrees != 0) { - MenuItem.SHOW_AS_ACTION_ALWAYS - } else { - MenuItem.SHOW_AS_ACTION_IF_ROOM - }) + if (rotationDegrees != 0) { + MenuItem.SHOW_AS_ACTION_ALWAYS + } else { + MenuItem.SHOW_AS_ACTION_IF_ROOM + }) } if (visibleBottomActions != 0) { @@ -718,10 +718,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } val shortcut = ShortcutInfo.Builder(this, path) - .setShortLabel(medium.name) - .setIcon(Icon.createWithBitmap(drawable.convertToBitmap())) - .setIntent(intent) - .build() + .setShortLabel(medium.name) + .setIcon(Icon.createWithBitmap(drawable.convertToBitmap())) + .setIntent(intent) + .build() manager.requestPinShortcut(shortcut, null) } @@ -915,27 +915,27 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } val options = RequestOptions() - .skipMemoryCache(true) - .diskCacheStrategy(DiskCacheStrategy.NONE) + .skipMemoryCache(true) + .diskCacheStrategy(DiskCacheStrategy.NONE) Glide.with(this) - .asBitmap() - .load(path) - .apply(options) - .listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { - showErrorToast(e?.localizedMessage ?: "") - return false + .asBitmap() + .load(path) + .apply(options) + .listener(object : RequestListener { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { + showErrorToast(e?.localizedMessage ?: "") + return false + } + + override fun onResourceReady(bitmap: Bitmap?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { + if (bitmap != null) { + printHelper.printBitmap(path.getFilenameFromPath(), bitmap) } - override fun onResourceReady(bitmap: Bitmap?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { - if (bitmap != null) { - printHelper.printBitmap(path.getFilenameFromPath(), bitmap) - } - - return false - } - }).submit(requestedWidth, requestedHeight) + return false + } + }).submit(requestedWidth, requestedHeight) } catch (e: Exception) { } } @@ -1261,8 +1261,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (bottom_actions.isVisible()) { bottom_actions.animate().alpha(newAlpha).start() arrayOf(bottom_favorite, bottom_edit, bottom_share, bottom_delete, bottom_rotate, bottom_properties, bottom_change_orientation, - bottom_slideshow, bottom_show_on_map, bottom_toggle_file_visibility, bottom_rename, bottom_set_as, bottom_copy, bottom_move, - bottom_resize).forEach { + bottom_slideshow, bottom_show_on_map, bottom_toggle_file_visibility, bottom_rename, bottom_set_as, bottom_copy, bottom_move, + bottom_resize).forEach { it.isClickable = !mIsFullScreen } }