Package io.rong.imkit.utils
Class RongUtils
-
- All Implemented Interfaces:
public class RongUtils
-
-
Field Summary
Fields Modifier and Type Field Description public static int
screenWidth
public static int
screenHeight
public static int
screenMin
public static int
screenMax
public static float
density
public static float
scaleDensity
public static float
xdpi
public static float
ydpi
public static int
densityDpi
public static int
dialogWidth
public static int
statusbarheight
public static int
navbarheight
-
Constructor Summary
Constructors Constructor Description RongUtils()
-
Method Summary
Modifier and Type Method Description static int
dip2px(float dipValue)
static int
px2dip(float pxValue)
static int
getDialogWidth()
static void
init(Context context)
static void
GetInfo(Context context)
static int
getStatusBarHeight(Context context)
static int
getScreenWidth()
static int
getScreenHeight()
static int
getNavBarHeight(Context context)
static Drawable
getDrawable(Context context, String resource)
static Uri
getUriFromDrawableRes(Context context, int id)
static Bitmap
getResizedBitmap(Context context, Uri uri, int widthLimit, int heightLimit)
static int
getVideoDuration(Context context, String videoPath)
获取视频文件的时长(时间戳) static String
md5(Object object)
md5加密 static String
getAppName(Context context)
获取应用程序名称 static boolean
isDestroy(Activity activity)
static boolean
isLocationServiceEnabled(Context context)
检查是否开启定位服务 检查定位服务是否开启的方法在不同的系统版本上不一样 static boolean
phoneIsInUse(Context context)
是否正在通话中 static boolean
checkMicAvailable(Context context)
static int
getSaveKeyBoardHeight(Context context, int orientation)
static void
saveKeyboardHeight(Context context, int orientation, int height)
static boolean
checkSDKVersionAndTargetIsTIRAMISU(Context context)
static boolean
checkSDKVersionAndTargetIsUDC(Context context)
注意使用此判断要在 checkSDKVersionAndTargetIsTIRAMISU 判断之前 static void
fixAndroid8ActivityCrash(Activity activity)
-
-
Method Detail
-
dip2px
static int dip2px(float dipValue)
-
px2dip
static int px2dip(float pxValue)
-
getDialogWidth
static int getDialogWidth()
-
init
static void init(Context context)
-
GetInfo
static void GetInfo(Context context)
-
getStatusBarHeight
static int getStatusBarHeight(Context context)
-
getScreenWidth
static int getScreenWidth()
-
getScreenHeight
static int getScreenHeight()
-
getNavBarHeight
static int getNavBarHeight(Context context)
-
getDrawable
static Drawable getDrawable(Context context, String resource)
-
getUriFromDrawableRes
static Uri getUriFromDrawableRes(Context context, int id)
-
getResizedBitmap
static Bitmap getResizedBitmap(Context context, Uri uri, int widthLimit, int heightLimit)
-
getVideoDuration
static int getVideoDuration(Context context, String videoPath)
获取视频文件的时长(时间戳)
-
md5
static String md5(Object object)
md5加密
-
getAppName
@Deprecated() static String getAppName(Context context)
获取应用程序名称
-
isDestroy
static boolean isDestroy(Activity activity)
-
isLocationServiceEnabled
static boolean isLocationServiceEnabled(Context context)
检查是否开启定位服务
检查定位服务是否开启的方法在不同的系统版本上不一样
-
phoneIsInUse
static boolean phoneIsInUse(Context context)
是否正在通话中
-
checkMicAvailable
static boolean checkMicAvailable(Context context)
-
getSaveKeyBoardHeight
static int getSaveKeyBoardHeight(Context context, int orientation)
-
saveKeyboardHeight
static void saveKeyboardHeight(Context context, int orientation, int height)
-
checkSDKVersionAndTargetIsTIRAMISU
static boolean checkSDKVersionAndTargetIsTIRAMISU(Context context)
-
checkSDKVersionAndTargetIsUDC
static boolean checkSDKVersionAndTargetIsUDC(Context context)
注意使用此判断要在 checkSDKVersionAndTargetIsTIRAMISU 判断之前
- Parameters:
context
- 上下文- Returns:
系统版本和 targetVersion 都大于34
-
fixAndroid8ActivityCrash
static void fixAndroid8ActivityCrash(Activity activity)
-
-
-
-