Search in sources :

Example 1 with FabToDialogTransitionChangeHandler

use of com.bluelinelabs.conductor.demo.changehandler.FabToDialogTransitionChangeHandler in project Conductor by bluelinelabs.

the class HomeController method onFabClicked.

private void onFabClicked(boolean fromFab) {
    SpannableString details = new SpannableString("A small, yet full-featured framework that allows building View-based Android applications");
    details.setSpan(new AbsoluteSizeSpan(16, true), 0, details.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
    final String url = "https://github.com/bluelinelabs/Conductor";
    SpannableString link = new SpannableString(url);
    link.setSpan(new URLSpan(url) {

        @Override
        public void onClick(View widget) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        }
    }, 0, link.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
    SpannableStringBuilder description = new SpannableStringBuilder();
    description.append(details);
    description.append("\n\n");
    description.append(link);
    ControllerChangeHandler pushHandler = fromFab ? new TransitionChangeHandlerCompat(new FabToDialogTransitionChangeHandler(), new FadeChangeHandler(false)) : new FadeChangeHandler(false);
    ControllerChangeHandler popHandler = fromFab ? new TransitionChangeHandlerCompat(new FabToDialogTransitionChangeHandler(), new FadeChangeHandler()) : new FadeChangeHandler();
    getRouter().pushController(RouterTransaction.with(new DialogController("Conductor", description)).pushChangeHandler(pushHandler).popChangeHandler(popHandler));
}
Also used : ControllerChangeHandler(com.bluelinelabs.conductor.ControllerChangeHandler) FadeChangeHandler(com.bluelinelabs.conductor.changehandler.FadeChangeHandler) Intent(android.content.Intent) FabToDialogTransitionChangeHandler(com.bluelinelabs.conductor.demo.changehandler.FabToDialogTransitionChangeHandler) SpannableString(android.text.SpannableString) URLSpan(android.text.style.URLSpan) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) AbsoluteSizeSpan(android.text.style.AbsoluteSizeSpan) SpannableString(android.text.SpannableString) TransitionChangeHandlerCompat(com.bluelinelabs.conductor.changehandler.TransitionChangeHandlerCompat) SpannableStringBuilder(android.text.SpannableStringBuilder)

Aggregations

Intent (android.content.Intent)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SpannableString (android.text.SpannableString)1 SpannableStringBuilder (android.text.SpannableStringBuilder)1 AbsoluteSizeSpan (android.text.style.AbsoluteSizeSpan)1 URLSpan (android.text.style.URLSpan)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 ControllerChangeHandler (com.bluelinelabs.conductor.ControllerChangeHandler)1 FadeChangeHandler (com.bluelinelabs.conductor.changehandler.FadeChangeHandler)1 TransitionChangeHandlerCompat (com.bluelinelabs.conductor.changehandler.TransitionChangeHandlerCompat)1 FabToDialogTransitionChangeHandler (com.bluelinelabs.conductor.demo.changehandler.FabToDialogTransitionChangeHandler)1