Search in sources :

Example 1 with AVLoadingIndicatorView

use of com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView in project XRecyclerView by jianghejie.

the class ArrowRefreshHeader method setProgressStyle.

public void setProgressStyle(int style) {
    if (style == ProgressStyle.SysProgress) {
        mProgressBar.setView(new ProgressBar(getContext(), null, android.R.attr.progressBarStyle));
    } else {
        AVLoadingIndicatorView progressView = new AVLoadingIndicatorView(this.getContext());
        progressView.setIndicatorColor(0xffB5B5B5);
        progressView.setIndicatorId(style);
        mProgressBar.setView(progressView);
    }
}
Also used : AVLoadingIndicatorView(com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView) ProgressBar(android.widget.ProgressBar)

Example 2 with AVLoadingIndicatorView

use of com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView in project XRecyclerView by jianghejie.

the class LoadingMoreFooter method setProgressStyle.

public void setProgressStyle(int style) {
    if (style == ProgressStyle.SysProgress) {
        progressCon.setView(new ProgressBar(getContext(), null, android.R.attr.progressBarStyle));
    } else {
        AVLoadingIndicatorView progressView = new AVLoadingIndicatorView(this.getContext());
        progressView.setIndicatorColor(0xffB5B5B5);
        progressView.setIndicatorId(style);
        progressCon.setView(progressView);
    }
}
Also used : AVLoadingIndicatorView(com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView) ProgressBar(android.widget.ProgressBar)

Example 3 with AVLoadingIndicatorView

use of com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView in project XRecyclerView by jianghejie.

the class ArrowRefreshHeader method initView.

private void initView() {
    // 初始情况,设置下拉刷新view高度为0
    mContainer = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.listview_header, null);
    LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    lp.setMargins(0, 0, 0, 0);
    this.setLayoutParams(lp);
    this.setPadding(0, 0, 0, 0);
    addView(mContainer, new LayoutParams(LayoutParams.MATCH_PARENT, 0));
    setGravity(Gravity.BOTTOM);
    mArrowImageView = (ImageView) findViewById(R.id.listview_header_arrow);
    mStatusTextView = (TextView) findViewById(R.id.refresh_status_textview);
    //init the progress view
    mProgressBar = (SimpleViewSwitcher) findViewById(R.id.listview_header_progressbar);
    AVLoadingIndicatorView progressView = new AVLoadingIndicatorView(getContext());
    progressView.setIndicatorColor(0xffB5B5B5);
    progressView.setIndicatorId(ProgressStyle.BallSpinFadeLoader);
    mProgressBar.setView(progressView);
    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
    mHeaderTimeView = (TextView) findViewById(R.id.last_refresh_time);
    measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    mMeasuredHeight = getMeasuredHeight();
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) AVLoadingIndicatorView(com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView)

Example 4 with AVLoadingIndicatorView

use of com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView in project XRecyclerView by jianghejie.

the class LoadingMoreFooter method initView.

public void initView() {
    setGravity(Gravity.CENTER);
    setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    progressCon = new SimpleViewSwitcher(getContext());
    progressCon.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    AVLoadingIndicatorView progressView = new AVLoadingIndicatorView(this.getContext());
    progressView.setIndicatorColor(0xffB5B5B5);
    progressView.setIndicatorId(ProgressStyle.BallSpinFadeLoader);
    progressCon.setView(progressView);
    addView(progressCon);
    mText = new TextView(getContext());
    mText.setText("正在加载...");
    loadingHint = (String) getContext().getText(R.string.listview_loading);
    noMoreHint = (String) getContext().getText(R.string.nomore_loading);
    loadingDoneHint = (String) getContext().getText(R.string.loading_done);
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParams.setMargins((int) getResources().getDimension(R.dimen.textandiconmargin), 0, 0, 0);
    mText.setLayoutParams(layoutParams);
    addView(mText);
}
Also used : AVLoadingIndicatorView(com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView) ViewGroup(android.view.ViewGroup) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout)

Aggregations

AVLoadingIndicatorView (com.jcodecraeer.xrecyclerview.progressindicator.AVLoadingIndicatorView)4 ProgressBar (android.widget.ProgressBar)2 RecyclerView (android.support.v7.widget.RecyclerView)1 ViewGroup (android.view.ViewGroup)1 RotateAnimation (android.view.animation.RotateAnimation)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1