bug 988471 - Action bar icons flicker while typing and scrolling with an active text selection r=wesj

--HG--
extra : rebase_source : b9bbd4197944a0efb678eb6643b911455dcc035f
This commit is contained in:
Brad Lassey 2014-04-03 10:47:07 -04:00
parent c4164eeb6a
commit 671d64c3a0

View File

@ -44,6 +44,8 @@ class TextSelection extends Layer implements GeckoEventListener {
private float mViewTop;
private float mViewZoom;
private String mCurrentItems;
private TextSelectionActionModeCallback mCallback;
// These timers are used to avoid flicker caused by selection handles showing/hiding quickly. For isntance
@ -164,6 +166,12 @@ class TextSelection extends Layer implements GeckoEventListener {
}
private void showActionMode(final JSONArray items) {
String itemsString = items.toString();
if (itemsString.equals(mCurrentItems)) {
return;
}
mCurrentItems = itemsString;
if (mCallback != null) {
mCallback.updateItems(items);
return;
@ -183,6 +191,7 @@ class TextSelection extends Layer implements GeckoEventListener {
final ActionModeCompat.Presenter presenter = (ActionModeCompat.Presenter) context;
presenter.endActionModeCompat();
}
mCurrentItems = null;
}
@Override