forked from aeharding/voyager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Android immersive styles (aeharding#644)
Resolves aeharding#638
- Loading branch information
Showing
18 changed files
with
206 additions
and
58 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
34 changes: 33 additions & 1 deletion
34
android/app/src/main/java/app/vger/voyager/MainActivity.java
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,5 +1,37 @@ | ||
package app.vger.voyager; | ||
|
||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
|
||
import com.getcapacitor.BridgeActivity; | ||
|
||
public class MainActivity extends BridgeActivity {} | ||
public class MainActivity extends BridgeActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
// https://github.com/ionic-team/capacitor/issues/2840#issuecomment-891093722 | ||
// | ||
// Use a transparent status bar and nav bar, and place the window behind the status bar | ||
// and nav bar. Due to a chromium bug, we need to get the height of both bars | ||
// and add it to the safe area insets. The native plugin is used to get this info. | ||
// See https://bugs.chromium.org/p/chromium/issues/detail?id=1094366 | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { | ||
getWindow().setDecorFitsSystemWindows(false); | ||
getWindow().setStatusBarColor(0); | ||
getWindow().setNavigationBarColor(0); | ||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { | ||
// On older versions of android setDecorFitsSystemWindows doesn't exist yet, but it can | ||
// be emulated with flags. | ||
// It still must be P or greater, as that is the min version for getting the insets | ||
// through the native plugin. | ||
getWindow().getDecorView().setSystemUiVisibility( | ||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | | ||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | | ||
View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); | ||
getWindow().setStatusBarColor(0); | ||
getWindow().setNavigationBarColor(0); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,5 +23,8 @@ project(':capacitor-status-bar').projectDir = new File('../node_modules/.pnpm/@c | |
include ':capacitor-application-context' | ||
project(':capacitor-application-context').projectDir = new File('../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-application-context/android') | ||
|
||
include ':capacitor-plugin-safe-area' | ||
project(':capacitor-plugin-safe-area').projectDir = new File('../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-plugin-safe-area/android') | ||
|
||
include ':capacitor-stash-media' | ||
project(':capacitor-stash-media').projectDir = new File('../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-stash-media/android') |
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ def capacitor_pods | |
pod 'CapacitorShare', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/share' | ||
pod 'CapacitorStatusBar', :path => '../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar' | ||
pod 'CapacitorApplicationContext', :path => '../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-application-context' | ||
pod 'CapacitorPluginSafeArea', :path => '../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-plugin-safe-area' | ||
pod 'CapacitorStashMedia', :path => '../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-stash-media' | ||
end | ||
|
||
|
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 |
---|---|---|
|
@@ -12,6 +12,8 @@ PODS: | |
- Capacitor | ||
- CapacitorKeyboard (5.0.6): | ||
- Capacitor | ||
- CapacitorPluginSafeArea (2.0.5): | ||
- Capacitor | ||
- CapacitorShare (5.0.6): | ||
- Capacitor | ||
- CapacitorStashMedia (0.0.3): | ||
|
@@ -31,6 +33,7 @@ DEPENDENCIES: | |
- "CapacitorCordova (from `../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/ios`)" | ||
- "CapacitorHaptics (from `../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics`)" | ||
- "CapacitorKeyboard (from `../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard`)" | ||
- "CapacitorPluginSafeArea (from `../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-plugin-safe-area`)" | ||
- "CapacitorShare (from `../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/share`)" | ||
- "CapacitorStashMedia (from `../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-stash-media`)" | ||
- "CapacitorStatusBar (from `../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/status-bar`)" | ||
|
@@ -54,6 +57,8 @@ EXTERNAL SOURCES: | |
:path: "../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/haptics" | ||
CapacitorKeyboard: | ||
:path: "../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/keyboard" | ||
CapacitorPluginSafeArea: | ||
:path: "../../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/capacitor-plugin-safe-area" | ||
CapacitorShare: | ||
:path: "../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@capacitor/share" | ||
CapacitorStashMedia: | ||
|
@@ -69,11 +74,12 @@ SPEC CHECKSUMS: | |
CapacitorCordova: 3773395d5331add072300ff6041ca2cf7b93cb0b | ||
CapacitorHaptics: 1fffc1217c7e64a472d7845be50fb0c2f7d4204c | ||
CapacitorKeyboard: b978154b024a5f65e044908e37d15b7de58b9d12 | ||
CapacitorPluginSafeArea: bfdd714827dbd89fb44fea286beec996e1b0c5c4 | ||
CapacitorShare: cd41743331cb71d217c029de54b681cbd91e0fcc | ||
CapacitorStashMedia: c2a4d719906c1862007f3562194018dfeda87451 | ||
CapacitorStatusBar: 565c0a1ebd79bb40d797606a8992b4a105885309 | ||
SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9 | ||
|
||
PODFILE CHECKSUM: 99b010f7612ca41b433f9bfe805a71822374b276 | ||
PODFILE CHECKSUM: 64aed244866097bf21833d6fbb682b5d31e29b18 | ||
|
||
COCOAPODS: 1.12.1 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.