Skip to content
Open
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: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ jobs:
cache: gradle

- name: Build with Gradle
run: ./gradlew build --no-daemon
run: ./gradlew build --parallel --build-cache --no-daemon

- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: app/build/outputs/apk/debug/app-debug.apk
322 changes: 233 additions & 89 deletions app/src/main/java/app/grapheneos/pdfviewer/PdfViewer.java

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_search_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M784,840L532,588Q502,612 463,626Q424,640 380,640Q271,640 195.5,564.5Q120,489 120,380Q120,271 195.5,195.5Q271,120 380,120Q489,120 564.5,195.5Q640,271 640,380Q640,424 626,463Q612,502 588,532L840,784L784,840ZM380,560Q455,560 507.5,507.5Q560,455 560,380Q560,305 507.5,252.5Q455,200 380,200Q305,200 252.5,252.5Q200,305 200,380Q200,455 252.5,507.5Q305,560 380,560Z"/>
</vector>
14 changes: 14 additions & 0 deletions app/src/main/res/layout/pdfviewer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,18 @@

</ScrollView>

<TextView
android:id="@+id/page_number_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:visibility="gone"
android:elevation="10dp"
android:textSize="14sp"
android:padding="8dp"
android:background="@android:drawable/toast_frame"
android:textColor="@android:color/white"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/menu/pdf_viewer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
<!--android:showAsAction="never"-->
<!--android:title="@string/action_settings"/>-->

<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_24dp"
android:title="@string/action_search"
app:actionViewClass="androidx.appcompat.widget.SearchView"
app:showAsAction="always" />

<item
android:id="@+id/action_previous"
android:icon="@drawable/ic_navigate_before_24dp"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<string name="action_outline">Outline</string>
<string name="action_view_document_properties">Properties</string>
<string name="action_close">Close</string>
<string name="action_search">Search</string>
<string name="search_hint">Find in document...</string>
<string name="no_matches">No matches found</string>
<string name="match_status">%1$d / %2$d</string>

<string name="outline_child_button_description">View nested outline entries</string>
<string name="outline_not_available">No outline available</string>
Expand Down
16 changes: 7 additions & 9 deletions viewer/css/text_layer.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
text-size-adjust: none;
forced-color-adjust: none;
caret-color: CanvasText;
z-index: 0;
}

.textLayer.highlighting {
touch-action: none;
}

.textLayer :is(span,br) {
.textLayer :is(span, br) {
color: var(--text-layer-foreground);
position: absolute;
white-space: pre;
cursor: text;
transform-origin: 0% 0%;
}

.textLayer > :not(.markedContent),.textLayer .markedContent span:not(.markedContent) {
.textLayer> :not(.markedContent),
.textLayer .markedContent span:not(.markedContent) {
z-index: 1;
}

Expand All @@ -52,14 +52,12 @@
--highlight-bg-color: transparent;
--highlight-selected-bg-color: transparent;
--highlight-backdrop-filter: var(--hcm-highlight-filter);
--highlight-selected-backdrop-filter: var(
--hcm-highlight-selected-filter
);
--highlight-selected-backdrop-filter: var(--hcm-highlight-selected-filter);
}
}

.textLayer .highlight {
margin:-1px;
margin: -1px;
padding: 1px;
background-color: var(--highlight-bg-color);
backdrop-filter: var(--highlight-backdrop-filter);
Expand Down Expand Up @@ -109,6 +107,6 @@
top: 0;
}

.textLayer.selecting ~ .annotationLayer section {
.textLayer.selecting~.annotationLayer section {
pointer-events: none;
}
}
Loading