浏览代码

Merge branch 'develop' of https://github.com/swict/LifePlusAndroid into develop

hyodong.min 7 年之前
父节点
当前提交
512d5f2303

+ 6 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsFragment.java

@@ -72,10 +72,14 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
     recyclerViewContentsDetail.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
       @Override
       public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent motionEvent) {
-        if (touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_RIGHT)) {
-          if (layoutManager.findFirstVisibleItemPosition() == adapter.getItemCount() - 1) {
+        if (layoutManager.findFirstVisibleItemPosition() == adapter.getItemCount() - 1) {
+          if (touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_NONE)) {
+            presenter.onEvent(new Event.Builder(Event.CANCEL).build());
+          }
+          else if (touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_LEFT)) {
             presenter.onEvent(new Event.Builder(Event.LAST).build());
           }
+
         }
         return false;
       }

+ 9 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsPresenter.java

@@ -203,6 +203,9 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
           onCommand(new WebCommand(htmlBean.getUrl()));
         }
         break;
+      case Event.CANCEL:
+        cancelLastPageToast();
+        break;
       default:
         break;
     }
@@ -513,4 +516,10 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
     toast = Toast.makeText(view.getActivity(), stringResource, Toast.LENGTH_SHORT);
     toast.show();
   }
+
+  private void cancelLastPageToast() {
+    if (toast != null) {
+      toast.cancel();
+    }
+  }
 }