Skip to content

Commit

Permalink
refactor: 빈 검색어가 입력되었을 경우 문구가 보이도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Choisehyeon committed Oct 16, 2023
1 parent e0a8cea commit fc81d44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class SearchFragment : BaseFragment<FragmentSearchBinding, SearchViewModel>({
}) {
override val viewModel: SearchViewModel by viewModels()
override val inflater: LayoutInflater by lazy { LayoutInflater.from(context) }

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand Down Expand Up @@ -66,6 +65,7 @@ class SearchFragment : BaseFragment<FragmentSearchBinding, SearchViewModel>({
}

override fun onQueryTextChange(newText: String?): Boolean {
if (newText == "") binding.tvEmptyPost.isVisible = false
return true
}
})
Expand Down
9 changes: 5 additions & 4 deletions android/app/src/main/res/layout/fragment_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@
android:id="@+id/tv_empty_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:text="@string/search_empty"
android:textColor="@color/black_434343"
app:layout_constraintTop_toTopOf="parent"
android:textSize="32sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/search_empty"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

0 comments on commit fc81d44

Please sign in to comment.