Skip to content

Commit 58fad02

Browse files
committed
Bump version to 1.2.5
- Update version numbers in gradle.properties, app/build.gradle.kts, and README.md - Add changelog entry for v1.2.5 with page navigation callback fixes - Update VERSION_HISTORY.md with new version information and upgrade guide - Prepare for release with comprehensive documentation updates
1 parent 001c37b commit 58fad02

File tree

5 files changed

+116
-13
lines changed

5 files changed

+116
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To install AndroidPDFPreview, add the following dependency to your project's Gra
3939

4040
```
4141
dependencies {
42-
implementation 'io.github.rhariskumar3:pdfpreview:1.2.4'
42+
implementation 'io.github.rhariskumar3:pdfpreview:1.2.5'
4343
}
4444
```
4545

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ android {
2323
minSdk = (property("minSdk") as String).toInt()
2424
targetSdk = (property("compileSdk") as String).toInt()
2525
versionCode = 1
26-
versionName = "1.2.4"
26+
versionName = "1.2.5"
2727

2828
ndk {
2929
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")

docs/CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,88 @@ All notable changes to AndroidPDFPreview will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.5] - 2025-10-29 - Critical Bug Fix: Page Navigation Callbacks & Page Snap
9+
10+
### Fixed
11+
12+
- **🐛 Page Navigation Callback Issues**
13+
- Fixed `onPageChanged()` callback not firing after scroll/animation completion
14+
- Added `loadPageByOffset()` calls in animation completion handlers (`handleAnimationEnd()` and `performFling()`)
15+
- Ensures page change detection occurs after all navigation operations (scroll, fling, jumpTo, page snap)
16+
- `onPageChanged()` now fires reliably for all navigation scenarios
17+
18+
- **📊 Page Snap Animation Callbacks**
19+
- Fixed `onPageScrolled()` reporting intermediate page numbers during page snap animations
20+
- Added check in `updateScrollUIElements()` to skip callbacks during active page snap animations
21+
- Prevents confusing page number jumping during snap animations when `pageSnap=true`
22+
- Page callbacks now only report final settled page positions
23+
24+
- **🎯 Initial Load Page Snapping**
25+
- Fixed pages not centering with page snap enabled during first load with default page
26+
- Added `performPageSnap()` calls to `jumpTo()` for non-animated jumps when page snap is enabled
27+
- Pages now properly center on initial load when `pageSnap=true` configuration is used
28+
- Improved `loadComplete()` with enhanced logging for debugging initial load issues
29+
30+
- **⚡ Animation State Detection**
31+
- Fixed compilation error with incorrect `pdfAnimator.isRunning` property reference
32+
- Replaced with correct `pdfAnimator.isFlinging` property that checks for active animations
33+
- Proper detection of page snap animations and flings for callback suppression
34+
35+
### Technical Details
36+
37+
- **Animation Completion Handling**:
38+
- `PdfAnimator.handleAnimationEnd()` now calls `pdfView.loadPageByOffset()` to detect page changes
39+
- `PdfAnimator.performFling()` now calls `pdfView.loadPageByOffset()` when fling completes
40+
- Ensures `onPageChanged()` fires after both programmatic animations and user scroll flings
41+
42+
- **Page Snap Callback Prevention**:
43+
- `PDFView.updateScrollUIElements()` skips intermediate callbacks when `isPageSnap && pdfAnimator.isFlinging`
44+
- Prevents page number jumping during snap animations while maintaining final position callbacks
45+
- Uses consistent page calculation logic across all callback scenarios
46+
47+
- **Initial Load Improvements**:
48+
- `PDFView.jumpTo()` now performs page snapping for non-animated jumps when page snap is enabled
49+
- Enhanced `loadComplete()` with better logging for initial page jump operations
50+
- Proper initialization sequence ensures page centering on document load
51+
52+
### Migration Guide
53+
54+
No code changes required. This is an internal bug fix that improves callback reliability and page snap behavior.
55+
56+
**What's Fixed:**
57+
58+
```kotlin
59+
// Page change callbacks now work correctly in all scenarios
60+
pdfView.configureView {
61+
pageSnap(true)
62+
pageNavigationEventListener(object : PageNavigationEventListener {
63+
override fun onPageChanged(page: Int, pageCount: Int) {
64+
// ✅ NOW FIRES: After scroll completion
65+
// ✅ NOW FIRES: After animation completion
66+
// ✅ NOW FIRES: After page snap settles
67+
}
68+
69+
override fun onPageScrolled(page: Int, positionOffset: Float) {
70+
// ✅ NO MORE JUMPING: Stable page numbers during snap animations
71+
// ✅ ACCURATE: Reports correct page during scroll
72+
}
73+
})
74+
}
75+
```
76+
77+
**Root Cause:**
78+
79+
- Animation completion didn't trigger page change detection
80+
- Page snap animations caused intermediate callback reports
81+
- Initial load timing issues prevented proper page positioning
82+
- Missing `loadPageByOffset()` calls in animation end handlers
83+
84+
```gradle
85+
dependencies {
86+
implementation 'io.github.rhariskumar3:pdfpreview:1.2.5'
87+
}
88+
```
89+
890
## [1.2.4] - 2025-10-28 - Critical Bug Fix: Page Calculation Accuracy with Page Snap
991

1092
### Fixed

docs/VERSION_HISTORY.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ This document provides a quick overview of all AndroidPDFPreview releases.
44

55
## 📋 Current Version
66

7-
**[1.2.4](./CHANGELOG.md#124---2025-10-28---critical-bug-fix-page-calculation-accuracy-with-page-snap)** - Latest Release (October 28, 2025)
7+
**[1.2.5](./CHANGELOG.md#125---2025-10-29---critical-bug-fix-page-navigation-callbacks--page-snap)** - Latest Release (October 29, 2025)
88

9-
- Fixed `onPageScrolled()` reporting incorrect page numbers during page snap animations
10-
- Accurate page position tracking with `pageSnap=true` configuration
11-
- Consistent page detection across scroll gestures and callbacks
12-
- Improved callback reliability during scroll deceleration
9+
- Fixed `onPageChanged()` callback not firing after scroll/animation completion
10+
- Fixed `onPageScrolled()` reporting intermediate pages during page snap animations
11+
- Fixed pages not centering with page snap enabled during first load
12+
- Improved page navigation callback reliability across all scenarios
1313

1414
## 📚 Version History
1515

1616
| Version | Release Date | Type | Key Features |
1717
|-----------|--------------|-------|------------------------------------------------------------------------------------|
18+
| **1.2.5** | 2025-10-29 | Patch | Critical bug fix: page navigation callbacks & page snap behavior |
1819
| **1.2.4** | 2025-10-28 | Patch | Critical bug fix: page calculation accuracy with page snap enabled |
1920
| **1.2.3** | 2025-10-28 | Patch | Critical bug fix: page navigation callbacks now fire correctly after manual scroll |
2021
| **1.2.2** | 2025-10-24 | Minor | Performance optimization: smart tile loading, scroll pre-rendering, zoom listener |
@@ -29,7 +30,8 @@ This document provides a quick overview of all AndroidPDFPreview releases.
2930

3031
## 🔄 Version Status
3132

32-
-**1.2.4** - Current (Recommended)
33+
-**1.2.5** - Current (Recommended)
34+
-**1.2.4** - Previous (Still supported)
3335
-**1.2.3** - Previous (Still supported)
3436
-**1.2.2** - Previous (Still supported)
3537
-**1.2.1** - Previous (Still supported)
@@ -44,15 +46,15 @@ This document provides a quick overview of all AndroidPDFPreview releases.
4446

4547
```gradle
4648
dependencies {
47-
implementation 'io.github.rhariskumar3:pdfpreview:1.2.4'
49+
implementation 'io.github.rhariskumar3:pdfpreview:1.2.5'
4850
}
4951
```
5052

5153
### Previous Version
5254

5355
```gradle
5456
dependencies {
55-
implementation 'io.github.rhariskumar3:pdfpreview:1.2.3'
57+
implementation 'io.github.rhariskumar3:pdfpreview:1.2.4'
5658
}
5759
```
5860

@@ -64,6 +66,25 @@ dependencies {
6466

6567
## 🚀 Upgrade Guide
6668

69+
### From 1.2.4 to 1.2.5
70+
71+
- **Compatibility**: ✅ Fully backward compatible
72+
- **Breaking Changes**: None
73+
- **Action Required**: None - just update the version number
74+
- **Benefits**:
75+
- `onPageChanged()` callback now fires after scroll/animation completion
76+
- `onPageScrolled()` no longer reports intermediate pages during page snap animations
77+
- Pages properly center with page snap enabled during first load
78+
- Improved page navigation callback reliability across all scenarios
79+
80+
```gradle
81+
// Old
82+
implementation 'io.github.rhariskumar3:pdfpreview:1.2.4'
83+
84+
// New
85+
implementation 'io.github.rhariskumar3:pdfpreview:1.2.5'
86+
```
87+
6788
### From 1.2.3 to 1.2.4
6889

6990
- **Compatibility**: ✅ Fully backward compatible
@@ -237,8 +258,8 @@ implementation 'io.github.rhariskumar3:pdfpreview:1.0.8'
237258

238259
## 📊 Release Statistics
239260

240-
- **Total Releases**: 9 versions
241-
- **Latest Release**: October 28, 2025
261+
- **Total Releases**: 10 versions
262+
- **Latest Release**: October 29, 2025
242263
- **Release Frequency**: Regular updates with improvements
243264
- **Stability**: Stable and production-ready
244265

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SONATYPE_HOST=S01
2424
RELEASE_SIGNING_ENABLED=true
2525
POM_GROUP_ID=io.github.rhariskumar3
2626
POM_ARTIFACT_ID=pdfpreview
27-
POM_VERSION=1.2.4
27+
POM_VERSION=1.2.5
2828
POM_PACKAGING=aar
2929
POM_NAME=pdfpreview
3030
POM_DESCRIPTION=AndroidPDFPreview is a lightweight and easy-to-use SDK that enables you to display and interact with PDF documents in your Android apps

0 commit comments

Comments
 (0)