Skip to content

fix: 텍스트 드래그 안되는 문제 해결#831

Open
Sadturtleman wants to merge 1 commit intodevelopfrom
fix/820
Open

fix: 텍스트 드래그 안되는 문제 해결#831
Sadturtleman wants to merge 1 commit intodevelopfrom
fix/820

Conversation

@Sadturtleman
Copy link
Contributor

@Sadturtleman Sadturtleman commented Mar 10, 2026

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 텍스트가 드래그가 안되던 문제 해결
  • EditText 영역을 클릭 시 키보드가 내렸다가 올라오는 문제 해결

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

image

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

둘다 dispatchTouchEvent 및 setupCustomScroll 에서 일어나는 문제들이어서 한꺼번에 수정했습니다.
터치 이벤트 시에만 dispatchTouchEvent를 실행하도록 하여 프레임 드랍을 감소하였습니다.
또한 드래그가 안되는 문제는 movementmethod가 scroll로 되있어 기본적인 드래그가 막혔던 문제로 파악했습니다.

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • EditText 외부 탭 시에만 키보드를 숨기도록 터치 감지 개선
    • 스크롤 상호작용 개선으로 더 부드러운 화면 제어 환경 제공
    • 피드 편집 시 완료 버튼이 더 많은 상황에서 올바르게 작동하도록 개선

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Walkthrough

EditText 외부 터치 감지를 통해 키보드 숨김 동작을 개선하고, Rect 기반 히트 감지로 경계 인식 처리를 구현하며, 스크롤 인터페이스 관리를 정제하고 Done 버튼 동작 범위를 피드 편집 시나리오로 확대했습니다.

Changes

코호트 / 파일(s) 요약
터치 처리 및 키보드 관리 개선
app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt
EditText 외부 터치 시에만 키보드를 숨기도록 경계 인식 터치 처리 구현, Rect 기반 히트 감지 추가, 터치 다운/업/취소에 따른 스크롤 인터페이스 관리 개선, Done 버튼 클릭 처리 범위를 피드 편집 시나리오로 확대

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • s9hn
  • m6z1
  • devfeijoa

Poem

🐰 손가락 닿는 곳마다,
정확히 감지하네요!
키보드는 제때 숨고,
글 복사도 잘되고,
터치의 경계, 이제 완벽해요! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경사항인 텍스트 드래그 문제 해결을 명확하게 요약하고 있습니다.
Description check ✅ Passed 설명이 템플릿 구조를 따르고 있으며, 이슈 번호, 작업 설명, 스크린샷, 리뷰어를 위한 상세 설명이 모두 포함되어 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경사항이 링크된 이슈 #820의 요구사항을 충족합니다: 텍스트 드래그 불가 문제 해결, EditText 터치 시 키보드 깜빡임 문제 해결 등.
Out of Scope Changes check ✅ Passed 모든 변경사항이 dispatchTouchEvent 및 setupCustomScroll의 터치 이벤트 처리 개선과 관련되어 있으며, 링크된 이슈의 범위 내입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/820

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt (1)

156-166: ⚠️ Potential issue | 🟠 Major

세 번째 조건 editFeedModel.feedCategory.isEmpty()가 의도치 않은 동작을 유발할 수 있습니다.

두 번째 조건 editFeedModel.feedId == DEFAULT_FEED_ID가 새 피드 생성(feedId = -1)을 이미 처리하므로, 세 번째 조건은 사실상 feedId가 유효한 기존 피드에서만 실행됩니다. 이 경우 feedCategory가 비어있으면 editFeed() 대신 createFeed()가 호출되어, 기존 피드를 수정하는 대신 중복 생성이 발생할 수 있습니다.

현재 구현에서 기존 피드의 feedCategory는 서버 데이터로 채워지므로 실제 문제는 드물지만, 로직적으로는 조건 2와 조건 3이 중복되거나 모순될 수 있습니다. 조건 3을 제거하거나 feedId 검사와 함께 명시적으로 결합하는 것이 안전합니다.

🛠️ 제안

조건 2가 이미 DEFAULT_FEED_ID인 모든 경우를 처리하므로 조건 3을 제거하는 것을 권장합니다:

                when {
                    editFeedModel == null -> createFeedViewModel.createFeed()

                    editFeedModel.feedId == DEFAULT_FEED_ID -> createFeedViewModel.createFeed()

-                   editFeedModel.feedCategory.isEmpty() -> createFeedViewModel.createFeed()

                    else -> createFeedViewModel.editFeed(
                         feedId = editFeedModel.feedId,
                    )
                }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt`
around lines 156 - 166, The third condition checking
editFeedModel.feedCategory.isEmpty() can cause existing feeds to be re-created;
update the when block to remove that standalone condition so decisions rely on
editFeedModel null check and editFeedModel.feedId == DEFAULT_FEED_ID only, then
call createFeedViewModel.createFeed() for null or DEFAULT_FEED_ID and
createFeedViewModel.editFeed(...) otherwise; reference editFeedModel,
DEFAULT_FEED_ID, createFeedViewModel.createFeed() and
createFeedViewModel.editFeed() when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt`:
- Around line 68-71: The code calls focusView.clearFocus() and then uses
currentFocus?.windowToken when hiding the keyboard, which can be null; instead
use the captured focusView's windowToken directly. Update the
InputMethodManager.hideSoftInputFromWindow call to pass focusView.windowToken
(from the existing focusView variable) rather than currentFocus?.windowToken so
the token is non-null even after clearFocus(); keep the same InputMethodManager
retrieval logic around getSystemService and imm.hideSoftInputFromWindow.

---

Outside diff comments:
In `@app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt`:
- Around line 156-166: The third condition checking
editFeedModel.feedCategory.isEmpty() can cause existing feeds to be re-created;
update the when block to remove that standalone condition so decisions rely on
editFeedModel null check and editFeedModel.feedId == DEFAULT_FEED_ID only, then
call createFeedViewModel.createFeed() for null or DEFAULT_FEED_ID and
createFeedViewModel.editFeed(...) otherwise; reference editFeedModel,
DEFAULT_FEED_ID, createFeedViewModel.createFeed() and
createFeedViewModel.editFeed() when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4f7e6d0-480d-4ca7-8f70-94421bd28d13

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1dff4 and b3d123a.

📒 Files selected for processing (1)
  • app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt

Comment on lines +68 to +71
focusView.clearFocus()
val imm: InputMethodManager =
getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

clearFocus() 호출 후 currentFocus가 null이 될 수 있습니다.

Line 68에서 clearFocus()를 호출한 후, Line 71에서 currentFocus?.windowToken을 사용하고 있습니다. 포커스가 해제되면 currentFocus가 null을 반환할 수 있어, hideSoftInputFromWindow에 null이 전달될 수 있습니다.

이미 focusView를 캡처해두었으므로, 해당 뷰의 windowToken을 직접 사용하는 것이 안전합니다.

🛠️ 수정 제안
                 if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) {
                     focusView.clearFocus()
                     val imm: InputMethodManager =
                         getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
-                    imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
+                    imm.hideSoftInputFromWindow(focusView.windowToken, 0)
                 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
focusView.clearFocus()
val imm: InputMethodManager =
getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
focusView.clearFocus()
val imm: InputMethodManager =
getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(focusView.windowToken, 0)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt`
around lines 68 - 71, The code calls focusView.clearFocus() and then uses
currentFocus?.windowToken when hiding the keyboard, which can be null; instead
use the captured focusView's windowToken directly. Update the
InputMethodManager.hideSoftInputFromWindow call to pass focusView.windowToken
(from the existing focusView variable) rather than currentFocus?.windowToken so
the token is non-null even after clearFocus(); keep the same InputMethodManager
retrieval logic around getSystemService and imm.hideSoftInputFromWindow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 [FIX] 버그를 수정합니다. 🧙마법사 하루

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 글 작성 시, 텍스트 복사 안됨 및 키보드 이벤트 에러

1 participant