Remove unnecessary ProGuard keep rule and extract SaveResult to own file
The -keep rule for no.naiv.tiltshift.effect.** was based on the incorrect assumption that GLSL shaders use Java reflection. Shader source is loaded from raw resources — all effect classes are reached through normal Kotlin code and R8 can trace them. Removing the rule lets R8 properly optimize the effect package. Also extract SaveResult sealed class from PhotoSaver.kt into its own file to match the documented architecture. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
878c23bf89
commit
c58c45c52c
3 changed files with 16 additions and 15 deletions
3
app/proguard-rules.pro
vendored
3
app/proguard-rules.pro
vendored
|
|
@ -1,5 +1,2 @@
|
||||||
# Add project specific ProGuard rules here.
|
# Add project specific ProGuard rules here.
|
||||||
# CameraX and GMS Location ship their own consumer ProGuard rules.
|
# CameraX and GMS Location ship their own consumer ProGuard rules.
|
||||||
|
|
||||||
# Keep OpenGL shader-related code (accessed via reflection by GLSL pipeline)
|
|
||||||
-keep class no.naiv.tiltshift.effect.** { *; }
|
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,6 @@ import java.time.format.DateTimeFormatter
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Result of a photo save operation.
|
|
||||||
*/
|
|
||||||
sealed class SaveResult {
|
|
||||||
data class Success(
|
|
||||||
val uri: Uri,
|
|
||||||
val originalUri: Uri? = null,
|
|
||||||
val thumbnail: android.graphics.Bitmap? = null
|
|
||||||
) : SaveResult()
|
|
||||||
data class Error(val message: String, val exception: Exception? = null) : SaveResult()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles saving captured photos to the device gallery.
|
* Handles saving captured photos to the device gallery.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
16
app/src/main/java/no/naiv/tiltshift/storage/SaveResult.kt
Normal file
16
app/src/main/java/no/naiv/tiltshift/storage/SaveResult.kt
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
package no.naiv.tiltshift.storage
|
||||||
|
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.net.Uri
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Result of a photo save operation.
|
||||||
|
*/
|
||||||
|
sealed class SaveResult {
|
||||||
|
data class Success(
|
||||||
|
val uri: Uri,
|
||||||
|
val originalUri: Uri? = null,
|
||||||
|
val thumbnail: Bitmap? = null
|
||||||
|
) : SaveResult()
|
||||||
|
data class Error(val message: String, val exception: Exception? = null) : SaveResult()
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue