@@ -0,0 +1,1559 @@
+/*%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.content.Context;%0Aimport android.util.DisplayMetrics;%0Aimport android.view.WindowManager;%0A%0A/**%0A * Created by %E7%A8%8B%E5%BA%8F%E4%BA%A6%E9%9D%9E%E7%8C%BF on 16/1/7.%0A */%0Apublic class ScreenUtil %7B%0A%0A    /**%0A     * %E8%8E%B7%E5%BE%97%E5%B1%8F%E5%B9%95%E9%AB%98%E5%BA%A6%0A     *%0A     * @param context%0A     * @return%0A     */%0A    public static int getScreenWidth(Context context) %7B%0A        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);%0A        DisplayMetrics outMetrics = new DisplayMetrics();%0A        wm.getDefaultDisplay().getMetrics(outMetrics);%0A        return outMetrics.widthPixels;%0A    %7D%0A%0A    /**%0A     * %E8%8E%B7%E5%BE%97%E5%B1%8F%E5%B9%95%E5%AE%BD%E5%BA%A6%0A     *%0A     * @param context%0A     * @return%0A     */%0A    public static int getScreenHeight(Context context) %7B%0A        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);%0A        DisplayMetrics outMetrics = new DisplayMetrics();%0A        wm.getDefaultDisplay().getMetrics(outMetrics);%0A        return outMetrics.heightPixels;%0A    %7D%0A%7D%0A

add Screenutil