File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 55 StyleSheet ,
66 Text ,
77 View ,
8- TouchableOpacity ,
98 Animated ,
109 Dimensions ,
1110 Image ,
@@ -102,7 +101,7 @@ const defaulStyles = {
102101 justifyContent : 'center' ,
103102 alignItems : 'center' ,
104103 } ,
105- }
104+ } ;
106105
107106export default class AppIntro extends Component {
108107 constructor ( props ) {
@@ -333,7 +332,11 @@ export default class AppIntro extends Component {
333332 }
334333
335334 if ( this . isToTintStatusBar ( ) ) {
336- StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( this . props . pageArray [ 0 ] . backgroundColor , - 0.3 ) , false ) ;
335+ const statusBarColor = this . props . pageArray [ 0 ] . statusBarColor || this . props . pageArray [ 0 ] . backgroundColor || undefined ;
336+
337+ if ( statusBarColor ) {
338+ StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( statusBarColor , - 0.3 ) , false ) ;
339+ }
337340 }
338341
339342 return (
@@ -345,7 +348,11 @@ export default class AppIntro extends Component {
345348 renderPagination = { this . renderPagination }
346349 onMomentumScrollEnd = { ( e , state ) => {
347350 if ( this . isToTintStatusBar ( ) ) {
348- StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( this . props . pageArray [ state . index ] . backgroundColor , - 0.3 ) , false ) ;
351+ const statusBarColor = this . props . pageArray [ state . index ] . statusBarColor || this . props . pageArray [ state . index ] . backgroundColor || undefined ;
352+
353+ if ( statusBarColor ) {
354+ StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( statusBarColor , - 0.3 ) , false ) ;
355+ }
349356 }
350357
351358 this . props . onSlideChange ( state . index , state . total ) ;
Original file line number Diff line number Diff line change 55 StyleSheet ,
66 Text ,
77 View ,
8- TouchableOpacity ,
98 Animated ,
109 Dimensions ,
1110 Image ,
@@ -102,7 +101,7 @@ const defaulStyles = {
102101 justifyContent : 'center' ,
103102 alignItems : 'center' ,
104103 } ,
105- }
104+ } ;
106105
107106export default class AppIntro extends Component {
108107 constructor ( props ) {
@@ -333,7 +332,11 @@ export default class AppIntro extends Component {
333332 }
334333
335334 if ( this . isToTintStatusBar ( ) ) {
336- StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( this . props . pageArray [ 0 ] . backgroundColor , - 0.3 ) , false ) ;
335+ const statusBarColor = this . props . pageArray [ 0 ] . statusBarColor || this . props . pageArray [ 0 ] . backgroundColor || undefined ;
336+
337+ if ( statusBarColor ) {
338+ StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( statusBarColor , - 0.3 ) , false ) ;
339+ }
337340 }
338341
339342 return (
@@ -345,7 +348,11 @@ export default class AppIntro extends Component {
345348 renderPagination = { this . renderPagination }
346349 onMomentumScrollEnd = { ( e , state ) => {
347350 if ( this . isToTintStatusBar ( ) ) {
348- StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( this . props . pageArray [ state . index ] . backgroundColor , - 0.3 ) , false ) ;
351+ const statusBarColor = this . props . pageArray [ state . index ] . statusBarColor || this . props . pageArray [ state . index ] . backgroundColor || undefined ;
352+
353+ if ( statusBarColor ) {
354+ StatusBar . setBackgroundColor ( this . shadeStatusBarColor ( statusBarColor , - 0.3 ) , false ) ;
355+ }
349356 }
350357
351358 this . props . onSlideChange ( state . index , state . total ) ;
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ class Example extends Component {
5454 width: 109 * 2.5 ,
5555 },
5656 backgroundColor: ' #fa931d' ,
57+ statusBarColor: ' #fa931d' , // If you don't specify, a 30% darker color will be inferred from your background color.
5758 fontColor: ' #fff' ,
5859 level: 10 ,
5960 }, {
You can’t perform that action at this time.
0 commit comments