Skip to content

Commit

Permalink
Add dark app theme support
Browse files Browse the repository at this point in the history
  • Loading branch information
MHShetty authored and thestinger committed Feb 13, 2022
1 parent f91ba52 commit 5f5e168
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/org/grapheneos/pdfviewer/PdfViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.webview);

mWebView = findViewById(R.id.webview);
mWebView.setBackgroundColor(Color.TRANSPARENT);

if (BuildConfig.DEBUG) {
WebView.setWebContentsDebuggingEnabled(true);
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">#000000</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Customize your theme here. -->
</style>

Expand Down

0 comments on commit 5f5e168

Please sign in to comment.