Skip to content

Commit

Permalink
3.0.1 Release from nightly
Browse files Browse the repository at this point in the history
* 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
IacobIonut01 authored Nov 2, 2024
1 parent 261ceb8 commit 28b2b63
Show file tree
Hide file tree
Showing 155 changed files with 5,720 additions and 7,029 deletions.
22 changes: 17 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
import java.io.FileInputStream
import java.util.Properties

Expand All @@ -21,8 +22,8 @@ android {
applicationId = "com.dot.gallery"
minSdk = 30
targetSdk = 35
versionCode = 30033
versionName = "3.0.0"
versionCode = 30123
versionName = "3.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -103,7 +104,9 @@ android {
buildConfig = true
}
composeCompiler {
enableStrongSkippingMode = true
featureFlags = setOf(
ComposeFeatureFlag.OptimizeNonSkippingGroups
)
includeSourceInformation = true
}
packaging {
Expand All @@ -115,6 +118,15 @@ android {
room {
schemaDirectory("$projectDir/schemas/")
}

splits {
abi {
isEnable = true
reset()
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
isUniversalApk = true
}
}
}

dependencies {
Expand Down Expand Up @@ -206,8 +218,8 @@ dependencies {
// Fuzzy Search
implementation(libs.fuzzywuzzy)

// GPU Image
implementation(libs.gpuimage)
// Aire
implementation(libs.aire)

// Pinch to zoom
implementation(libs.pinchzoomgrid)
Expand Down
4 changes: 3 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
-dontwarn org.bouncycastle.jsse.**
-dontwarn org.conscrypt.**
-dontwarn org.openjsse.**
-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn org.slf4j.impl.StaticLoggerBinder

-keep class com.dot.gallery.feature_node.presentation.edit.adjustments.** { *; }
11 changes: 9 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<!-- Required to download Map Preview for Media -->
<uses-permission android:name="android.permission.INTERNET"/>

<!-- Remove unwanted permissions from being added -->
<uses-permission android:name="android.permission.INTERNET" tools:node="remove"/>

<!-- Required to access media for SDK < 33 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
Expand Down Expand Up @@ -61,11 +64,15 @@
android:name=".feature_node.presentation.main.MainActivity"
android:exported="true"
android:configChanges="keyboard|keyboardHidden|screenSize|screenLayout|smallestScreenSize|uiMode"
android:launchMode="singleTop"
android:theme="@style/Theme.Gallery.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.APP_GALLERY"/>
<category android:name="android.intent.category.INFO"/>
</intent-filter>
</activity>

Expand Down Expand Up @@ -150,7 +157,7 @@
<activity
android:name=".feature_node.presentation.edit.EditActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|screenLayout|smallestScreenSize|uiMode"
android:enabled="false"
android:launchMode="singleTop"
android:exported="true">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.EDIT"/>
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/kotlin/com/dot/gallery/core/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,24 @@ object Settings {
@Composable
fun rememberAutoHideNavBar() =
rememberPreference(key = AUTO_HIDE_NAVIGATIONBAR, defaultValue = true)

private val AUDIO_FOCUS = booleanPreferencesKey("audio_focus")

@Composable
fun rememberAudioFocus() =
rememberPreference(key = AUDIO_FOCUS, defaultValue = true)

private val FULL_BRIGHTNESS_VIEW = booleanPreferencesKey("full_brightness_view")

@Composable
fun rememberFullBrightnessView() =
rememberPreference(key = FULL_BRIGHTNESS_VIEW, defaultValue = false)

private val AUTO_HIDE_ON_VIDEO_PLAY = booleanPreferencesKey("auto_hide_on_video_play")

@Composable
fun rememberAutoHideOnVideoPlay() =
rememberPreference(key = AUTO_HIDE_ON_VIDEO_PLAY, defaultValue = true)
}
}

Expand Down
74 changes: 74 additions & 0 deletions app/src/main/kotlin/com/dot/gallery/core/decoder/DecoderExt.kt
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)
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
package com.dot.gallery.core.decoder

import com.github.panpf.sketch.ComponentRegistry
import com.github.panpf.sketch.asSketchImage
import com.github.panpf.sketch.decode.DecodeResult
import com.github.panpf.sketch.decode.Decoder
import com.github.panpf.sketch.decode.ImageInfo
import com.github.panpf.sketch.decode.internal.calculateSampleSize
import com.github.panpf.sketch.decode.internal.createInSampledTransformed
import com.github.panpf.sketch.decode.internal.isSmallerSizeMode
import com.github.panpf.sketch.fetch.FetchResult
import com.github.panpf.sketch.request.RequestContext
import com.github.panpf.sketch.source.DataSource
import com.github.panpf.sketch.util.Size
import com.radzivon.bartoshyk.avif.coder.HeifCoder
import com.radzivon.bartoshyk.avif.coder.PreferredColorConfig
import okio.buffer

fun ComponentRegistry.Builder.supportHeifDecoder(): ComponentRegistry.Builder = apply {
addDecoder(SketchHeifDecoder.Factory())
}

@Suppress("SpellCheckingInspection")
class SketchHeifDecoder(
private val requestContext: RequestContext,
private val dataSource: DataSource,
Expand Down Expand Up @@ -64,59 +57,12 @@ class SketchHeifDecoder(

override suspend fun decode(): Result<DecodeResult> = runCatching {
val coder = HeifCoder(requestContext.request.context)
dataSource.openSource().use { src ->
val sourceData = src.buffer().readByteArray()

val request = requestContext.request

val imageInfo: ImageInfo

val size: Size

val decodedImage = if (requestContext.size == Size.Origin) {
val originalImageBitmap = coder.decode(sourceData)
size = Size(originalImageBitmap.width, originalImageBitmap.height)
imageInfo = ImageInfo(
width = size.width,
height = size.height,
mimeType = mimeType,
)
originalImageBitmap
} else {
val resize = requestContext.computeResize(requestContext.size!!)
size = resize.size
imageInfo = ImageInfo(
width = size.width,
height = size.height,
mimeType = mimeType,
)
coder.decodeSampled(
sourceData,
size.width,
size.height,
preferredColorConfig = PreferredColorConfig.RGBA_8888
)
}

val precision = request.precisionDecider.get(
imageSize = Size(imageInfo.size.width, imageInfo.size.height),
targetSize = size,
)
val inSampleSize = calculateSampleSize(
imageSize = Size(imageInfo.size.width, imageInfo.size.height),
targetSize = size,
smallerSizeMode = precision.isSmallerSizeMode()
)

DecodeResult(
image = decodedImage.asSketchImage(),
imageInfo = imageInfo,
dataFrom = dataSource.dataFrom,
resize = requestContext.computeResize(if (size == Size.Origin) requestContext.size!! else size),
transformeds = if (inSampleSize != 1) listOf(createInSampledTransformed(inSampleSize)) else null,
extras = null
)
}
return@runCatching dataSource.withCustomDecoder(
requestContext = requestContext,
mimeType = mimeType,
getSize = coder::getSize,
decodeSampled = coder::decodeSampled
)
}

}
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
package com.dot.gallery.core.decoder

import com.awxkee.jxlcoder.JxlCoder
import com.dot.gallery.core.decoder.SketchJxlDecoder.Factory.Companion.JXL_MIMETYPE
import com.github.panpf.sketch.ComponentRegistry
import com.github.panpf.sketch.asSketchImage
import com.github.panpf.sketch.decode.DecodeResult
import com.github.panpf.sketch.decode.Decoder
import com.github.panpf.sketch.decode.ImageInfo
import com.github.panpf.sketch.decode.internal.calculateSampleSize
import com.github.panpf.sketch.decode.internal.createInSampledTransformed
import com.github.panpf.sketch.decode.internal.isSmallerSizeMode
import com.github.panpf.sketch.fetch.FetchResult
import com.github.panpf.sketch.request.RequestContext
import com.github.panpf.sketch.source.DataSource
import com.github.panpf.sketch.util.Size
import okio.buffer

fun ComponentRegistry.Builder.supportJxlDecoder(): ComponentRegistry.Builder = apply {
addDecoder(SketchJxlDecoder.Factory())
Expand Down Expand Up @@ -55,50 +49,11 @@ class SketchJxlDecoder(
}

override suspend fun decode(): Result<DecodeResult> = kotlin.runCatching {
val request = requestContext.request
val sourceData = dataSource.openSource().buffer().readByteArray()
val originalImageBitmap = JxlCoder.decode(sourceData)
var imageInfo = ImageInfo(
width = originalImageBitmap.width,
height = originalImageBitmap.height,
mimeType = "image/jxl",
)

val resize = requestContext.computeResize(imageInfo.size)
val decodedImage = if (requestContext.size == Size.Origin) {
originalImageBitmap
} else {
imageInfo = ImageInfo(
width = resize.size.width,
height = resize.size.height,
mimeType = "image/jxl",
)
JxlCoder.decodeSampled(
sourceData,
resize.size.width,
resize.size.height
)
}

val size = requestContext.size!!
val precision = request.precisionDecider.get(
imageSize = Size(imageInfo.size.width, imageInfo.size.height),
targetSize = size,
)
val inSampleSize = calculateSampleSize(
imageSize = Size(imageInfo.size.width, imageInfo.size.height),
targetSize = size,
smallerSizeMode = precision.isSmallerSizeMode()
)
val transformeds: List<String>? =
if (inSampleSize != 1) listOf(createInSampledTransformed(inSampleSize)) else null
DecodeResult(
image = decodedImage.asSketchImage(),
imageInfo = imageInfo,
dataFrom = dataSource.dataFrom,
resize = requestContext.computeResize(if (size == Size.Origin) requestContext.size!! else size),
transformeds = transformeds,
extras = null
return@runCatching dataSource.withCustomDecoder(
requestContext = requestContext,
mimeType = JXL_MIMETYPE,
getSize = JxlCoder::getSize,
decodeSampled = JxlCoder::decodeSampled
)
}

Expand Down
Loading

0 comments on commit 28b2b63

Please sign in to comment.