Преглед изворни кода

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

hyodong.min пре 7 година
родитељ
комит
12f55acbad

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

@@ -50,6 +50,7 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
   private LinearLayoutManager layoutManager;
   private View dim;
   private TextView textViewPageNumber;
+  private String direction = null;
 
   private RecyclerView.OnScrollListener scrollEventListener;
 
@@ -73,11 +74,13 @@ public class ContentsFragment extends FragmentBase<ContentsPresenter> implements
       @Override
       public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent motionEvent) {
         if (null != layoutManager && layoutManager.findFirstVisibleItemPosition() == adapter.getItemCount() - 1) {
-          if (touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_NONE)) {
-            presenter.onEvent(new Event.Builder(Event.CANCEL).build());
+          if (touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_LEFT)) {
+            direction = TouchEventWithDirection.DIRECTION_LEFT;
           }
-          else if (touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_LEFT)) {
+          else if (null != direction && direction.equals(TouchEventWithDirection.DIRECTION_LEFT)
+            && touchEventWithDirection.getDirection(motionEvent).equals(TouchEventWithDirection.DIRECTION_NONE)) {
             presenter.onEvent(new Event.Builder(Event.LAST).build());
+            direction = null;
           }
 
         }

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

@@ -203,9 +203,6 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
           onCommand(new WebCommand(htmlBean.getUrl()));
         }
         break;
-      case Event.CANCEL:
-        cancelLastPageToast();
-        break;
       default:
         break;
     }
@@ -516,10 +513,4 @@ 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();
-    }
-  }
 }