@@ -0,0 +1,1695 @@
+/*%0A * Copyright (C) 2015, %E7%A8%8B%E5%BA%8F%E4%BA%A6%E9%9D%9E%E7%8C%BF%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage me.yifeiyuan.utils;%0A%0Aimport android.app.Activity;%0Aimport android.content.Context;%0Aimport android.support.annotation.NonNull;%0Aimport android.view.View;%0Aimport android.view.inputmethod.InputMethodManager;%0A%0A/**%0A * Created by %E7%A8%8B%E5%BA%8F%E4%BA%A6%E9%9D%9E%E7%8C%BF on 16/1/5.%0A *%0A *  %E9%9A%90%E8%97%8F/%E6%98%BE%E7%A4%BA%E8%BE%93%E5%85%A5%E6%B3%95%0A */%0Apublic class ImmUtils %7B%0A%0A    /**%0A     * %E9%9A%90%E8%97%8F%E8%BE%93%E5%85%A5%E6%B3%95%0A     * @param act activity%0A     */%0A    public static void hide(@NonNull Activity act) %7B%0A%0A        InputMethodManager imm = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);%0A        View view = act.getCurrentFocus();%0A        if (view != null) %7B%0A            imm.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);%0A        %7D%0A    %7D%0A%0A    /**%0A     * %E6%98%BE%E7%A4%BA%E8%BE%93%E5%85%A5%E6%B3%95%0A     * @param act activity%0A     */%0A    public static void show(@NonNull Activity act)%7B%0A        InputMethodManager imm = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);%0A        View view = act.getCurrentFocus();%0A        if (view != null) %7B%0A            imm.showSoftInputFromInputMethod(view.getWindowToken(),InputMethodManager.SHOW_IMPLICIT);%0A        %7D%0A    %7D%0A%0A%7D%0A

add immutils