类 Util
- java.lang.Object
-
- cn.authing.guard.util.Util
-
public class Util extends Object
-
-
构造器概要
构造器 构造器 说明 Util()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidbiometricBind(AuthActivity activity)static floatdp2px(Context context, float dp)static StringencodeBase64URL(byte[] bytes)static StringencryptPassword(String password)static List<View>findAllViewByClass(View current, Class<?> T)static ViewfindChildViewByClass(ViewGroup parent, Class<?> T, boolean onlyVisible)static ViewfindViewByClass(View current, Class<?> T)static ViewfindViewByClass(View current, Class<?> T, boolean onlyVisible)static StringgetAccount(View current)static StringgetAppLanguage()static StringgetAuthCode(String url)static StringgetEmail(View current)static StringgetHost(Config config)static StringgetIdentifierHost(Config config)static StringgetLabel(Config config, String name)获取字段名称static StringgetLangHeader()static StringgetPassword(View current)static StringgetPhoneCountryCode(View current)static StringgetPhoneCountryCodeByCache(Context context)static StringgetPhoneNumber(View current)static StringgetQueryParam(String url, String key)static intgetThemeAccentColor(Context context)static StringgetTimeString()static StringgetUserName(UserInfo userInfo)static StringgetVerifyCode(View current)static voidhideKeyboard(Activity activity)static List<Integer>intDigits(int i)static booleanisCn()static booleanisEn()static booleanisIp(String name)static booleanisNull(String s)static List<Country>loadCountryList(Context context)static voidloginSuccess(Activity activity, UserInfo userInfo)登录成功逻辑统一处理static voidopenSettingUI(Activity activity)static JSONObjectpareUnderLine(JSONObject object)static voidpushCid(Context context)static floatpx2dp(Context context, float px)static intpx2sp(Context context, float px)static voidquitActivity()static StringrandomString(int length)static voidsetErrorText(View view, String text)static voidsetStatusBarColor(Activity activity, int colorResId)static booleanshouldCompleteAfterLogin(Config config)static intsp2px(Context context, float sp)static Map<String,List<String>>splitQuery(URI url)static List<String>toStringList(JSONArray array)static StringunderlineToHump(String str)
-
-
-
方法详细资料
-
dp2px
public static float dp2px(Context context, float dp)
-
px2dp
public static float px2dp(Context context, float px)
-
sp2px
public static int sp2px(Context context, float sp)
-
px2sp
public static int px2sp(Context context, float px)
-
findChildViewByClass
public static View findChildViewByClass(ViewGroup parent, Class<?> T, boolean onlyVisible)
-
splitQuery
public static Map<String,List<String>> splitQuery(URI url) throws UnsupportedEncodingException
-
getThemeAccentColor
public static int getThemeAccentColor(Context context)
-
randomString
public static String randomString(int length)
-
isNull
public static boolean isNull(String s)
-
isCn
public static boolean isCn()
-
isEn
public static boolean isEn()
-
getAppLanguage
public static String getAppLanguage()
-
getLangHeader
public static String getLangHeader()
-
isIp
public static boolean isIp(String name)
-
toStringList
public static List<String> toStringList(JSONArray array) throws JSONException
- 抛出:
JSONException
-
setStatusBarColor
public static void setStatusBarColor(Activity activity, int colorResId)
-
openSettingUI
public static void openSettingUI(Activity activity)
-
hideKeyboard
public static void hideKeyboard(Activity activity)
-
pareUnderLine
public static JSONObject pareUnderLine(JSONObject object)
-
shouldCompleteAfterLogin
public static boolean shouldCompleteAfterLogin(Config config)
-
getTimeString
public static String getTimeString()
-
pushCid
public static void pushCid(Context context)
-
encodeBase64URL
public static String encodeBase64URL(byte[] bytes)
-
biometricBind
public static void biometricBind(AuthActivity activity)
-
quitActivity
public static void quitActivity()
-
-