bug 876689 - Virtual keyboard does not invoke on text input field focus if 'Don't keep activities' is enabled r=jchen

This commit is contained in:
Brad Lassey 2013-06-06 14:05:06 -04:00
parent 0614a12fea
commit a5ec74e1fb
6 changed files with 11 additions and 23 deletions

View File

@ -2243,10 +2243,6 @@ abstract public class GeckoApp
}
}
public LayerView getLayerView() {
return mLayerView;
}
public AbsoluteLayout getPluginContainer() { return mPluginContainer; }
// Accelerometer.

View File

@ -117,10 +117,7 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis
public void show(String aTitle, String aText, PromptListItem[] aMenuList, boolean aMultipleSelection) {
ThreadUtils.assertOnUiThread();
// treat actions that show a dialog as if preventDefault by content to prevent panning
if (mContext instanceof GeckoApp) {
((GeckoApp)mContext).getLayerView().abortPanning();
}
GeckoAppShell.getLayerView().abortPanning();
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
if (!TextUtils.isEmpty(aTitle)) {

View File

@ -36,7 +36,7 @@ public class RobocopAPI {
}
public void setDrawListener(GeckoLayerClient.DrawListener listener) {
mGeckoApp.getLayerView().getLayerClient().setDrawListener(listener);
GeckoAppShell.getLayerView().getLayerClient().setDrawListener(listener);
}
public Cursor querySql(String dbPath, String query) {

View File

@ -9,6 +9,7 @@ import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.util.EventDispatcher;
import org.mozilla.gecko.util.FloatUtils;
import org.mozilla.gecko.util.GeckoEventListener;
import org.mozilla.gecko.util.ThreadUtils;
import org.json.JSONArray;
import org.json.JSONException;
@ -29,8 +30,6 @@ class TextSelection extends Layer implements GeckoEventListener {
private float mViewTop;
private float mViewZoom;
private GeckoApp mActivity;
TextSelection(TextSelectionHandle startHandle,
TextSelectionHandle middleHandle,
TextSelectionHandle endHandle,
@ -40,7 +39,6 @@ class TextSelection extends Layer implements GeckoEventListener {
mMiddleHandle = middleHandle;
mEndHandle = endHandle;
mEventDispatcher = eventDispatcher;
mActivity = activity;
// Only register listeners if we have valid start/middle/end handles
if (mStartHandle == null || mMiddleHandle == null || mEndHandle == null) {
@ -70,7 +68,7 @@ class TextSelection extends Layer implements GeckoEventListener {
@Override
public void handleMessage(final String event, final JSONObject message) {
mActivity.runOnUiThread(new Runnable() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
try {
@ -84,12 +82,12 @@ class TextSelection extends Layer implements GeckoEventListener {
mViewLeft = 0.0f;
mViewTop = 0.0f;
mViewZoom = 0.0f;
LayerView layerView = mActivity.getLayerView();
LayerView layerView = GeckoAppShell.getLayerView();
if (layerView != null) {
layerView.addLayer(TextSelection.this);
}
} else if (event.equals("TextSelection:HideHandles")) {
LayerView layerView = mActivity.getLayerView();
LayerView layerView = GeckoAppShell.getLayerView();
if (layerView != null) {
layerView.removeLayer(TextSelection.this);
}
@ -135,7 +133,7 @@ class TextSelection extends Layer implements GeckoEventListener {
mViewTop = viewTop;
mViewZoom = viewZoom;
mActivity.runOnUiThread(new Runnable() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
mStartHandle.repositionWithViewport(viewLeft, viewTop, viewZoom);

View File

@ -43,12 +43,9 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
private static final int IMAGE_LEVEL_LTR = 0;
private static final int IMAGE_LEVEL_RTL = 1;
private GeckoApp mActivity;
public TextSelectionHandle(Context context, AttributeSet attrs) {
super(context, attrs);
setOnTouchListener(this);
mActivity = (GeckoApp) context;
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TextSelectionHandle);
int handleType = a.getInt(R.styleable.TextSelectionHandle_handleType, 0x01);
@ -76,7 +73,7 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
mTouchStartY = event.getY();
int[] rect = new int[2];
mActivity.getLayerView().getLocationOnScreen(rect);
GeckoAppShell.getLayerView().getLocationOnScreen(rect);
mLayerViewX = rect[0];
mLayerViewY = rect[1];
break;
@ -111,7 +108,7 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
mLeft = newX - mLayerViewX - mTouchStartX;
mTop = newY - mLayerViewY - mTouchStartY;
LayerView layerView = mActivity.getLayerView();
LayerView layerView = GeckoAppShell.getLayerView();
if (layerView == null) {
Log.e(LOGTAG, "Can't move selection because layerView is null");
return;
@ -142,7 +139,7 @@ class TextSelectionHandle extends ImageView implements View.OnTouchListener {
}
void positionFromGecko(int left, int top, boolean rtl) {
LayerView layerView = mActivity.getLayerView();
LayerView layerView = GeckoAppShell.getLayerView();
if (layerView == null) {
Log.e(LOGTAG, "Can't position handle because layerView is null");
return;

View File

@ -217,6 +217,6 @@ public class WebAppImpl extends GeckoApp {
@Override
protected void geckoConnected() {
super.geckoConnected();
getLayerView().setOverScrollMode(View.OVER_SCROLL_NEVER);
mLayerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
}
};