diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 616d2ae..a8cb933 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -1,20 +1,21 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.dagger.hilt)
}
android {
namespace = "com.abizer_r.quickedit"
- compileSdk = 34
+ compileSdk = 35
defaultConfig {
applicationId = "com.abizer_r.quickedit"
minSdk = 24
- targetSdk = 34
- versionCode = 4
- versionName = "1.1.0"
+ targetSdk = 35
+ versionCode = 5
+ versionName = "1.1.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
@@ -42,9 +43,9 @@ android {
buildFeatures {
compose = true
}
- composeOptions {
- kotlinCompilerExtensionVersion = "1.4.3"
- }
+
+ // remove composeOptions.kotlinCompilerExtensionVersion when on Kotlin 2.x
+// composeOptions { kotlinCompilerExtensionVersion = "1.5.10" }
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f5eb1df..8953cc8 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -20,9 +20,15 @@
android:windowSoftInputMode="adjustResize">
-
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/abizer_r/quickedit/ui/main/MainActivity.kt b/app/src/main/java/com/abizer_r/quickedit/ui/main/MainActivity.kt
index e03f056..1b8533f 100644
--- a/app/src/main/java/com/abizer_r/quickedit/ui/main/MainActivity.kt
+++ b/app/src/main/java/com/abizer_r/quickedit/ui/main/MainActivity.kt
@@ -1,8 +1,13 @@
package com.abizer_r.quickedit.ui.main
+import android.content.Intent
+import android.net.Uri
import android.os.Bundle
import androidx.activity.ComponentActivity
+import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
+import androidx.activity.enableEdgeToEdge
+import androidx.core.view.WindowCompat
import com.abizer_r.quickedit.ui.navigation.QuickEditApp
import dagger.hilt.android.AndroidEntryPoint
@@ -10,8 +15,23 @@ import dagger.hilt.android.AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+
+ WindowCompat.setDecorFitsSystemWindows(window, false)
+
+ val imageUri: Uri? = extractImageUriFromIntent(intent)
+
setContent {
- QuickEditApp()
+ QuickEditApp(initialImageUri = imageUri)
+ }
+ }
+
+ private fun extractImageUriFromIntent(intent: Intent?): Uri? {
+ if (intent == null) return null
+
+ return if (intent.action == Intent.ACTION_SEND) {
+ intent.getParcelableExtra(Intent.EXTRA_STREAM)
+ } else {
+ null
}
}
}
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index dcabeb3..e015789 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
+ alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.dagger.hilt) apply false
// id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0-RC3" apply false
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 492d799..905f308 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,22 +1,22 @@
[versions]
activityCompose = "1.9.0"
-agp = "8.1.4"
+agp = "8.6.1"
androidImageCropper = "4.5.0"
appcompat = "1.7.0"
-cloudy = "0.1.2"
+cloudy = "0.2.7"
colorpicker = "1.0.0"
-composeBom = "2024.06.00"
+composeBom = "2025.05.00"
composeScreenshot = "1.0.3"
constraintlayoutCompose = "1.0.1"
coreKtx = "1.13.1"
espressoCore = "3.6.0"
gpuimage = "2.1.0"
-hiltAndroid = "2.49"
+hiltAndroid = "2.57.1"
hiltNavigationCompose = "1.2.0"
junit = "4.13.2"
junitVersion = "1.2.0"
-kotlinxSerializationJson = "1.7.0-RC"
-kotlin = "1.8.10"
+kotlinxSerializationJson = "1.6.3"
+kotlin = "2.1.10"
lifecycleRuntimeKtx = "2.8.2"
material = "1.12.0"
navigationCompose = "2.7.7"
@@ -59,5 +59,6 @@ material = { module = "com.google.android.material:material", version.ref = "mat
android-application = { id = "com.android.application", version.ref = "agp"}
android-library = { id = "com.android.library", version.ref = "agp"}
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin"}
+kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin"}
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin"}
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "hiltAndroid"}
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index e708b1c..a4b76b9 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 3dab237..cea7a79 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
-#Sat Mar 09 22:53:01 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 4f906e0..f3b75f3 100644
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
-#!/usr/bin/env sh
+#!/bin/sh
#
-# Copyright 2015 the original author or authors.
+# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,69 +15,103 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
-##
-## Gradle start up script for UN*X
-##
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
##############################################################################
# Attempt to set APP_HOME
+
# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
+MAX_FD=maximum
warn () {
echo "$*"
-}
+} >&2
die () {
echo
echo "$*"
echo
exit 1
-}
+} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
+ JAVACMD=$JAVA_HOME/jre/sh/java
else
- JAVACMD="$JAVA_HOME/bin/java"
+ JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,88 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
+ fi
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
fi
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
fi
- i=`expr $i + 1`
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
done
- case $i in
- 0) set -- ;;
- 1) set -- "$args0" ;;
- 2) set -- "$args0" "$args1" ;;
- 3) set -- "$args0" "$args1" "$args2" ;;
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
fi
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=`save "$@"`
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 107acd3..9d21a21 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +27,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
+if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/quickedit/build.gradle.kts b/quickedit/build.gradle.kts
index e0a87fe..cb4363e 100644
--- a/quickedit/build.gradle.kts
+++ b/quickedit/build.gradle.kts
@@ -1,13 +1,14 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.dagger.hilt)
}
android {
namespace = "com.abizer_r.quickedit"
- compileSdk = 34
+ compileSdk = 35
defaultConfig {
minSdk = 24
@@ -35,9 +36,9 @@ android {
buildFeatures {
compose = true
}
- composeOptions {
- kotlinCompilerExtensionVersion = "1.4.3"
- }
+
+ // remove composeOptions.kotlinCompilerExtensionVersion when on Kotlin 2.x
+// composeOptions { kotlinCompilerExtensionVersion = "1.5.10" }
}
dependencies {
diff --git a/quickedit/proguard-rules.pro b/quickedit/proguard-rules.pro
index 481bb43..d703fe8 100644
--- a/quickedit/proguard-rules.pro
+++ b/quickedit/proguard-rules.pro
@@ -18,4 +18,15 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
-#-renamesourcefileattribute SourceFile
\ No newline at end of file
+#-renamesourcefileattribute SourceFile
+
+# Hilt / Dagger
+-keep class dagger.hilt.** { *; }
+-keep class * extends dagger.hilt.internal.GeneratedComponent { *; }
+-keep class * extends androidx.lifecycle.ViewModel { *; } # keep ViewModel names if used in DI
+
+# Okio/OkHttp/Moshi (if you add later)
+-dontwarn javax.annotation.**
+
+# GPUImage (avoid stripping)
+-keep class jp.co.cyberagent.android.gpuimage.** { *; }
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/theme/Theme.kt b/quickedit/src/main/java/com/abizer_r/quickedit/theme/Theme.kt
index 35298c7..7a9a824 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/theme/Theme.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/theme/Theme.kt
@@ -55,9 +55,14 @@ fun QuickEditTheme(
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
- window.statusBarColor = Color.Black.toArgb()
- window.navigationBarColor = Color.Black.toArgb()
- WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
+ window.statusBarColor = Color.Transparent.toArgb()
+ window.navigationBarColor = Color.Transparent.toArgb()
+
+ val controller = WindowCompat.getInsetsController(window, view)
+ controller.isAppearanceLightStatusBars = !darkTheme
+ controller.isAppearanceLightNavigationBars = !darkTheme
+
+ if (Build.VERSION.SDK_INT >= 29) window.isNavigationBarContrastEnforced = false
}
}
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/cropMode/cropperOptions/CropperOptionsFullWidth.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/cropMode/cropperOptions/CropperOptionsFullWidth.kt
index 06b9d1a..47ea5de 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/cropMode/cropperOptions/CropperOptionsFullWidth.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/cropMode/cropperOptions/CropperOptionsFullWidth.kt
@@ -61,7 +61,7 @@ fun CropperOptionsFullWidth(
val cropperOption = cropperOptionList[index]
CropperOptionView(
modifier = Modifier
- .animateItemPlacement()
+ .animateItem()
.padding(horizontal = 4.dp),
cropperOption = cropperOption,
isSelected = index == selectedIndex,
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/EffectsModeScreen.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/EffectsModeScreen.kt
index c6ee067..4384ed7 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/EffectsModeScreen.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/EffectsModeScreen.kt
@@ -48,8 +48,7 @@ import com.abizer_r.quickedit.ui.editorScreen.bottomToolbar.TOOLBAR_HEIGHT_SMALL
import com.abizer_r.quickedit.ui.editorScreen.topToolbar.TextModeTopToolbar
import com.abizer_r.quickedit.ui.effectsMode.effectsPreview.EffectItem
import com.abizer_r.quickedit.ui.effectsMode.effectsPreview.EffectsPreviewListFullWidth
-import com.abizer_r.quickedit.utils.SharedTransitionPreviewExtension
-import com.abizer_r.quickedit.utils.editorScreen.EffectsModeUtils
+import com.abizer_r.quickedit.utils.effectsMode.EffectsModeUtils
import com.abizer_r.quickedit.utils.other.anim.AnimUtils
import com.abizer_r.quickedit.utils.other.bitmap.ImmutableBitmap
import com.smarttoolfactory.screenshot.ImageResult
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/effectsPreview/EffectsPreviewListFullWidth.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/effectsPreview/EffectsPreviewListFullWidth.kt
index 9471f9c..fc3f7c0 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/effectsPreview/EffectsPreviewListFullWidth.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/effectsMode/effectsPreview/EffectsPreviewListFullWidth.kt
@@ -67,7 +67,7 @@ fun EffectsPreviewListFullWidth(
val effectItem = effectsList[index]
EffectPreview(
modifier = Modifier
- .animateItemPlacement()
+ .animateItem()
.padding(horizontal = 4.dp),
effectItem = effectItem,
isSelected = index == selectedIndex,
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreen.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreen.kt
index 9924952..d4abe49 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreen.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreen.kt
@@ -39,7 +39,8 @@ import java.io.File
@Composable
fun MainScreen(
modifier: Modifier = Modifier,
- onImageSelected: (Bitmap) -> Unit
+ onImageSelected: (Bitmap) -> Unit,
+ initialImageUri: Uri? = null,
) {
val context = LocalContext.current
val activity = context.getActivity()
@@ -94,9 +95,19 @@ fun MainScreen(
}
}
+ LaunchedEffect(initialImageUri) {
+ initialImageUri?.let { imgUri ->
+ lifecycleScope.launch(Dispatchers.Default) {
+ BitmapUtils.getScaledBitmap(context, imgUri).onEach {
+ scaledBitmapStatus = it
+ }.collect()
+ }
+ }
+ }
+
LaunchedEffect(key1 = imageUri) {
imageUri?.let { imgUri ->
- lifecycleScope.launch(Dispatchers.IO) {
+ lifecycleScope.launch(Dispatchers.Default) {
BitmapUtils.getScaledBitmap(context, imgUri).onEach {
scaledBitmapStatus = it
}.collect()
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreenViewModel.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreenViewModel.kt
index 4ee27c3..d9f8e7f 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreenViewModel.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/mainScreen/MainScreenViewModel.kt
@@ -16,7 +16,7 @@ class MainScreenViewModel @Inject constructor(
val visiblePermissionDialogQueue = mutableStateListOf()
fun dismissDialog() {
- visiblePermissionDialogQueue.removeLast()
+ visiblePermissionDialogQueue.removeAt(visiblePermissionDialogQueue.size - 1)
}
fun onPermissionResult(
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditApp.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditApp.kt
index ee0b88a..c484571 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditApp.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditApp.kt
@@ -1,20 +1,35 @@
package com.abizer_r.quickedit.ui.navigation
+import android.net.Uri
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.abizer_r.quickedit.theme.QuickEditTheme
@Composable
-fun QuickEditApp() {
+fun QuickEditApp(
+ initialImageUri: Uri? = null
+) {
QuickEditTheme {
- Box(
- modifier = Modifier
- .background(MaterialTheme.colorScheme.background)
- ) {
- QuickEditNavigation()
+ Scaffold(
+ // Ensure content avoids system bars & cutouts
+ contentWindowInsets = WindowInsets.safeDrawing,
+ ) { innerPadding ->
+ Box(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(innerPadding)
+ .background(MaterialTheme.colorScheme.background)
+ ) {
+ QuickEditNavigation(initialImageUri)
+ }
}
}
}
\ No newline at end of file
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditNavigation.kt b/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditNavigation.kt
index 042c5c3..0ee17e7 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditNavigation.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/ui/navigation/QuickEditNavigation.kt
@@ -1,13 +1,16 @@
package com.abizer_r.quickedit.ui.navigation
import android.graphics.Bitmap
+import android.net.Uri
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.tween
import androidx.compose.animation.slideIn
import androidx.compose.animation.slideOut
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
+import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.IntOffset
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
@@ -29,14 +32,18 @@ import com.abizer_r.quickedit.utils.other.anim.enterTransition
import com.abizer_r.quickedit.utils.other.anim.exitTransition
import com.abizer_r.quickedit.utils.other.anim.popEnterTransition
import com.abizer_r.quickedit.utils.other.anim.popExitTransition
+import com.abizer_r.quickedit.utils.other.bitmap.BitmapUtils
import com.abizer_r.quickedit.utils.other.bitmap.ImmutableBitmap
+import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
+import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
@Composable
-fun QuickEditNavigation() {
- val lifeCycleOwner = LocalLifecycleOwner.current
- val lifecycleScope = lifeCycleOwner.lifecycleScope
+fun QuickEditNavigation(
+ initialImageUri: Uri? = null
+) {
val sharedEditorViewModel = hiltViewModel()
val navController = rememberNavController()
@@ -103,7 +110,10 @@ fun QuickEditNavigation() {
popEnterTransition = { popEnterTransition() },
popExitTransition = { popExitTransition() }
) {
- MainScreen(onImageSelected = onImageSelected)
+ MainScreen(
+ initialImageUri = initialImageUri,
+ onImageSelected = onImageSelected
+ )
}
composable(
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/AcvToneCurveParser.kt b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/AcvToneCurveParser.kt
new file mode 100644
index 0000000..a72d305
--- /dev/null
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/AcvToneCurveParser.kt
@@ -0,0 +1,58 @@
+package com.abizer_r.quickedit.utils.effectsMode
+
+import java.io.InputStream
+import kotlin.math.roundToInt
+
+object AcvToneCurveParser {
+ data class Curve(val r: List>, val g: List>, val b: List>)
+
+ fun parse(input: InputStream): Curve {
+ val data = input.readBytes()
+ var offset = 0
+
+ fun readShort(): Int {
+ val result = ((data[offset].toInt() and 0xFF) shl 8) or (data[offset + 1].toInt() and 0xFF)
+ offset += 2
+ return result
+ }
+
+ readShort() // version
+ val totalCurves = readShort()
+
+ val curves = mutableListOf>>()
+ repeat(totalCurves) {
+ val pointCount = readShort()
+ val points = List(pointCount) {
+ val y = readShort().toFloat()
+ val x = readShort().toFloat()
+ Pair(x / 255f, y / 255f)
+ }.sortedBy { it.first }
+ curves.add(points)
+ }
+
+ return Curve(
+ r = curves.getOrNull(1) ?: curves[0],
+ g = curves.getOrNull(2) ?: curves[0],
+ b = curves.getOrNull(3) ?: curves[0]
+ )
+ }
+
+ fun interpolate(points: List>): IntArray {
+ val lut = IntArray(256)
+ for (i in 0..255) {
+ val x = i / 255f
+ val p = points.zipWithNext().firstOrNull { x >= it.first.first && x <= it.second.first }
+ val value = when {
+ p != null -> {
+ val (x1, y1) = p.first
+ val (x2, y2) = p.second
+ y1 + (x - x1) * (y2 - y1) / (x2 - x1)
+ }
+ x <= points.first().first -> points.first().second
+ else -> points.last().second
+ }
+ lut[i] = (value.coerceIn(0f, 1f) * 255).roundToInt()
+ }
+ return lut
+ }
+}
\ No newline at end of file
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/BitmapGrayscaleFilter.kt b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/BitmapGrayscaleFilter.kt
new file mode 100644
index 0000000..1983da9
--- /dev/null
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/BitmapGrayscaleFilter.kt
@@ -0,0 +1,18 @@
+package com.abizer_r.quickedit.utils.effectsMode
+
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.graphics.ColorMatrix
+import android.graphics.ColorMatrixColorFilter
+import android.graphics.Paint
+
+object BitmapGrayscaleFilter {
+ fun apply(original: Bitmap): Bitmap {
+ val result = Bitmap.createBitmap(original.width, original.height, Bitmap.Config.ARGB_8888)
+ val canvas = Canvas(result)
+ val matrix = ColorMatrix().apply { setSaturation(0f) }
+ val paint = Paint().apply { colorFilter = ColorMatrixColorFilter(matrix) }
+ canvas.drawBitmap(original, 0f, 0f, paint)
+ return result
+ }
+}
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/BitmapToneCurveFilter.kt b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/BitmapToneCurveFilter.kt
new file mode 100644
index 0000000..0adc1a9
--- /dev/null
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/BitmapToneCurveFilter.kt
@@ -0,0 +1,30 @@
+package com.abizer_r.quickedit.utils.effectsMode
+
+import android.graphics.Bitmap
+
+object BitmapToneCurveFilter {
+ fun apply(original: Bitmap, curve: AcvToneCurveParser.Curve): Bitmap {
+ val rLut = AcvToneCurveParser.interpolate(curve.r)
+ val gLut = AcvToneCurveParser.interpolate(curve.g)
+ val bLut = AcvToneCurveParser.interpolate(curve.b)
+
+ val w = original.width
+ val h = original.height
+ val result = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888)
+
+ val pixels = IntArray(w * h)
+ original.getPixels(pixels, 0, w, 0, 0, w, h)
+
+ for (i in pixels.indices) {
+ val c = pixels[i]
+ val a = c ushr 24
+ val r = rLut[(c shr 16) and 0xFF]
+ val g = gLut[(c shr 8) and 0xFF]
+ val b = bLut[c and 0xFF]
+ pixels[i] = (a shl 24) or (r shl 16) or (g shl 8) or b
+ }
+
+ result.setPixels(pixels, 0, w, 0, 0, w, h)
+ return result
+ }
+}
\ No newline at end of file
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/EffectsModeUtils.kt b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/EffectsModeUtils.kt
index 507f2be..70a356f 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/EffectsModeUtils.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/utils/effectsMode/EffectsModeUtils.kt
@@ -1,64 +1,46 @@
-package com.abizer_r.quickedit.utils.editorScreen
+package com.abizer_r.quickedit.utils.effectsMode
import android.content.Context
import android.graphics.Bitmap
import com.abizer_r.quickedit.ui.effectsMode.effectsPreview.EffectItem
import com.abizer_r.quickedit.utils.AppUtils
-import jp.co.cyberagent.android.gpuimage.GPUImage
-import jp.co.cyberagent.android.gpuimage.filter.GPUImageGrayscaleFilter
-import jp.co.cyberagent.android.gpuimage.filter.GPUImageToneCurveFilter
import kotlinx.coroutines.flow.flow
object EffectsModeUtils {
fun getEffectsPreviewList(
- context: Context,
- bitmap: Bitmap,
+ context: Context,
+ bitmap: Bitmap,
) = flow> {
val effectList = arrayListOf()
- val filterFile = arrayListOf()
- filterFile.addAll(
- listOf(
- "acv/Fade.acv",
- "acv/Pistol.acv",
- "acv/Cinnamon_darkness.acv",
- "acv/Blue_Poppies.acv",
- "acv/Brighten.acv",
- "acv/Darken.acv",
- "acv/Contrast.acv",
- "acv/Matte.acv",
- "acv/Softness.acv",
- "acv/Carousel.acv",
- "acv/Electric.acv",
- "acv/Peacock_Feathers.acv",
- "acv/Good_Luck_Charm.acv",
- "acv/Lullabye.acv",
- "acv/Moth_Wings.acv",
- "acv/Old_Postcards_1.acv",
- "acv/Old_Postcards_2.acv",
- "acv/Toes_In_The_Ocean.acv",
-
- // NEW ONES
- "acv/Mark_Galer_Grading.acv",
- "acv/Curve_1.acv",
- "acv/Curve_2.acv",
- "acv/Curve_3.acv",
- "acv/Curve_Le_Fabuleux_Coleur_de_Amelie.acv",
- "acv/Tropical_Beach.acv",
- )
+ val filterFile = listOf(
+ "acv/Fade.acv",
+ "acv/Pistol.acv",
+ "acv/Cinnamon_darkness.acv",
+ "acv/Blue_Poppies.acv",
+ "acv/Brighten.acv",
+ "acv/Darken.acv",
+ "acv/Contrast.acv",
+ "acv/Matte.acv",
+ "acv/Softness.acv",
+ "acv/Carousel.acv",
+ "acv/Electric.acv",
+ "acv/Peacock_Feathers.acv",
+ "acv/Good_Luck_Charm.acv",
+ "acv/Lullabye.acv",
+ "acv/Moth_Wings.acv",
+ "acv/Old_Postcards_1.acv",
+ "acv/Old_Postcards_2.acv",
+ "acv/Toes_In_The_Ocean.acv",
+ "acv/Mark_Galer_Grading.acv",
+ "acv/Curve_1.acv",
+ "acv/Curve_2.acv",
+ "acv/Curve_3.acv",
+ "acv/Curve_Le_Fabuleux_Coleur_de_Amelie.acv",
+ "acv/Tropical_Beach.acv"
)
- val gpuImage = GPUImage(context)
- gpuImage.setImage(bitmap)
-
-// emit(
-// EffectItem(
-// ogBitmap = bitmap,
-// previewBitmap = getScaledPreviewBitmap(context, bitmap),
-// label = "original"
-// )
-// )
effectList.add(
EffectItem(
ogBitmap = bitmap,
@@ -68,19 +50,11 @@ object EffectsModeUtils {
)
try {
- gpuImage.setFilter(GPUImageGrayscaleFilter())
- val grayScaleBitmap = gpuImage.bitmapWithFilterApplied
-// emit(
-// EffectItem(
-// ogBitmap = grayScaleBitmap,
-// previewBitmap = getScaledPreviewBitmap(context, grayScaleBitmap),
-// label = "grayscale"
-// )
-// )
+ val grayBitmap = BitmapGrayscaleFilter.apply(bitmap)
effectList.add(
EffectItem(
- ogBitmap = grayScaleBitmap,
- previewBitmap = getScaledPreviewBitmap(context, grayScaleBitmap),
+ ogBitmap = grayBitmap,
+ previewBitmap = getScaledPreviewBitmap(context, grayBitmap),
label = "grayscale"
)
)
@@ -88,32 +62,22 @@ object EffectsModeUtils {
e.printStackTrace()
}
- filterFile.forEachIndexed { index, fileName ->
+ filterFile.forEach { fileName ->
try {
- val inputFilter = context.assets.open(fileName)
- val gpuFilter = GPUImageToneCurveFilter()
- gpuFilter.setFromCurveFileInputStream(inputFilter)
- inputFilter.close()
- gpuImage.setFilter(gpuFilter)
-
- val filteredBitmap = gpuImage.bitmapWithFilterApplied
-// emit(
-// EffectItem(
-// ogBitmap = filteredBitmap,
-// previewBitmap = getScaledPreviewBitmap(context, filteredBitmap),
-// label = fileName.drop(4).dropLast(4).replace("_", " ")
-// )
-// )
- effectList.add(
- EffectItem(
- ogBitmap = filteredBitmap,
- previewBitmap = getScaledPreviewBitmap(context, filteredBitmap),
- label = fileName.drop(4).dropLast(4).replace("_", " ")
+ context.assets.open(fileName).use { stream ->
+ val curve = AcvToneCurveParser.parse(stream)
+ val filtered = BitmapToneCurveFilter.apply(bitmap, curve)
+ effectList.add(
+ EffectItem(
+ ogBitmap = filtered,
+ previewBitmap = getScaledPreviewBitmap(context, filtered),
+ label = fileName.drop(4).dropLast(4).replace("_", " ")
+ )
)
- )
+ }
if (effectList.size >= 10) {
- emit(effectList)
+ emit(ArrayList(effectList))
effectList.clear()
}
} catch (e: Exception) {
@@ -124,15 +88,13 @@ object EffectsModeUtils {
if (effectList.isNotEmpty()) {
emit(effectList)
}
-// return effectList
}
fun getScaledPreviewBitmap(context: Context, originalBitmap: Bitmap): Bitmap {
-
val screenWidth = AppUtils.getScreenWidth(context)
val aspectRatio = originalBitmap.width.toFloat() / originalBitmap.height.toFloat()
val reqWidth = screenWidth / 3
val reqHeight = (reqWidth / aspectRatio).toInt()
return Bitmap.createScaledBitmap(originalBitmap, reqWidth, reqHeight, false)
}
-}
\ No newline at end of file
+}
diff --git a/quickedit/src/main/java/com/abizer_r/quickedit/utils/textMode/blurBackground/BlurBitmapBackground.kt b/quickedit/src/main/java/com/abizer_r/quickedit/utils/textMode/blurBackground/BlurBitmapBackground.kt
index 3c52d33..f276aeb 100644
--- a/quickedit/src/main/java/com/abizer_r/quickedit/utils/textMode/blurBackground/BlurBitmapBackground.kt
+++ b/quickedit/src/main/java/com/abizer_r/quickedit/utils/textMode/blurBackground/BlurBitmapBackground.kt
@@ -16,7 +16,7 @@ import androidx.compose.ui.res.imageResource
import androidx.compose.ui.tooling.preview.Preview
import com.abizer_r.quickedit.R
import com.abizer_r.quickedit.theme.QuickEditTheme
-import com.skydoves.cloudy.Cloudy
+import com.skydoves.cloudy.cloudy
@OptIn(ExperimentalComposeUiApi::class)
@Composable
@@ -36,19 +36,15 @@ fun BlurBitmapBackground(
*/
if (shouldBlur) {
Log.e("TEST_BLUR", "BlurBitmapBackground: ", )
- Cloudy(
- modifier = modifier,
- radius = blurRadius
- ) {
- Image(
- modifier = Modifier.fillMaxSize(),
- bitmap = imageBitmap,
- contentScale = contentScale,
- contentDescription = null,
- alpha = 0.5f
- )
- }
-
+ Image(
+ modifier = modifier.fillMaxSize().cloudy(
+ radius = blurRadius
+ ),
+ bitmap = imageBitmap,
+ contentScale = contentScale,
+ contentDescription = null,
+ alpha = 0.5f
+ )
} else {
Image(
modifier = Modifier