Fixed a bug where keyboard wouldn't hide correctly on ICS

pull/14/head
Sam Bosley 12 years ago
parent 6e0de0a375
commit d3929f2004

@ -23,6 +23,7 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
@ -99,6 +100,7 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
public void onClick(View v) {
mainMenu.setSelected(true);
mainMenuPopover.show(v);
hideKeyboard();
}
};
@ -107,6 +109,7 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
public void onClick(View v) {
setListsDropdownSelected(true);
listsPopover.show(v);
hideKeyboard();
}
};
@ -693,6 +696,15 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
return mainMenuPopover;
}
private void hideKeyboard() {
TaskListFragment tlf = getTaskListFragment();
if (tlf == null)
return;
InputMethodManager imm = (InputMethodManager)getSystemService(
Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(tlf.quickAddBar.getQuickAddBox().getWindowToken(), 0);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU) {

Loading…
Cancel
Save