mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
autoformating some files, no real change
This commit is contained in:
parent
150aace3ca
commit
318275590c
2 changed files with 44 additions and 44 deletions
|
@ -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<ThumbnailItem>, 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<Bitmap>() {
|
||||
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
|
||||
try {
|
||||
WallpaperManager.getInstance(applicationContext).setBitmap(resource)
|
||||
setResult(Activity.RESULT_OK)
|
||||
} catch (ignored: IOException) {
|
||||
}
|
||||
|
||||
finish()
|
||||
.asBitmap()
|
||||
.load(File(path))
|
||||
.apply(options)
|
||||
.into(object : SimpleTarget<Bitmap>() {
|
||||
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
|
||||
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)
|
||||
|
|
|
@ -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<Bitmap> {
|
||||
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
|
||||
showErrorToast(e?.localizedMessage ?: "")
|
||||
return false
|
||||
.asBitmap()
|
||||
.load(path)
|
||||
.apply(options)
|
||||
.listener(object : RequestListener<Bitmap> {
|
||||
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
|
||||
showErrorToast(e?.localizedMessage ?: "")
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onResourceReady(bitmap: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
|
||||
if (bitmap != null) {
|
||||
printHelper.printBitmap(path.getFilenameFromPath(), bitmap)
|
||||
}
|
||||
|
||||
override fun onResourceReady(bitmap: Bitmap?, model: Any?, target: Target<Bitmap>?, 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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue