File tree Expand file tree Collapse file tree 8 files changed +32
-7
lines changed
Expand file tree Collapse file tree 8 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 22android {
33 defaultConfig {
44 generatedDensities = []
5- applicationId = " org.nativescript.demovuematerial"
5+ multiDexEnabled true
6+ applicationId = " org.nativescript.demovuematerial"
67
78 // override supported platforms
89 // ndk {
Original file line number Diff line number Diff line change 22<resources xmlns : android =" http://schemas.android.com/apk/res/android" >
33
44 <!-- theme to use FOR launch screen-->
5- <style name =" LaunchScreenThemeBase" parent =" Theme.MaterialComponents.Light .NoActionBar" >
5+ <style name =" LaunchScreenThemeBase" parent =" Theme.MaterialComponents.DayNight .NoActionBar" >
66 <item name =" toolbarStyle" >@style/NativeScriptToolbarStyle</item >
77
88 <item name =" colorPrimary" >@color/ns_primary</item >
2020 </style >
2121
2222 <!-- theme to use AFTER launch screen is loaded-->
23- <style name =" AppThemeBase" parent =" Theme.MaterialComponents.Light .NoActionBar" >
23+ <style name =" AppThemeBase" parent =" Theme.MaterialComponents.DayNight .NoActionBar" >
2424 <item name =" toolbarStyle" >@style/NativeScriptToolbarStyle</item >
2525
2626 <item name =" colorPrimary" >@color/ns_primary</item >
Original file line number Diff line number Diff line change 22 font-family : $mdi-fontFamily ;
33}
44
5+ label {
6+ color :black ;
7+ .ns-dark & {
8+ color : red ;
9+ }
10+ }
511mdbutton,MDFloatingActionButton, MDCardView {
612 shape : cut;
713}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import BottomNavigationBarPlugin from '@nativescript-community/ui-material-botto
1919import TabsPlugin from '@nativescript-community/ui-material-tabs/vue' ;
2020import BottomNavigationPlugin from '@nativescript-community/ui-material-bottom-navigation/vue' ;
2121import SpeedDialPlugin from '@nativescript-community/ui-material-speeddial/vue' ;
22+ import Theme from '@nativescript-community/css-theme' ;
2223
2324installBottomSheet ( ) ;
2425
@@ -56,8 +57,17 @@ themer.createShape('cut', {
5657 unit : '%'
5758 }
5859} ) ;
60+
61+ if ( global . isAndroid ) {
62+ Application . on ( Application . displayedEvent , ( ) => {
63+ Theme . setMode ( Theme . Auto ) ;
64+ androidx . appcompat . app . AppCompatDelegate . setDefaultNightMode ( androidx . appcompat . app . AppCompatDelegate . MODE_NIGHT_FOLLOW_SYSTEM ) ;
65+ } ) ;
66+ }
67+
5968// import { getExamples } from './examples';
6069import * as views from './views' ;
70+ import { Application } from '@nativescript/core' ;
6171
6272// for (let item of getExamples()) {
6373// Vue.component(item.component.name, item.component);
Original file line number Diff line number Diff line change 1+ import { Application } from '@nativescript/core' ;
12import { getExamples } from '../examples' ;
23
34export default {
@@ -23,6 +24,11 @@ export default {
2324 examples : getExamples ( )
2425 } ;
2526 } ,
27+ mounted ( ) {
28+ Application . on ( Application . systemAppearanceChangedEvent , ( event ) => {
29+ this . $refs ?. listView ?. nativeView ?. refresh ( ) ;
30+ } ) ;
31+ } ,
2632 methods : {
2733 async goToExample ( item ) {
2834 console . log ( 'goToExample' , item . title ) ;
Original file line number Diff line number Diff line change 55 "main" : " app/main" ,
66 "dependencies" : {
77 "@mdi/font" : " 5.9.55" ,
8- "@nativescript/core " : " 8.0.5 " ,
8+ "@nativescript-community/css-theme " : " ^1.2.7 " ,
99 "@nativescript-community/text" : " 1.4.11" ,
1010 "@nativescript-community/ui-material-activityindicator" : " file:../packages/activityindicator" ,
1111 "@nativescript-community/ui-material-bottom-navigation" : " file:../packages/bottom-navigation" ,
2424 "@nativescript-community/ui-material-tabs" : " file:../packages/tabs" ,
2525 "@nativescript-community/ui-material-textfield" : " file:../packages/textfield" ,
2626 "@nativescript-community/ui-material-textview" : " file:../packages/textview" ,
27+ "@nativescript/core" : " 8.0.5" ,
2728 "@nativescript/iqkeyboardmanager" : " ^2.0.0" ,
2829 "@nativescript/theme" : " 3.0.1" ,
2930 "nativescript-vue" : " ~2.9.0" ,
3940 "sass-loader" : " ^11.0.1" ,
4041 "scss-symbols-parser" : " ^2.0.1" ,
4142 "string-replace-loader" : " ^3.0.1" ,
42- "tns-ios" :" 6.5.4" ,
43+ "tns-ios" : " 6.5.4" ,
4344 "typescript" : " ^4.2.4" ,
4445 "vue" : " ^2.6.12" ,
4546 "vue-i18n" : " ^8.24.1" ,
Original file line number Diff line number Diff line change @@ -403,7 +403,7 @@ export class BottomNavigation extends TabNavigationBase {
403403 // _onAttachedToWindow called from OS again after it was detach
404404 // still happens with androidx.fragment:1.3.2
405405 const activity = Application . android . foregroundActivity ;
406- if ( ( this . _manager && this . _manager . isDestroyed ( ) ) || ! activity . getLifecycle ( ) . getCurrentState ( ) . isAtLeast ( androidx . lifecycle . Lifecycle . State . STARTED ) ) {
406+ if ( ( this . _manager && this . _manager . isDestroyed ( ) ) || ! activity . getLifecycle ?. ( ) . getCurrentState ( ) . isAtLeast ( androidx . lifecycle . Lifecycle . State . STARTED ) ) {
407407 return ;
408408 }
409409
@@ -527,6 +527,7 @@ export class BottomNavigation extends TabNavigationBase {
527527
528528 //@ts -ignore
529529 const fragmentManager = this . _getRootFragmentManager ( ) ;
530+ console . log ( ) ;
530531 let fragment : androidx . fragment . app . Fragment = fragmentManager . findFragmentByTag ( name ) ;
531532 if ( fragment != null ) {
532533 this . attachFragment ( fragment ) ;
Original file line number Diff line number Diff line change @@ -513,7 +513,7 @@ export class Tabs extends TabsBase {
513513 // _onAttachedToWindow called from OS again after it was detach
514514 // still happens with androidx.fragment:1.3.2
515515 const activity = Application . android . foregroundActivity ;
516- if ( ( this . _manager && this . _manager . isDestroyed ( ) ) || ! activity . getLifecycle ( ) . getCurrentState ( ) . isAtLeast ( androidx . lifecycle . Lifecycle . State . STARTED ) ) {
516+ if ( ( this . _manager && this . _manager . isDestroyed ( ) ) || ! activity . getLifecycle ?. ( ) . getCurrentState ( ) . isAtLeast ( androidx . lifecycle . Lifecycle . State . STARTED ) ) {
517517 return ;
518518 }
519519
You can’t perform that action at this time.
0 commit comments