Skip to content

Commit 4d8a8f7

Browse files
committed
chore: allow demo snippets to override App_Resources
1 parent 25a9622 commit 4d8a8f7

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- theme to use FOR launch screen-->
5+
<style name="LaunchScreenThemeBase" parent="Theme.MaterialComponents.Light.NoActionBar">
6+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
7+
8+
<item name="colorPrimary">@color/ns_primary</item>
9+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
10+
<item name="colorAccent">@color/ns_accent</item>
11+
12+
<item name="android:windowBackground">@drawable/splash_screen</item>
13+
14+
<item name="android:windowActionBarOverlay">true</item>
15+
<item name="android:windowTranslucentStatus">true</item>
16+
</style>
17+
18+
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
19+
</style>
20+
21+
<!-- theme to use AFTER launch screen is loaded-->
22+
<style name="AppThemeBase" parent="Theme.MaterialComponents.Light.NoActionBar">
23+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
24+
25+
<item name="colorPrimary">@color/ns_primary</item>
26+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
27+
<item name="colorAccent">@color/ns_accent</item>
28+
</style>
29+
30+
<style name="AppTheme" parent="AppThemeBase">
31+
</style>
32+
33+
<!-- theme for action-bar -->
34+
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
35+
<item name="android:background">@color/ns_primary</item>
36+
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
37+
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
38+
</style>
39+
40+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
41+
</style>
42+
</resources>

demo-snippets/package.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
{
22
"name": "@nativescript-community/template-snippet",
33
"version": "0.0.1",
4+
"nativescript": {
5+
"platforms": {
6+
"android": "*"
7+
},
8+
"hooks": [
9+
{
10+
"type": "after-prepare",
11+
"script": "scripts/after-prepare.js",
12+
"inject": true
13+
}
14+
]
15+
},
16+
"scripts": {
17+
"preuninstall": "node preuninstall.js",
18+
"postinstall": "node postinstall.js"
19+
},
420
"dependencies": {
521
"@nativescript-community/ui-material-activityindicator": "file:../packages/activityindicator",
622
"@nativescript-community/ui-material-bottom-navigation": "file:../packages/bottom-navigation",
@@ -20,7 +36,8 @@
2036
"@nativescript-community/ui-material-tabs": "file:../packages/tabs",
2137
"@nativescript-community/ui-material-textfield": "file:../packages/textfield",
2238
"@nativescript-community/ui-material-textview": "file:../packages/textview",
23-
"@mdi/font": "6.5.95"
39+
"@mdi/font": "6.5.95",
40+
"@nativescript/hook": "~2.0.0"
2441
},
2542
"devDependencies": {
2643
"nativescript-vue-template-compiler": "~2.9.0",

demo-snippets/postinstall.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-snippets/preuninstall.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)