Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓:如何使屏幕布局更难向下滑动_Android_Swiperefreshlayout - Fatal编程技术网

Android 安卓:如何使屏幕布局更难向下滑动

Android 安卓:如何使屏幕布局更难向下滑动,android,swiperefreshlayout,Android,Swiperefreshlayout,我的意思是,我有一个简单的swipeRefreshLayout,我希望当用户向下滚动到更困难的位置时,直到完成向上滚动条并触发onRefresh方法。类似Gmail的东西。有可能吗?如果您只想更用力地向下滑动,您可以修改SwipeRefreshLayout源代码,创建您自己的SwipeRefreshLayout: public class SwipeRefreshLayout extends ViewGroup { private static final long RETURN_TO_

我的意思是,我有一个简单的swipeRefreshLayout,我希望当用户向下滚动到更困难的位置时,直到完成向上滚动条并触发onRefresh方法。类似Gmail的东西。有可能吗?

如果您只想更用力地向下滑动,您可以修改
SwipeRefreshLayout
源代码,创建您自己的SwipeRefreshLayout:

public class SwipeRefreshLayout extends ViewGroup {
    private static final long RETURN_TO_ORIGINAL_POSITION_TIMEOUT = 300;
    private static final float ACCELERATE_INTERPOLATION_FACTOR = 1.5f;
    private static final float DECELERATE_INTERPOLATION_FACTOR = 2f;
    private static final float PROGRESS_BAR_HEIGHT = 4;
    private static final float MAX_SWIPE_DISTANCE_FACTOR = .6f; 
    private static final int REFRESH_TRIGGER_DISTANCE = 120; \\ change this value

但是,如果您希望ActionBar上出现一个类似Gmail的工具栏,我建议您不要在support library中使用
SwipeRefreshLayout
,而是使用类似的库。

哦,谢谢:D库ActionBar PullToRefresh是我需要的:D:D