-
public class FragmentLifecycleObserver extends FragmentManager.FragmentLifecycleCallbacks
Observe changes to the FragmentManager to determine if we're still on the same fragment to display a survey
-
-
Field Summary
Fields Modifier and Type Field Description public final static FragmentLifecycleObserverINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitregisterEvent(String event, FragmentActivity activity)Register that we've started tracking an event; keep track of the fragment that was shown when the event was initially tracked final UnitclearRegisteredEvents()We assume that we should be dismissing on page change until the SDK is fully initialized; if once it is initialized it turns out we won't dismiss on page change, we should clear out our tracked data final BooleansameFragmentVisibleForEvent(String event)We consider the same fragment to be showing for an even in three scenarios: There wasn't a fragment associated with the event
currentFragment is null, which means there hasn't been a fragment going through onResume
The same fragment is currently showing as was showing when the event was tracked
UnitonFragmentResumed(FragmentManager fm, Fragment f)-
Methods inherited from class com.userleap.internal.FragmentLifecycleObserver
onFragmentActivityCreated, onFragmentAttached, onFragmentCreated, onFragmentDestroyed, onFragmentDetached, onFragmentPaused, onFragmentPreAttached, onFragmentPreCreated, onFragmentSaveInstanceState, onFragmentStarted, onFragmentStopped, onFragmentViewCreated, onFragmentViewDestroyed -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
registerEvent
final Unit registerEvent(String event, FragmentActivity activity)
Register that we've started tracking an event; keep track of the fragment that was shown when the event was initially tracked
-
clearRegisteredEvents
final Unit clearRegisteredEvents()
We assume that we should be dismissing on page change until the SDK is fully initialized; if once it is initialized it turns out we won't dismiss on page change, we should clear out our tracked data
-
sameFragmentVisibleForEvent
final Boolean sameFragmentVisibleForEvent(String event)
We consider the same fragment to be showing for an even in three scenarios:
There wasn't a fragment associated with the event
currentFragment is null, which means there hasn't been a fragment going through onResume
The same fragment is currently showing as was showing when the event was tracked
-
onFragmentResumed
Unit onFragmentResumed(FragmentManager fm, Fragment f)
-
-
-