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);
}
Aggregations