import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
import com.android.printspooler.R;
/**
mSummaryContent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mDraggableContent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mMoreOptionsContainer.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ ensureImeClosedAndInputFocusCleared();
}
if ((mDragProgress > 0 && progress == 0)
|| (mDragProgress < 1.0f && progress == 1.0f)) {
}
}
+ private void ensureImeClosedAndInputFocusCleared() {
+ View focus = findFocus();
+ if (focus != null) {
+ InputMethodManager imm = (InputMethodManager) mContext.getSystemService(
+ Context.INPUT_METHOD_SERVICE);
+ if (imm.isActive(focus)) {
+ imm.hideSoftInputFromWindow(getWindowToken(), 0);
+ }
+ focus.clearFocus();
+ }
+ }
+
private final class DragCallbacks extends ViewDragHelper.Callback {
@Override
public boolean tryCaptureView(View child, int pointerId) {