在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Android常用控件之下拉刷新Wifi列表

            Android常用控件之下拉刷新Wifi列表

            作者: 時(shí)間:2016-09-12 來(lái)源:網(wǎng)絡(luò) 收藏

            本文引用地址:http://www.biyoush.com/article/201609/304586.htm

            界面

            關(guān)鍵代碼

            下拉列表類

            package com.example.dropdownrefresh.ui;

            import java.text.SimpleDateFormat;

            import java.util.Date;

            import com.example.dropdownrefresh.R;

            import android.content.Context;

            import android.util.AttributeSet;

            import android.util.Log;

            import android.view.LayoutInflater;

            import android.view.MotionEvent;

            import android.view.View;

            import android.view.ViewGroup;

            import android.view.animation.LinearInterpolator;

            import android.view.animation.RotateAnimation;

            import android.widget.AbsListView;

            import android.widget.AbsListView.OnScrollListener;

            import android.widget.BaseAdapter;

            import android.widget.ImageView;

            import android.widget.LinearLayout;

            import android.widget.ListView;

            import android.widget.ProgressBar;

            import android.widget.TextView;

            /**

            * 下拉列表類

            * @author Administrator

            *

            */

            public class DropdownListView extends ListView implements OnScrollListener {

            private static final String TAG = listview;

            private final static int RELEASE_To_REFRESH = 0;

            private final static int PULL_To_REFRESH = 1;

            private final static int REFRESHING = 2;

            private final static int DONE = 3;

            private final static int LOADING = 4;

            // 實(shí)際的padding的距離與界面上偏移距離的比例

            private final static int RATIO = 3;

            private LayoutInflater inflater;

            private LinearLayout headView;

            private TextView tipsTextview;

            private TextView lastUpdatedTextView;

            private ImageView arrowImageView;

            private ProgressBar progressBar;

            private RotateAnimation animation;

            private RotateAnimation reverseAnimation;

            // 用于保證startY的值在一個(gè)完整的touch事件中只被記錄一次

            private boolean isRecored;

            private int headContentWidth;

            private int headContentHeight;

            private int startY;

            private int firstItemIndex;

            private int state;

            private boolean isBack;

            private OnRefreshListener refreshListener;

            private boolean isRefreshable;

            public DropdownListView(Context context) {

            super(context);

            // TODO Auto-generated constructor stub

            init(context);

            }

            public DropdownListView(Context context, AttributeSet attrs) {

            super(context, attrs);

            init(context);

            }

            private void init(Context context) {

            setCacheColorHint(context.getResources().getColor(R.color.transparent));

            inflater = LayoutInflater.from(context);

            headView = (LinearLayout) inflater.inflate(R.layout.head, null);

            arrowImageView = (ImageView) headView

            .findViewById(R.id.head_arrowImageView);

            arrowImageView.setMinimumWidth(70);

            arrowImageView.setMinimumHeight(50);

            progressBar = (ProgressBar) headView

            .findViewById(R.id.head_progressBar);

            tipsTextview = (TextView) headView.findViewById(R.id.head_tipsTextView);

            lastUpdatedTextView = (TextView) headView

            .findViewById(R.id.head_lastUpdatedTextView);

            measureView(headView);

            headContentHeight = headView.getMeasuredHeight();

            headContentWidth = headView.getMeasuredWidth();

            headView.setPadding(0, -1 * headContentHeight, 0, 0);

            headView.invalidate();

            Log.v(size, width: + headContentWidth + height:

            + headContentHeight);

            addHeaderView(headView, null, false);

            setOnScrollListener(this);

            animation = new RotateAnimation(0, -180,

            RotateAnimation.RELATIVE_TO_SELF, 0.5f,

            RotateAnimation.RELATIVE_TO_SELF, 0.5f);

            animation.setInterpolator(new LinearInterpolator());

            animation.setDuration(250);

            animation.setFillAfter(true);

            reverseAnimation = new RotateAnimation(-180, 0,

            RotateAnimation.RELATIVE_TO_SELF, 0.5f,

            RotateAnimation.RELATIVE_TO_SELF, 0.5f);

            reverseAnimation.setInterpolator(new LinearInterpolator());

            reverseAnimation.setDuration(200);

            reverseAnimation.setFillAfter(true);

            state = DONE;


            上一頁(yè) 1 2 3 4 5 下一頁(yè)

            關(guān)鍵詞:

            評(píng)論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉