mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Hide softkeyboard when leaving uploads list view
This commit is contained in:
parent
be215f1dda
commit
dbca99f38e
2 changed files with 15 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import android.text.Editable;
|
|||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.*;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.wikimedia.commons;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
|
|
@ -11,6 +12,7 @@ import android.util.DisplayMetrics;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.*;
|
||||
import com.actionbarsherlock.app.SherlockFragment;
|
||||
import com.nostra13.universalimageloader.core.DisplayImageOptions;
|
||||
|
|
@ -86,6 +88,18 @@ public class MultipleUploadListFragment extends SherlockFragment {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
|
||||
// FIXME: Stops the keyboard from being shown 'stale' while
|
||||
View target = getView().findFocus();
|
||||
if (target != null) {
|
||||
InputMethodManager imm = (InputMethodManager) target.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(target.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Wrong result type
|
||||
private Point calculatePicDimension(int count) {
|
||||
DisplayMetrics screenMetrics = getResources().getDisplayMetrics();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue