jorgesilva/TeclaAccess — pull request #41 by withad (2012-03-25 14:21:21+00:00)
Title: Fixed bug "Fullscreen overlay does not resize on orientation changed"

Fixed bug "Fullscreen overlay does not resize on orientation changed" (https://github.com/jorgesilva/TeclaAccess/issues/14).

The problem was caused by the fact that the fullscreen switch overlay didn't change size/shape when the screen orientation changed. To fix this, I've overridden onConfigurationChanged in TeclaApp (which triggers when the orientation changes) to send out a new intent, ACTION_RESTART_FS_SWITCH_MODE. This works similarly to the ACTION_START_FS_SWITCH_MODE intent, in that it runs startFullScreenSwitchMode() in TeclaIME. However, it won't show the "Fullscreen switch mode enabled" toast (this isn't totally necessary but I found it annoying when testing and thought it was worth doing).

To toggle the Toast, I modified mCreateSwitchRunnable to be an instance of an inner class that takes a boolean argument, showToast. startFullScreenSwitchMode() provides the boolean, which it gets depending on whether it's called on a START or RESTART intent.