Skip to content

Instantly share code, notes, and snippets.

@felHR85
Last active February 17, 2024 23:11
Show Gist options
  • Select an option

  • Save felHR85/6070f643d25f5a0b3674 to your computer and use it in GitHub Desktop.

Select an option

Save felHR85/6070f643d25f5a0b3674 to your computer and use it in GitHub Desktop.

Revisions

  1. felHR85 revised this gist Jan 5, 2015. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -112,7 +112,7 @@ private void initEditTexts(ViewGroup viewgroup)
    {
    EditText editText = (EditText) v;
    editText.setOnFocusChangeListener(this);
    editText.setCursorVisible(false);
    editText.setCursorVisible(true);
    editTextList.add(editText);
    }
    }
    @@ -210,6 +210,17 @@ public void run()
    // Now Keyboard is shown, keep checking layout dimensions until keyboard is gone
    while(currentBottomLocation != layoutBottom && started.get())
    {
    synchronized(this)
    {
    try
    {
    wait(500);
    } catch (InterruptedException e)
    {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }
    currentBottomLocation = getLayoutCoordinates();
    }

  2. felHR85 revised this gist Nov 8, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    /*
    * Author: Felipe Herranz ([email protected])
    * Contributors:Francesco Verheye ([email protected])
    * Israel Dominguez ([email protected])
    * Israel Dominguez ([email protected])
    */
    import java.util.ArrayList;
    import java.util.List;
  3. felHR85 revised this gist Nov 8, 2014. 1 changed file with 15 additions and 8 deletions.
    23 changes: 15 additions & 8 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    /*
    * Author: Felipe Herranz ([email protected])
    * Contributors: Francesco Verheye ([email protected])
    */
    * Contributors:Francesco Verheye ([email protected])
    * Israel Dominguez ([email protected])
    */
    import java.util.ArrayList;
    import java.util.List;
    import java.util.concurrent.atomic.AtomicBoolean;
    @@ -117,16 +118,22 @@ private void initEditTexts(ViewGroup viewgroup)
    }
    }


    /*
    * OnFocusChange does update tempView correctly now when keyboard is still shown
    * Thanks to Israel Dominguez ([email protected])
    */
    @Override
    public void onFocusChange(View v, boolean hasFocus)
    {
    if(hasFocus && !isKeyboardShow)
    {
    if(hasFocus)
    {
    layoutBottom = getLayoutCoordinates();
    softKeyboardThread.keyboardOpened();
    isKeyboardShow = true;
    tempView = v;
    if(!isKeyboardShow)
    {
    layoutBottom = getLayoutCoordinates();
    softKeyboardThread.keyboardOpened();
    isKeyboardShow = true;
    }
    }
    }

  4. felHR85 revised this gist Oct 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    /*
    * Author: Felipe Herranz ([email protected])
    * Contributors:Francesco Verheye ([email protected])
    * Contributors: Francesco Verheye ([email protected])
    */
    import java.util.ArrayList;
    import java.util.List;
  5. felHR85 revised this gist Oct 7, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions SoftKeyboardHideShow.java
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    /*
    * Android Manifest: android:windowSoftInputMode="adjustResize"
    */

    /*
    Somewhere else in your code
    */
  6. felHR85 revised this gist Oct 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -111,7 +111,7 @@ private void initEditTexts(ViewGroup viewgroup)
    {
    EditText editText = (EditText) v;
    editText.setOnFocusChangeListener(this);
    //editText.setCursorVisible(false);
    editText.setCursorVisible(false);
    editTextList.add(editText);
    }
    }
  7. felHR85 revised this gist Oct 7, 2014. 1 changed file with 26 additions and 9 deletions.
    35 changes: 26 additions & 9 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    /*
    * Author: Felipe Herranz ([email protected])
    * Contributors:Francesco Verheye ([email protected])
    */
    import java.util.ArrayList;
    import java.util.List;
    import java.util.concurrent.atomic.AtomicBoolean;
    @@ -27,7 +31,7 @@ public SoftKeyboard(ViewGroup layout, InputMethodManager im)
    {
    this.layout = layout;
    keyboardHideByDefault();
    initEditTexts();
    initEditTexts(layout);
    this.im = im;
    this.coords = new int[2];
    this.isKeyboardShow = false;
    @@ -84,23 +88,36 @@ private void keyboardHideByDefault()
    layout.setFocusableInTouchMode(true);
    }

    private void initEditTexts()
    /*
    * InitEditTexts now handles EditTexts in nested views
    * Thanks to Francesco Verheye ([email protected])
    */
    private void initEditTexts(ViewGroup viewgroup)
    {
    editTextList = new ArrayList<EditText>();
    int childCount = layout.getChildCount();
    for(int i=0;i<=childCount -1;i++)
    if(editTextList == null)
    editTextList = new ArrayList<EditText>();

    int childCount = viewgroup.getChildCount();
    for(int i=0; i<= childCount-1;i++)
    {
    View v = layout.getChildAt(i);
    if(v instanceof EditText)
    View v = viewgroup.getChildAt(i);

    if(v instanceof ViewGroup)
    {
    initEditTexts((ViewGroup) v);
    }

    if(v instanceof EditText)
    {
    EditText editText = (EditText) v;
    editText.setOnFocusChangeListener(this);
    editText.setCursorVisible(false);
    //editText.setCursorVisible(false);
    editTextList.add(editText);
    }
    }
    }



    @Override
    public void onFocusChange(View v, boolean hasFocus)
    {
  8. felHR85 revised this gist Sep 3, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SoftKeyboardHideShow.java
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,7 @@ public void onSoftKeyboardShow()
    softKeyboard.closeSoftKeyboard();

    /* Prevent memory leaks:
    */
    @Override
    public void onDestroy()
    {
  9. felHR85 revised this gist Sep 3, 2014. 2 changed files with 37 additions and 11 deletions.
    38 changes: 28 additions & 10 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    import java.util.ArrayList;
    import java.util.List;
    import java.util.concurrent.atomic.AtomicBoolean;

    import android.os.Handler;
    import android.os.Message;
    @@ -60,6 +61,11 @@ public void setSoftKeyboardCallback(SoftKeyboardChanged mCallback)
    softKeyboardThread.setCallback(mCallback);
    }

    public void unRegisterSoftKeyboardCallback()
    {
    softKeyboardThread.stopThread();
    }

    public interface SoftKeyboardChanged
    {
    public void onSoftKeyboardHide();
    @@ -128,12 +134,12 @@ public void handleMessage(Message m)

    private class SoftKeyboardChangesThread extends Thread
    {
    private boolean started;
    private AtomicBoolean started;
    private SoftKeyboardChanged mCallback;

    public SoftKeyboardChangesThread()
    {
    this.started = true;
    started = new AtomicBoolean(true);
    }

    public void setCallback(SoftKeyboardChanged mCallback)
    @@ -144,7 +150,7 @@ public void setCallback(SoftKeyboardChanged mCallback)
    @Override
    public void run()
    {
    while(started)
    while(started.get())
    {
    // Wait until keyboard is requested to open
    synchronized(this)
    @@ -161,35 +167,38 @@ public void run()
    int currentBottomLocation = getLayoutCoordinates();

    // There is some lag between open soft-keyboard function and when it really appears.
    while(currentBottomLocation == layoutBottom)
    while(currentBottomLocation == layoutBottom && started.get())
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    mCallback.onSoftKeyboardShow();
    if(started.get())
    mCallback.onSoftKeyboardShow();

    // When keyboard is opened from EditText, initial bottom location is greater than layoutBottom
    // and at some moment equals layoutBottom.
    // That broke the previous logic, so I added this new loop to handle this.
    while(currentBottomLocation >= layoutBottom)
    while(currentBottomLocation >= layoutBottom && started.get())
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    // Now Keyboard is shown, keep checking layout dimensions until keyboard is gone
    while(currentBottomLocation != layoutBottom)
    while(currentBottomLocation != layoutBottom && started.get())
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    mCallback.onSoftKeyboardHide();
    if(started.get())
    mCallback.onSoftKeyboardHide();

    // if keyboard has been opened clicking and EditText.
    if(isKeyboardShow)
    if(isKeyboardShow && started.get())
    isKeyboardShow = false;

    // if an EditText is focused, remove its focus (on UI thread)
    mHandler.obtainMessage(CLEAR_FOCUS).sendToTarget();
    if(started.get())
    mHandler.obtainMessage(CLEAR_FOCUS).sendToTarget();
    }
    }

    @@ -200,6 +209,15 @@ public void keyboardOpened()
    notify();
    }
    }

    public void stopThread()
    {
    synchronized(this)
    {
    started.set(false);
    notify();
    }
    }

    }
    }
    10 changes: 9 additions & 1 deletion SoftKeyboardHideShow.java
    Original file line number Diff line number Diff line change
    @@ -29,4 +29,12 @@ public void onSoftKeyboardShow()
    Open or close the soft keyboard easily
    */
    softKeyboard.openSoftKeyboard();
    softKeyboard.closeSoftKeyboard();
    softKeyboard.closeSoftKeyboard();

    /* Prevent memory leaks:
    @Override
    public void onDestroy()
    {
    super.onDestroy();
    softKeyboard.unRegisterSoftKeyboardCallback();
    }
  10. felHR85 revised this gist Jun 15, 2014. 2 changed files with 88 additions and 12 deletions.
    98 changes: 87 additions & 11 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,32 @@
    import java.util.ArrayList;
    import java.util.List;

    import android.os.Handler;
    import android.os.Message;
    import android.view.View;
    import android.view.ViewGroup;
    import android.view.inputmethod.InputMethodManager;

    public class SoftKeyboard
    import android.widget.EditText;

    public class SoftKeyboard implements View.OnFocusChangeListener
    {
    private View layout;
    private static final int CLEAR_FOCUS = 0;

    private ViewGroup layout;
    private int layoutBottom;
    private InputMethodManager im;
    private int[] coords;
    private boolean isKeyboardShow;
    private SoftKeyboardChangesThread softKeyboardThread;
    private List<EditText> editTextList;

    private View tempView; // reference to a focused EditText

    public SoftKeyboard(View layout, InputMethodManager im)
    public SoftKeyboard(ViewGroup layout, InputMethodManager im)
    {
    this.layout = layout;
    keyboardHideByDefault();
    keyboardHideByDefault();
    initEditTexts();
    this.im = im;
    this.coords = new int[2];
    this.isKeyboardShow = false;
    @@ -58,13 +71,61 @@ private int getLayoutCoordinates()
    layout.getLocationOnScreen(coords);
    return coords[1] + layout.getHeight();
    }

    private void keyboardHideByDefault()
    private void keyboardHideByDefault()
    {
    layout.setFocusable(true);
    layout.setFocusableInTouchMode(true);
    }

    private void initEditTexts()
    {
    editTextList = new ArrayList<EditText>();
    int childCount = layout.getChildCount();
    for(int i=0;i<=childCount -1;i++)
    {
    View v = layout.getChildAt(i);
    if(v instanceof EditText)
    {
    EditText editText = (EditText) v;
    editText.setOnFocusChangeListener(this);
    editText.setCursorVisible(false);
    editTextList.add(editText);
    }
    }
    }

    @Override
    public void onFocusChange(View v, boolean hasFocus)
    {
    if(hasFocus && !isKeyboardShow)
    {
    layoutBottom = getLayoutCoordinates();
    softKeyboardThread.keyboardOpened();
    isKeyboardShow = true;
    tempView = v;
    }
    }

    // This handler will clear focus of selected EditText
    private final Handler mHandler = new Handler()
    {
    @Override
    public void handleMessage(Message m)
    {
    switch(m.what)
    {
    case CLEAR_FOCUS:
    if(tempView != null)
    {
    tempView.clearFocus();
    tempView = null;
    }
    break;
    }
    }
    };

    private class SoftKeyboardChangesThread extends Thread
    {
    private boolean started;
    @@ -85,6 +146,7 @@ public void run()
    {
    while(started)
    {
    // Wait until keyboard is requested to open
    synchronized(this)
    {
    try
    @@ -97,6 +159,7 @@ public void run()
    }

    int currentBottomLocation = getLayoutCoordinates();

    // There is some lag between open soft-keyboard function and when it really appears.
    while(currentBottomLocation == layoutBottom)
    {
    @@ -105,15 +168,29 @@ public void run()

    mCallback.onSoftKeyboardShow();

    // When keyboard is opened from EditText, initial bottom location is greater than layoutBottom
    // and at some moment equals layoutBottom.
    // That broke the previous logic, so I added this new loop to handle this.
    while(currentBottomLocation >= layoutBottom)
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    // Now Keyboard is shown, keep checking layout dimensions until keyboard is gone
    while(currentBottomLocation != layoutBottom)
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    mCallback.onSoftKeyboardHide();
    }


    // if keyboard has been opened clicking and EditText.
    if(isKeyboardShow)
    isKeyboardShow = false;

    // if an EditText is focused, remove its focus (on UI thread)
    mHandler.obtainMessage(CLEAR_FOCUS).sendToTarget();
    }
    }

    public void keyboardOpened()
    @@ -125,5 +202,4 @@ public void keyboardOpened()
    }

    }

    }
    }
    2 changes: 1 addition & 1 deletion SoftKeyboardHideShow.java
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    /*
    Somewhere else in your code
    */
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You can use whatever View, but must be the view root (Tipically your Layout root)
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You must use the layout root
    InputMethodManager im = (InputMethodManager) getSystemService(Service.INPUT_METHOD_SERVICE);

    /*
  11. felHR85 revised this gist Jun 14, 2014. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,7 @@ public class SoftKeyboard
    public SoftKeyboard(View layout, InputMethodManager im)
    {
    this.layout = layout;
    keyboardHideByDefault();
    this.im = im;
    this.coords = new int[2];
    this.isKeyboardShow = false;
    @@ -57,6 +58,12 @@ private int getLayoutCoordinates()
    layout.getLocationOnScreen(coords);
    return coords[1] + layout.getHeight();
    }

    private void keyboardHideByDefault()
    {
    layout.setFocusable(true);
    layout.setFocusableInTouchMode(true);
    }

    private class SoftKeyboardChangesThread extends Thread
    {
  12. felHR85 revised this gist Jun 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SoftKeyboardHideShow.java
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    /*
    Somewhere else in your code
    */
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You can use this snippet with whatever kind of View
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You can use whatever View, but must be the view root (Tipically your Layout root)
    InputMethodManager im = (InputMethodManager) getSystemService(Service.INPUT_METHOD_SERVICE);

    /*
  13. felHR85 revised this gist Jun 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ public void closeSoftKeyboard()
    {
    if(isKeyboardShow)
    {
    im.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
    im.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
    isKeyboardShow = false;
    }
    }
  14. felHR85 revised this gist Jun 14, 2014. 1 changed file with 14 additions and 5 deletions.
    19 changes: 14 additions & 5 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -7,29 +7,38 @@ public class SoftKeyboard
    private int layoutBottom;
    private InputMethodManager im;
    private int[] coords;
    private boolean isKeyboardShow;
    private SoftKeyboardChangesThread softKeyboardThread;

    public SoftKeyboard(View layout, InputMethodManager im)
    {
    this.layout = layout;
    this.im = im;
    this.coords = new int[2];
    this.isKeyboardShow = false;
    this.softKeyboardThread = new SoftKeyboardChangesThread();
    this.softKeyboardThread.start();
    }


    public void openSoftKeyboard()
    {
    layoutBottom = getLayoutCoordinates();
    im.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
    softKeyboardThread.keyboardOpened();

    if(!isKeyboardShow)
    {
    layoutBottom = getLayoutCoordinates();
    im.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
    softKeyboardThread.keyboardOpened();
    isKeyboardShow = true;
    }
    }

    public void closeSoftKeyboard()
    {
    im.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
    if(isKeyboardShow)
    {
    im.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
    isKeyboardShow = false;
    }
    }

    public void setSoftKeyboardCallback(SoftKeyboardChanged mCallback)
  15. felHR85 renamed this gist May 5, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  16. felHR85 revised this gist May 4, 2014. 1 changed file with 29 additions and 32 deletions.
    61 changes: 29 additions & 32 deletions Example.java
    Original file line number Diff line number Diff line change
    @@ -1,35 +1,32 @@
    /*
    Somewhere else in your code
    */
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You can use this snippet with whatever kind of View object you want, I would use main layout anyways
    InputMethodManager im = (InputMethodManager) getSystemService(Service.INPUT_METHOD_SERVICE);
    /*
    Somewhere else in your code
    */
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You can use this snippet with whatever kind of View
    InputMethodManager im = (InputMethodManager) getSystemService(Service.INPUT_METHOD_SERVICE);

    /*
    Instantiate and pass a callback
    */
    SoftKeyboard softKeyboard;
    softKeyboard = new SoftKeyboard(mainLayout, im);
    softKeyboard.setSoftKeyboardCallback(new SoftKeyboard.SoftKeyboardChanged()
    /*
    Instantiate and pass a callback
    */
    SoftKeyboard softKeyboard;
    softKeyboard = new SoftKeyboard(mainLayout, im);
    softKeyboard.setSoftKeyboardCallback(new SoftKeyboard.SoftKeyboardChanged()
    {

    @Override
    public void onSoftKeyboardHide()
    {

    @Override
    public void onSoftKeyboardHide()
    {
    // Code here
    }

    @Override
    public void onSoftKeyboardShow()
    {
    // Code here
    }
    });

    /*
    Open or close the soft keyboard easily
    */
    softKeyboard.openSoftKeyboard();
    softKeyboard.closeSoftKeyboard();

    // Code here
    }

    @Override
    public void onSoftKeyboardShow()
    {
    // Code here
    }
    });


    /*
    Open or close the soft keyboard easily
    */
    softKeyboard.openSoftKeyboard();
    softKeyboard.closeSoftKeyboard();
  17. felHR85 created this gist May 4, 2014.
    35 changes: 35 additions & 0 deletions Example.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    /*
    Somewhere else in your code
    */
    RelativeLayout mainLayout = findViewById(R.layout.main_layout); // You can use this snippet with whatever kind of View object you want, I would use main layout anyways
    InputMethodManager im = (InputMethodManager) getSystemService(Service.INPUT_METHOD_SERVICE);

    /*
    Instantiate and pass a callback
    */
    SoftKeyboard softKeyboard;
    softKeyboard = new SoftKeyboard(mainLayout, im);
    softKeyboard.setSoftKeyboardCallback(new SoftKeyboard.SoftKeyboardChanged()
    {

    @Override
    public void onSoftKeyboardHide()
    {
    // Code here
    }

    @Override
    public void onSoftKeyboardShow()
    {
    // Code here
    }
    });

    /*
    Open or close the soft keyboard easily
    */
    softKeyboard.openSoftKeyboard();
    softKeyboard.closeSoftKeyboard();



    113 changes: 113 additions & 0 deletions SoftKeyboard.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,113 @@
    import android.view.View;
    import android.view.inputmethod.InputMethodManager;

    public class SoftKeyboard
    {
    private View layout;
    private int layoutBottom;
    private InputMethodManager im;
    private int[] coords;
    private SoftKeyboardChangesThread softKeyboardThread;

    public SoftKeyboard(View layout, InputMethodManager im)
    {
    this.layout = layout;
    this.im = im;
    this.coords = new int[2];
    this.softKeyboardThread = new SoftKeyboardChangesThread();
    this.softKeyboardThread.start();
    }


    public void openSoftKeyboard()
    {
    layoutBottom = getLayoutCoordinates();
    im.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
    softKeyboardThread.keyboardOpened();

    }

    public void closeSoftKeyboard()
    {
    im.toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
    }

    public void setSoftKeyboardCallback(SoftKeyboardChanged mCallback)
    {
    softKeyboardThread.setCallback(mCallback);
    }

    public interface SoftKeyboardChanged
    {
    public void onSoftKeyboardHide();
    public void onSoftKeyboardShow();
    }

    private int getLayoutCoordinates()
    {
    layout.getLocationOnScreen(coords);
    return coords[1] + layout.getHeight();
    }

    private class SoftKeyboardChangesThread extends Thread
    {
    private boolean started;
    private SoftKeyboardChanged mCallback;

    public SoftKeyboardChangesThread()
    {
    this.started = true;
    }

    public void setCallback(SoftKeyboardChanged mCallback)
    {
    this.mCallback = mCallback;
    }

    @Override
    public void run()
    {
    while(started)
    {
    synchronized(this)
    {
    try
    {
    wait();
    } catch (InterruptedException e)
    {
    e.printStackTrace();
    }
    }

    int currentBottomLocation = getLayoutCoordinates();
    // There is some lag between open soft-keyboard function and when it really appears.
    while(currentBottomLocation == layoutBottom)
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    mCallback.onSoftKeyboardShow();

    // Now Keyboard is shown, keep checking layout dimensions until keyboard is gone
    while(currentBottomLocation != layoutBottom)
    {
    currentBottomLocation = getLayoutCoordinates();
    }

    mCallback.onSoftKeyboardHide();
    }

    }

    public void keyboardOpened()
    {
    synchronized(this)
    {
    notify();
    }
    }

    }

    }