Search in sources :

Example 1 with Style

use of com.github.johnpersano.supertoasts.library.Style in project SuperToasts by JohnPersano.

the class SuperActivityToastFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
    final FloatingActionButton button = (FloatingActionButton) getActivity().findViewById(R.id.floating_action_button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        @SuppressWarnings("ResourceType")
        public void onClick(View view) {
            final int containerId = AttributeUtils.getFrame(getActivity()) == Style.FRAME_LOLLIPOP || AttributeUtils.getType(getActivity()) == Style.TYPE_BUTTON ? R.id.toast_container : 0;
            SuperActivityToast.create(getActivity(), new Style(), AttributeUtils.getType(getActivity()), containerId).setButtonText("UNDO").setButtonIconResource(R.drawable.ic_undo).setOnButtonClickListener("good_tag_name", null, onButtonClickListener).setProgressBarColor(Color.WHITE).setText("SuperActivityToast").setDuration(AttributeUtils.getDuration(getActivity())).setFrame(AttributeUtils.getFrame(getActivity())).setColor(AttributeUtils.getColor(getActivity())).setAnimations(AttributeUtils.getAnimations(getActivity())).show();
        }
    });
    return super.onCreateView(inflater, container, savedInstanceState);
}
Also used : FloatingActionButton(android.support.design.widget.FloatingActionButton) Style(com.github.johnpersano.supertoasts.library.Style) View(android.view.View)

Aggregations

FloatingActionButton (android.support.design.widget.FloatingActionButton)1 View (android.view.View)1 Style (com.github.johnpersano.supertoasts.library.Style)1