Hide ime in go to dialog
This commit is contained in:
1 parent
2d65b71fff
commit
e10172c09c
2 files changed
+11
No files matched your search
@@ -80,6 +80,7 @@ import com.hippo.rippleold.RippleSalon;
|
||||
import com.hippo.scene.Announcer;
|
||||
import com.hippo.scene.SceneFragment;
|
||||
import com.hippo.util.ApiHelper;
|
||||
import com.hippo.util.AppHelper;
|
||||
import com.hippo.util.DrawableManager;
|
||||
import com.hippo.view.ViewTransition;
|
||||
import com.hippo.widget.ContentLayout;
|
||||
@@ -807,6 +808,7 @@ public final class GalleryListScene extends BaseScene
|
||||
}
|
||||
builder.setError(null);
|
||||
mHelper.goTo(goTo);
|
||||
AppHelper.hideSoftInput(dialog);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.hippo.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.Service;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
@@ -86,4 +87,12 @@ public class AppHelper {
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void hideSoftInput(Dialog dialog) {
|
||||
View view = dialog.getCurrentFocus();
|
||||
if (view != null) {
|
||||
InputMethodManager imm = (InputMethodManager) dialog.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user