Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
TepesLucian committed May 10, 2023
2 parents 7703093 + 773e10b commit d93ae1c
Show file tree
Hide file tree
Showing 66 changed files with 1,255 additions and 359 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# Skip if head commit contains 'skip ci'
if: "!contains(github.event.head_commit.message, 'skip ci')"

runs-on: ubuntu-latest
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
Expand All @@ -31,7 +31,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
Expand Down
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17.0
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
![Build & test](https://github.com/mxalbert1996/Zoomable/actions/workflows/build.yml/badge.svg)
[![Maven Central](https://img.shields.io/maven-central/v/com.mxalbert.zoomable/zoomable)](https://search.maven.org/artifact/com.mxalbert.zoomable/zoomable)

Content zooming with dragging, double tap and dismiss gesture support for Compose.
Supports Jetpack Compose and Compose for Desktop.
Content zooming with dragging, double tap and dismiss gesture support for Compose Multiplatform.
Supports Android, iOS and desktop.

The demo can also be installed from [Google Play](https://play.google.com/store/apps/details?id=com.mxalbert.zoomable.sample).
The demo for Android can also be installed from [Google Play](https://play.google.com/store/apps/details?id=com.mxalbert.zoomable.sample).

## Features

Expand Down Expand Up @@ -61,7 +61,7 @@ Note that `Modifier.aspectRatio()` is needed in order to remove the extra space
when the image is zoomed.

For how to use `Zoomable` with [Coil](https://github.com/coil-kt/coil), see
[the sample](sample/src/main/java/com/mxalbert/zoomable/sample/MainActivity.kt).
[the sample](sample/shared/src/androidMain/kotlin/com/mxalbert/zoomable/sample/ZoomableApp.android.kt#L26-L41).

## Notes

Expand Down
25 changes: 0 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.android.build.api.dsl.CommonExtension as AndroidCommonExtension

buildscript {
repositories {
google()
Expand All @@ -12,28 +9,6 @@ buildscript {
}
}

subprojects {
afterEvaluate {
extensions.findByType(AndroidCommonExtension::class)?.apply {
buildFeatures {
buildConfig = false
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
}
}
}
}

task<Delete>("clean") {
delete(rootProject.buildDir)
}
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ android.enableJetifier=false
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

android.disableAutomaticComponentCreation=true
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.cacheKind=none
kotlin.native.ignoreIncorrectDependencies=true
org.jetbrains.compose.experimental.uikit.enabled=true

GROUP=com.mxalbert.zoomable
POM_ARTIFACT_ID=zoomable
VERSION_NAME=1.6.0-SNAPSHOT
VERSION_NAME=1.7.0-SNAPSHOT

POM_NAME=Zoomable
POM_DESCRIPTION=Content zooming with dragging, double tap and dismiss gesture support for Jetpack Compose.
Expand Down
42 changes: 21 additions & 21 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
[versions]
agp = "7.2.1"
agp = "8.0.0"
sdk-min = "21"
sdk-target = "32"
sdk-compile = "32"
buildTools = "32.0.0"
binaryCompatibilityValidator = "0.11.0"
maven-publish = "0.21.0"
kotlin = "1.6.10"
coroutines = "1.6.1"
compose-jetbrains = "1.1.1"
compose-jetpack = "1.1.1"
androidx-activity = "1.5.0"
accompanist = "0.23.1"
coil = "2.1.0"
sdk-target = "33"
sdk-compile = "33"
buildTools = "33.0.2"
binaryCompatibilityValidator = "0.13.0"
maven-publish = "0.25.2"
kotlin = "1.8.20"
dokka = "1.8.10"
coroutines = "1.6.4"
compose-jetbrains = "1.4.0"
compose-jetpack = "1.4.2"
compose-compiler = "1.4.6"
ktor = "2.3.0"
androidx-activity = "1.7.1"
coil = "2.2.2"
jUnit = "4.13.2"
truth = "1.1.3"
testExt = "1.1.3"
testExt = "1.1.5"

[libraries]
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }

coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
compose-compiler-jetpack = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }
compose-runtime-jetbrains = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-jetbrains" }
compose-runtime-jetpack = { module = "androidx.compose.runtime:runtime", version.ref = "compose-jetpack" }
compose-foundation-jetbrains = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose-jetbrains" }
compose-foundation-jetpack = { module = "androidx.compose.foundation:foundation", version.ref = "compose-jetpack" }
compose-ui-util-jetbrains = { module = "org.jetbrains.compose.ui:ui-util", version.ref = "compose-jetbrains" }
compose-ui-util-jetpack = { module = "androidx.compose.ui:ui-util", version.ref = "compose-jetpack" }
compose-material = { module = "androidx.compose.material:material", version.ref = "compose-jetpack" }
compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose-jetpack" }
compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose-jetpack" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
accompanist-insets = { module = "com.google.accompanist:accompanist-insets", version.ref = "accompanist" }
accompanist-pager = { module = "com.google.accompanist:accompanist-pager", version.ref = "accompanist" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
jUnit = { module = "junit:junit", version.ref = "jUnit" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }
testExt = { module = "androidx.test.ext:junit", version.ref = "testExt" }

[bundles]
accompanist = ["accompanist-insets", "accompanist-pager"]

[plugins]
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose-jetbrains" }
kotlin-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidator" }
dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
maven-publish-base = { id = "com.vanniktech.maven.publish.base", version.ref = "maven-publish" }
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Jul 24 12:40:38 JST 2022
#Mon Apr 17 20:11:28 JST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
File renamed without changes.
23 changes: 16 additions & 7 deletions sample/build.gradle.kts → sample/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ android {
compileSdk = libs.versions.sdk.compile.get().toInt()
buildToolsVersion = libs.versions.buildTools.get()

buildFeatures.compose = true
buildFeatures {
buildConfig = false
compose = true
}

defaultConfig {
applicationId = "com.mxalbert.zoomable.sample"
Expand Down Expand Up @@ -40,8 +43,17 @@ android {
.fold(0) { result, number -> (result + number.toInt()) * 100 }
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.jetpack.get()
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}

buildTypes {
Expand All @@ -54,7 +66,7 @@ android {
}
}

packagingOptions {
packaging {
resources.excludes += listOf(
"META-INF/*",
"**/*.kotlin_builtins",
Expand All @@ -64,9 +76,6 @@ android {
}

dependencies {
implementation(project(":zoomable"))
implementation(project(":sample:shared"))
implementation(libs.androidx.activity.compose)
implementation(libs.compose.material)
implementation(libs.bundles.accompanist)
implementation(libs.coil.compose)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mxalbert.zoomable.sample

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.core.view.WindowCompat

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
ZoomableApp()
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions sample/desktopApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions sample/desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
alias(libs.plugins.jetbrains.compose)
}

tasks.withType(KotlinCompile::class).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

compose.desktop {
application {
mainClass = "com.mxalbert.zoomable.sample.MainKt"
}
}

dependencies {
implementation(project(":sample:shared"))
implementation(compose.desktop.currentOs)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mxalbert.zoomable.sample

import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import com.mxalbert.zoomable.sample.ZoomableApp

fun main() = application {
Window(
onCloseRequest = ::exitApplication,
title = "Zoomable"
) {
ZoomableApp()
}
}
5 changes: 5 additions & 0 deletions sample/iosApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Podfile.lock
Pods/*
Zoomable.xcworkspace/*
Zoomable.xcodeproj/*
!Zoomable.xcodeproj/project.pbxproj
5 changes: 5 additions & 0 deletions sample/iosApp/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
target 'Zoomable' do
use_frameworks!
platform :ios, '14.1'
pod 'shared', :path => '../shared'
end
Loading

0 comments on commit d93ae1c

Please sign in to comment.