Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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 @@ -2,16 +2,14 @@ package com.into.websoso.ui.createFeed

import android.os.Bundle
import android.view.View
import com.into.websoso.R.layout.dialog_editing_cancel_feed
import com.into.websoso.R.layout.dialog_report_popup_menu
import com.into.websoso.core.common.ui.base.BaseDialogFragment
import com.into.websoso.core.common.util.SingleEventHandler
import com.into.websoso.core.resource.R.string.remove_popup_menu_keep_creating
import com.into.websoso.core.resource.R.string.remove_popup_menu_stop_creating
import com.into.websoso.core.resource.R.string.tv_remove_popup_menu_stop_creating
import com.into.websoso.databinding.DialogReportPopupMenuBinding
import com.into.websoso.databinding.DialogEditingCancelFeedBinding
import com.into.websoso.ui.main.feed.FeedFragment.FeedDialogClickListener

class CreatingFeedDialogFragment : BaseDialogFragment<DialogReportPopupMenuBinding>(dialog_report_popup_menu) {
class CreatingFeedDialogFragment : BaseDialogFragment<DialogEditingCancelFeedBinding>(dialog_editing_cancel_feed) {
private val singleEventHandler: SingleEventHandler by lazy { SingleEventHandler.from() }
private val onRemoveClick: FeedDialogClickListener by lazy {
arguments?.getSerializable(EVENT) as FeedDialogClickListener
Expand All @@ -23,11 +21,8 @@ class CreatingFeedDialogFragment : BaseDialogFragment<DialogReportPopupMenuBindi
) {
super.onViewCreated(view, savedInstanceState)

binding.tvReportPopupMenuTitle.text = getString(tv_remove_popup_menu_stop_creating)
binding.tvReportPopupMenuCancel.text = getString(remove_popup_menu_keep_creating)
binding.tvReportPopupMenuReport.text = getString(remove_popup_menu_stop_creating)
binding.tvReportPopupMenuCancel.setOnClickListener { dismiss() }
binding.tvReportPopupMenuReport.setOnClickListener {
binding.tvEditingCancelFeedAlertCancelButton.setOnClickListener { dismiss() }
binding.tvEditingCancelFeedCancelButton.setOnClickListener {
singleEventHandler.throttleFirst {
dismiss()
onRemoveClick()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup.LayoutParams
import android.view.WindowManager.LayoutParams.WRAP_CONTENT
import android.widget.PopupWindow
import android.widget.TextView
Expand Down Expand Up @@ -36,7 +35,6 @@ import com.into.websoso.core.common.util.getS3ImageUrl
import com.into.websoso.core.common.util.hideKeyboard
import com.into.websoso.core.common.util.showWebsosoSnackBar
import com.into.websoso.core.common.util.toFloatPxFromDp
import com.into.websoso.core.common.util.toIntPxFromDp
import com.into.websoso.core.common.util.tracker.Tracker
import com.into.websoso.core.resource.R.drawable.ic_blocked_user_snack_bar
import com.into.websoso.core.resource.R.drawable.ic_novel_detail_check
Expand Down Expand Up @@ -375,7 +373,7 @@ class FeedDetailActivity : BaseActivity<ActivityFeedDetailBinding>(activity_feed
NovelDetailBack.RESULT_OK,
CreateFeed.RESULT_OK,
OtherUserProfileBack.RESULT_OK,
-> {
-> {
feedDetailViewModel.updateFeedDetail(feedId, CreateFeed)
}

Expand Down Expand Up @@ -467,24 +465,13 @@ class FeedDetailActivity : BaseActivity<ActivityFeedDetailBinding>(activity_feed
}

private fun setupView() {
setupRefreshView()
feedDetailViewModel.updateFeedDetail(feedId, Feed, isLiked)
binding.rvFeedDetail.apply {
adapter = feedDetailAdapter
itemAnimator = null
}
}

private fun setupRefreshView() {
binding.sptrFeedRefresh.apply {
setRefreshViewParams(LayoutParams(30.toIntPxFromDp(), 30.toIntPxFromDp()))
setLottieAnimation(LOTTIE_IMAGE)
setOnRefreshListener {
feedDetailViewModel.updateFeedDetail(feedId, FeedDetailRefreshed)
}
}
}

private fun setupObserver() {
feedDetailViewModel.feedDetailUiState.observe(this) { feedDetailUiState ->
when {
Expand Down Expand Up @@ -527,7 +514,6 @@ class FeedDetailActivity : BaseActivity<ActivityFeedDetailBinding>(activity_feed

!feedDetailUiState.loading -> {
binding.wllFeed.setWebsosoLoadingVisibility(false)
binding.sptrFeedRefresh.setRefreshing(false)
updateView(feedDetailUiState)
}
}
Expand Down Expand Up @@ -590,7 +576,6 @@ class FeedDetailActivity : BaseActivity<ActivityFeedDetailBinding>(activity_feed
private const val DEFAULT_FEED_ID: Long = -1
private const val NOTIFICATION_ID: String = "NOTIFICATION_ID"
private const val FEED_LIKE_STATUS: String = "FEED_LIKE_STATUS"
private const val LOTTIE_IMAGE = "lottie_websoso_loading.json"

fun getIntent(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ class FeedDetailViewModel
fun dispatchComment(comment: String) {
feedDetailUiState.value?.let { feedDetailUiState ->
viewModelScope.launch {
_feedDetailUiState.value = feedDetailUiState.copy(loading = true)
runCatching {
feedRepository.saveComment(feedId, comment)
}.onSuccess {
Expand All @@ -214,7 +213,6 @@ class FeedDetailViewModel
fun modifyComment(comment: String) {
feedDetailUiState.value?.let { feedDetailUiState ->
viewModelScope.launch {
_feedDetailUiState.value = feedDetailUiState.copy(loading = true)
runCatching {
feedRepository.saveModifiedComment(feedId, commentId, comment)
}.onSuccess {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class FeedFragment : BaseFragment<FragmentFeedBinding>(fragment_feed) {
onFirstItemClick = { feedId, isMyFeed ->
when (isMyFeed) {
true -> navigateToFeedEdit(feedId)

false -> showDialog<DialogReportPopupMenuBinding>(
menuType = ReportMenuType.SPOILER_FEED.name,
event = { feedViewModel.updateReportedSpoilerFeed(feedId) },
Expand Down Expand Up @@ -123,19 +124,21 @@ class FeedFragment : BaseFragment<FragmentFeedBinding>(fragment_feed) {
noinline event: () -> Unit,
) {
when (Dialog::class) {
DialogRemovePopupMenuBinding::class ->
DialogRemovePopupMenuBinding::class -> {
FeedRemoveDialogFragment
.newInstance(
menuType = menuType,
event = { event() },
).show(childFragmentManager, FeedRemoveDialogFragment.TAG)
}

DialogReportPopupMenuBinding::class ->
DialogReportPopupMenuBinding::class -> {
FeedReportDialogFragment
.newInstance(
menuType = menuType,
event = { event() },
).show(childFragmentManager, FeedReportDialogFragment.TAG)
}
}
}

Expand All @@ -153,7 +156,7 @@ class FeedFragment : BaseFragment<FragmentFeedBinding>(fragment_feed) {
isSpoiler = feed.isSpoiler,
isPublic = feed.isPublic,
feedContent = feed.content,
feedCategory = feed.relevantCategories,
feedCategory = feed.relevantCategoriesByKr,
imageUrls = feed.imageUrls,
)
} ?: throw IllegalArgumentException()
Expand Down
32 changes: 13 additions & 19 deletions app/src/main/res/layout/activity_feed_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,22 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<com.simform.refresh.SSPullToRefreshLayout
android:id="@+id/sptr_feed_refresh"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_feed_detail"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="@+id/cl_feed_detail_input"
app:layout_constraintTop_toBottomOf="@+id/cl_feed_detail_toolbar">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_feed_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

<com.into.websoso.core.common.ui.custom.WebsosoLoadingLayout
android:id="@+id/wll_feed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="100dp"
android:visibility="invisible" />
</com.simform.refresh.SSPullToRefreshLayout>
app:layout_constraintTop_toBottomOf="@+id/cl_feed_detail_toolbar" />

<com.into.websoso.core.common.ui.custom.WebsosoLoadingLayout
android:id="@+id/wll_feed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="100dp"
android:visibility="invisible" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_feed_detail_input"
Expand Down
73 changes: 73 additions & 0 deletions app/src/main/res/layout/dialog_editing_cancel_feed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_novel_detail_white_radius_14dp"
android:padding="20dp">

<ImageView
android:id="@+id/iv_editing_cancel_feed"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_marginHorizontal="102dp"
android:src="@drawable/ic_novel_detail_warning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Comment on lines +11 to +19
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

경고 아이콘 접근성 설정이 필요합니다.
장식용 이미지라면 스크린리더 노출을 막고, 의미가 있다면 설명을 추가하세요.

✅ 제안 수정
 <ImageView
     android:id="@+id/iv_editing_cancel_feed"
+    android:contentDescription="@null"
+    android:importantForAccessibility="no"
     android:layout_width="46dp"
     android:layout_height="46dp"
📝 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
<ImageView
android:id="@+id/iv_editing_cancel_feed"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_marginHorizontal="102dp"
android:src="@drawable/ic_novel_detail_warning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_editing_cancel_feed"
android:contentDescription="@null"
android:importantForAccessibility="no"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_marginHorizontal="102dp"
android:src="@drawable/ic_novel_detail_warning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
🤖 Prompt for AI Agents
In `@app/src/main/res/layout/dialog_editing_cancel_feed.xml` around lines 11 - 19,
The ImageView with id iv_editing_cancel_feed is missing accessibility info;
decide if it's decorative or meaningful: if decorative, add
android:contentDescription="@null" and android:importantForAccessibility="no" on
iv_editing_cancel_feed to hide it from screen readers; if it conveys meaning,
add a descriptive contentDescription referencing a string resource (e.g.,
`@string/`...), and ensure it is not set focusable or clickable for unintended
traversal.


<TextView
android:id="@+id/tv_editing_cancel_feed_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:gravity="center"
android:maxLines="2"
android:text="@string/tv_remove_popup_menu_stop_creating"
android:textAlignment="center"
android:textAppearance="@style/title2"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_editing_cancel_feed" />

<TextView
android:id="@+id/tv_editing_cancel_feed_cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:background="@drawable/bg_novel_info_gray_50_radius_8dp"
android:gravity="center"
android:paddingHorizontal="36dp"
android:paddingVertical="10dp"
android:text="@string/novel_rating_cancel_alert_accept"
android:textAlignment="center"
android:textAppearance="@style/label1"
android:textColor="@color/gray_300_52515F"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_editing_cancel_feed_alert_cancel_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_editing_cancel_feed_title" />

<TextView
android:id="@+id/tv_editing_cancel_feed_alert_cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:background="@drawable/bg_novel_info_primary_100_radius_8dp"
android:gravity="center"
android:paddingHorizontal="34dp"
android:paddingVertical="10dp"
android:text="@string/novel_rating_cancel_alert_cancel"
android:textAlignment="center"
android:textAppearance="@style/label1"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="@+id/tv_editing_cancel_feed_cancel_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tv_editing_cancel_feed_cancel_button"
app:layout_constraintTop_toTopOf="@+id/tv_editing_cancel_feed_cancel_button" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
16 changes: 10 additions & 6 deletions app/src/main/res/layout/fragment_my_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>

<View
android:id="@+id/view_my_page_profile_divider"
android:layout_width="0dp"
android:layout_height="3dp"
android:background="@color/gray_50_F4F5F8"
Expand All @@ -286,7 +287,7 @@
android:id="@+id/cl_my_library_genre_preference"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/cl_my_page_user_profile"
app:layout_constraintTop_toBottomOf="@id/view_my_page_profile_divider"
tools:layout_editor_absoluteX="0dp">

<TextView
Expand Down Expand Up @@ -450,15 +451,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/cl_my_page_user_profile">
app:layout_constraintTop_toBottomOf="@id/view_my_page_profile_divider">

<TextView
android:id="@+id/tv_my_library_preference_analysis_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:paddingVertical="10dp"
android:layout_marginTop="30dp"
android:paddingVertical="0dp"
android:includeFontPadding="false"
android:text="@string/my_page_taste_title"
android:textAppearance="@style/title2"
android:textColor="@color/gray_300_52515F"
Expand Down Expand Up @@ -558,14 +560,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/cl_my_library_genre_preference">
app:layout_constraintTop_toBottomOf="@id/view_my_page_novel_preference_divider">

<TextView
android:id="@+id/tv_my_library_unknown_novel_preference_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="24dp"
android:layout_marginTop="30dp"
android:paddingVertical="0dp"
android:includeFontPadding="false"
android:text="@string/my_page_taste_title"
android:textAppearance="@style/title2"
android:textColor="@color/gray_300_52515F"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_feed_detail_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
android:ellipsize="end"
android:maxLines="2"
android:text="@{feedDetail.feed.novel.title}"
android:textAppearance="@style/title3"
android:textAppearance="@style/title2"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@id/ll_feed_detail_ratings"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface UserApi {
@Path("userId") userId: Long,
@Query("lastFeedId") lastFeedId: Long,
@Query("size") size: Int,
@Query("genres") genres: Array<String>?,
@Query("genreNames") genres: Array<String>?,
@Query("isVisible") isVisible: Boolean?,
@Query("isUnVisible") isUnVisible: Boolean?,
@Query("sortCriteria") sortCriteria: String?,
Expand Down
Loading
Loading