From 2779904345d41eb906a3abe75b24235c331cb838 Mon Sep 17 00:00:00 2001 From: engdyn Date: Thu, 19 Feb 2026 15:33:47 +0100 Subject: [PATCH 1/2] Migrate to Kotlin DSL --- build.gradle | 21 ----------------- build.gradle.kts | 5 ++++ example/build.gradle | 34 -------------------------- example/build.gradle.kts | 38 ++++++++++++++++++++++++++++++ gradle.properties | 3 ++- gradle/libs.versions.toml | 14 +++++++++++ photofilterssdk/build.gradle | 36 ---------------------------- photofilterssdk/build.gradle.kts | 34 ++++++++++++++++++++++++++ photofilterssdk/proguard-rules.pro | 16 ++++++++----- settings.gradle | 1 - settings.gradle.kts | 20 ++++++++++++++++ 11 files changed, 123 insertions(+), 99 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 example/build.gradle create mode 100644 example/build.gradle.kts create mode 100644 gradle/libs.versions.toml delete mode 100644 photofilterssdk/build.gradle create mode 100644 photofilterssdk/build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 1f7482a..0000000 --- a/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - ext { - kotlin_version = '1.9.25' - } - repositories { - gradlePluginPortal() - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.6.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..119965d --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,5 @@ +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false +} diff --git a/example/build.gradle b/example/build.gradle deleted file mode 100644 index cc11126..0000000 --- a/example/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'org.jetbrains.kotlin.android' - -android { - namespace = "com.example.filters" - compileSdk 34 - defaultConfig { - applicationId 'com.example.filters' - minSdk 23 - targetSdk 34 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } -} - -dependencies { - implementation project(':photofilterssdk') - - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'androidx.recyclerview:recyclerview:1.3.2' -} diff --git a/example/build.gradle.kts b/example/build.gradle.kts new file mode 100644 index 0000000..bacb246 --- /dev/null +++ b/example/build.gradle.kts @@ -0,0 +1,38 @@ +plugins { + alias(libs.plugins.kotlin.android) + alias(libs.plugins.android.application) +} + +kotlin { + jvmToolchain(17) +} + +android { + namespace = "com.example.filters" + + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.filters" + minSdk = 23 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + } + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } +} + +dependencies { + implementation(project(":photofilterssdk")) + + implementation(libs.androidx.appcompat) + implementation(libs.androidx.recyclerview) +} diff --git a/gradle.properties b/gradle.properties index deec6c2..792a6af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,4 @@ android.enableJetifier=true android.useAndroidX=true -org.gradle.jvmargs=-Xmx8192m \ No newline at end of file +org.gradle.jvmargs=-Xmx8192m +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..e312ed4 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,14 @@ +[versions] +agp = "8.6.1" +kotlin = "1.9.10" +androidx-appcompat = "1.7.0" +androidx-recyclerview = "1.3.2" + +[libraries] +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } +androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" } + +[plugins] +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" } diff --git a/photofilterssdk/build.gradle b/photofilterssdk/build.gradle deleted file mode 100644 index e8119e6..0000000 --- a/photofilterssdk/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'org.jetbrains.kotlin.android' - -android { - namespace = "com.zomato.photofilters" - - compileSdk 34 - defaultConfig { - minSdk 23 - targetSdk 34 - - ndk { - abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a' - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - externalNativeBuild { - ndkBuild { - path file('src/main/jni/Android.mk') - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } -} diff --git a/photofilterssdk/build.gradle.kts b/photofilterssdk/build.gradle.kts new file mode 100644 index 0000000..2828fae --- /dev/null +++ b/photofilterssdk/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + alias(libs.plugins.kotlin.android) + alias(libs.plugins.android.library) +} + +kotlin { + jvmToolchain(17) +} + +android { + namespace = "com.zomato.photofilters" + compileSdk = 34 + + defaultConfig { + minSdk = 23 + targetSdk = 34 + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + externalNativeBuild { + ndkBuild { + path = file("src/main/jni/Android.mk") + } + } +} diff --git a/photofilterssdk/proguard-rules.pro b/photofilterssdk/proguard-rules.pro index 5407790..481bb43 100644 --- a/photofilterssdk/proguard-rules.pro +++ b/photofilterssdk/proguard-rules.pro @@ -1,17 +1,21 @@ # Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /android-sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html -# Add any project specific keep options here: - # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index f823f71..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':example', ':photofilterssdk' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..b1ce8e5 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,20 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + + repositories { + google() + mavenCentral() + maven("https://jitpack.io") + } +} + +rootProject.name = "AndroidPhotoFilters" +include(":example", ":photofilterssdk") From 13cea32f18473b77ff53aa67ec5255cae3536ef8 Mon Sep 17 00:00:00 2001 From: engdyn Date: Thu, 19 Feb 2026 16:57:28 +0100 Subject: [PATCH 2/2] Bump AGP --- .travis.yml | 48 ----- README.md | 2 +- build.gradle.kts | 1 - example/build.gradle.kts | 11 +- example/lint-baseline.xml | 165 ++++++++++++++++++ example/src/main/res/layout/activity_main.xml | 1 + gradle.properties | 1 - gradle/libs.versions.toml | 8 +- gradle/wrapper/gradle-wrapper.properties | 2 +- photofilterssdk/build.gradle.kts | 13 +- photofilterssdk/lint-baseline.xml | 11 ++ 11 files changed, 197 insertions(+), 66 deletions(-) delete mode 100644 .travis.yml create mode 100644 example/lint-baseline.xml create mode 100644 photofilterssdk/lint-baseline.xml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6ee5f95..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: android -android: - components: - #- platform-tools - - tools - - build-tools-23.0.3 - - android-23 - - extra-android-m2repository - - # Additional components - #- add-on - #- extra - - # Specify at least one system image, - # if you need to run emulator(s) during your tests - #- sys-img-armeabi-v7a-android-21 - - - jdk: - # Check Travis JDKs http://docs.travis-ci.com/user/languages/java/#Testing-Against-Multiple-JDKs - # Test against one or more JDKs: 'jdk' is combined with 'env' to construct a build matrix. - # - openjdk7 - - oraclejdk7 - -sudo: false - -env: - - TERM=dumb - -# Emulator Management: Create, Start and Wait -#before_script: - #- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a - #- emulator -avd test -no-skin -no-audio -no-window & - #- curl http://is.gd/android_wait_for_emulator > android-wait-for-emulator - #- chmod u+x android-wait-for-emulator - #- ./android-wait-for-emulator - #- adb shell input keyevent 82 & - -script: ./gradlew clean test - -after_failure: - # Customize this line, 'app' is the specific app module name of this project. Shows log. - - export MY_MOD="app" - #- export MY_LOG_DIR="$(pwd)/${MY_MOD}/build/outputs/reports/androidTests/connected/" - - export MY_LOG_DIR="$(pwd)/${MY_MOD}/build/reports/tests/debug/' - - pwd && cd "${MY_LOG_DIR:-.}" && pwd && ls -al - - apt-get install -qq lynx && lynx --dump index.html > myIndex.log - - for file in *.html; do echo "$file"; echo "====================="; lynx --dump $file; done || true diff --git a/README.md b/README.md index 89c166c..11938e1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media. -Library supports OS on API 23 and above. +Library supports OS on API 26 and above. ![PhotoFilters gif](art/photofilters.gif) diff --git a/build.gradle.kts b/build.gradle.kts index 119965d..9c5ba57 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.kotlin.android) apply false } diff --git a/example/build.gradle.kts b/example/build.gradle.kts index bacb246..f9b5a5e 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -1,5 +1,4 @@ plugins { - alias(libs.plugins.kotlin.android) alias(libs.plugins.android.application) } @@ -9,13 +8,11 @@ kotlin { android { namespace = "com.example.filters" - - compileSdk = 34 + compileSdk = 36 defaultConfig { applicationId = "com.example.filters" - minSdk = 23 - targetSdk = 34 + minSdk = 26 versionCode = 1 versionName = "1.0" } @@ -28,6 +25,10 @@ android { ) } } + lint { + targetSdk = 36 + baseline = file("lint-baseline.xml") + } } dependencies { diff --git a/example/lint-baseline.xml b/example/lint-baseline.xml new file mode 100644 index 0000000..edaed9c --- /dev/null +++ b/example/lint-baseline.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/src/main/res/layout/activity_main.xml b/example/src/main/res/layout/activity_main.xml index 2b0b4a0..1fafac6 100644 --- a/example/src/main/res/layout/activity_main.xml +++ b/example/src/main/res/layout/activity_main.xml @@ -5,6 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/thumb_background_color" + android:fitsSystemWindows="true" tools:context=".MainActivity"> + + + + + + +