- 浏览: 1225467 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (353)
- java基础 (40)
- tapestry (16)
- gwt (14)
- ajax (7)
- linux (8)
- ubuntu (18)
- eclipse (6)
- dojo (2)
- javascript (7)
- maven (4)
- 日常生活 (29)
- web2.0 (2)
- jsonrpc (1)
- compass (1)
- lucene (0)
- spring (10)
- cluster (3)
- 数据结构 (2)
- sqlserver (1)
- tomcat (2)
- swing (1)
- servlet (1)
- hibernate (1)
- firefox (1)
- Java-Puzzlers (1)
- Wicket (2)
- mysql (10)
- windows (5)
- Webwork (1)
- struts2 (1)
- Seam (2)
- jboss (1)
- idea (6)
- 分布计算 (3)
- Python-Django (7)
- Hadoop (1)
- 工具 (3)
- Tokyo Tyrant (2)
- Comet (1)
- android (115)
- 音乐 (6)
- cxf (1)
- mqtt (1)
最新评论
-
hesai_vip:
学习了,感谢
gradlew wrapper使用下载到本地的gradle.zip文件安装。 -
imknown:
姚瑶大坏蛋 写道我也遇到了这个,用你这个方法,导致下拉刷新不起 ...
解决android-Ultra-Pull-To-Refresh下拉刷新组件中嵌套ViewPager的一个bug -
姚瑶大坏蛋:
我也遇到了这个,用你这个方法,导致下拉刷新不起作用了,你遇到过 ...
解决android-Ultra-Pull-To-Refresh下拉刷新组件中嵌套ViewPager的一个bug -
寐语者:
LeaderElection(String zookeeper ...
使用Zookeeper来为你的程序加上Leader Election的功能。 -
fyc0109:
博主, 安装了一部分还是报这个错误!FAILURE: Buil ...
gradlew wrapper使用下载到本地的gradle.zip文件安装。
在上一个一个博客中介绍了android的UI组件,其中就包括了一个android-pulltorefresh组件。
https://github.com/johannilsson/android-pulltorefresh
这个组件是用在twitter微博中的, 往下拉列表的话, 顶部会自动load, 而且有反弹的效果,非常cool。 但是它的自动load顶部的内部, 我现在需要拖拉listview到最后的时候load。这个组件不知道方向的选择, 所以自己就动手改了下,实现从底部load。 (今天发现新浪微博也实现了同样的功能。) 附件是源码。
com.markupartist.android.widget.PullToRefreshListView
请使用
https://github.com/fengcunhan/Android-PullToRefresh
请使用
https://github.com/fengcunhan/Android-PullToRefresh
https://github.com/johannilsson/android-pulltorefresh
这个组件是用在twitter微博中的, 往下拉列表的话, 顶部会自动load, 而且有反弹的效果,非常cool。 但是它的自动load顶部的内部, 我现在需要拖拉listview到最后的时候load。这个组件不知道方向的选择, 所以自己就动手改了下,实现从底部load。 (今天发现新浪微博也实现了同样的功能。) 附件是源码。
com.markupartist.android.widget.PullToRefreshListView
package com.markupartist.android.widget; 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.*; import android.widget.AbsListView.OnScrollListener; import com.markupartist.android.widget.pulltorefresh.R; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class PullToRefreshListView extends ListView implements OnScrollListener { private static final int TAP_TO_REFRESH = 1; private static final int PULL_TO_REFRESH = 2; private static final int RELEASE_TO_REFRESH = 3; private static final int REFRESHING = 4; private static final String TAG = "PullToRefreshListView"; private OnRefreshListener mOnRefreshListener; /** * Listener that will receive notifications every time the list scrolls. */ private OnScrollListener mOnScrollListener; private LayoutInflater mInflater; private RelativeLayout mRefreshView; private TextView mRefreshViewText; private ImageView mRefreshViewImage; private ProgressBar mRefreshViewProgress; private TextView mRefreshViewLastUpdated; private int mCurrentScrollState; private int mRefreshState; private RotateAnimation mFlipAnimation; private RotateAnimation mReverseFlipAnimation; private int mRefreshViewHeight; private int mRefreshOriginalTopPadding; private int mRefreshOriginalBottomPadding; private int mLastMotionY; public PullToRefreshListView(Context context) { super(context); init(context); } public PullToRefreshListView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } public PullToRefreshListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(context); } private void init(Context context) { // Load all of the animations we need in code rather than through XML mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); mFlipAnimation.setInterpolator(new LinearInterpolator()); mFlipAnimation.setDuration(250); mFlipAnimation.setFillAfter(true); mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); mReverseFlipAnimation.setInterpolator(new LinearInterpolator()); mReverseFlipAnimation.setDuration(250); mReverseFlipAnimation.setFillAfter(true); mInflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE); mRefreshView = (RelativeLayout) mInflater.inflate( R.layout.pull_to_refresh_header, this, false); mRefreshViewText = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_text); mRefreshViewImage = (ImageView) mRefreshView.findViewById(R.id.pull_to_refresh_image); mRefreshViewProgress = (ProgressBar) mRefreshView.findViewById(R.id.pull_to_refresh_progress); mRefreshViewLastUpdated = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_updated_at); mRefreshViewImage.setMinimumHeight(50); mRefreshView.setOnClickListener(new OnClickRefreshListener()); mRefreshOriginalTopPadding = mRefreshView.getPaddingTop(); mRefreshOriginalBottomPadding = mRefreshView.getPaddingBottom(); mRefreshState = TAP_TO_REFRESH; // addHeaderView(mRefreshView); addFooterView(mRefreshView); super.setOnScrollListener(this); measureView(mRefreshView); mRefreshViewHeight = mRefreshView.getMeasuredHeight(); } @Override protected void onAttachedToWindow() { //setSelection(1); } @Override public void setAdapter(ListAdapter adapter) { super.setAdapter(adapter); //setSelection(1); } /** * Set the listener that will receive notifications every time the list * scrolls. * * @param l The scroll listener. */ @Override public void setOnScrollListener(OnScrollListener l) { mOnScrollListener = l; } /** * Register a callback to be invoked when this list should be refreshed. * * @param onRefreshListener The callback to run. */ public void setOnRefreshListener(OnRefreshListener onRefreshListener) { mOnRefreshListener = onRefreshListener; } /** * Set a text to represent when the list was last updated. * * @param lastUpdated Last updated at. */ public void setLastUpdated(CharSequence lastUpdated) { if (lastUpdated != null) { mRefreshViewLastUpdated.setVisibility(View.VISIBLE); mRefreshViewLastUpdated.setText(lastUpdated); } else { mRefreshViewLastUpdated.setVisibility(View.GONE); } } @Override public boolean onTouchEvent(MotionEvent event) { final int y = (int) event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_UP: if (!isVerticalScrollBarEnabled()) { setVerticalScrollBarEnabled(true); } if (getLastVisiblePosition() == getAdapter().getCount() - 1 && mRefreshState != REFRESHING) { if (( mRefreshView.getTop() <= getMeasuredHeight() - mRefreshViewHeight) && mRefreshState == RELEASE_TO_REFRESH) { // Initiate the refresh mRefreshState = REFRESHING; prepareForRefresh(); onRefresh(); } else if (mRefreshView.getTop() > getMeasuredHeight() - mRefreshViewHeight) { // Abort refresh and scroll down below the refresh view resetHeader(); //setSelection(1); if (getFooterViewsCount() > 0) { setSelectionFromTop(getAdapter().getCount() - 1, (this.getMeasuredHeight())); } // if (mRefreshState != RELEASE_TO_REFRESH){ // scrollTo(0, mRefreshView.getScrollY() - mRefreshViewHeight); // } } } break; case MotionEvent.ACTION_DOWN: mLastMotionY = y; break; case MotionEvent.ACTION_MOVE: applyHeaderPadding(event); break; } return super.onTouchEvent(event); } private void applyHeaderPadding(MotionEvent ev) { final int historySize = ev.getHistorySize(); // Workaround for getPointerCount() which is unavailable in 1.5 // (it's always 1 in 1.5) int pointerCount = 1; try { Method method = MotionEvent.class.getMethod("getPointerCount"); pointerCount = (Integer) method.invoke(ev); } catch (NoSuchMethodException e) { pointerCount = 1; } catch (IllegalArgumentException e) { throw e; } catch (IllegalAccessException e) { System.err.println("unexpected " + e); } catch (InvocationTargetException e) { System.err.println("unexpected " + e); } // Log.i("PullToRefreshListView", "historySize:" + historySize); // Log.i("PullToRefreshListView", "pointerCount:" + pointerCount); // Log.i("PullToRefreshListView", " "); // Log.i("PullToRefreshListView", " "); // Log.i("PullToRefreshListView", " "); for (int h = 0; h < historySize; h++) { for (int p = 0; p < pointerCount; p++) { if (mRefreshState == RELEASE_TO_REFRESH) { if (isVerticalFadingEdgeEnabled()) { setVerticalScrollBarEnabled(false); } int historicalY = 0; try { // For Android > 2.0 Method method = MotionEvent.class.getMethod( "getHistoricalY", Integer.TYPE, Integer.TYPE); historicalY = ((Float) method.invoke(ev, p, h)).intValue(); } catch (NoSuchMethodException e) { // For Android < 2.0 historicalY = (int) (ev.getHistoricalY(h)); } catch (IllegalArgumentException e) { throw e; } catch (IllegalAccessException e) { System.err.println("unexpected " + e); } catch (InvocationTargetException e) { System.err.println("unexpected " + e); } // Calculate the padding to apply, we divide by 1.7 to // simulate a more resistant effect during pull. int topPadding = (int) (((historicalY + mLastMotionY) + mRefreshViewHeight) / 1.7); mRefreshView.setPadding( mRefreshView.getPaddingLeft(), mRefreshView.getPaddingTop(), mRefreshView.getPaddingRight(), topPadding); } } } } /** * Sets the header padding back to original size. */ private void resetHeaderPadding() { mRefreshView.setPadding( mRefreshView.getPaddingLeft(), mRefreshView.getPaddingTop(), mRefreshView.getPaddingRight(), mRefreshOriginalBottomPadding); } /** * Resets the header to the original state. */ private void resetHeader() { if (mRefreshState != TAP_TO_REFRESH) { mRefreshState = TAP_TO_REFRESH; resetHeaderPadding(); // Set refresh view text to the pull label mRefreshViewText.setText(R.string.pull_to_refresh_tap_label); // Replace refresh drawable with arrow drawable mRefreshViewImage.setImageResource(R.drawable.ic_pulltorefresh_arrow); // Clear the full rotation animation mRefreshViewImage.clearAnimation(); // Hide progress bar and arrow. mRefreshViewImage.setVisibility(View.GONE); mRefreshViewProgress.setVisibility(View.GONE); } } private void measureView(View child) { ViewGroup.LayoutParams p = child.getLayoutParams(); if (p == null) { p = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } int childWidthSpec = ViewGroup.getChildMeasureSpec(0, 0 + 0, p.width); int lpHeight = p.height; int childHeightSpec; if (lpHeight > 0) { childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY); } else { childHeightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); } child.measure(childWidthSpec, childHeightSpec); } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { // Log.i("PullToRefreshListView", "firstVisibleItem:" + firstVisibleItem); // Log.i("PullToRefreshListView", "visibleItemCount:" + visibleItemCount); // Log.i("PullToRefreshListView", "totalItemCount:" + totalItemCount); // Log.i("PullToRefreshListView", ""); // Log.i("PullToRefreshListView", ""); // Log.i("PullToRefreshListView", ""); // When the refresh view is completely visible, change the text to say // "Release to refresh..." and flip the arrow drawable. if (mCurrentScrollState == SCROLL_STATE_TOUCH_SCROLL && mRefreshState != REFRESHING) { if (firstVisibleItem + visibleItemCount == totalItemCount) { mRefreshViewImage.setVisibility(View.VISIBLE); if (( mRefreshView.getTop() <= getMeasuredHeight() - mRefreshViewHeight) && mRefreshState != RELEASE_TO_REFRESH) { mRefreshViewText.setText(R.string.pull_to_refresh_release_label); mRefreshViewImage.clearAnimation(); mRefreshViewImage.startAnimation(mFlipAnimation); mRefreshState = RELEASE_TO_REFRESH; } else if ( mRefreshView.getTop() > getMeasuredHeight() - 20 - mRefreshViewHeight && mRefreshState != PULL_TO_REFRESH) { mRefreshViewText.setText(R.string.pull_to_refresh_pull_label); if (mRefreshState != TAP_TO_REFRESH) { mRefreshViewImage.clearAnimation(); mRefreshViewImage.startAnimation(mReverseFlipAnimation); } mRefreshState = PULL_TO_REFRESH; } } else { mRefreshViewImage.setVisibility(View.GONE); resetHeader(); } } else if (mCurrentScrollState == SCROLL_STATE_FLING && getLastVisiblePosition() >= getAdapter().getCount() -1 && mRefreshState != REFRESHING) { if (getFooterViewsCount() > 0) { setSelectionFromTop(getAdapter().getCount() - 1, (this.getMeasuredHeight())); } } if (mOnScrollListener != null) { mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); } } public View getLoadBarView() { return mRefreshView; } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { mCurrentScrollState = scrollState; if (mOnScrollListener != null) { mOnScrollListener.onScrollStateChanged(view, scrollState); } } public void prepareForRefresh() { resetHeaderPadding(); mRefreshViewImage.setVisibility(View.GONE); // We need this hack, otherwise it will keep the previous drawable. mRefreshViewImage.setImageDrawable(null); mRefreshViewProgress.setVisibility(View.VISIBLE); // Set refresh view text to the refreshing label mRefreshViewText.setText(R.string.pull_to_refresh_refreshing_label); mRefreshState = REFRESHING; } public void onRefresh() { Log.d(TAG, "onRefresh"); if (mOnRefreshListener != null) { mOnRefreshListener.onRefresh(); } } /** * Resets the list to a normal state after a refresh. * * @param lastUpdated Last updated at. */ public void onRefreshComplete(CharSequence lastUpdated) { setLastUpdated(lastUpdated); onRefreshComplete(); } /** * Resets the list to a normal state after a refresh. */ public void onRefreshComplete() { Log.d(TAG, "onRefreshComplete"); resetHeader(); // If refresh view is visible when loading completes, scroll down to // the next item. if (mRefreshView.getBottom() > 0) { invalidateViews(); //setSelection(1); } } /** * Invoked when the refresh view is clicked on. This is mainly used when * there's only a few items in the list and it's not possible to drag the * list. */ private class OnClickRefreshListener implements OnClickListener { @Override public void onClick(View v) { if (mRefreshState != REFRESHING) { prepareForRefresh(); onRefresh(); } } } /** * Interface definition for a callback to be invoked when list should be * refreshed. */ public interface OnRefreshListener { /** * Called when the list should be refreshed. * <p/> * A call to {@link com.itaoo.view.PullToRefreshListView #onRefreshComplete()} is * expected to indicate that the refresh has completed. */ public void onRefresh(); } }
- pulltorefresh.zip (59.7 KB)
- 下载次数: 1279
评论
5 楼
pop1030123
2014-03-13
cdhhappy 写道
博主您好,想请教您一个问题。
我之前也看过这个控件的实现,它有一个很大的问题就是当ListView的内容填不满一屏的时候,比如说ListView里面只有一项的时候,顶部的点击刷新的 button就不能隐藏了。
似乎新浪微薄的pullToRefresh ListView没有这个问题。
我现在在我的app里是自己实现了一个PullToRefresh控件,但是不是继承了ListView,而是从FrameLayout继承来的,所以当adapter的item数量较多的时候会对性能产生很大影响。非常容易crash。
对于这个问题的解决和新浪微薄客户端的是实现方法您有什么看法么。
多谢指教
我之前也看过这个控件的实现,它有一个很大的问题就是当ListView的内容填不满一屏的时候,比如说ListView里面只有一项的时候,顶部的点击刷新的 button就不能隐藏了。
似乎新浪微薄的pullToRefresh ListView没有这个问题。
我现在在我的app里是自己实现了一个PullToRefresh控件,但是不是继承了ListView,而是从FrameLayout继承来的,所以当adapter的item数量较多的时候会对性能产生很大影响。非常容易crash。
对于这个问题的解决和新浪微薄客户端的是实现方法您有什么看法么。
多谢指教
请使用
https://github.com/fengcunhan/Android-PullToRefresh
4 楼
pop1030123
2014-03-13
laineyhui 写道
我也遇到了同样的问题,就解答。谢谢
请使用
https://github.com/fengcunhan/Android-PullToRefresh
3 楼
guanting207
2013-05-31
为什么我在模拟器上跑无法下拉啊
2 楼
laineyhui
2012-12-06
我也遇到了同样的问题,就解答。谢谢
1 楼
cdhhappy
2011-10-09
博主您好,想请教您一个问题。
我之前也看过这个控件的实现,它有一个很大的问题就是当ListView的内容填不满一屏的时候,比如说ListView里面只有一项的时候,顶部的点击刷新的 button就不能隐藏了。
似乎新浪微薄的pullToRefresh ListView没有这个问题。
我现在在我的app里是自己实现了一个PullToRefresh控件,但是不是继承了ListView,而是从FrameLayout继承来的,所以当adapter的item数量较多的时候会对性能产生很大影响。非常容易crash。
对于这个问题的解决和新浪微薄客户端的是实现方法您有什么看法么。
多谢指教
我之前也看过这个控件的实现,它有一个很大的问题就是当ListView的内容填不满一屏的时候,比如说ListView里面只有一项的时候,顶部的点击刷新的 button就不能隐藏了。
似乎新浪微薄的pullToRefresh ListView没有这个问题。
我现在在我的app里是自己实现了一个PullToRefresh控件,但是不是继承了ListView,而是从FrameLayout继承来的,所以当adapter的item数量较多的时候会对性能产生很大影响。非常容易crash。
对于这个问题的解决和新浪微薄客户端的是实现方法您有什么看法么。
多谢指教
发表评论
-
安卓各种长知识的技术文章,不断更新
2015-10-27 18:24 796http://blog.udinic.com/2015/09 ... -
发现一个android sdk更新神速的镜像
2015-09-02 11:26 954mirrors.dormforce.net:80 //(栋力无 ... -
gradle项目中怎么集中管理你的依赖库
2015-08-16 11:30 738项目结构 引用root --gradleScript ... -
使用Dexposed为你的安卓应用加上在线修复的能力。
2015-08-11 16:15 6142移动客户端应用相对于W ... -
解决android-Ultra-Pull-To-Refresh下拉刷新组件中嵌套ViewPager的一个bug
2015-08-02 00:15 17079在项目中使用了android-Ultra-Pull-To-Re ... -
android有质量的面试题
2015-03-17 14:31 960https://github.com/android-cn/i ... -
提高Android Studio的gradle编译速度。
2015-03-12 14:12 4419发现用Android Studio的make和直接使用comm ... -
gradlew wrapper使用下载到本地的gradle.zip文件安装。
2015-03-12 01:26 15485使用gradlew来build项目时,有时候老是需要下载gra ... -
gradlew wrapper设置代理下载gradle
2015-02-27 18:25 45991. HTTP Only Proxy configuratio ... -
认识mqtt
2015-01-30 11:43 1109http://www.hivemq.com/mqtt-esse ... -
Google的Android性能模式
2015-01-14 14:44 779http://www.infoq.com/cn/news/20 ... -
反对Fragment的理由,顺便叫你如果创建自己的自定义view
2014-12-18 17:08 1137下面这篇文章讲了反对Fragment的理由,顺便叫你如果创建自 ... -
获取status bar的高度
2014-12-16 19:52 1316public static int getStatus ... -
最新的appCompat support library中,actionbar的自定义view不能占用全部的宽度
2014-12-02 23:22 957<style name="AppTheme&q ... -
ScrollTricks实现StickHeader效果
2014-11-06 19:07 1140https://code.google.com/p/roman ... -
AppCompat v21 — Material Design for Pre-Lollipop Devices!
2014-10-23 11:03 901http://android-developers.blogs ... -
国内Android Sdk Manager不能更新的问题。
2014-09-15 15:49 983加hosts 引用203.208.46.146 dl.goo ... -
在Centos上安装android sdk遇到的问题。
2014-09-15 12:00 1400安装好android sdk后, 打包时老是会有下面的问题。 ... -
Android的一些制作图表按钮的工具
2014-09-09 16:36 1555Android Button Maker Android P ... -
DESIGNER'S GUIDE TO DPI
2014-08-29 14:37 483强烈建议美工看看, 对于移动app的多密度屏幕的支持 http ...
相关推荐
在Android应用开发中,下拉刷新(Pull-to-Refresh)功能已经成为许多应用的标准配置,它允许用户通过简单地向下拉动列表来更新内容。 Ultra-pull-to-refresh 是一个流行的开源第三方库,专为Android设计,提供了一种...
* @description An ListView support (a) Pull down to refresh, (b) Pull up to load more. * Implement IXListViewListener, and see stopRefresh() / stopLoadMore(). */ package ...
使用这个库,你可以自定义刷新头部视图,甚至实现上拉加载更多(Pull-up-to-load-more)的功能。 在`PullToRefreshActivity`这个示例文件中,可能包含了使用类似`android-pulltorefresh`库实现的拉动刷新ListView的...
一、下拉刷新(Pull to Refresh) 下拉刷新通常用于更新列表的最新数据。实现这一功能可以借助SwipeRefreshLayout库,它提供了一个可滑动刷新的容器,包括ListView、GridView等。以下步骤可以帮助你实现这个功能: ...
This project aims to provide a reusable Pull to Refresh widget for Android. It was originally based on Johan Nilsson's library (mainly for graphics, strings and animations), but these have been ...
a widget provided to the flutter scroll component drop-down refresh and pull up load.support android and ios. If you are Chinese,click here(中文文档) (Suspend maintenance until 12 months after the end...
**下拉刷新(Pull-to-Refresh)** 下拉刷新功能允许用户通过在ListView顶部向下拉动来获取最新的数据。这在实时性要求较高的应用中尤其有用。实现下拉刷新一般包括以下步骤: 1. **集成下拉刷新库**:Android提供了...
2. 自定义刷新提示:使用`PullToRefreshBase.setMode()`方法选择下拉刷新模式,如仅上拉刷新(MODE_PULL_DOWN_TO_REFRESH)、仅下拉刷新(MODE_PULL_UP_TO_REFRESH)或两者都支持(MODE_BOTH)。 3. 提供动画效果:...
首先,我们来看一下描述中提到的`pull_to_refresh.xml`布局文件,这是定义下拉刷新头部视图的关键部分。布局包含了一个`RelativeLayout`,里面有两个主要组件:一个`ImageView`和一个`ProgressBar`。`ImageView`通常...
然而,为了提供更好的用户体验,开发者经常需要在ListView中添加上拉加载(Load More)和下拉刷新(Pull to Refresh)的功能。本篇文章将详细讲解如何通过自定义ListView布局来实现这一功能。 首先,我们创建一个名...
// when disable pull refresh. protected RelativeLayout mHeaderViewContent; protected TextView mHeaderTimeView; protected int mHeaderViewHeight; // header view's height protected boolean ...
在众多Android应用开发中,下拉刷新(Pull-to-Refresh)功能是提升用户体验的重要手段之一。LearnPullToRefreshControls是一个专门研究和实现这一功能的开源项目,它为我们提供了深入理解下拉刷新机制及其在Android...
} else if (currentStatus == STATUS_PULL_TO_REFRESH) { // 松手时如果是下拉状态,就去调用隐藏下拉头的任务 new HideHeaderTask().execute(); } break; } // 时刻记得更新下拉头中的...
4. **下拉刷新(Pull-to-Refresh)**:ListView的一个流行特性是下拉刷新,用户上滑列表到顶部时,可以触发刷新数据的操作,常用于更新网络数据。 5. **上拉加载(More)**:与下拉刷新类似,上拉加载允许用户在滑动到...
adb pull:正确,用于从设备上拉取文件到本地。 **5. 自定义布局文件加载** - **知识点概述**: Android提供了LayoutInflater类来加载自定义布局文件。 - **选项分析**: - A. Load:非标准类名。 - B. Layout...
在Android应用开发中,下拉刷新(Pull-to-Refresh)是一种常见的交互模式,用户通过下拉列表或视图来触发数据的更新。本项目“Android项目仿新浪微博下拉刷新继承FrameLayout”旨在实现一个类似新浪微博的下拉刷新...