Skip to content

Commit c3fd7d0

Browse files
[Fix|Android] Support follow system nightmode flag in widget viewer (#318)
* Add custom PdfViewCtrlTabHostFragment2 to support follow system night mode * Updating package version * Updating package version * Missed bracket * Update host fragment * Update host fragment * apply theme after onCreate * Updating pubspec.yaml * Updating package version * Reorder apply theme * Updating pubspec.yaml * Updating package version --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 463f5f7 commit c3fd7d0

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

android/src/main/java/com/pdftron/pdftronflutter/nativeviews/FlutterPdfViewCtrlTabHostFragment.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
package com.pdftron.pdftronflutter.nativeviews;
22

3+
import android.os.Bundle;
4+
import androidx.fragment.app.FragmentActivity;
5+
36
import com.pdftron.pdf.controls.PdfViewCtrlTabHostFragment2;
47

58
public class FlutterPdfViewCtrlTabHostFragment extends PdfViewCtrlTabHostFragment2 {
9+
10+
@Override
11+
public void onCreate(Bundle savedInstanceState) {
12+
FragmentActivity activity = getActivity();
13+
if (activity != null) {
14+
applyTheme(activity);
15+
}
16+
17+
super.onCreate(savedInstanceState);
18+
}
19+
620
@Override
721
protected void updateFullScreenModeLayout() {
822
if (isInFullScreenMode()) {

android/src/main/java/com/pdftron/pdftronflutter/views/DocumentView.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.pdftron.pdf.controls.PdfViewCtrlTabFragment2;
2222
import com.pdftron.pdf.controls.PdfViewCtrlTabHostFragment2;
2323
import com.pdftron.pdf.tools.ToolManager;
24-
import com.pdftron.pdf.utils.PdfViewCtrlSettingsManager;
2524
import com.pdftron.pdf.utils.Utils;
2625
import com.pdftron.pdftronflutter.R;
2726
import com.pdftron.pdftronflutter.helpers.PluginUtils;
@@ -324,11 +323,11 @@ public boolean isAutoSaveEnabled() {
324323
return mAutoSaveEnabled;
325324
}
326325

327-
public boolean isAnnotationManagerEnabled() { return mAnnotationManagerEnabled; };
326+
public boolean isAnnotationManagerEnabled() { return mAnnotationManagerEnabled; }
328327

329-
public String getUserId() { return mUserId; };
328+
public String getUserId() { return mUserId; }
330329

331-
public String getUserName() { return mUserName; };
330+
public String getUserName() { return mUserName; }
332331

333332
public boolean isUseStylusAsPen() {
334333
return mUseStylusAsPen;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pdftron_flutter
22
description: A convenience wrapper to build Flutter apps that use the PDFTron mobile SDK for smooth, flexible, and stand-alone document viewing.
3-
version: 1.0.1-27
3+
version: 1.0.1-28
44
homepage: https://www.pdftron.com
55
repository: https://github.com/PDFTron/pdftron-flutter
66
issue_tracker: https://github.com/PDFTron/pdftron-flutter/issues

0 commit comments

Comments
 (0)