类 Util


  • public class Util
    extends java.lang.Object
    • 构造器概要

      构造器 
      构造器 说明
      Util()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static float dp2px​(android.content.Context context, float dp)  
      static java.lang.String encryptPassword​(java.lang.String password)  
      static java.util.List<android.view.View> findAllViewByClass​(android.view.View current, java.lang.Class<?> T)  
      static android.view.View findChildViewByClass​(android.view.ViewGroup parent, java.lang.Class<?> T, boolean onlyVisible)  
      static android.view.View findViewByClass​(android.view.View current, java.lang.Class<?> T)  
      static android.view.View findViewByClass​(android.view.View current, java.lang.Class<?> T, boolean onlyVisible)  
      static java.lang.String getAccount​(android.view.View current)  
      static java.lang.String getAppLanguage()  
      static java.lang.String getAuthCode​(java.lang.String url)  
      static java.lang.String getHost​(Config config)  
      static java.lang.String getLabel​(Config config, java.lang.String name)
      获取字段名称
      static java.lang.String getLangHeader()  
      static java.lang.String getPassword​(android.view.View current)  
      static java.lang.String getPhoneCountryCode​(android.view.View current)  
      static java.lang.String getPhoneCountryCodeByCache​(android.content.Context context)  
      static java.lang.String getPhoneNumber​(android.view.View current)  
      static java.lang.String getQueryParam​(java.lang.String url, java.lang.String key)  
      static int getThemeAccentColor​(android.content.Context context)  
      static java.lang.String getVerifyCode​(android.view.View current)  
      static java.util.List<java.lang.Integer> intDigits​(int i)  
      static boolean isCn()  
      static boolean isIp​(java.lang.String name)  
      static boolean isNull​(java.lang.String s)  
      static java.util.List<Country> loadCountryList​(android.content.Context context)  
      static org.json.JSONObject pareUnderLine​(org.json.JSONObject object)  
      static float px2dp​(android.content.Context context, float px)  
      static int px2sp​(android.content.Context context, float px)  
      static java.lang.String randomString​(int length)  
      static void setErrorText​(android.view.View view, java.lang.String text)  
      static void setStatusBarColor​(android.app.Activity activity, int colorResId)  
      static int sp2px​(android.content.Context context, float sp)  
      static java.util.Map<java.lang.String,​java.util.List<java.lang.String>> splitQuery​(java.net.URI url)  
      static java.util.List<java.lang.String> toStringList​(org.json.JSONArray array)  
      static java.lang.String underlineToHump​(java.lang.String str)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Util

        public Util()
    • 方法详细资料

      • dp2px

        public static float dp2px​(android.content.Context context,
                                  float dp)
      • px2dp

        public static float px2dp​(android.content.Context context,
                                  float px)
      • sp2px

        public static int sp2px​(android.content.Context context,
                                float sp)
      • px2sp

        public static int px2sp​(android.content.Context context,
                                float px)
      • encryptPassword

        public static java.lang.String encryptPassword​(java.lang.String password)
      • intDigits

        public static java.util.List<java.lang.Integer> intDigits​(int i)
      • findAllViewByClass

        public static java.util.List<android.view.View> findAllViewByClass​(android.view.View current,
                                                                           java.lang.Class<?> T)
      • findViewByClass

        public static android.view.View findViewByClass​(android.view.View current,
                                                        java.lang.Class<?> T)
      • findViewByClass

        public static android.view.View findViewByClass​(android.view.View current,
                                                        java.lang.Class<?> T,
                                                        boolean onlyVisible)
      • findChildViewByClass

        public static android.view.View findChildViewByClass​(android.view.ViewGroup parent,
                                                             java.lang.Class<?> T,
                                                             boolean onlyVisible)
      • getAccount

        public static java.lang.String getAccount​(android.view.View current)
      • getPhoneNumber

        public static java.lang.String getPhoneNumber​(android.view.View current)
      • getPhoneCountryCode

        public static java.lang.String getPhoneCountryCode​(android.view.View current)
      • getPhoneCountryCodeByCache

        public static java.lang.String getPhoneCountryCodeByCache​(android.content.Context context)
      • getPassword

        public static java.lang.String getPassword​(android.view.View current)
      • getVerifyCode

        public static java.lang.String getVerifyCode​(android.view.View current)
      • setErrorText

        public static void setErrorText​(android.view.View view,
                                        java.lang.String text)
      • splitQuery

        public static java.util.Map<java.lang.String,​java.util.List<java.lang.String>> splitQuery​(java.net.URI url)
                                                                                                 throws java.io.UnsupportedEncodingException
        抛出:
        java.io.UnsupportedEncodingException
      • getAuthCode

        public static java.lang.String getAuthCode​(java.lang.String url)
      • getQueryParam

        public static java.lang.String getQueryParam​(java.lang.String url,
                                                     java.lang.String key)
      • getThemeAccentColor

        public static int getThemeAccentColor​(android.content.Context context)
      • randomString

        public static java.lang.String randomString​(int length)
      • isNull

        public static boolean isNull​(java.lang.String s)
      • loadCountryList

        public static java.util.List<Country> loadCountryList​(android.content.Context context)
      • isCn

        public static boolean isCn()
      • getAppLanguage

        public static java.lang.String getAppLanguage()
      • getLangHeader

        public static java.lang.String getLangHeader()
      • isIp

        public static boolean isIp​(java.lang.String name)
      • getHost

        public static java.lang.String getHost​(Config config)
      • toStringList

        public static java.util.List<java.lang.String> toStringList​(org.json.JSONArray array)
                                                             throws org.json.JSONException
        抛出:
        org.json.JSONException
      • setStatusBarColor

        public static void setStatusBarColor​(android.app.Activity activity,
                                             int colorResId)
      • pareUnderLine

        public static org.json.JSONObject pareUnderLine​(org.json.JSONObject object)
      • underlineToHump

        public static java.lang.String underlineToHump​(java.lang.String str)
      • getLabel

        public static java.lang.String getLabel​(Config config,
                                                java.lang.String name)
        获取字段名称