Skip to content

Commit

Permalink
Support new feature(Can set the background color in the height range …
Browse files Browse the repository at this point in the history
…of the refresh view)&&Rename the method name to make the meaning is more explicit
  • Loading branch information
dkzwm committed Oct 28, 2017
1 parent 1d30cf8 commit a49c33e
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 80 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,8 +1,9 @@
*.iml
.gradle
/.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea
.DS_Store
/build
/captures
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -345,8 +345,8 @@ mRefreshLayout.setFooterView(footer);
|removeOnUIPositionChangedListener|OnUIPositionChangedListener|移除视图位置变化的监听回调|
|setOnLoadMoreScrollCallback|OnLoadMoreScrollCallback|设置Footer完成刷新后进行平滑滚动的回调|
|setOnPerformAutoLoadMoreCallBack|OnPerformAutoLoadMoreCallBack|设置触发自动加载更多的条件回调,如果回调的`canAutoLoadMore()`方法返回`true`则会立即触发加载更多|
|setOnChildAlreadyInEdgeCanMoveHeaderCallBack|OnChildAlreadyInEdgeCanMoveHeaderCallBack|设置检查内容视图是否在顶部的重载回调(SmoothRefreshLayout内部`isChildAlreadyInEdgeCanMoveHeader()`方法)|
|setOnChildAlreadyInEdgeCanMoveFooterCallBack|OnChildAlreadyInEdgeCanMoveFooterCallBack|设置检查内容视图是否在底部的重载回调(SmoothRefreshLayout内部`isChildAlreadyInEdgeCanMoveFooter()`方法)|
|setOnChildAlreadyInEdgeCanMoveHeaderCallBack|OnChildAlreadyInEdgeCanMoveHeaderCallBack|设置检查内容视图是否在顶部的重载回调(SmoothRefreshLayout内部`isChildNotYetInEdgeCannotMoveHeader()`方法)|
|setOnChildAlreadyInEdgeCanMoveFooterCallBack|OnChildAlreadyInEdgeCanMoveFooterCallBack|设置检查内容视图是否在底部的重载回调(SmoothRefreshLayout内部`isChildNotYetInEdgeCannotMoveFooter()`方法)|
|setOnHookHeaderRefreshCompleteCallback|OnHookUIRefreshCompleteCallBack|设置Header刷新完成的Hook回调,可实现延迟完成刷新|
|setOnHookFooterRefreshCompleteCallback|OnHookUIRefreshCompleteCallBack|设置Footer刷新完成的Hook回调,可实现延迟完成刷新|
|setOnFingerInsideAnotherDirectionViewCallback|OnFingerInsideAnotherDirectionViewCallback|设置检查手指按下点是否位于其他滚动视图内的重载回调,可自定义判断逻辑,提高判断效率|
Expand Down
Expand Up @@ -79,15 +79,16 @@ public void run() {
}, 2000);
}
}, mRecyclerView);
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveHeaderCallBack(new SmoothRefreshLayout.OnChildAlreadyInEdgeCanMoveHeaderCallBack() {
mRefreshLayout.setDisableLoadMore(false);
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveHeaderCallBack(new SmoothRefreshLayout.OnChildNotYetInEdgeCannotMoveHeaderCallBack() {
@Override
public boolean isChildAlreadyInEdgeCanMoveHeader(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView header) {
public boolean isChildNotYetInEdgeCannotMoveHeader(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView header) {
return ScrollCompat.canChildScrollUp(mRecyclerView);
}
});
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveFooterCallBack(new SmoothRefreshLayout.OnChildAlreadyInEdgeCanMoveFooterCallBack() {
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveFooterCallBack(new SmoothRefreshLayout.OnChildNotYetInEdgeCannotMoveFooterCallBack() {
@Override
public boolean isChildAlreadyInEdgeCanMoveFooter(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView footer) {
public boolean isChildNotYetInEdgeCannotMoveFooter(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView footer) {
return ScrollCompat.canChildScrollDown(mRecyclerView);
}
});
Expand Down
Expand Up @@ -97,15 +97,15 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
mMinOffset = Math.min(mOffset, mMinOffset);
}
});
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveHeaderCallBack(new SmoothRefreshLayout.OnChildAlreadyInEdgeCanMoveHeaderCallBack() {
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveHeaderCallBack(new SmoothRefreshLayout.OnChildNotYetInEdgeCannotMoveHeaderCallBack() {
@Override
public boolean isChildAlreadyInEdgeCanMoveHeader(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView header) {
public boolean isChildNotYetInEdgeCannotMoveHeader(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView header) {
return !mFullyExpanded || ScrollCompat.canChildScrollUp(mRecyclerView);
}
});
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveFooterCallBack(new SmoothRefreshLayout.OnChildAlreadyInEdgeCanMoveFooterCallBack() {
mRefreshLayout.setOnChildAlreadyInEdgeCanMoveFooterCallBack(new SmoothRefreshLayout.OnChildNotYetInEdgeCannotMoveFooterCallBack() {
@Override
public boolean isChildAlreadyInEdgeCanMoveFooter(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView footer) {
public boolean isChildNotYetInEdgeCannotMoveFooter(SmoothRefreshLayout parent, @Nullable View child, @Nullable IRefreshView footer) {
return mMinOffset != mOffset || ScrollCompat.canChildScrollDown(mRecyclerView);
}
});
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_with_listview.xml
Expand Up @@ -11,6 +11,8 @@
app:sr_content="@+id/listView_with_list"
app:sr_custom_layout="@layout/layout_custom_view"
app:sr_empty_layout="@layout/layout_empty_view"
app:sr_header_background_color="@color/colorPrimary"
app:sr_footer_background_color="@color/colorAccent"
app:sr_error_layout="@layout/layout_error_view"
app:sr_state="empty">

Expand All @@ -30,14 +32,12 @@
android:id="@+id/classicHeader_with_listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
app:sr_style="style_scale"/>

<me.dkzwm.widget.srl.extra.footer.ClassicFooter
android:id="@+id/classicFooter_with_listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
app:sr_style="style_scale"/>

<RelativeLayout
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_with_textview.xml
Expand Up @@ -8,6 +8,8 @@
android:orientation="vertical"
app:sr_content="@+id/textView_with_textView_desc"
app:sr_empty_layout="@layout/layout_empty_view"
app:sr_footer_background_color="@color/colorAccent"
app:sr_header_background_color="@color/colorPrimary"
app:sr_error_layout="@layout/layout_error_view"
app:sr_state="empty">

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -6,11 +6,11 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

Expand Down

0 comments on commit a49c33e

Please sign in to comment.