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 2
2
android {
3
3
defaultConfig {
4
4
generatedDensities = []
5
- applicationId = " org.nativescript.demovuematerial"
5
+ multiDexEnabled true
6
+ applicationId = " org.nativescript.demovuematerial"
6
7
7
8
// override supported platforms
8
9
// ndk {
Original file line number Diff line number Diff line change 2
2
<resources xmlns : android =" http://schemas.android.com/apk/res/android" >
3
3
4
4
<!-- theme to use FOR launch screen-->
5
- <style name =" LaunchScreenThemeBase" parent =" Theme.MaterialComponents.Light .NoActionBar" >
5
+ <style name =" LaunchScreenThemeBase" parent =" Theme.MaterialComponents.DayNight .NoActionBar" >
6
6
<item name =" toolbarStyle" >@style/NativeScriptToolbarStyle</item >
7
7
8
8
<item name =" colorPrimary" >@color/ns_primary</item >
20
20
</style >
21
21
22
22
<!-- 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" >
24
24
<item name =" toolbarStyle" >@style/NativeScriptToolbarStyle</item >
25
25
26
26
<item name =" colorPrimary" >@color/ns_primary</item >
Original file line number Diff line number Diff line change 2
2
font-family : $mdi-fontFamily ;
3
3
}
4
4
5
+ label {
6
+ color :black ;
7
+ .ns-dark & {
8
+ color : red ;
9
+ }
10
+ }
5
11
mdbutton,MDFloatingActionButton, MDCardView {
6
12
shape : cut;
7
13
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import BottomNavigationBarPlugin from '@nativescript-community/ui-material-botto
19
19
import TabsPlugin from '@nativescript-community/ui-material-tabs/vue' ;
20
20
import BottomNavigationPlugin from '@nativescript-community/ui-material-bottom-navigation/vue' ;
21
21
import SpeedDialPlugin from '@nativescript-community/ui-material-speeddial/vue' ;
22
+ import Theme from '@nativescript-community/css-theme' ;
22
23
23
24
installBottomSheet ( ) ;
24
25
@@ -56,8 +57,17 @@ themer.createShape('cut', {
56
57
unit : '%'
57
58
}
58
59
} ) ;
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
+
59
68
// import { getExamples } from './examples';
60
69
import * as views from './views' ;
70
+ import { Application } from '@nativescript/core' ;
61
71
62
72
// for (let item of getExamples()) {
63
73
// Vue.component(item.component.name, item.component);
Original file line number Diff line number Diff line change
1
+ import { Application } from '@nativescript/core' ;
1
2
import { getExamples } from '../examples' ;
2
3
3
4
export default {
@@ -23,6 +24,11 @@ export default {
23
24
examples : getExamples ( )
24
25
} ;
25
26
} ,
27
+ mounted ( ) {
28
+ Application . on ( Application . systemAppearanceChangedEvent , ( event ) => {
29
+ this . $refs ?. listView ?. nativeView ?. refresh ( ) ;
30
+ } ) ;
31
+ } ,
26
32
methods : {
27
33
async goToExample ( item ) {
28
34
console . log ( 'goToExample' , item . title ) ;
Original file line number Diff line number Diff line change 5
5
"main" : " app/main" ,
6
6
"dependencies" : {
7
7
"@mdi/font" : " 5.9.55" ,
8
- "@nativescript/core " : " 8.0.5 " ,
8
+ "@nativescript-community/css-theme " : " ^1.2.7 " ,
9
9
"@nativescript-community/text" : " 1.4.11" ,
10
10
"@nativescript-community/ui-material-activityindicator" : " file:../packages/activityindicator" ,
11
11
"@nativescript-community/ui-material-bottom-navigation" : " file:../packages/bottom-navigation" ,
24
24
"@nativescript-community/ui-material-tabs" : " file:../packages/tabs" ,
25
25
"@nativescript-community/ui-material-textfield" : " file:../packages/textfield" ,
26
26
"@nativescript-community/ui-material-textview" : " file:../packages/textview" ,
27
+ "@nativescript/core" : " 8.0.5" ,
27
28
"@nativescript/iqkeyboardmanager" : " ^2.0.0" ,
28
29
"@nativescript/theme" : " 3.0.1" ,
29
30
"nativescript-vue" : " ~2.9.0" ,
39
40
"sass-loader" : " ^11.0.1" ,
40
41
"scss-symbols-parser" : " ^2.0.1" ,
41
42
"string-replace-loader" : " ^3.0.1" ,
42
- "tns-ios" :" 6.5.4" ,
43
+ "tns-ios" : " 6.5.4" ,
43
44
"typescript" : " ^4.2.4" ,
44
45
"vue" : " ^2.6.12" ,
45
46
"vue-i18n" : " ^8.24.1" ,
Original file line number Diff line number Diff line change @@ -403,7 +403,7 @@ export class BottomNavigation extends TabNavigationBase {
403
403
// _onAttachedToWindow called from OS again after it was detach
404
404
// still happens with androidx.fragment:1.3.2
405
405
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 ) ) {
407
407
return ;
408
408
}
409
409
@@ -527,6 +527,7 @@ export class BottomNavigation extends TabNavigationBase {
527
527
528
528
//@ts -ignore
529
529
const fragmentManager = this . _getRootFragmentManager ( ) ;
530
+ console . log ( ) ;
530
531
let fragment : androidx . fragment . app . Fragment = fragmentManager . findFragmentByTag ( name ) ;
531
532
if ( fragment != null ) {
532
533
this . attachFragment ( fragment ) ;
Original file line number Diff line number Diff line change @@ -513,7 +513,7 @@ export class Tabs extends TabsBase {
513
513
// _onAttachedToWindow called from OS again after it was detach
514
514
// still happens with androidx.fragment:1.3.2
515
515
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 ) ) {
517
517
return ;
518
518
}
519
519
You can’t perform that action at this time.
0 commit comments