Add comment gallery, add Announcer
This commit is contained in:
1 parent
596966b4ab
commit
875509be68
18 files changed
+497
-55
No files matched your search
@@ -17,11 +17,15 @@
|
||||
package com.hippo.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Service;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.hippo.ehviewer.R;
|
||||
@@ -62,4 +66,24 @@ public class ActivityHelper {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void showSoftInput(Context context, View view) {
|
||||
showSoftInput(context, view, true);
|
||||
}
|
||||
|
||||
public static void showSoftInput(Context context, View view, boolean requestFocus) {
|
||||
if (requestFocus) {
|
||||
view.requestFocus();
|
||||
}
|
||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Service.INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(view, 0);
|
||||
}
|
||||
|
||||
public static void hideSoftInput(Activity activity) {
|
||||
View view = activity.getCurrentFocus();
|
||||
if (view != null) {
|
||||
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user