Last active
December 23, 2019 18:03
-
-
Save Buom01/9bd08a292e1cc006cf8cc160b89f9869 to your computer and use it in GitHub Desktop.
TWA splashscreen
This file contains hidden or 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
<!--- | |
IMPORTANT NOTE: This gist in now useless since splashscreen are now supported: https://github.com/GoogleChromeLabs/svgomg-twa/pull/23/files#diff-4ad2826e1292d083a4995de57bfaf133 | |
--> | |
<!-- import here your svg logo (in drawables) | |
See https://stackoverflow.com/questions/30923205/easiest-way-to-use-svg-in-android/39266840#39266840 | |
--> |
This file contains hidden or 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
<!-- put this file in drawables --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" | |
android:opacity="opaque"> | |
<item android:drawable="@color/colorPrimary"/> | |
<item | |
android:gravity="center" | |
android:drawable="@drawable/ic_logo" | |
android:height="150dp" | |
android:width="150dp" /> | |
</layer-list> |
This file contains hidden or 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
<!-- | |
Copyright 2019 Google Inc. All Rights Reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. | |
--- | |
Adapted from https://github.com/GoogleChromeLabs/svgomg-twa | |
--> | |
<resources> | |
<!-- Theme to create a blank screen while the TWA is opening --> | |
<style name="Theme.TwaSplash" parent="Theme.AppCompat.Light.NoActionBar"> | |
<item name="android:windowNoTitle">true</item> | |
<item name="android:backgroundDimEnabled">false</item> | |
<item name="android:windowBackground">@drawable/splash</item> | |
<item name="android:statusBarColor">@color/colorPrimary</item> <!-- Make all the srcreen of the same color without fullscreen keeping statusbar and navigation (virtual home buttons (...)) visible but unicolor color --> | |
<item name="android:navigationBarColor">@color/colorPrimary</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I realize this is outdated now, but have you ever had luck with the
navigationBarColor
property? I can't seem to get it to work, and I'd like to make the navigation transparent for my main view in my TWA on Android 10+, as described here https://medium.com/androiddevelopers/gesture-navigation-going-edge-to-edge-812f62e4e83e