forked from Baseflow/PhotoView
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from GetStream/feature/photoview-dialog
Implement photoview dialog module
- Loading branch information
Showing
37 changed files
with
2,413 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") | ||
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.baseline.profile) apply false | ||
alias(libs.plugins.nexus.plugin) | ||
alias(libs.plugins.spotless) | ||
alias(libs.plugins.dokka) | ||
alias(libs.plugins.kotlin.binary.compatibility) | ||
alias(libs.plugins.android.application) apply false | ||
alias(libs.plugins.android.library) apply false | ||
alias(libs.plugins.kotlin.android) apply false | ||
alias(libs.plugins.baseline.profile) apply false | ||
alias(libs.plugins.nexus.plugin) | ||
alias(libs.plugins.spotless) | ||
alias(libs.plugins.dokka) | ||
alias(libs.plugins.kotlin.binary.compatibility) | ||
} | ||
|
||
subprojects { | ||
apply(plugin = rootProject.libs.plugins.spotless.get().pluginId) | ||
apply(plugin = rootProject.libs.plugins.spotless.get().pluginId) | ||
|
||
if (!this.name.contains("dialog")) { | ||
configure<com.diffplug.gradle.spotless.SpotlessExtension> { | ||
kotlin { | ||
target("**/*.kt") | ||
targetExclude("$buildDir/**/*.kt") | ||
ktlint().editorConfigOverride( | ||
mapOf( | ||
"indent_size" to "2", | ||
"continuation_indent_size" to "2" | ||
) | ||
) | ||
licenseHeaderFile(rootProject.file("spotless/copyright.kt")) | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
} | ||
format("xml") { | ||
target("**/*.xml") | ||
targetExclude("**/build/**/*.xml") | ||
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml) | ||
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])") | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
} | ||
kotlin { | ||
target("**/*.kt") | ||
targetExclude("$buildDir/**/*.kt") | ||
ktlint().editorConfigOverride( | ||
mapOf( | ||
"indent_size" to "2", | ||
"continuation_indent_size" to "2" | ||
) | ||
) | ||
licenseHeaderFile(rootProject.file("spotless/copyright.kt")) | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
} | ||
format("xml") { | ||
target("**/*.xml") | ||
targetExclude("**/build/**/*.xml") | ||
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml) | ||
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])") | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
public final class io/getstream/photoview/dialog/PhotoViewDialog { | ||
public fun <init> (Landroid/content/Context;Lio/getstream/photoview/dialog/viewer/builder/BuilderData;)V | ||
public final fun close ()V | ||
public final fun currentPosition ()I | ||
public final fun dismiss ()V | ||
public final fun setCurrentPosition (I)I | ||
public final fun show ()V | ||
public final fun show (Z)V | ||
public static synthetic fun show$default (Lio/getstream/photoview/dialog/PhotoViewDialog;ZILjava/lang/Object;)V | ||
public final fun updateImages (Ljava/util/List;)V | ||
public final fun updateImages ([Ljava/lang/Object;)V | ||
public final fun updateTransitionImage (Landroid/widget/ImageView;)V | ||
} | ||
|
||
public final class io/getstream/photoview/dialog/PhotoViewDialog$Builder { | ||
public fun <init> (Landroid/content/Context;Ljava/util/List;Lio/getstream/photoview/dialog/loader/ImageLoader;)V | ||
public fun <init> (Landroid/content/Context;[Ljava/lang/Object;Lio/getstream/photoview/dialog/loader/ImageLoader;)V | ||
public final fun allowSwipeToDismiss (Z)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun allowZooming (Z)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun build ()Lio/getstream/photoview/dialog/PhotoViewDialog; | ||
public final fun show ()Lio/getstream/photoview/dialog/PhotoViewDialog; | ||
public final fun show (Z)Lio/getstream/photoview/dialog/PhotoViewDialog; | ||
public static synthetic fun show$default (Lio/getstream/photoview/dialog/PhotoViewDialog$Builder;ZILjava/lang/Object;)Lio/getstream/photoview/dialog/PhotoViewDialog; | ||
public final fun withBackgroundColor (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withBackgroundColorResource (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withContainerPadding (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withContainerPadding (IIII)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withContainerPaddingPixels (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withContainerPaddingPixels (IIII)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withDismissListener (Lio/getstream/photoview/dialog/listeners/OnDismissListener;)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withHiddenStatusBar (Z)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withImageChangeListener (Lio/getstream/photoview/dialog/listeners/OnImageChangeListener;)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withImageMarginPixels (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withImagesMargin (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withOverlayView (Landroid/view/View;)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withStartPosition (I)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
public final fun withTransitionFrom (Landroid/widget/ImageView;)Lio/getstream/photoview/dialog/PhotoViewDialog$Builder; | ||
} | ||
|
||
public abstract interface class io/getstream/photoview/dialog/listeners/OnDismissListener { | ||
public abstract fun onDismiss ()V | ||
} | ||
|
||
public abstract interface class io/getstream/photoview/dialog/listeners/OnImageChangeListener { | ||
public abstract fun onImageChange (I)V | ||
} | ||
|
||
public abstract interface class io/getstream/photoview/dialog/loader/ImageLoader { | ||
public abstract fun loadImage (Landroid/widget/ImageView;Ljava/lang/Object;)V | ||
} | ||
|
||
public final class io/getstream/photoview/dialog/viewer/builder/BuilderData { | ||
public fun <init> (Ljava/util/List;Lio/getstream/photoview/dialog/loader/ImageLoader;)V | ||
public final fun getBackgroundColor ()I | ||
public final fun getContainerPaddingPixels ()[I | ||
public final fun getImageChangeListener ()Lio/getstream/photoview/dialog/listeners/OnImageChangeListener; | ||
public final fun getImageLoader ()Lio/getstream/photoview/dialog/loader/ImageLoader; | ||
public final fun getImageMarginPixels ()I | ||
public final fun getImages ()Ljava/util/List; | ||
public final fun getOnDismissListener ()Lio/getstream/photoview/dialog/listeners/OnDismissListener; | ||
public final fun getOverlayView ()Landroid/view/View; | ||
public final fun getShouldStatusBarHide ()Z | ||
public final fun getStartPosition ()I | ||
public final fun getTransitionView ()Landroid/widget/ImageView; | ||
public final fun isSwipeToDismissAllowed ()Z | ||
public final fun isZoomingAllowed ()Z | ||
public final fun setBackgroundColor (I)V | ||
public final fun setContainerPaddingPixels ([I)V | ||
public final fun setImageChangeListener (Lio/getstream/photoview/dialog/listeners/OnImageChangeListener;)V | ||
public final fun setImageMarginPixels (I)V | ||
public final fun setOnDismissListener (Lio/getstream/photoview/dialog/listeners/OnDismissListener;)V | ||
public final fun setOverlayView (Landroid/view/View;)V | ||
public final fun setShouldStatusBarHide (Z)V | ||
public final fun setStartPosition (I)V | ||
public final fun setSwipeToDismissAllowed (Z)V | ||
public final fun setTransitionView (Landroid/widget/ImageView;)V | ||
public final fun setZoomingAllowed (Z)V | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import io.getstream.photoview.Configuration | ||
|
||
@Suppress("DSL_SCOPE_VIOLATION") | ||
plugins { | ||
id(libs.plugins.android.library.get().pluginId) | ||
id(libs.plugins.kotlin.android.get().pluginId) | ||
id(libs.plugins.nexus.plugin.get().pluginId) | ||
id(libs.plugins.baseline.profile.get().pluginId) | ||
} | ||
|
||
apply(from = "${rootDir}/scripts/publish-module.gradle.kts") | ||
|
||
mavenPublishing { | ||
val artifactId = "photoview-dialog" | ||
coordinates( | ||
Configuration.artifactGroup, | ||
artifactId, | ||
rootProject.extra.get("libVersion").toString() | ||
) | ||
|
||
pom { | ||
name.set(artifactId) | ||
description.set("PhotoView is an ImageView component for Android that enables zoom functionality through diverse touch gestures.") | ||
} | ||
} | ||
|
||
android { | ||
compileSdk = Configuration.compileSdk | ||
namespace = "io.getstream.photoview.dialog" | ||
|
||
defaultConfig { | ||
minSdk = Configuration.minSdk | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions.freeCompilerArgs += listOf( | ||
"-Xexplicit-api=strict" | ||
) | ||
} | ||
|
||
tasks.withType(JavaCompile::class.java).configureEach { | ||
this.targetCompatibility = JavaVersion.VERSION_17.toString() | ||
this.sourceCompatibility = JavaVersion.VERSION_17.toString() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidx.appcompat) | ||
api(project(":photoview")) | ||
|
||
baselineProfile(project(":benchmark")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2024 Stream.IO, Inc. | ||
Copyright 2011, 2012 Chris Banes. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<manifest /> |
Oops, something went wrong.