urbanairship-core/src/main/java/com/urbanairship/iam/banner/BannerFragment.java
private void removeSelf(boolean animate) {
        if (getActivity() != null) {

            /*
             * Commit allowing state loss is ok because we keep track or our own
             * state and will dismiss the fragment anyways when its restored.
             * We do not rely on the fragment manager to keep track for us.
             */

            int exit;

            switch (displayContent.getPlacement()) {
                case BannerDisplayContent.PLACEMENT_TOP:
                    exit = R.animator.ua_iam_slide_out_top;
                    break;

                case BannerDisplayContent.PLACEMENT_BOTTOM:
                default:
                    exit = R.animator.ua_iam_slide_out_bottom;
            }

            //noinspection ResourceType
            getActivity().getFragmentManager().beginTransaction()
                         .setCustomAnimations(0, animate ? exit : 0)
                         .remove(this)
                         .commitAllowingStateLoss();
        }
    }
/**
     * Helper method to remove itself from the activity.
     *
     * @param animate {@code true} if the fragment should animate out, otherwise {@code false}.
     */
Helper method to remove itself from the activity.
@param animate  true if the fragment should animate out, otherwise  false.
Helper method to remove itself from the activity . @param animate true if the fragment should animate out otherwise false .
private void removeSelf(boolean animate) {
        if (getActivity() != null) {
            /*
             * Commit allowing state loss is ok because we keep track or our own
             * state and will dismiss the fragment anyways when its restored.
             * We do not rely on the fragment manager to keep track for us.
             */
            int exit;
            switch (displayContent.getPlacement()) {
                case BannerDisplayContent.PLACEMENT_TOP:
                    exit = R.animator.ua_iam_slide_out_top;
                    break;
                case BannerDisplayContent.PLACEMENT_BOTTOM:
                default:
                    exit = R.animator.ua_iam_slide_out_bottom;
            }
            getActivity().getFragmentManager().beginTransaction()
                         .setCustomAnimations(0, animate ? exit : 0)
                         .remove(this)
                         .commitAllowingStateLoss();
        }
    }
private void removeSelf ( boolean animate ) { if ( getActivity ( ) != null ) { /*
             * Commit allowing state loss is ok because we keep track or our own
             * state and will dismiss the fragment anyways when its restored.
             * We do not rely on the fragment manager to keep track for us.
             */ int exit ; switch ( displayContent . getPlacement ( ) ) { case BannerDisplayContent . PLACEMENT_TOP : exit = R . animator . ua_iam_slide_out_top ; break ; case BannerDisplayContent . PLACEMENT_BOTTOM : default : exit = R . animator . ua_iam_slide_out_bottom ; } getActivity ( ) . getFragmentManager ( ) . beginTransaction ( ) . setCustomAnimations ( 0 , animate ? exit : 0 ) . remove ( this ) . commitAllowingStateLoss ( ) ; } }
Helper method to remove itself from the activity.
Helper method to remove itself from the activity .
//noinspection ResourceType