Skip to content

Instantly share code, notes, and snippets.

@r17x
Forked from Buom01/ic_logo.xml
Created March 14, 2019 10:14
Show Gist options
  • Save r17x/6a30cdf3d6e732df6df3d5f3f9102140 to your computer and use it in GitHub Desktop.
Save r17x/6a30cdf3d6e732df6df3d5f3f9102140 to your computer and use it in GitHub Desktop.
TWA splashscreen
<!-- import here your svg logo (in drawables)
See https://stackoverflow.com/questions/30923205/easiest-way-to-use-svg-in-android/39266840#39266840
-->
<!-- 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>
<!--
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