Package cn.authing.guard.util
Class Util
- java.lang.Object
-
- cn.authing.guard.util.Util
-
public class Util extends Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static floatdp2px(Context context, float dp)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 StringgetAuthCode(String url)static StringgetHost(Config config)static StringgetLangHeader()static StringgetPassword(View current)static StringgetPhoneNumber(View current)static StringgetQueryParam(String url, String key)static intgetThemeAccentColor(Context context)static StringgetVerifyCode(View current)static List<Integer>intDigits(int i)static booleanisIp(String name)static booleanisNull(String s)static List<Country>loadCountries(Context context)static floatpx2dp(Context context, float px)static StringrandomString(int length)static voidsetErrorText(View view, String text)static Map<String,List<String>>splitQuery(URL url)static List<String>toStringList(JSONArray array)
-
-
-
Method Detail
-
dp2px
public static float dp2px(Context context, float dp)
-
px2dp
public static float px2dp(Context context, float px)
-
findChildViewByClass
public static View findChildViewByClass(ViewGroup parent, Class<?> T, boolean onlyVisible)
-
splitQuery
public static Map<String,List<String>> splitQuery(URL url) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getThemeAccentColor
public static int getThemeAccentColor(Context context)
-
randomString
public static String randomString(int length)
-
isNull
public static boolean isNull(String s)
-
getLangHeader
public static String getLangHeader()
-
isIp
public static boolean isIp(String name)
-
toStringList
public static List<String> toStringList(JSONArray array) throws JSONException
- Throws:
JSONException
-
-