Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,18 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(fragment_home) {
onPostInterestNovelClick()
onSettingPreferenceGenreClick()
onNotificationButtonClick()
onNormalSearchButtonClick()
tracker.trackEvent("home")
}

private fun onNormalSearchButtonClick() {
binding.clHomeNormalSearch.setOnClickListener {
tracker.trackEvent("general_search")
val intent = NormalExploreActivity.getIntent(requireContext())
startActivity(intent)
}
}
Comment on lines +115 to +121
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

startActivity 대신 startActivityLauncher를 사용해야 합니다.

onPostInterestNovelClick() (Line 304-312)에서 동일한 NormalExploreActivitystartActivityLauncher.launch()로 실행하고 있으며, 이를 통해 NormalExploreBack.RESULT_OK 결과를 수신하여 homeViewModel.updateFeed()homeViewModel.updateNovel()을 호출합니다 (Line 76-80).

반면 이 메서드는 startActivity(intent)를 사용하므로, 검색 화면에서 돌아왔을 때 결과 콜백이 동작하지 않아 홈 화면의 피드/소설 데이터가 갱신되지 않습니다.

🐛 startActivityLauncher 사용으로 수정
 private fun onNormalSearchButtonClick() {
     binding.clHomeNormalSearch.setOnClickListener {
         tracker.trackEvent("general_search")
         val intent = NormalExploreActivity.getIntent(requireContext())
-        startActivity(intent)
+        startActivityLauncher.launch(intent)
     }
 }
📝 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
private fun onNormalSearchButtonClick() {
binding.clHomeNormalSearch.setOnClickListener {
tracker.trackEvent("general_search")
val intent = NormalExploreActivity.getIntent(requireContext())
startActivity(intent)
}
}
private fun onNormalSearchButtonClick() {
binding.clHomeNormalSearch.setOnClickListener {
tracker.trackEvent("general_search")
val intent = NormalExploreActivity.getIntent(requireContext())
startActivityLauncher.launch(intent)
}
}
🤖 Prompt for AI Agents
In `@app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt` around lines
115 - 121, onNormalSearchButtonClick uses startActivity(intent) which bypasses
the existing ActivityResultLauncher and prevents the result handling that
onPostInterestNovelClick achieves; replace the startActivity call to launch
NormalExploreActivity via the same startActivityLauncher (call
startActivityLauncher.launch(NormalExploreActivity.getIntent(requireContext())))
so the returned NormalExploreBack.RESULT_OK will trigger
homeViewModel.updateFeed() and homeViewModel.updateNovel() as in
onPostInterestNovelClick; ensure you reference the same startActivityLauncher
instance used elsewhere in the fragment.


private fun bindViewModel() {
binding.viewModel = homeViewModel
binding.lifecycleOwner = this
Expand Down
50 changes: 44 additions & 6 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:layout_width="92dp"
android:layout_height="30dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginTop="10dp"
android:src="@drawable/ic_home_logo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -40,7 +40,7 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:layout_marginTop="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -50,15 +50,53 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_home_normal_search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="12dp"
android:background="@drawable/btn_explore_gray50_radius_14dp"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/tv_home_normal_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/explore_normal_search_hint"
android:textAppearance="@style/label1"
android:textColor="@color/gray_200_949399"
app:layout_constraintBottom_toBottomOf="@id/cl_home_normal_search"
app:layout_constraintStart_toStartOf="@id/cl_home_normal_search"
app:layout_constraintTop_toTopOf="@id/cl_home_normal_search" />

<ImageView
android:id="@+id/iv_home_normal_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/ic_explore_search"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Comment on lines +53 to +88
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

검색 영역에 접근성(contentDescription) 설정이 필요합니다.

cl_home_normal_search는 클릭 가능한 검색 진입점이지만, contentDescription이 설정되어 있지 않습니다. 내부 ImageViewcontentDescription@null로 지정되어 있어, TalkBack 등 스크린 리더 사용자가 이 요소의 용도를 인식할 수 없습니다.

♿ 접근성 개선 제안
 <androidx.constraintlayout.widget.ConstraintLayout
     android:id="@+id/cl_home_normal_search"
     android:layout_width="0dp"
     android:layout_height="wrap_content"
     android:layout_marginHorizontal="20dp"
     android:layout_marginTop="12dp"
     android:background="@drawable/btn_explore_gray50_radius_14dp"
+    android:contentDescription="@string/explore_normal_search_hint"
     android:paddingHorizontal="16dp"
     android:paddingVertical="12dp"
🤖 Prompt for AI Agents
In `@app/src/main/res/layout/fragment_home.xml` around lines 53 - 88,
cl_home_normal_search (the clickable search entry) and iv_home_normal_search
(the ImageView) lack accessible labels; add descriptive accessibility text so
screen readers can announce the control. Update cl_home_normal_search to be
focusable/clickable for accessibility and set android:contentDescription to a
concise string resource like "@string/explore_normal_search" (or use
tv_home_normal_hint's text) and set iv_home_normal_search's
android:contentDescription to the same string (or to `@null` if you mark the
container as the accessible element and set
android:importantForAccessibility="yes" on cl_home_normal_search and
android:importantForAccessibility="no" on iv_home_normal_search) so TalkBack
correctly describes the control.


<TextView
android:id="@+id/tv_home_today_popular_novel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="24dp"
android:text="@string/home_today_popular"
android:textAppearance="@style/headline1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/cl_home_normal_search" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_home_today_popular_novel"
Expand All @@ -78,7 +116,7 @@
android:layout_width="28dp"
android:layout_height="16dp"
android:layout_marginStart="20dp"
android:layout_marginTop="62dp"
android:layout_marginTop="32dp"
android:src="@drawable/ic_home_hot"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rv_home_today_popular_novel" />
Expand Down Expand Up @@ -124,7 +162,7 @@
android:id="@+id/tv_home_interest_feed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="76dp"
android:layout_marginTop="40dp"
android:paddingVertical="2dp"
android:text="@string/home_interest_feed"
android:textAppearance="@style/headline1"
Expand Down Expand Up @@ -235,7 +273,7 @@
android:id="@+id/tv_home_recommend_novel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="56dp"
android:layout_marginTop="40dp"
android:paddingVertical="2dp"
android:text="@string/home_recommend_novel"
android:textAppearance="@style/headline1"
Expand Down
6 changes: 3 additions & 3 deletions core/resource/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
<string name="my_library_attractive_point_fixed_text">(이)가 매력적인 작품</string>

<!-- 홈 뷰 -->
<string name="home_today_popular">오늘의 발견</string>
<string name="home_today_popular">+ 오늘의 발견 +</string>
<string name="home_rising_feed">지금 뜨는 글</string>
<string name="home_interest_feed">관심글</string>
<string name="home_user_interest_recent_feed">관심 등록한 작품의 최신 글이에요</string>
Expand All @@ -242,13 +242,13 @@
<string name="home_recommend_novel_description">로맨스, 로판, 판타지, 현판 등\n선호장르를 기반으로 웹소설을 추천해드려요!</string>
<string name="home_recommend_novel_by_user_taste_description">선호장르를 기반으로 추천해드려요</string>
<string name="home_setting_interest_general">선호장르 설정하기</string>
<string name="home_recommend_novel">이 웹소설은 어때요?</string>
<string name="home_recommend_novel">이 웹소설은 어때요? (´ヮ`)ノ📚</string>
<string name="home_popular_novel_nickname">%s님의 한마디</string>
<string name="home_popular_novel_feed_title_null">작품 소개</string>
<string name="home_popular_feed_spoiler">스포일러가 포함된 글 보기</string>
<string name="home_user_interest_feed_nickname_format">%1$s님의 한마디</string>
<string name="home_user_interest_novel_rating_format">%1$.1f (%2$d)</string>
<string name="home_nickname_interest_feed">%1$s님의 관심글</string>
<string name="home_nickname_interest_feed">・ :*%1$s님의 관심글*: ・</string>
<string name="home_recommended_novel_rating_format">%1$.1f (%2$d)</string>
<string name="home_no_associated_feed">관심 등록한 작품과 관련된 글이 없어요</string>
<string name="home_interest_feed_text">관심글</string>
Expand Down
Loading