Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Jul 3, 2024
1 parent 246a562 commit a184707
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ java_pid*.hprof
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
.android/
.kotlin/
*.moved-aside
*.pbxuser
!default.pbxuser
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.1

Released 2024-07-03


## 0.4.0

Released 2024-05-25
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ let package = Package(
defaultLocalization: "en",
platforms: [.iOS(.v17), .macOS(.v13), .tvOS(.v17), .watchOS(.v10), .macCatalyst(.v17)],
products: [
.library(name: "SkipWeb", targets: ["SkipWeb"]),
.library(name: "SkipWeb", type: .dynamic, targets: ["SkipWeb"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "0.8.45"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "0.9.3")
.package(url: "https://source.skip.tools/skip.git", from: "0.9.2"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "0.10.0")
],
targets: [
.target(name: "SkipWeb", dependencies: [.product(name: "SkipUI", package: "skip-ui")], resources: [.process("Resources")], plugins: [.plugin(name: "skipstone", package: "skip")]),
Expand Down
13 changes: 2 additions & 11 deletions Sources/SkipWeb/Skip/skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
# the blocks to add to the build.gradle.kts
build:
contents:
- block: 'android'
contents:
- block: 'buildFeatures'
contents:
- 'compose = true'
- block: 'composeOptions'
contents:
- 'kotlinCompilerExtensionVersion = libs.versions.kotlin.compose.compiler.extension.get()'

- block: 'dependencies'
export: false
contents:
- 'implementation("androidx.webkit:webkit:1.11.0")'
- 'androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")'
- 'androidTestImplementation("androidx.test.espresso:espresso-web:3.5.1")'
- 'androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")'
- 'androidTestImplementation("androidx.test.espresso:espresso-web:3.6.1")'

- 'testImplementation(libs.androidx.compose.ui.test)'
- 'androidTestImplementation(libs.androidx.compose.ui.test)'
Expand Down
10 changes: 7 additions & 3 deletions Sources/SkipWeb/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public struct WebView : View {
public internal(set) var backList: [BackForwardListItem] = []
public internal(set) var forwardList: [BackForwardListItem] = []
public internal(set) var scrollingDown: Bool = false
public internal(set) var scrollingOffset: Double = 0.0

public init() {
}
Expand Down Expand Up @@ -795,14 +794,19 @@ extension WebViewCoordinator: WebNavigationDelegate {
@available(macOS 14.0, iOS 17.0, *)
extension WebViewCoordinator: UIScrollViewDelegate {
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
//logger.log("scrollView: isDecelerating=\(scrollView.isDecelerating) isDragging=\(scrollView.isDragging) isTracking=\(scrollView.isTracking) isZoomBouncing=\(scrollView.isZoomBouncing) contentOffset=\(scrollView.contentOffset.debugDescription)")
// ignore scrolling while the page is loading
if self.state.isLoading { return }
// only change the state if we are actively dragging, not if intertial scrolling is in effect
if !scrollView.isTracking { return }

defer { self.lastScrollOffset = scrollView.contentOffset }
let offsetY = scrollView.contentOffset.y
let isScrollingDown = ((offsetY + scrollView.visibleSize.height) >= scrollView.contentSize.height) || (offsetY > 0 && offsetY > self.lastScrollOffset.y)
self.state.scrollingDown = isScrollingDown
self.state.scrollingOffset = offsetY

if self.state.scrollingDown != isScrollingDown {
self.state.scrollingDown = isScrollingDown
}
}

public func scrollViewDidZoom(_ scrollView: UIScrollView) {
Expand Down

0 comments on commit a184707

Please sign in to comment.