Bug 1180295 - Update the FormAssistPopup to account for the new dynamic toolbar model. r=rbarker

--HG--
extra : commitid : GeBruH6hqiI
This commit is contained in:
Kartikaya Gupta 2015-08-18 14:27:20 -04:00
Родитель cf36c6c82f
Коммит 5d5556600e
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -1552,6 +1552,10 @@ public class BrowserApp extends GeckoApp
final float offset = getResources().getDimensionPixelOffset(R.dimen.progress_bar_scroll_offset);
final float progressTranslationY = Math.min(aToolbarTranslation, mToolbarHeight - offset);
ViewHelper.setTranslationY(progressView, -progressTranslationY);
if (mFormAssistPopup != null) {
mFormAssistPopup.onTranslationChanged();
}
}
@Override
@ -1560,8 +1564,9 @@ public class BrowserApp extends GeckoApp
return;
}
if (mFormAssistPopup != null)
if (mFormAssistPopup != null) {
mFormAssistPopup.onMetricsChanged(aMetrics);
}
}
@Override

Просмотреть файл

@ -5,6 +5,7 @@
package org.mozilla.gecko;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.gfx.FloatSize;
import org.mozilla.gecko.gfx.ImmutableViewportMetrics;
import org.mozilla.gecko.util.GeckoEventListener;
@ -284,12 +285,11 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene
}
float zoom = aMetrics.zoomFactor;
PointF offset = aMetrics.getMarginOffset();
// These values correspond to the input box for which we want to
// display the FormAssistPopup.
int left = (int) (mX * zoom - aMetrics.viewportRectLeft + offset.x);
int top = (int) (mY * zoom - aMetrics.viewportRectTop + offset.y);
int left = (int) (mX * zoom - aMetrics.viewportRectLeft);
int top = (int) (mY * zoom - aMetrics.viewportRectTop + ViewHelper.getTranslationY(GeckoAppShell.getLayerView()));
int width = (int) (mW * zoom);
int height = (int) (mH * zoom);
@ -383,6 +383,14 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene
broadcastGeckoEvent("FormAssist:Blocklisted", String.valueOf(blocklisted));
}
void onTranslationChanged() {
ThreadUtils.assertOnUiThread();
if (!isShown()) {
return;
}
positionAndShowPopup();
}
void onMetricsChanged(final ImmutableViewportMetrics aMetrics) {
if (!isShown()) {
return;