|
|
@@ -691,16 +691,14 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
public void initListener() {
|
|
|
- scrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
|
|
|
- @Override
|
|
|
- public void onScrollChange(NestedScrollView nestedScrollView, int x, int y, int oldX, int oldY) {
|
|
|
- listTitle.getLocationInWindow(locate);
|
|
|
- if (locate[1] < 0 && titleCardLayout.getVisibility() == View.GONE) {
|
|
|
- ViewUtil.setVisibility(titleCardLayout, true);
|
|
|
- } else if (locate[1] > 20 && titleCardLayout.getVisibility() == View.VISIBLE) {
|
|
|
- ViewUtil.setVisibility(titleCardLayout, false);
|
|
|
- }
|
|
|
- //设置搜索框颜色变化
|
|
|
+ scrollView.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (nestedScrollView, x, y, oldX, oldY) -> {
|
|
|
+ listTitle.getLocationInWindow(locate);
|
|
|
+ if (locate[1] < 0 && titleCardLayout.getVisibility() == View.GONE) {
|
|
|
+ ViewUtil.setVisibility(titleCardLayout, true);
|
|
|
+ } else if (locate[1] > 20 && titleCardLayout.getVisibility() == View.VISIBLE) {
|
|
|
+ ViewUtil.setVisibility(titleCardLayout, false);
|
|
|
+ }
|
|
|
+ //设置搜索框颜色变化
|
|
|
// float ratio = Math.min(bannerHeight, y) * 1.0f / bannerHeight;
|
|
|
// to_search_but_rl.setBackgroundColor(Color.argb((int) (ratio * 255), 255, 255, 255));
|
|
|
// float colorRatio = 1 - ratio * 0.26f;
|
|
|
@@ -720,36 +718,32 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
|
|
|
// }
|
|
|
// }
|
|
|
// LogUtil.println("FgtSmallSheep", "onScrollChange", x, y, oldX, oldY, locate[0], locate[1]);
|
|
|
- }
|
|
|
});
|
|
|
- scrollView.setOnTouchListener(new View.OnTouchListener() {
|
|
|
- @Override
|
|
|
- public boolean onTouch(View v, MotionEvent event) {
|
|
|
- switch (event.getAction()) {
|
|
|
- case MotionEvent.ACTION_DOWN:
|
|
|
- if (upview1 != null) {
|
|
|
- //开始滚动
|
|
|
- upview1.stopFlipping();
|
|
|
- }
|
|
|
- if (homepageItemNoticeMv != null) {
|
|
|
- //开始滚动
|
|
|
- homepageItemNoticeMv.stopFlipping();
|
|
|
- }
|
|
|
- break;
|
|
|
- case MotionEvent.ACTION_UP:
|
|
|
- default:
|
|
|
- if (upview1 != null) {
|
|
|
- //开始滚动
|
|
|
- upview1.startFlipping();
|
|
|
- }
|
|
|
- if (homepageItemNoticeMv != null) {
|
|
|
- //开始滚动
|
|
|
- homepageItemNoticeMv.startFlipping();
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- return false;
|
|
|
+ scrollView.setOnTouchListener((v, event) -> {
|
|
|
+ switch (event.getAction()) {
|
|
|
+ case MotionEvent.ACTION_DOWN:
|
|
|
+ if (upview1 != null) {
|
|
|
+ //开始滚动
|
|
|
+ upview1.stopFlipping();
|
|
|
+ }
|
|
|
+ if (homepageItemNoticeMv != null) {
|
|
|
+ //开始滚动
|
|
|
+ homepageItemNoticeMv.stopFlipping();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case MotionEvent.ACTION_UP:
|
|
|
+ default:
|
|
|
+ if (upview1 != null) {
|
|
|
+ //开始滚动
|
|
|
+ upview1.startFlipping();
|
|
|
+ }
|
|
|
+ if (homepageItemNoticeMv != null) {
|
|
|
+ //开始滚动
|
|
|
+ homepageItemNoticeMv.startFlipping();
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
+ return false;
|
|
|
});
|
|
|
|
|
|
refresh.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|