Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/artifacts/lib_desktop.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/artifacts/lib_desktop_1_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.gradle.api.attributes.plugin.GradlePluginApiVersion
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

/*
Expand All @@ -18,13 +19,15 @@ import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}

dependencies {
classpath libs.android.gradlePlugin
classpath libs.kotlin.gradlePlugin
classpath libs.atomicfu.gradlePlugin

classpath libs.gradleMavenPublishPlugin

Expand Down Expand Up @@ -161,7 +164,7 @@ subprojects {
def depVersion = dependency.version
if (depVersion != null && depVersion.endsWith('SNAPSHOT')) {
throw new IllegalArgumentException(
"Using SNAPSHOT dependency with non-SNAPSHOT library version: $dependency"
"Using SNAPSHOT dependency with non-SNAPSHOT library version: $dependency"
)
}
}
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ org.gradle.parallel=true
# Declare we support AndroidX
android.useAndroidX=true

# Enable iOS Compose experimental support
org.jetbrains.compose.experimental.uikit.enabled=true

# Required to publish to Nexus (see https://github.com/gradle/gradle/issues/11308)
systemProp.org.gradle.internal.publish.checksums.insecure=true

Expand Down
11 changes: 7 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[versions]
compose = "1.2.1"
# Last version to support Kotlin 1.6.21
# Last version to support Kotlin 1.7.20
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
composecompiler = "1.2.0-rc02"
composecompiler = "1.3.1"
composesnapshot = "-" # a single character = no snapshot

agp = "7.2.2"
agp = "8.0.0-alpha06"

ktlint = "0.45.2"
kotlin = "1.6.21"
kotlin = "1.7.10"
coroutines = "1.5.2"

androidxtest = "1.4.0"
androidxnavigation = "2.5.1"

[plugins]
metalavaGradle = { id = "me.tylerbwong.gradle.metalava", version = "0.2.3" }
jetbrainsCompose = { id = "org.jetbrains.compose", version = "1.2.0" }

[libraries]
compose-ui-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
Expand All @@ -32,6 +33,8 @@ compose-animation-animation = { module = "androidx.compose.animation:animation",
android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "agp" }
gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"

atomicfu-gradlePlugin = "org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.18.4"

coil = "io.coil-kt:coil-compose:1.4.0"

kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal-testutils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ plugins {

android {
compileSdkVersion 33
namespace "dev.chrisbanes.snapper.internal.test"

defaultConfig {
minSdkVersion 21
Expand Down
3 changes: 1 addition & 2 deletions internal-testutils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.chrisbanes.snapper.internal.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application android:theme="@style/Theme.Test" />

Expand Down
1 change: 1 addition & 0 deletions kmp/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
84 changes: 84 additions & 0 deletions kmp/lib/api/0.1.0.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Signature format: 4.0
package dev.chrisbanes.snapper {

@kotlin.RequiresOptIn(message="Snapper is experimental. The API may be changed in the future.") @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention) public @interface ExperimentalSnapperApi {
}

public final class LazyListKt {
method @androidx.compose.runtime.Composable @dev.chrisbanes.snapper.ExperimentalSnapperApi public static dev.chrisbanes.snapper.LazyListSnapperLayoutInfo rememberLazyListSnapperLayoutInfo(androidx.compose.foundation.lazy.LazyListState lazyListState, optional kotlin.jvm.functions.Function2<? super dev.chrisbanes.snapper.SnapperLayoutInfo,? super dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> snapOffsetForItem, optional float endContentPadding);
method @androidx.compose.runtime.Composable @dev.chrisbanes.snapper.ExperimentalSnapperApi public static dev.chrisbanes.snapper.SnapperFlingBehavior rememberSnapperFlingBehavior(androidx.compose.foundation.lazy.LazyListState lazyListState, optional kotlin.jvm.functions.Function2<? super dev.chrisbanes.snapper.SnapperLayoutInfo,? super dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> snapOffsetForItem, optional float endContentPadding, optional androidx.compose.animation.core.DecayAnimationSpec<java.lang.Float> decayAnimationSpec, optional androidx.compose.animation.core.AnimationSpec<java.lang.Float> springAnimationSpec, optional kotlin.jvm.functions.Function1<? super dev.chrisbanes.snapper.SnapperLayoutInfo,java.lang.Float> maximumFlingDistance);
}

@dev.chrisbanes.snapper.ExperimentalSnapperApi public final class LazyListSnapperLayoutInfo extends dev.chrisbanes.snapper.SnapperLayoutInfo {
ctor public LazyListSnapperLayoutInfo(androidx.compose.foundation.lazy.LazyListState lazyListState, kotlin.jvm.functions.Function2<? super dev.chrisbanes.snapper.SnapperLayoutInfo,? super dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> snapOffsetForItem, optional int endContentPadding);
method public boolean canScrollTowardsEnd();
method public boolean canScrollTowardsStart();
method public int determineTargetIndex(float velocity, androidx.compose.animation.core.DecayAnimationSpec<java.lang.Float> decayAnimationSpec, float maximumFlingDistance);
method public int distanceToIndexSnap(int index);
method public dev.chrisbanes.snapper.SnapperLayoutItemInfo? getCurrentItem();
method public int getEndScrollOffset();
method public int getStartScrollOffset();
method public kotlin.sequences.Sequence<dev.chrisbanes.snapper.SnapperLayoutItemInfo> getVisibleItems();
property public dev.chrisbanes.snapper.SnapperLayoutItemInfo? currentItem;
property public int endScrollOffset;
property public int startScrollOffset;
property public kotlin.sequences.Sequence<dev.chrisbanes.snapper.SnapperLayoutItemInfo> visibleItems;
}

@dev.chrisbanes.snapper.ExperimentalSnapperApi public final class SnapOffsets {
method public kotlin.jvm.functions.Function2<dev.chrisbanes.snapper.SnapperLayoutInfo,dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> getCenter();
method public kotlin.jvm.functions.Function2<dev.chrisbanes.snapper.SnapperLayoutInfo,dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> getEnd();
method public kotlin.jvm.functions.Function2<dev.chrisbanes.snapper.SnapperLayoutInfo,dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> getStart();
property public final kotlin.jvm.functions.Function2<dev.chrisbanes.snapper.SnapperLayoutInfo,dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> Center;
property public final kotlin.jvm.functions.Function2<dev.chrisbanes.snapper.SnapperLayoutInfo,dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> End;
property public final kotlin.jvm.functions.Function2<dev.chrisbanes.snapper.SnapperLayoutInfo,dev.chrisbanes.snapper.SnapperLayoutItemInfo,java.lang.Integer> Start;
field public static final dev.chrisbanes.snapper.SnapOffsets INSTANCE;
}

@dev.chrisbanes.snapper.ExperimentalSnapperApi public final class SnapperFlingBehavior implements androidx.compose.foundation.gestures.FlingBehavior {
ctor public SnapperFlingBehavior(dev.chrisbanes.snapper.SnapperLayoutInfo layoutInfo, optional kotlin.jvm.functions.Function1<? super dev.chrisbanes.snapper.SnapperLayoutInfo,java.lang.Float> maximumFlingDistance, androidx.compose.animation.core.DecayAnimationSpec<java.lang.Float> decayAnimationSpec, optional androidx.compose.animation.core.AnimationSpec<java.lang.Float> springAnimationSpec);
method public Integer? getAnimationTarget();
method public suspend Object? performFling(androidx.compose.foundation.gestures.ScrollScope, float initialVelocity, kotlin.coroutines.Continuation<? super java.lang.Float> p);
property public final Integer? animationTarget;
}

@dev.chrisbanes.snapper.ExperimentalSnapperApi public final class SnapperFlingBehaviorDefaults {
method public kotlin.jvm.functions.Function1<dev.chrisbanes.snapper.SnapperLayoutInfo,java.lang.Float> getMaximumFlingDistance();
method public androidx.compose.animation.core.AnimationSpec<java.lang.Float> getSpringAnimationSpec();
property public final kotlin.jvm.functions.Function1<dev.chrisbanes.snapper.SnapperLayoutInfo,java.lang.Float> MaximumFlingDistance;
property public final androidx.compose.animation.core.AnimationSpec<java.lang.Float> SpringAnimationSpec;
field public static final dev.chrisbanes.snapper.SnapperFlingBehaviorDefaults INSTANCE;
}

public final class SnapperFlingBehaviorKt {
method @androidx.compose.runtime.Composable @dev.chrisbanes.snapper.ExperimentalSnapperApi public static dev.chrisbanes.snapper.SnapperFlingBehavior rememberSnapperFlingBehavior(dev.chrisbanes.snapper.SnapperLayoutInfo layoutInfo, optional androidx.compose.animation.core.DecayAnimationSpec<java.lang.Float> decayAnimationSpec, optional androidx.compose.animation.core.AnimationSpec<java.lang.Float> springAnimationSpec, optional kotlin.jvm.functions.Function1<? super dev.chrisbanes.snapper.SnapperLayoutInfo,java.lang.Float> maximumFlingDistance);
}

@dev.chrisbanes.snapper.ExperimentalSnapperApi public abstract class SnapperLayoutInfo {
ctor public SnapperLayoutInfo();
method public abstract boolean canScrollTowardsEnd();
method public abstract boolean canScrollTowardsStart();
method public abstract int determineTargetIndex(float velocity, androidx.compose.animation.core.DecayAnimationSpec<java.lang.Float> decayAnimationSpec, float maximumFlingDistance);
method public abstract int distanceToIndexSnap(int index);
method public abstract dev.chrisbanes.snapper.SnapperLayoutItemInfo? getCurrentItem();
method public abstract int getEndScrollOffset();
method public abstract int getStartScrollOffset();
method public abstract kotlin.sequences.Sequence<dev.chrisbanes.snapper.SnapperLayoutItemInfo> getVisibleItems();
property public abstract dev.chrisbanes.snapper.SnapperLayoutItemInfo? currentItem;
property public abstract int endScrollOffset;
property public abstract int startScrollOffset;
property public abstract kotlin.sequences.Sequence<dev.chrisbanes.snapper.SnapperLayoutItemInfo> visibleItems;
}

public abstract class SnapperLayoutItemInfo {
ctor public SnapperLayoutItemInfo();
method public abstract int getIndex();
method public abstract int getOffset();
method public abstract int getSize();
property public abstract int index;
property public abstract int offset;
property public abstract int size;
}

}

Loading