1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-04 03:40:07 +00:00

Tidied up a few minor coding style discrepencies

This commit is contained in:
jules 2018-04-10 09:50:11 +01:00
parent 2204c6b263
commit d691838765
13 changed files with 82 additions and 94 deletions

View file

@ -222,11 +222,11 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
super.onResume();
resumeApp();
// Ensure that navigation/status bar visibility is correctly restored.
for (int i = 0; i < viewHolder.getChildCount(); ++i)
{
if (viewHolder.getChildAt (i) instanceof ComponentPeerView)
((ComponentPeerView) viewHolder.getChildAt (i)).appResumed();
// Ensure that navigation/status bar visibility is correctly restored.
for (int i = 0; i < viewHolder.getChildCount(); ++i)
{
if (viewHolder.getChildAt (i) instanceof ComponentPeerView)
((ComponentPeerView) viewHolder.getChildAt (i)).appResumed();
}
}
@ -808,37 +808,37 @@ public class JuceAppActivity extends $$JuceAppActivityBaseClass$$
}
private class TreeObserver implements ViewTreeObserver.OnGlobalLayoutListener
{
TreeObserver()
{
keyboardShown = false;
}
{
TreeObserver()
{
keyboardShown = false;
}
@Override
public void onGlobalLayout()
{
Rect r = new Rect();
ViewGroup parentView = (ViewGroup) getParent();
if (parentView == null)
return;
ViewGroup parentView = (ViewGroup) getParent();
if (parentView == null)
return;
parentView.getWindowVisibleDisplayFrame (r);
int diff = parentView.getHeight() - (r.bottom - r.top);
// Arbitrary threshold, surely keyboard would take more than 20 pix.
if (diff < 20 && keyboardShown)
{
keyboardShown = false;
handleKeyboardHidden (view.host);
}
if (! keyboardShown && diff > 20)
if (diff < 20 && keyboardShown)
{
keyboardShown = false;
handleKeyboardHidden (view.host);
}
if (! keyboardShown && diff > 20)
keyboardShown = true;
};
};
private boolean keyboardShown;
};