java
魑魅魍魉都是鬼
懒
展开
-
Android 常见问题五:dp-px转换
package com.zqq.shell.utils;import android.content.Context;import android.util.TypedValue;public class DpUtils { public static float px2dp(Context context, float px){ float density = context.getResources().getDisplayMetrics().density;原创 2021-03-29 18:14:35 · 161 阅读 · 0 评论 -
Android 常见问题二:创建MyApplication
一、MyApplication单例java 常见单例模式单例模式import android.util.Log;public class Car { /** * 饿汉式 * 线程安全 */ private static Car car=new Car(); public static Car getInstance(){ return car; } /** * 懒汉式 * 线程安全,效率稍低原创 2021-03-29 16:07:17 · 2810 阅读 · 0 评论 -
代理模式
原创 2019-12-25 15:35:00 · 60 阅读 · 0 评论