UNPKG

autobots-lib

Version:

汽车人基础库

48 lines (41 loc) 881 B
'use strict'; import React from 'react-native'; import Native from '../native'; import Toast from './toast'; const { ToastAndroid, Platform, } = React; let openNative = function(isShow,shadeHeight,callback) { let url = 'autobots://testrn/MainLoading'; if(isShow){ url = url +"?display=true"; }else { url = url +"?display=false"; } if(shadeHeight>0) { url = url +"&shadeHeight="+shadeHeight; } Native.callNative(url,function(result,data){ if(callback) { callback(result,data); } }); } var loading = { Show:function(callback) { openNative(true,0,callback); }, ShowWithHeight:function(height,callback) { openNative(true,height,callback); }, Hide:function(callback){ openNative(false,0,callback); } } module.exports = loading;