Skip to content

Commit f2a8f33

Browse files
authored
Revisit the new fxl navigator and introduce a reflowable one (#680)
1 parent b2b26e1 commit f2a8f33

File tree

330 files changed

+24755
-3108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+24755
-3108
lines changed

.github/workflows/checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ jobs:
7474
runs-on: macos-latest
7575
if: ${{ !github.event.pull_request.draft }}
7676
env:
77-
scripts: ${{ 'readium/navigators/web/scripts' }}
77+
scripts: ${{ 'readium/navigators/web/internals/scripts' }}
7878
steps:
7979
- name: Checkout
8080
uses: actions/checkout@v4
8181
- name: Install pnpm
8282
uses: pnpm/action-setup@v4
8383
with:
84-
package_json_file: readium/navigators/web/scripts/package.json
84+
package_json_file: readium/navigators/web/internals/scripts/package.json
8585
run_install: false
8686
- name: Setup cache
8787
uses: actions/setup-node@v4
8888
with:
8989
node-version: 20
9090
cache: 'pnpm'
91-
cache-dependency-path: readium/navigators/web/scripts/pnpm-lock.yaml
91+
cache-dependency-path: readium/navigators/web/internals/scripts/pnpm-lock.yaml
9292
- name: Install dependencies
9393
run: pnpm --dir "$scripts" install --frozen-lockfile
9494
- name: Lint
@@ -98,4 +98,4 @@ jobs:
9898
- name: Check if bundled scripts are up-to-date
9999
run: |
100100
make scripts-new
101-
git diff --exit-code --name-only readium/navigators/web/src/main/assets/*
101+
git diff --exit-code --name-only readium/navigators/web/internals/src/main/assets/*

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SCRIPTS_PATH := readium/navigator/src/main/assets/_scripts
2-
SCRIPTS_NAVIGATOR_WEB_PATH := readium/navigators/web/scripts
2+
SCRIPTS_NAVIGATOR_WEB_PATH := readium/navigators/web/internals/scripts
33

44
help:
55
@echo "Usage: make <target>\n\n\
@@ -38,7 +38,8 @@ scripts-new:
3838
pnpm run format; \
3939
pnpm run lint; \
4040
pnpm run bundle; \
41-
mv dist/* ../src/main/assets/readium/navigators/web/
41+
rm -r ../src/main/assets/readium/navigator/web/internals/generated/*; \
42+
mv dist/* ../src/main/assets/readium/navigator/web/internals/generated/
4243

4344
.PHONY: scripts
4445
scripts: scripts-legacy scripts-new

readium/navigators/demo/build.gradle.kts renamed to demos/navigator/build.gradle.kts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android {
1010
compileSdk = (property("android.compileSdk") as String).toInt()
1111

1212
defaultConfig {
13-
minSdk = (property("android.minSdk") as String).toInt()
13+
minSdk = 23
1414
targetSdk = (property("android.targetSdk") as String).toInt()
1515

1616
applicationId = "org.readium.navigator.demo"
@@ -56,22 +56,25 @@ android {
5656
assets.srcDirs("src/main/assets")
5757
}
5858
}
59-
namespace = "org.readium.navigator.demo"
59+
namespace = "org.readium.demo.navigator"
6060
}
6161

6262
dependencies {
6363
implementation(project(":readium:readium-shared"))
6464
implementation(project(":readium:readium-streamer"))
6565
implementation(project(":readium:readium-navigator"))
66-
implementation(project(":readium:navigators:readium-navigator-web"))
66+
implementation(project(":readium:navigators:web:readium-navigator-web-reflowable"))
67+
implementation(project(":readium:navigators:web:readium-navigator-web-fixedlayout"))
6768
implementation(project(":readium:adapters:pdfium"))
6869

6970
coreLibraryDesugaring(libs.desugar.jdk.libs)
7071

7172
implementation(libs.timber)
7273
implementation(libs.kotlinx.coroutines.android)
74+
implementation(libs.kotlinx.collections.immutable)
7375
implementation(libs.kotlin.stdlib)
7476
implementation(libs.bundles.compose)
77+
implementation(libs.google.material)
7578
implementation(libs.androidx.core)
7679
implementation(libs.androidx.fragment.ktx)
7780
implementation(libs.androidx.appcompat)

readium/navigators/demo/src/main/AndroidManifest.xml renamed to demos/navigator/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
android:allowBackup="true"
66
android:icon="@mipmap/ic_launcher"
77
android:label="@string/app_name"
8-
android:roundIcon="@mipmap/ic_launcher_round"
98
android:supportsRtl="true"
10-
android:theme="@android:style/Theme.Material.Light.NoActionBar">
9+
android:theme="@style/Theme.AppTheme">
1110
<activity
1211
android:name=".DemoActivity"
1312
android:exported="true">
Lines changed: 1 addition & 0 deletions
Loading
806 KB
Binary file not shown.
845 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* available in the top-level LICENSE file of the project.
55
*/
66

7-
package org.readium.navigator.demo
7+
package org.readium.demo.navigator
88

99
import android.net.Uri
1010
import android.os.Bundle
@@ -17,7 +17,7 @@ import androidx.compose.runtime.mutableStateOf
1717
import androidx.compose.runtime.remember
1818
import androidx.core.view.WindowCompat
1919
import androidx.fragment.app.FragmentActivity
20-
import org.readium.navigator.demo.util.Theme
20+
import org.readium.demo.navigator.theme.Theme
2121
import org.readium.r2.shared.util.toAbsoluteUrl
2222

2323
class DemoActivity : FragmentActivity() {

readium/navigators/demo/src/main/java/org/readium/navigator/demo/DemoUi.kt renamed to demos/navigator/src/main/java/org/readium/demo/navigator/DemoUi.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* available in the top-level LICENSE file of the project.
55
*/
66

7-
package org.readium.navigator.demo
7+
package org.readium.demo.navigator
88

99
import androidx.activity.compose.BackHandler
1010
import androidx.compose.foundation.layout.Box
@@ -21,16 +21,17 @@ import androidx.compose.runtime.State
2121
import androidx.compose.runtime.collectAsState
2222
import androidx.compose.ui.Alignment
2323
import androidx.compose.ui.Modifier
24+
import androidx.compose.ui.platform.LocalTextToolbar
2425
import androidx.core.view.WindowInsetsControllerCompat
25-
import org.readium.navigator.demo.reader.Reader
26-
import org.readium.navigator.demo.util.Fullscreenable
26+
import org.readium.demo.navigator.reader.Rendition
27+
import org.readium.demo.navigator.util.Fullscreenable
2728

2829
@Composable
2930
fun Scaffold(
3031
fullscreenState: State<Boolean>,
3132
insetsController: WindowInsetsControllerCompat,
3233
snackbarHostState: SnackbarHostState,
33-
content: @Composable () -> Unit
34+
content: @Composable () -> Unit,
3435
) {
3536
Fullscreenable(
3637
fullscreenState = fullscreenState,
@@ -41,6 +42,7 @@ fun Scaffold(
4142
) {
4243
content.invoke()
4344

45+
LocalTextToolbar
4446
SnackbarHost(
4547
modifier = Modifier
4648
.align(Alignment.BottomCenter)
@@ -56,7 +58,7 @@ fun MainContent(
5658
viewmodel: DemoViewModel,
5759
launchBookSelection: () -> Unit,
5860
snackbarHostState: SnackbarHostState,
59-
fullscreenState: MutableState<Boolean>
61+
fullscreenState: MutableState<Boolean>,
6062
) {
6163
val viewmodelState = viewmodel.state.collectAsState().value
6264

@@ -98,7 +100,7 @@ fun MainContent(
98100
viewmodel.onBookClosed()
99101
}
100102

101-
Reader(
103+
Rendition(
102104
readerState = viewmodelState.readerState,
103105
fullScreenState = fullscreenState
104106
)

0 commit comments

Comments
 (0)