public class LikeActionController extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
LikeActionController.CreationCallback
Used by the call to getControllerForObjectId()
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_LIKE_ACTION_CONTROLLER_DID_ERROR |
static String |
ACTION_LIKE_ACTION_CONTROLLER_DID_RESET |
static String |
ACTION_LIKE_ACTION_CONTROLLER_UPDATED |
static String |
ACTION_OBJECT_ID_KEY |
static String |
ERROR_INVALID_OBJECT_ID |
Modifier and Type | Method and Description |
---|---|
static void |
getControllerForObjectId(Context context,
String objectId,
LikeActionController.CreationCallback callback)
Called by the LikeView when an object-id is set on it.
|
String |
getLikeCountString()
Gets the String representation of the like-count for the associated object
|
String |
getObjectId()
Gets the the associated object id
|
String |
getSocialSentence()
Gets the String representation of the like-count for the associated object
|
static boolean |
handleOnActivityResult(Context context,
int requestCode,
int resultCode,
Intent data)
Called from UiLifecycleHelper to process any pending likes that had resulted in the Like dialog
being displayed
|
boolean |
isObjectLiked()
Indicates whether the associated object is liked
|
void |
toggleLike(Activity activity,
Bundle analyticsParameters)
Entry-point to the code that performs the like/unlike action.
|
public static final String ACTION_LIKE_ACTION_CONTROLLER_UPDATED
public static final String ACTION_LIKE_ACTION_CONTROLLER_DID_ERROR
public static final String ACTION_LIKE_ACTION_CONTROLLER_DID_RESET
public static final String ACTION_OBJECT_ID_KEY
public static final String ERROR_INVALID_OBJECT_ID
public static boolean handleOnActivityResult(Context context, int requestCode, int resultCode, Intent data)
context
- Hosting contextrequestCode
- From the originating call to onActivityResultresultCode
- From the originating call to onActivityResultdata
- From the originating call to onActivityResultpublic static void getControllerForObjectId(Context context, String objectId, LikeActionController.CreationCallback callback)
context
- contextobjectId
- Object Idpublic String getObjectId()
public String getLikeCountString()
public String getSocialSentence()
public boolean isObjectLiked()