ArrowRefreshHeader.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:ImitateZHRB 作者:
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();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号