Created
February 9, 2012 12:12
Revisions
-
fpillet created this gist
Feb 9, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ containerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { final Activity app = getActivity(); if (app == null) return; Rect r = new Rect(); containerView.getWindowVisibleDisplayFrame(r); boolean visible = (Math.abs(r.height() - containerView.getHeight()) > 128); if (visible != keyboardVisible) { keyboardVisible = visible; NotificationCenter.postNotification( Constants.KEYBOARD_VISIBILITY_CHANGED, this, CFDictionary.withObjectsAndKeys(visible, "visible")); } } });