Class ProfileFieldViewHelper
- java.lang.Object
-
- com.cheetahdigital.profile.ui.widgets.ProfileFieldViewHelper
-
public class ProfileFieldViewHelper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ProfileFieldViewHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<ProfileFieldView>
findProfileFieldViews(android.app.Activity activity, int... ids)
Finds and returns aList<ProfileFieldView>
given theirids
.static java.util.List<ProfileFieldView>
findProfileFieldViews(android.view.View view, int... ids)
Finds and returns aList<ProfileFieldView>
given theirids
.static java.util.Map<java.lang.String,java.lang.String>
getMailingStateCountryChanges(android.content.Context context, ProfileCountryStateSelector profileCountryStateSelector)
Get changes from Country and statestatic 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 givenProfileFieldView
static java.util.Map<java.lang.String,java.lang.String>
getProfileFieldViewChanges(java.util.List<ProfileFieldView> profileFieldViews)
Gets all the changes made for the givenProfileFieldView
static void
populateMailingStateCountryView(android.content.Context context, Profile profile, java.util.List<Metadata> metaDatumList, ProfileCountryStateSelector profileCountryStateSelector)
Initialize Country and Statestatic void
populateProfileFieldViews(Profile profile, java.util.List<Metadata> metadata, java.util.List<ProfileFieldView> profileFieldViews)
static void
populateProfileFieldViews(Profile profile, java.util.List<ProfileFieldView> profileFieldViews)
-
-
-
Method Detail
-
findProfileFieldViews
public static java.util.List<ProfileFieldView> findProfileFieldViews(android.app.Activity activity, int... ids)
Finds and returns aList<ProfileFieldView>
given theirids
. Ideally called duringActivity.onCreate()
- Parameters:
activity
- the activity which contains theProfileFieldView
ids
- the id attributes of theProfileFieldView
- Returns:
- list of
ProfileFieldView
-
findProfileFieldViews
public static java.util.List<ProfileFieldView> findProfileFieldViews(android.view.View view, int... ids)
Finds and returns aList<ProfileFieldView>
given theirids
. Ideally called duringActivity.onCreate()
- Parameters:
view
- the view which contains theProfileFieldView
ids
- the id attributes of theProfileFieldView
- Returns:
- list of
ProfileFieldView
-
populateProfileFieldViews
public static void populateProfileFieldViews(Profile profile, java.util.List<ProfileFieldView> profileFieldViews)
Populates the givenList<ProfileFieldView>
by callinginitialize()
on each of them given theProfile
Data andMetadata
List.- Parameters:
profile
- profile DataprofileFieldViews
- 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 givenList<ProfileFieldView>
by callinginitialize()
on each of them given theProfile
Data andMetadata
List.- Parameters:
profile
- profile Datametadata
- profile MetadataprofileFieldViews
- 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 givenProfileFieldView
- Parameters:
profileFieldViews
- the list ofProfileFieldView
- 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 givenProfileFieldView
- Parameters:
context
- context of the applicationprofileFieldViews
- the list ofProfileFieldView
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 applicationprofileCountryStateSelector
- 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 applicationprofile
- profile data retrieved from servermetaDatumList
- profile metadata retrieved from serverprofileCountryStateSelector
- ProfileCountryStateSelector widget
-
-