@@ -45,9 +45,10 @@ export default class Chat extends Component {
4545 constructor ( props ) {
4646 super ( props ) ;
4747 this . state = {
48- inputViewLayout : { width :window . width , height :100 , } ,
48+ inputViewLayout : { width :window . width , height :86 , } ,
4949 menuContainerHeight : 1000 ,
5050 isDismissMenuContainer : false ,
51+ shouldExpandMenuContainer : false ,
5152 } ;
5253
5354 this . updateLayout = this . updateLayout . bind ( this ) ;
@@ -189,7 +190,10 @@ export default class Chat extends Component {
189190 componentWillUnmount ( ) {
190191 JMessage . removeReceiveMessageListener ( this . receiveMessageCallBack )
191192 AuroraIController . removeMessageListDidLoadListener ( this . messageListDidLoadCallback )
192- UIManager . dispatchViewManagerCommand ( findNodeHandle ( this . refs [ "MessageList" ] ) , 1 , null )
193+ if ( Platform . OS === 'android' ) {
194+ UIManager . dispatchViewManagerCommand ( findNodeHandle ( this . refs [ "MessageList" ] ) , 1 , null )
195+ }
196+
193197 }
194198
195199 updateLayout ( layout ) {
@@ -208,12 +212,29 @@ export default class Chat extends Component {
208212 width : Dimensions . get ( 'window' ) . width ,
209213 height : 100
210214 } ,
215+ shouldExpandMenuContainer : false ,
211216 } ) ;
212217 }
213218
214- onTouchEditText ( ) {
219+ onTouchEditText = ( ) => {
215220 console . log ( "scroll to bottom" )
216221 AuroraIController . scrollToBottom ( true ) ;
222+ if ( this . state . shouldExpandMenuContainer ) {
223+ this . setState ( { inputViewLayout : { width :window . width , height :420 , } } )
224+ }
225+
226+ }
227+
228+ onFullScreen = ( ) => {
229+ this . setState ( {
230+ inputViewLayout : { width : window . width , height :window . height }
231+ } )
232+ }
233+
234+ onRecoverScreen = ( ) => {
235+ this . setState ( {
236+ inputViewLayout : { width : window . width , height : 480 }
237+ } )
217238 }
218239
219240 onMsgClick = ( message ) => {
@@ -358,15 +379,23 @@ export default class Chat extends Component {
358379 }
359380
360381 onSwitchToMicrophoneMode = ( ) => {
361- this . updateLayout ( { width :window . width , height :420 , } )
382+ this . updateLayout ( { width :window . width , height :338 , } )
362383 }
363384
364385 onSwitchToGalleryMode = ( ) => {
365- this . updateLayout ( { width :window . width , height :420 , } )
386+ this . updateLayout ( { width :window . width , height :338 , } )
366387 }
367388
368389 onSwitchToCameraMode = ( ) => {
369- this . updateLayout ( { width :window . width , height :420 , } )
390+ if ( Platform . OS == "android" ) {
391+ this . updateLayout ( { width :window . width , height : 338 } )
392+ this . setState ( {
393+ shouldExpandMenuContainer : true
394+ } )
395+ } else {
396+ this . updateLayout ( { width :window . width , height :338 , } )
397+ }
398+
370399 }
371400
372401 onShowKeyboard = ( keyboard_height ) => {
@@ -413,6 +442,8 @@ export default class Chat extends Component {
413442 onSwitchToCameraMode = { this . onSwitchToCameraMode }
414443 onShowKeyboard = { this . onShowKeyboard }
415444 onTouchEditText = { this . onTouchEditText }
445+ onFullScreen = { this . onFullScreen }
446+ onRecoverScreen = { this . onRecoverScreen }
416447 />
417448 </ View >
418449 ) ;
0 commit comments