Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#485 빈화면문구추가 #492

Merged
merged 4 commits into from
Oct 17, 2023
Merged
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
10 changes: 7 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
android:exported="true" />
<activity
android:name="com.app.edonymyeon.presentation.ui.main.MainActivity"
android:exported="true">
android:exported="true"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down Expand Up @@ -97,14 +98,17 @@
</intent-filter>
</service>

<service android:name="com.google.android.gms.metadata.ModuleDependencies"
<service
android:name="com.google.android.gms.metadata.ModuleDependencies"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass">
<intent-filter>
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
</intent-filter>
<meta-data android:name="photopicker_activity:0:required" android:value="" />
<meta-data
android:name="photopicker_activity:0:required"
android:value="" />
</service>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.SearchView
import androidx.core.view.isVisible
import androidx.fragment.app.viewModels
import androidx.recyclerview.widget.RecyclerView
import app.edonymyeon.databinding.FragmentSearchBinding
Expand All @@ -19,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 All @@ -41,7 +41,10 @@ class SearchFragment : BaseFragment<FragmentSearchBinding, SearchViewModel>({

binding.rvSearchResult.adapter = searchAdapter
viewModel.searchResult.observe(viewLifecycleOwner) {
searchAdapter.setPosts(it)
binding.tvEmptyPost.isVisible = it.isEmpty()
if (it.isNotEmpty()) {
searchAdapter.setPosts(it)
}
}
}

Expand All @@ -62,6 +65,7 @@ class SearchFragment : BaseFragment<FragmentSearchBinding, SearchViewModel>({
}

override fun onQueryTextChange(newText: String?): Boolean {
if (newText == "") binding.tvEmptyPost.isVisible = false
return true
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.MenuItem
import androidx.activity.viewModels
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import app.edonymyeon.databinding.ActivityMyPostBinding
import com.app.edonymyeon.presentation.common.activity.BaseActivity
Expand Down Expand Up @@ -89,7 +90,10 @@ class MyPostActivity :

private fun setMyPostsObserver() {
viewModel.posts.observe(this) {
adapter.setMyPosts(it)
binding.tvEmptyPost.isVisible = it.isEmpty()
if (it.isNotEmpty()) {
adapter.setMyPosts(it)
}
}
}

Expand Down
14 changes: 13 additions & 1 deletion android/app/src/main/res/layout/activity_my_post.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/space_my_post_list_top"
tools:listitem="@layout/item_my_post"/>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

<TextView
android:id="@+id/tv_empty_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:visibility="gone"
android:textColor="@color/black_434343"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/my_post_empty"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
15 changes: 14 additions & 1 deletion android/app/src/main/res/layout/fragment_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,18 @@
app:layout_constraintTop_toBottomOf="@id/space_search_container_bottom"
tools:listitem="@layout/item_post" />

<TextView
android:id="@+id/tv_empty_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/search_empty"
android:textColor="@color/black_434343"
android:textSize="32sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
</layout>
6 changes: 5 additions & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<string name="home_edonymyeon">이돈이면</string>
<string name="home_hot_post">HOT 게시물</string>
<string name="home_all_post">전체 게시글</string>
<string name="home_hot_post_not_content">이번 주 핫 게시글이 없습니다</string>
<string name="home_hot_post_not_content">3일간 핫 게시글이 없습니다</string>

<!-- post detail -->
<string name="post_detail_toolbar_menu_update">수정</string>
Expand Down Expand Up @@ -124,6 +124,7 @@
<string name="my_post_createdAt">%s</string>
<string name="my_post_purchase_text">%,d원 구매확정</string>
<string name="my_post_saving_text">절약확정</string>
<string name="my_post_empty">내가 쓴 글이 없습니다</string>

<!-- my_post_dialog -->
<string name="dialog_purchase_title">구매 금액과 날짜를 입력해주세요</string>
Expand Down Expand Up @@ -164,4 +165,7 @@
<string name="profile_update_image_delete">기본 이미지로 변경</string>
<string name="profile_update_nickname_title">닉네임</string>
<string name="profile_update_button_update">수정하기</string>

<!--search fragment -->
<string name="search_empty">검색된 게시글이 없습니다</string>
</resources>