public class ModuleRatingCore extends ModuleBase
| Modifier and Type | Class and Description |
|---|---|
static interface |
ModuleRatingCore.RatingCallback
Callbacks for star rating dialog
|
protected class |
ModuleRatingCore.RatingsCore |
static class |
ModuleRatingCore.StarRatingPreferences
Class that handles star rating internal state
|
| Modifier and Type | Field and Description |
|---|---|
protected CtxCore |
ctx |
protected boolean |
disabledModule |
protected InternalConfig |
internalConfig |
protected static Log.Module |
L |
protected static java.lang.String |
STAR_RATING_EVENT_KEY |
static java.lang.Long |
storableStorageId |
static java.lang.String |
storableStoragePrefix |
| Constructor and Description |
|---|
ModuleRatingCore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAutomaticStarRatingSessionCount()
Set the automatic star rating session count back to 0
|
void |
disableModule() |
int |
getAutomaticStarRatingSessionLimit()
Returns the session limit set for automatic star rating
|
int |
getCurrentVersionsSessionCount()
Returns how many sessions has star rating counted internally
|
java.lang.Integer |
getFeature() |
void |
init(InternalConfig config)
All initialization must be done in this method, not constructor.
|
protected ModuleRatingCore.StarRatingPreferences |
loadStarRatingPreferences()
Returns a object with the loaded preferences
|
void |
onContextAcquired(CtxCore ctx)
SDK got a first context.
|
java.lang.Boolean |
onRequest(Request request)
This method is called only on owning module only if module marks request as owned (
Request.own(Class). |
void |
PurgeRatingInfo() |
protected void |
saveStarRatingPreferences(ModuleRatingCore.StarRatingPreferences srp)
Save the star rating preferences object
|
void |
setIfRatingDialogIsCancellable(boolean isCancellable)
Set if the star rating dialog is cancellable
|
void |
setShowDialogAutomatically(boolean shouldShow)
Set if the star rating dialog should be shown automatically
|
void |
setStarRatingDisableAskingForEachAppVersion(boolean disableAsking)
Set if automatic star rating should be disabled for each new version.
|
void |
setStarRatingInitConfig(int limit,
java.lang.String starRatingTextTitle,
java.lang.String starRatingTextMessage,
java.lang.String starRatingTextDismiss)
Setting things that would be provided during initial config
|
isActive, onActivityCreated, onActivityDestroyed, onActivityPaused, onActivityResumed, onActivitySaveInstanceState, onActivityStarted, onActivityStopped, onConfigurationChanged, onDeviceId, onLimitedContextAcquired, onRequestCompleted, onSessionBegan, onSessionEnded, onUserChanged, stopprotected static final java.lang.String STAR_RATING_EVENT_KEY
protected static final Log.Module L
protected boolean disabledModule
public static final java.lang.Long storableStorageId
public static final java.lang.String storableStoragePrefix
protected InternalConfig internalConfig
protected CtxCore ctx
public void init(InternalConfig config)
Moduleinit in interface Moduleinit in class ModuleBaseconfig - Countly configuration object: can be stored locally if needed.public void onContextAcquired(CtxCore ctx)
ModuleApplication#onCreate())onContextAcquired in interface ModuleonContextAcquired in class ModuleBasectx - CtxCore with application instancepublic java.lang.Integer getFeature()
public java.lang.Boolean onRequest(Request request)
ModuleRequest.own(Class).
Gives a module another chance to modify request before sending. Being run in CountlyService.onRequest in interface ModuleonRequest in class ModuleBaserequest - request to checktrue if ok to send now, false if not ok to (remove request
from queue), null if cannot decide yetpublic void disableModule()
public void PurgeRatingInfo()
protected ModuleRatingCore.StarRatingPreferences loadStarRatingPreferences()
protected void saveStarRatingPreferences(ModuleRatingCore.StarRatingPreferences srp)
srp - public void setStarRatingInitConfig(int limit,
java.lang.String starRatingTextTitle,
java.lang.String starRatingTextMessage,
java.lang.String starRatingTextDismiss)
limit - limit for automatic ratingstarRatingTextTitle - provided titlestarRatingTextMessage - provided messagestarRatingTextDismiss - provided dismiss textpublic void setShowDialogAutomatically(boolean shouldShow)
shouldShow - public void setStarRatingDisableAskingForEachAppVersion(boolean disableAsking)
disableAsking - if set true, will not show star rating for every new app versionpublic int getAutomaticStarRatingSessionLimit()
public int getCurrentVersionsSessionCount()
public void clearAutomaticStarRatingSessionCount()
public void setIfRatingDialogIsCancellable(boolean isCancellable)
isCancellable -