@@ -131,8 +131,8 @@ export default class DropdownAlert extends Component {
131131 inactiveStatusBarStyle : StatusBarDefaultBarStyle ,
132132 inactiveStatusBarBackgroundColor : StatusBarDefaultBackgroundColor ,
133133 updateStatusBar : true ,
134- useNativeDriver : IS_IOS ,
135134 isInteraction : undefined ,
135+ useNativeDriver : true ,
136136 elevation : 1 ,
137137 zIndex : null ,
138138 sensitivity : 20 ,
@@ -158,6 +158,7 @@ export default class DropdownAlert extends Component {
158158 startDelta : props . startDelta ,
159159 endDelta : props . endDelta ,
160160 topValue : 0 ,
161+ payload : { } ,
161162 } ;
162163 this . types = {
163164 INFO : 'info' ,
@@ -174,6 +175,9 @@ export default class DropdownAlert extends Component {
174175 if ( this . _closeTimeoutId != null ) {
175176 clearTimeout ( this . _closeTimeoutId ) ;
176177 }
178+ if ( this . state . isOpen ) {
179+ this . closeDirectly ( ) ;
180+ }
177181 }
178182 createPanResponder = ( ) => {
179183 this . _panResponder = PanResponder . create ( {
@@ -204,7 +208,7 @@ export default class DropdownAlert extends Component {
204208 } ,
205209 } ) ;
206210 } ;
207- alertWithType = ( type , title , message , interval ) => {
211+ alertWithType = ( type , title , message , payload , interval ) => {
208212 if ( validateType ( type ) == false ) {
209213 return ;
210214 }
@@ -221,6 +225,7 @@ export default class DropdownAlert extends Component {
221225 message : message ,
222226 title : title ,
223227 topValue : 0 ,
228+ payload : payload ,
224229 } ) ;
225230 if ( this . state . isOpen == false ) {
226231 this . setState ( {
@@ -255,6 +260,7 @@ export default class DropdownAlert extends Component {
255260 title : title ,
256261 isOpen : true ,
257262 topValue : 0 ,
263+ payload : payload ,
258264 } ) ;
259265 }
260266 self . animate ( 1 ) ;
@@ -271,6 +277,14 @@ export default class DropdownAlert extends Component {
271277 ) ;
272278 }
273279 } ;
280+ resetStatusBarColor = ( ) => {
281+ if ( this . props . updateStatusBar ) {
282+ if ( IS_ANDROID ) {
283+ StatusBar . setBackgroundColor ( this . props . inactiveStatusBarBackgroundColor , true ) ;
284+ }
285+ StatusBar . setBarStyle ( this . props . inactiveStatusBarStyle , true ) ;
286+ }
287+ }
274288 close = action => {
275289 if ( action == undefined ) {
276290 action = 'programmatic' ;
@@ -284,15 +298,11 @@ export default class DropdownAlert extends Component {
284298 clearTimeout ( this . _closeTimeoutId ) ;
285299 }
286300 this . animate ( 0 ) ;
287- if ( this . props . updateStatusBar ) {
288- if ( IS_ANDROID ) {
289- StatusBar . setBackgroundColor ( this . props . inactiveStatusBarBackgroundColor , true ) ;
290- }
291- StatusBar . setBarStyle ( this . props . inactiveStatusBarStyle , true ) ;
292- }
301+ this . resetStatusBarColor ( ) ;
293302 setTimeout (
294303 function ( ) {
295304 if ( this . state . isOpen ) {
305+ this . resetStatusBarColor ( ) ;
296306 this . setState ( {
297307 isOpen : false ,
298308 } ) ;
@@ -302,6 +312,7 @@ export default class DropdownAlert extends Component {
302312 title : this . state . title ,
303313 message : this . state . message ,
304314 action : action , // !!! How the alert was closed: automatic, programmatic, tap, pan or cancel
315+ payload : this . state . payload ,
305316 } ;
306317 onClose ( data ) ;
307318 }
@@ -319,12 +330,7 @@ export default class DropdownAlert extends Component {
319330 this . setState ( {
320331 isOpen : false ,
321332 } ) ;
322- if ( this . props . updateStatusBar ) {
323- if ( IS_ANDROID ) {
324- StatusBar . setBackgroundColor ( this . props . inactiveStatusBarBackgroundColor , true ) ;
325- }
326- StatusBar . setBarStyle ( this . props . inactiveStatusBarStyle , true ) ;
327- }
333+ this . resetStatusBarColor ( ) ;
328334 }
329335 }
330336 animate = toValue => {
0 commit comments