-
Notifications
You must be signed in to change notification settings - Fork 3
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] #182 link category change #184
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
49c868e
[feat] #182 delete link name limit
leeseokchan00 023bab6
[feat] #182-clip-change-ui
leeseokchan00 ca6c88b
[feat] #182 clip change api
leeseokchan00 fe1c9c4
[chore] #182 ktlint
leeseokchan00 cde575d
Merge branch 'develop' of https://github.com/Link-MIND/Toaster_Androiโฆ
leeseokchan00 c485667
[refactor] #182 refactor
leeseokchan00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
core/designsystem/src/main/java/designsystem/components/bottomsheet/BottomSheetType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package designsystem.components.bottomsheet | ||
|
||
enum class BottomSheetType { | ||
LINK, | ||
CLIP, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/main/java/org/sopt/timer/model/Clip.kt โ ...rc/main/java/org/sopt/model/timer/Clip.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.sopt.timer.model | ||
package org.sopt.model.timer | ||
|
||
import org.sopt.model.category.Category | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
data-remote/link/src/main/java/org/sopt/remote/link/request/RequestPatchCategoryDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.sopt.remote.link.request | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class RequestPatchCategoryDto( | ||
@SerialName("toastId") | ||
val toastId: Long, | ||
@SerialName("categoryId") | ||
val categoryId: Long, | ||
) |
10 changes: 10 additions & 0 deletions
10
data-remote/link/src/main/java/org/sopt/remote/link/response/ResponsePatchCategoryDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.sopt.remote.link.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponsePatchCategoryDto( | ||
@SerialName("categoryId") | ||
val categoryId: Long, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
domain/link/src/main/java/org/sopt/domain/link/usecase/PatchLinkCategoryUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.sopt.domain.link.usecase | ||
|
||
import org.sopt.domain.link.repository.LinkRepository | ||
import javax.inject.Inject | ||
|
||
class PatchLinkCategoryUseCase @Inject constructor( | ||
private val linkRepository: LinkRepository, | ||
) { | ||
suspend operator fun invoke(param: Param): Result<Long> = linkRepository.patchToastCategory( | ||
toastId = param.toastId, | ||
categoryId = param.categoryId, | ||
) | ||
|
||
data class Param( | ||
val toastId: Long, | ||
val categoryId: Long, | ||
) | ||
} |
48 changes: 38 additions & 10 deletions
48
feature/clip/src/main/java/org/sopt/clip/DeleteLinkBottomSheetFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
feature/clip/src/main/java/org/sopt/clip/clipchange/ClipChangeAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.sopt.clip.clipchange | ||
|
||
import android.content.Context | ||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.core.content.ContextCompat | ||
import androidx.recyclerview.widget.ListAdapter | ||
import org.sopt.clip.databinding.ItemClipChangeBinding | ||
import org.sopt.model.timer.Clip | ||
import org.sopt.ui.view.ItemDiffCallback | ||
|
||
class ClipChangeAdapter( | ||
private val onClick: (Clip, Int) -> Unit, | ||
private val context: Context, | ||
) : ListAdapter<Clip, ClipChangeViewHolder>(DiffUtil) { | ||
var selectedPosition = -1 | ||
override fun onBindViewHolder(holder: ClipChangeViewHolder, position: Int) { | ||
holder.onBind(getItem(position), position) { clip, position -> | ||
selectItemByPosition(position, clip) | ||
onClick(clip, position) | ||
} | ||
|
||
if (position == 0) { | ||
val disMissClickColor = ContextCompat.getColor(context, org.sopt.mainfeature.R.color.neutrals400) | ||
holder.binding.ivItemClipChange.setColorFilter(disMissClickColor) | ||
holder.binding.tvItemClipChangeName.setTextColor(disMissClickColor) | ||
holder.binding.tvItemClipChangeCount.setTextColor(disMissClickColor) | ||
holder.binding.root.isEnabled = false | ||
} | ||
} | ||
|
||
private fun selectItemByPosition(position: Int, clip: Clip) { | ||
if (selectedPosition != position) { | ||
if (selectedPosition != -1) { | ||
getItem(selectedPosition).isSelected = false | ||
notifyItemChanged(selectedPosition) | ||
} | ||
clip.isSelected = true | ||
selectedPosition = position | ||
} else { | ||
clip.isSelected = !clip.isSelected | ||
if (!clip.isSelected) { | ||
selectedPosition = -1 | ||
} | ||
} | ||
notifyItemChanged(position) | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ClipChangeViewHolder { | ||
return ClipChangeViewHolder( | ||
ItemClipChangeBinding.inflate(LayoutInflater.from(parent.context), parent, false), | ||
context, | ||
) | ||
} | ||
|
||
companion object { | ||
private val DiffUtil = ItemDiffCallback<Clip>( | ||
onItemsTheSame = { old, new -> old == new }, | ||
onContentsTheSame = { old, new -> old == new }, | ||
) | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id