Browse Source

[콘텐츠상세][Common] more info 팝업 스크롤 이벤트 처리

Hasemi 7 năm trước cách đây
mục cha
commit
a45281cd91

+ 47 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/CustomScrollView.java

@@ -0,0 +1,47 @@
+package kr.co.zumo.app.lifeplus.view.custom;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.widget.ScrollView;
+
+/**
+ * CustomScrollView
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-12-03]   [최초 작성]
+ * @since 2018-12-03
+ */
+public class CustomScrollView extends ScrollView {
+
+  public CustomScrollView(Context context) {
+    super(context);
+  }
+
+  public CustomScrollView(Context context, AttributeSet attrs) {
+    super(context, attrs);
+  }
+
+  public CustomScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
+    super(context, attrs, defStyleAttr);
+  }
+
+  @Override
+  public boolean onInterceptTouchEvent(MotionEvent ev) {
+    switch (ev.getAction()) {
+      case MotionEvent.ACTION_SCROLL:
+      case MotionEvent.ACTION_DOWN:
+      case MotionEvent.ACTION_MOVE:
+      case MotionEvent.ACTION_UP:
+        getParent().requestDisallowInterceptTouchEvent(true);
+        break;
+
+      default:
+        break;
+    }
+    return false;
+  }
+}

+ 2 - 2
app/src/main/res/layout/dialog_contents_more_info.xml

@@ -65,7 +65,7 @@
       app:layout_constraintBottom_toTopOf="@+id/layout_more_info_button"
       app:layout_constraintTop_toBottomOf="@+id/first_layout">
 
-      <ScrollView
+      <kr.co.zumo.app.lifeplus.view.custom.CustomScrollView
         android:id="@+id/scroll_view"
         style="@style/ContentsScrollBars"
         android:layout_width="match_parent"
@@ -86,7 +86,7 @@
             android:layout_height="wrap_content"
             />
         </LinearLayout>
-      </ScrollView>
+      </kr.co.zumo.app.lifeplus.view.custom.CustomScrollView>
     </android.support.constraint.ConstraintLayout>
 
     <android.support.constraint.ConstraintLayout