com.samsung.android.sdk.look.cocktailbar
Class SlookCocktailProvider
- java.lang.Object
-
- android.content.BroadcastReceiver
-
- com.samsung.android.sdk.look.cocktailbar.SlookCocktailProvider
-
public class SlookCocktailProvider extends android.content.BroadcastReceiver
A convenience class to aid in implementing a Cocktail provider. Everything you can do with SlookCocktailProvider, you can do with a regularBroadcastReceiver
. SlookCocktailProvider merely parses the relevant fields out of the Intent that is received inonReceive(Context,Intent)
, and calls hook methods with the received extras.Extend this class and override one or more of the
This is also supported by edge simulator.onUpdate(android.content.Context, com.samsung.android.sdk.look.cocktailbar.SlookCocktailManager, int[])
,onEnabled(android.content.Context)
,onVisibilityChanged(android.content.Context, int, int)
, oronDisabled(android.content.Context)
methods to implement your own Cocktail functionality.
-
-
Constructor Summary
Constructors Constructor and Description SlookCocktailProvider()
Constructor to initialize SlookCocktailProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
onDisabled(android.content.Context context)
Called in response to the ACTION_COCKTAIL_DISABLED broadcast, which is sent when the Cocktail instance for this provider is disabled in setting or Cocktail-Bar.void
onEnabled(android.content.Context context)
Called in response to the ACTION_COCKTAIL_ENABLED broadcast when the Cocktail for this provider is instantiated.void
onReceive(android.content.Context context, android.content.Intent intent)
ImplementsBroadcastReceiver.onReceive(android.content.Context, android.content.Intent)
to dispatch calls to the various other methods on SlookCocktailProvider.void
onUpdate(android.content.Context context, SlookCocktailManager cocktailManager, int[] cocktailIds)
Called in response to the ACTION_COCKTAIL_UPDATE or ACTION_COCKTAIL_UPDATE_V2 broadcast when this Cocktail provider is being asked to provide CocktailInfo for a Cocktail.void
onVisibilityChanged(android.content.Context context, int cocktailId, int visibility)
Called in response to the ACTION_COCKTAIL_VISIBILITY_CHANGED broadcast, which is sent when the visibility of the cocktail is changed.
-
-
-
Constructor Detail
-
SlookCocktailProvider
public SlookCocktailProvider()
Constructor to initialize SlookCocktailProvider.- Since:
- 1.1.0
-
-
Method Detail
-
onReceive
public void onReceive(android.content.Context context, android.content.Intent intent)
ImplementsBroadcastReceiver.onReceive(android.content.Context, android.content.Intent)
to dispatch calls to the various other methods on SlookCocktailProvider.- Specified by:
onReceive
in classandroid.content.BroadcastReceiver
- Parameters:
context
- The Context in which the receiver is running.intent
- The Intent being received.- Since:
- 1.1.0
-
onUpdate
public void onUpdate(android.content.Context context, SlookCocktailManager cocktailManager, int[] cocktailIds)
Called in response to the ACTION_COCKTAIL_UPDATE or ACTION_COCKTAIL_UPDATE_V2 broadcast when this Cocktail provider is being asked to provide CocktailInfo for a Cocktail. Override this method to implement your own Cocktail functionality. If the cocktailId or RemoteViews is not valid, the Cocktail panel will not appear on the cocktail-bar.- Parameters:
context
- TheContext
in which this receiver is running.cocktailManager
- ASlookCocktailManager
object you can callSlookCocktailManager.updateCocktail(int, android.widget.RemoteViews)
on.cocktailIds
- The cocktailIds for which an update is needed.- Since:
- 1.1.0
-
onEnabled
public void onEnabled(android.content.Context context)
Called in response to the ACTION_COCKTAIL_ENABLED broadcast when the Cocktail for this provider is instantiated. Override this method to implement your own Cocktail functionality.- Parameters:
context
- TheContext
in which this receiver is running.- Since:
- 1.1.0
-
onDisabled
public void onDisabled(android.content.Context context)
Called in response to the ACTION_COCKTAIL_DISABLED broadcast, which is sent when the Cocktail instance for this provider is disabled in setting or Cocktail-Bar. Override this method to implement your own Cocktail functionality.- Parameters:
context
- TheContext
in which this receiver is running.- Since:
- 1.1.0
-
onVisibilityChanged
public void onVisibilityChanged(android.content.Context context, int cocktailId, int visibility)
Called in response to the ACTION_COCKTAIL_VISIBILITY_CHANGED broadcast, which is sent when the visibility of the cocktail is changed. Override this method to implement your own Cocktail functionality.- Parameters:
context
- TheContext
in which this receiver is running.cocktailId
- The cocktailId that the visibility of the cocktail has been changed.visibility
- The visibility of the cocktail.- Since:
- 1.1.0
-
-