{"id":10580,"date":"2020-10-30T16:13:43","date_gmt":"2020-10-30T07:13:43","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10580"},"modified":"2020-12-05T15:48:57","modified_gmt":"2020-12-05T06:48:57","slug":"%ed%99%94%eb%a9%b4-%ed%84%b0%ec%b9%98-%ec%a4%91-swiping%ec%9d%84-%ec%9d%b4%ec%9a%a9%ed%95%9c-view-%ec%a0%84%ed%99%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10580","title":{"rendered":"[Android] \ud654\uba74 \ud130\uce58 \uc911 Swiping\uc744 \uc774\uc6a9\ud55c View \uc804\ud658"},"content":{"rendered":"<p>\ud654\uba74 \ud130\uce58\uac00 \uac00\ub2a5\ud55c \ubaa8\ubc14\uc77c \ub2e8\ub9d0\uae30\uc5d0\uc11c \ud130\uce58\ub97c \ud1b5\ud55c UI\uc758 \uc870\uc791\uc740 \ub9e4\uc6b0 \ud6a8\uacfc\uc801\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud130\uce58 \uae30\ubc18\uc758 UI\uc758 \ud65c\uc6a9\uc5d0 \ub300\ud574 \uc790\uc5f0\uc2a4\ub7ec\uc6b4 \uc0ac\uc6a9\uc740 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ud504\ub85c\uadf8\ub7a8\uc758 \uce5c\ubc00\ub3c4\ub97c \ub192\uc5ec\uc90d\ub2c8\ub2e4. \ud654\uba74 \ud130\uce58\uc5d0 \ub300\ud55c \uc870\uc791 \uc911 Swiping\uc740 \uc0ac\uc6a9\uc790\uac00 \ud654\uba74\uc744 \uc2a4\uce58\ub4ef\uc774 \uc0c1\ud558\uc88c\uc6b0\ub85c \uc4f8\uc5b4\ub118\uae30\ub294 \ud589\uc704\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c Swiping \uc911 \uc88c\uc6b0\uc5d0 \ub300\ud55c \uc774\ubca4\ud2b8\ub97c \ucc98\ub9ac\ud558\uae30 \uc704\ud55c \ud074\ub798\uc2a4\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\npackage geoservice.nexgen\r\n\r\nimport android.content.Context\r\nimport android.view.GestureDetector\r\nimport android.view.MotionEvent\r\nimport android.view.View\r\n\r\nabstract class OnSwipeTouchListener(context: Context?) : View.OnTouchListener {\r\n    companion object {\r\n        private const val SWIPE_DISTANCE_THRESHOLD = 100\r\n        private const val SWIPE_VELOCITY_THRESHOLD = 100\r\n    }\r\n\r\n    private val gestureDetector: GestureDetector\r\n\r\n    abstract fun onSwipeLeft()\r\n    abstract fun onSwipeRight()\r\n\r\n    override fun onTouch(v: View?, event: MotionEvent?): Boolean {\r\n        return gestureDetector.onTouchEvent(event)\r\n    }\r\n\r\n    private inner class GestureListener : GestureDetector.SimpleOnGestureListener() {\r\n        override fun onDown(e: MotionEvent): Boolean {\r\n            return true\r\n        }\r\n\r\n        override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {\r\n            val distanceX = e2.x - e1.x\r\n            val distanceY = e2.y - e1.y\r\n            if (Math.abs(distanceX) > Math.abs(distanceY) \r\n                    && Math.abs(distanceX) > SWIPE_DISTANCE_THRESHOLD \r\n                    && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) {\r\n                if (distanceX > 0) onSwipeRight() else onSwipeLeft()\r\n                return true\r\n            }\r\n            return false\r\n        }\r\n    }\r\n\r\n    init {\r\n        gestureDetector = GestureDetector(context, GestureListener())\r\n    }\r\n}\r\n<\/pre>\n<p>\uc704 \ud074\ub798\uc2a4\ub97c \uc2e4\uc81c View\uc5d0 \uc801\uc6a9\ud558\ub294 \ucf54\ub4dc\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"kotlin\">\r\nllListScroll.setOnTouchListener(object: OnSwipeTouchListener(context) {\r\n    override fun onSwipeLeft() { btnNext.performClick() }\r\n    override fun onSwipeRight() { btnPrevious.performClick() }\r\n})\r\n<\/pre>\n<p>\uc2e4\uc81c \uc704\uc758 \ucf54\ub4dc\ub294 \ubaa8\ubc14\uc77c \uae30\ubc18\uc758 GIS \uc194\ub8e8\uc158\uc778 Mobile NexGen\uc5d0 \ubc18\uc601\ub41c \ucf54\ub4dc\uc778\ub370\uc694. \uc704\uc758 \ucf54\ub4dc\uc640 \uc5f0\uad00\ub41c \uae30\ub2a5\uc5d0 \ub300\ud55c \uc2dc\uc5f0 \uc601\uc0c1\uc740 \uc544\ub798\uc640 \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><center><video width=\"500px\" controls style=\"outline:none\"><source src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2020\/10\/NexGen_Mobile_Attribute_Identify.mp4\">\ube44\ub514\uc624\ub97c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\ub294 \uc6f9\ube0c\ub77c\uc6b0\uc838\uc785\ub2c8\ub2e4.<\/video><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud654\uba74 \ud130\uce58\uac00 \uac00\ub2a5\ud55c \ubaa8\ubc14\uc77c \ub2e8\ub9d0\uae30\uc5d0\uc11c \ud130\uce58\ub97c \ud1b5\ud55c UI\uc758 \uc870\uc791\uc740 \ub9e4\uc6b0 \ud6a8\uacfc\uc801\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud130\uce58 \uae30\ubc18\uc758 UI\uc758 \ud65c\uc6a9\uc5d0 \ub300\ud574 \uc790\uc5f0\uc2a4\ub7ec\uc6b4 \uc0ac\uc6a9\uc740 \uc0ac\uc6a9\uc790\uc5d0\uac8c \ud504\ub85c\uadf8\ub7a8\uc758 \uce5c\ubc00\ub3c4\ub97c \ub192\uc5ec\uc90d\ub2c8\ub2e4. \ud654\uba74 \ud130\uce58\uc5d0 \ub300\ud55c \uc870\uc791 \uc911 Swiping\uc740 \uc0ac\uc6a9\uc790\uac00 \ud654\uba74\uc744 \uc2a4\uce58\ub4ef\uc774 \uc0c1\ud558\uc88c\uc6b0\ub85c \uc4f8\uc5b4\ub118\uae30\ub294 \ud589\uc704\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c Swiping \uc911 \uc88c\uc6b0\uc5d0 \ub300\ud55c \uc774\ubca4\ud2b8\ub97c \ucc98\ub9ac\ud558\uae30 \uc704\ud55c \ud074\ub798\uc2a4\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. package geoservice.nexgen import android.content.Context import android.view.GestureDetector import android.view.MotionEvent import &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10580\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[Android] \ud654\uba74 \ud130\uce58 \uc911 Swiping\uc744 \uc774\uc6a9\ud55c View \uc804\ud658&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,123],"tags":[],"class_list":["post-10580","post","type-post","status-publish","format-standard","hentry","category-android","category-nexgen"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10580"}],"version-history":[{"count":5,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10580\/revisions"}],"predecessor-version":[{"id":10689,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10580\/revisions\/10689"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10580"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}