-
-
Notifications
You must be signed in to change notification settings - Fork 173
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 #51 from Husseinhj/feature/loading-and-spacing
Loading and spacing
- Loading branch information
Showing
11 changed files
with
149 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# CHANGELOG | ||
|
||
# v1.1.0 | ||
- Added `pdfView_page_margin` as an attribute to change spacing (Right, Left, Top, Bottom) from the pages Or use the following attribute to add space for each edges: | ||
```xml | ||
<com.rajat.pdfviewer.PdfRendererView | ||
android:id="@+id/pdfView" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:pdfView_divider="@drawable/divider" | ||
app:pdfView_engine="internal" | ||
app:pdfView_enableLoadingForPages="true" | ||
app:pdfView_page_marginRight="10dp" | ||
app:pdfView_page_marginLeft="10dp" | ||
app:pdfView_page_marginTop="5dp" | ||
app:pdfView_page_marginBottom="5dp" | ||
/> | ||
``` | ||
|
||
- Added loading view for each pages. It's available by using `pdfView_enableLoadingForPages` attribute. | ||
- Optimise rendering PDF process by using `CoroutineScope` instead of `GlobalScope` | ||
|
||
## Breaking Changes | ||
- Added night/light mode background for `PdfViewerActivity`. If you enable spacing it would show background of this activity. | ||
- Remove background from the list of pages (`PinchZoomRecyclerView`) to let developers to add custom background for PDF viewer. It may affect to see the PDF viewer result by showing the parent background. |
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
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
11 changes: 11 additions & 0 deletions
11
pdfViewer/src/main/java/com/rajat/pdfviewer/util/ViewExt.kt
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,11 @@ | ||
package com.rajat.pdfviewer.util | ||
|
||
import android.view.View | ||
|
||
fun View.show() { | ||
this.visibility = View.VISIBLE | ||
} | ||
|
||
fun View.hide() { | ||
this.visibility = View.GONE | ||
} |
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 |
---|---|---|
@@ -1,10 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/pageView" | ||
<FrameLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="480dp" | ||
android:layout_margin="0dp" | ||
android:background="#ffffff" | ||
android:contentDescription="@string/content_des" | ||
android:padding="0dp" | ||
android:scaleType="fitCenter" /> | ||
android:id="@+id/container_view" | ||
> | ||
|
||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/pageView" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_margin="0dp" | ||
android:background="#ffffff" | ||
android:contentDescription="@string/content_des" | ||
android:padding="0dp" | ||
android:scaleType="fitCenter" /> | ||
|
||
<include | ||
layout="@layout/pdf_view_page_loading_layout"/> | ||
|
||
</FrameLayout> |
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
12 changes: 12 additions & 0 deletions
12
pdfViewer/src/main/res/layout/pdf_view_page_loading_layout.xml
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<ProgressBar | ||
android:id="@+id/pdf_view_page_loading_progress" | ||
android:layout_gravity="center" | ||
android:layout_width="40dp" | ||
android:layout_height="40dp"/> | ||
|
||
</FrameLayout> |
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