WassimBenltaief / FlowLayout

A custom Layout packed with a content view, an empty view, a progress bar and network connectivity status
MIT License
228 stars 24 forks source link

add show animat #6

Closed JakeWoki closed 7 years ago

JakeWoki commented 7 years ago
private FlowLayout fadeIn(final View view, final boolean animate) {
        if (view != null)
            if (animate)
                view.startAnimation(AnimationUtils.loadAnimation(getContext(),
                        android.R.anim.fade_in));
            else
                view.clearAnimation();
        return this;
    }

public void setMode(MODE mode) {
        switch (mode) {
            case PROGRESS:
                fadeIn(progressView, true).setProgress(VISIBLE);
                setEmpty(GONE);
                setContent(GONE);
                break;
            case EMPTY:
                setProgress(GONE);
                fadeIn(emptyView, true).setEmpty(VISIBLE);
                setContent(GONE);
                break;
            case CONTENT:
                setProgress(GONE);
                setEmpty(GONE);
                fadeIn(contentView, true).setContent(VISIBLE);
                break;
        }
    }
WassimBenltaief commented 7 years ago

Hi Jake, can you make a PR with the needed changes please ?

JakeWoki commented 7 years ago

FlowLayout