Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
okcaptain committed Mar 14, 2024
1 parent 8fe1f5a commit 7edb234
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ protected void onBackPress() {
getHomeFragment().mBinding.progressLayout.showContent();
} else if (mPageAdapter != null && getHomeFragment().mPresenter != null && getHomeFragment().mPresenter.isDelete()) {
getHomeFragment().setHistoryDelete(false);
} else if (mBinding.recycler.getSelectedPosition() != 0) {
mBinding.recycler.scrollToPosition(0);
} else if (getHomeFragment().canBack()) {
getHomeFragment().goBack();
} else if (!confirm) {
setConfirm();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,12 @@ public void onResume() {
refreshFuncRow();
}

public boolean canBack() {
return mBinding.recycler.getSelectedPosition() != 0;
}

public void goBack() {
mBinding.recycler.scrollToPosition(0);
}

}

0 comments on commit 7edb234

Please sign in to comment.