textview2 Android] Textview TextWatcher 자동 콤마 https://onlyfor-me-blog.tistory.com/435 [Android] TextWatcher란? 앱을 만들다 보면 editText에 입력한 값을 실시간으로 관찰하면서 입력값에 따른 처리를 해야 할 때가 있다. 그 때 가볍게 써먹을 수 있는 편리한 TextWatcher란 인터페이스가 있다. 이름부터 뭘 하는 onlyfor-me-blog.tistory.com editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { Log.e(TAG, "beforeTextChanged() - charSequen.. 2023. 6. 20. Kotlin] 안드로이드 뷰 눌러서 이동하기n] 안드로이드 뷰 눌러서 이동하기 // view MotionEvent 뷰를 눌러서 이동해보겠습니다 예제는 리사이클러뷰지만 아무 뷰나 상관없습니다. #이미지 뷰 #텍스트뷰 #리사이클러뷰 #리스트뷰 var startX = 0f var startY = 0f ... recyclerView.setOnTouchListener { v, event -> when (event.action) { MotionEvent.ACTION_DOWN -> { startX = event.x startY = event.y } MotionEvent.ACTION_MOVE -> { val movedX: Float = event.x - startX val movedY: Float = event.y - startY v.x = v.x + movedX v.y = v.y + movedY } } true } 처음 눌렀을 .. 2021. 3. 18. 이전 1 다음