-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Translations: Escape ' correctly with \' Signed-off-by: IacobIonut01 <[email protected]> * Fix imports after sketch update Signed-off-by: IacobIonut01 <[email protected]> * Start development for 3.0.1 Signed-off-by: IacobIonut01 <[email protected]> * Apply 'ignored' rules to Media Picker as well Signed-off-by: IacobIonut01 <[email protected]> * Keep Screen On (Again) while watching Videos Signed-off-by: IacobIonut01 <[email protected]> * Fixed a bug a that prevented direct vertical swipes up on zoomed image Signed-off-by: IacobIonut01 <[email protected]> * Update dependencies Signed-off-by: IacobIonut01 <[email protected]> * Fix [BUG] Photo info, black screen #469 Also now the info button works as a toggle (if it is already opened, it will close) Signed-off-by: IacobIonut01 <[email protected]> * Gradle: Remove already-enabled flags Signed-off-by: IacobIonut01 <[email protected]> * Run UI Events trough the immediate dispatcher Might fix a random bug where the navigation bar would be visible where it shouldn't be Signed-off-by: IacobIonut01 <[email protected]> * Fix 3.0.0 nomap has internet permission again #471 Thanks @IzzySoft for solution Signed-off-by: IacobIonut01 <[email protected]> * Keep ACCESS_NETWORK_STATE permission inheritance Fixes crash on previous permission removal Signed-off-by: IacobIonut01 <[email protected]> * Fix crash for standalone activity Signed-off-by: IacobIonut01 <[email protected]> * [Standalone] Fix some bugs when Device system bar updates Signed-off-by: IacobIonut01 <[email protected]> * Fix navigation bar display with predictive back gesture animation Signed-off-by: IacobIonut01 <[email protected]> * Update AGP to 8.6.1 Signed-off-by: IacobIonut01 <[email protected]> * Save currentPage in MediaView and use it on restore Fixes App resets on system-initiated process death #487 Signed-off-by: IacobIonut01 <[email protected]> * Restore system bars on swipe down Before: Swipe down on MediaView when system bars are hidden The app goes back, but the system bars are still hidden Now: Swipe down on MediaView when system bars are hidden The app goes back, the system bars are back Signed-off-by: IacobIonut01 <[email protected]> * Feature: Add hold to rotate photo Now you can long press to rotate the photo 90 degrees to the right. The change is only visiual and no orientation changes occurs directly on the photo file Signed-off-by: IacobIonut01 <[email protected]> * Save showCryptoOptions and reduce clutter in SupportSheet Fixes ModalBottomSheet resets on orientation change #481 Signed-off-by: IacobIonut01 <[email protected]> * Search with query only when the user intents to Fixes SearchBar resets on orientation change #483 Signed-off-by: IacobIonut01 <[email protected]> * SearchBar: Improve history management Signed-off-by: IacobIonut01 <[email protected]> * Update dependencies Signed-off-by: IacobIonut01 <[email protected]> * Try to fix video playing issue in media view Fixes [BUG] Video issues when viewing album of videos #477 Signed-off-by: IacobIonut01 <[email protected]> * Allow Video Playback Without Pausing Other Audio Add new setting to disable audio focus in video player, allowing other apps to play in background while playing videos in the Gallery. Fixes [Enhancement] Allow Video Playback Without Pausing Other Audio #480 Signed-off-by: IacobIonut01 <[email protected]> * Improve JXL and HEIF decoders Signed-off-by: IacobIonut01 <[email protected]> * Fix compose-material-icons-extended versioning Signed-off-by: IacobIonut01 <[email protected]> * Build app by architecture Generates separate apks for: - universal - arm64-v8a - armeabi-v7a - x86_64 - x86 Fixes #492 Signed-off-by: IacobIonut01 <[email protected]> * Add ultra HDR support Needs testing from supported devices, but it should work Fixes [Enhancement] Add ultra HDR support #490 Signed-off-by: IacobIonut01 <[email protected]> * Allow viewing media with full brightness Add option to set full brightness when viewing media, can be enabled (disabled by default) in the settings screen. Fixes Set Brightness to maximum #280 Signed-off-by: IacobIonut01 <[email protected]> * Dismiss UI automatically when playing videos Added option in settings (enabled by default) Fixes [Enhancement] Video UI that doesn't get in your way #416 Signed-off-by: IacobIonut01 <[email protected]> * Don't display navigation when searchBar is active Signed-off-by: IacobIonut01 <[email protected]> * Add support to open the app from camera Signed-off-by: IacobIonut01 <[email protected]> * Introduce Image Editor v2 Supports: - Cropping - Adjustments (Brightness, Contrast..) - Filters - Markup (Drawing) Also adds tablet/landscape optimised layout Fixes Image editing #1 Fixes [Enhancement] Editor: Drawing #351 Fixes [BUG] Can't crop when I'm not holding makred corners #406 Fixes [Improvement] Cropping #441 Fixes [Enhancement] Please add draw support to edits #494 Signed-off-by: IacobIonut01 <[email protected]> --------- Signed-off-by: IacobIonut01 <[email protected]>
- Loading branch information
1 parent
261ceb8
commit 28b2b63
Showing
155 changed files
with
5,720 additions
and
7,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
app/src/main/kotlin/com/dot/gallery/core/decoder/DecoderExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.dot.gallery.core.decoder | ||
|
||
import android.graphics.Bitmap | ||
import com.github.panpf.sketch.asSketchImage | ||
import com.github.panpf.sketch.decode.DecodeResult | ||
import com.github.panpf.sketch.decode.ImageInfo | ||
import com.github.panpf.sketch.decode.internal.appliedResize | ||
import com.github.panpf.sketch.decode.internal.createScaledTransformed | ||
import com.github.panpf.sketch.request.RequestContext | ||
import com.github.panpf.sketch.source.DataSource | ||
import com.github.panpf.sketch.util.Size | ||
import com.github.panpf.sketch.util.computeScaleMultiplierWithOneSide | ||
import okio.buffer | ||
import kotlin.math.roundToInt | ||
|
||
inline fun DataSource.withCustomDecoder( | ||
requestContext: RequestContext, | ||
mimeType: String, | ||
getSize: (ByteArray) -> android.util.Size?, | ||
decodeSampled: (ByteArray, Int, Int) -> Bitmap | ||
): DecodeResult = openSource().use { src -> | ||
val sourceData = src.buffer().readByteArray() | ||
|
||
val imageInfo: ImageInfo | ||
var transformeds: List<String>? = null | ||
val originalSizeDecoded = getSize(sourceData) ?: android.util.Size(0, 0) | ||
val originalSize = Size(originalSizeDecoded.width, originalSizeDecoded.height) | ||
val targetSize = requestContext.size!! | ||
val scale = computeScaleMultiplierWithOneSide( | ||
sourceSize = originalSize, | ||
targetSize = targetSize, | ||
) | ||
if (scale != 1f) { | ||
transformeds = listOf(createScaledTransformed(scale)) | ||
} | ||
|
||
val decodedImage = if (requestContext.size == Size.Origin) { | ||
imageInfo = ImageInfo( | ||
width = originalSize.width, | ||
height = originalSize.height, | ||
mimeType = mimeType, | ||
) | ||
decodeSampled( | ||
sourceData, | ||
originalSize.width, | ||
originalSize.height | ||
) | ||
} else { | ||
val dstSize = Size( | ||
width = (originalSize.width * scale).roundToInt(), | ||
height = (originalSize.height * scale).roundToInt() | ||
) | ||
imageInfo = ImageInfo( | ||
width = dstSize.width, | ||
height = dstSize.height, | ||
mimeType = mimeType, | ||
) | ||
decodeSampled( | ||
sourceData, | ||
dstSize.width, | ||
dstSize.height | ||
) | ||
} | ||
|
||
val resize = requestContext.computeResize(imageInfo.size) | ||
DecodeResult( | ||
image = decodedImage.asSketchImage(), | ||
imageInfo = imageInfo, | ||
dataFrom = dataFrom, | ||
resize = resize, | ||
transformeds = transformeds, | ||
extras = null | ||
).appliedResize(requestContext) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.