Package 

Class TDUtils

    • Method Detail

      • addViewPathProperties

         static void addViewPathProperties(Activity activity, View view, JSONObject properties)

        addViewPathProperties

        Parameters:
        activity - Activity
        view - View
        properties - properties
      • traverseView

         static String traverseView(StringBuilder stringBuilder, ViewGroup root)

        traverseView

        Parameters:
        stringBuilder - StringBuilder
        root - ViewGroup
      • getFragmentNameFromView

         static void getFragmentNameFromView(View view, JSONObject properties)

        getFragmentNameFromView

        Parameters:
        view - View
        properties - JSONObject
      • getActivityFromContext

         static Activity getActivityFromContext(Context context)
        Parameters:
        context - Context
      • getViewId

         static String getViewId(View view, String token)

        getViewId

        Parameters:
        view - View
        token - App ID
      • getActivityTitle

         static String getActivityTitle(Activity activity)

        getActivityTitle

        Parameters:
        activity - Activity
      • setTag

         static synchronized void setTag(String token, View view, int tagId, Object value)

        setTag

        Parameters:
        token - App ID
        view - View
        tagId - ID
        value - Value
      • getTag

         static synchronized Object getTag(String token, View view, int tagId)

        getTag

        Parameters:
        token - App ID
        view - View
        tagId - ID
      • getScreenNameAndTitleFromActivity

         static void getScreenNameAndTitleFromActivity(JSONObject properties, Activity activity)

        getScreenNameAndTitleFromActivity

        Parameters:
        properties - JSONObject
        activity - Activity
      • getToolbarTitle

         static String getToolbarTitle(Activity activity)

        getToolbarTitle

        Parameters:
        activity - Activity
      • mergeJSONObject

         static void mergeJSONObject(JSONObject source, JSONObject dest, TimeZone timeZone)

        mergeJSONObject

        Parameters:
        source - sourceJSONObject
        dest - destJSONObject
        timeZone - TimeZone
      • mergeNestedJSONObject

         static void mergeNestedJSONObject(JSONObject source, JSONObject dest, TimeZone timeZone)

        Used to merge two nested json objects[example] JSONObject{key:JSONObject{key:value}}.

        Parameters:
        source - source json
        dest - dest json
        timeZone - time zone
      • formatJSONArray

         static JSONArray formatJSONArray(JSONArray jsonArr, TimeZone timeZone)

        formatJSONArray with TimeZone

        Parameters:
        jsonArr - JSONArray
        timeZone - TimeZone
      • formatJSONObject

         static JSONObject formatJSONObject(JSONObject jsonObject, TimeZone timeZone)

        formatJSONObject with TimeZone

        Parameters:
        jsonObject - JSONObject
        timeZone - TimeZone
      • getSuffix

         static String getSuffix(String source, int length)

        getSuffix

        Parameters:
        source - String
        length - Len
      • getCurrentProcessName

         static String getCurrentProcessName(Context context)

        Gets the current process name

        Parameters:
        context - context
      • formatNumber

         static double formatNumber(double num)

        keep one decimal place.

        Parameters:
        num - double
      • isForeground

         static boolean isForeground(Context context)

        Determine if the current application is in the foreground.

        Parameters:
        context - context
      • convertToNetworkType

         static int convertToNetworkType(String networkType)

        Network type conversion

        Parameters:
        networkType - network type
      • isLogControlFileExist

         static boolean isLogControlFileExist()

        Check whether the local log switch file exists.