Class ProfileFieldViewHelper


  • public class ProfileFieldViewHelper
    extends java.lang.Object
    • Constructor Detail

      • ProfileFieldViewHelper

        public ProfileFieldViewHelper()
    • Method Detail

      • findProfileFieldViews

        public static java.util.List<ProfileFieldView> findProfileFieldViews​(android.app.Activity activity,
                                                                             int... ids)
        Finds and returns a List<ProfileFieldView> given their ids. Ideally called during Activity.onCreate()
        Parameters:
        activity - the activity which contains the ProfileFieldView
        ids - the id attributes of the ProfileFieldView
        Returns:
        list of ProfileFieldView
      • findProfileFieldViews

        public static java.util.List<ProfileFieldView> findProfileFieldViews​(android.view.View view,
                                                                             int... ids)
        Finds and returns a List<ProfileFieldView> given their ids. Ideally called during Activity.onCreate()
        Parameters:
        view - the view which contains the ProfileFieldView
        ids - the id attributes of the ProfileFieldView
        Returns:
        list of ProfileFieldView
      • populateProfileFieldViews

        public static void populateProfileFieldViews​(Profile profile,
                                                     java.util.List<ProfileFieldView> profileFieldViews)
        Populates the given List<ProfileFieldView> by calling initialize() on each of them given the Profile Data and Metadata List.
        Parameters:
        profile - profile Data
        profileFieldViews - the views to show each Profile Field
      • populateProfileFieldViews

        public static void populateProfileFieldViews​(Profile profile,
                                                     java.util.List<Metadata> metadata,
                                                     java.util.List<ProfileFieldView> profileFieldViews)
        Populates the given List<ProfileFieldView> by calling initialize() on each of them given the Profile Data and Metadata List.
        Parameters:
        profile - profile Data
        metadata - profile Metadata
        profileFieldViews - the views to show each Profile Field
      • getProfileFieldViewChanges

        public static java.util.Map<java.lang.String,​java.lang.String> getProfileFieldViewChanges​(java.util.List<ProfileFieldView> profileFieldViews)
        Gets all the changes made for the given ProfileFieldView
        Parameters:
        profileFieldViews - the list of ProfileFieldView
        Returns:
        the map of changes
      • getProfileFieldViewChanges

        public static java.util.Map<java.lang.String,​java.lang.String> getProfileFieldViewChanges​(android.content.Context context,
                                                                                                        java.util.List<ProfileFieldView> profileFieldViews,
                                                                                                        boolean isMailingCountryUS)
        Gets all the changes made for the given ProfileFieldView
        Parameters:
        context - context of the application
        profileFieldViews - the list of ProfileFieldView
        isMailingCountryUS - true - mailing country is set to US, false - mailing country is not US
        Returns:
        the map of changes
      • getMailingStateCountryChanges

        public static java.util.Map<java.lang.String,​java.lang.String> getMailingStateCountryChanges​(android.content.Context context,
                                                                                                           ProfileCountryStateSelector profileCountryStateSelector)
        Get changes from Country and state
        Parameters:
        context - current context of the application
        profileCountryStateSelector - ProfileCountryStateSelector
        Returns:
        current country and mailing state
      • populateMailingStateCountryView

        public static void populateMailingStateCountryView​(android.content.Context context,
                                                           Profile profile,
                                                           java.util.List<Metadata> metaDatumList,
                                                           ProfileCountryStateSelector profileCountryStateSelector)
        Initialize Country and State
        Parameters:
        context - current context of the application
        profile - profile data retrieved from server
        metaDatumList - profile metadata retrieved from server
        profileCountryStateSelector - ProfileCountryStateSelector widget