Skip to content

v1.1.0

Latest
Compare
Choose a tag to compare
@drakeet drakeet released this 21 Sep 04:41
· 6 commits to master since this release

Added IntentHandler to start or handle Intents (#13)


public interface IntentHandler {

    /**
     * Called immediately after intent has created on {@link Floo#start()}.
     *
     * @param context The context.
     * @param intent The intent.
     */
    void onIntentCreated(@NonNull Context context, @NonNull Intent intent);
}
Floo.configuration()
    .setDebugEnabled(BuildConfig.DEBUG)
    .setIntentHandler(new FragmentIntentHandler()) // <- DefaultIntentHandler by default 
    .addRequestInterceptor(new LogInterceptor("Request"))
    .addTargetInterceptor(new LogInterceptor("Target"))
    .addTargetNotFoundHandler(new WebHandler())
    .addTargetNotFoundHandler(new OpenDirectlyHandler())
    .addTargetNotFoundHandler(new TargetNotFoundToaster());