crn-cli
Version:
The Ctrip React Native CLI Tools
1 lines • 2.18 kB
JavaScript
__d(function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),h=r(d[6]),u=h.StyleSheet,T=h.Text,E=h.ToastAndroid,f=h.TouchableWithoutFeedback,y=r(d[7]),w=r(d[8]),v=(function(h){function u(){return t(this,u),s(this,o(u).apply(this,arguments))}return l(u,h),n(u,[{key:"render",value:function(){return c.createElement(w,{title:"ToastAndroid"},c.createElement(y,{title:"Simple toast"},c.createElement(f,{onPress:function(){return E.show('This is a toast with short duration',E.SHORT)}},c.createElement(T,{style:x.text},"Click me."))),c.createElement(y,{title:"Toast with long duration"},c.createElement(f,{onPress:function(){return E.show('This is a toast with long duration',E.LONG)}},c.createElement(T,{style:x.text},"Click me."))),c.createElement(y,{title:"Toast with top gravity"},c.createElement(f,{onPress:function(){return E.showWithGravity('This is a toast with top gravity',E.SHORT,E.TOP)}},c.createElement(T,{style:x.text},"Click me."))),c.createElement(y,{title:"Toast with center gravity"},c.createElement(f,{onPress:function(){return E.showWithGravity('This is a toast with center gravity',E.SHORT,E.CENTER)}},c.createElement(T,{style:x.text},"Click me."))),c.createElement(y,{title:"Toast with bottom gravity"},c.createElement(f,{onPress:function(){return E.showWithGravity('This is a toast with bottom gravity',E.SHORT,E.BOTTOM)}},c.createElement(T,{style:x.text},"Click me."))),c.createElement(y,{title:"Toast with x offset"},c.createElement(f,{onPress:function(){return E.showWithGravityAndOffset('This is a toast with x offset',E.SHORT,E.CENTER,50,0)}},c.createElement(T,{style:x.text},"Click me."))),c.createElement(y,{title:"Toast with y offset"},c.createElement(f,{onPress:function(){return E.showWithGravityAndOffset('This is a toast with y offset',E.SHORT,E.BOTTOM,0,50)}},c.createElement(T,{style:x.text},"Click me."))))}}]),u})(c.Component),x=u.create({text:{color:'black'}});e.title='Toast Example',e.description='Example that demonstrates the use of an Android Toast to provide feedback.',e.examples=[{title:'Basic toast',render:function(){return c.createElement(v,null)}}]},666830,[3,4,5,8,9,11,15,666679,666681]);