-
Notifications
You must be signed in to change notification settings - Fork 0
파일 및 공통 모듈 리팩토링 #73
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
base: develop
Are you sure you want to change the base?
파일 및 공통 모듈 리팩토링 #73
Changes from all commits
9834a5c
01e35c7
50a844e
1326445
69c19e0
6d04654
b27b3ed
e9fbcb6
5af7142
12076b6
1b6b502
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ import androidx.compose.foundation.layout.fillMaxHeight | |
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.heightIn | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.offset | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.lazy.LazyColumn | ||
| import androidx.compose.foundation.lazy.items | ||
|
|
@@ -25,6 +25,7 @@ import androidx.compose.material3.Text | |
| import androidx.compose.material3.rememberModalBottomSheetState | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateListOf | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.runtime.rememberCoroutineScope | ||
|
|
@@ -45,6 +46,7 @@ import com.example.core.model.LinkItemInfo | |
| import com.example.file.FileViewModel | ||
| import com.example.file.R | ||
| import com.example.design.modifier.noRippleClickable | ||
| import com.example.design.theme.color.Basic | ||
| import com.example.file.ui.theme.Black | ||
| import com.example.file.ui.theme.DefaultFont | ||
| import com.example.file.ui.theme.Gray100 | ||
|
|
@@ -62,9 +64,9 @@ fun LinkCategorizationBottomSheet( | |
| ) { | ||
| val links by fileViewModel.notCategorizationLinks.collectAsStateWithLifecycle() | ||
|
|
||
| var link by remember { mutableStateOf<LinkItemInfo?>(null) } | ||
| //var link by remember { mutableStateOf<LinkItemInfo?>(null) } | ||
|
|
||
| var selectedLinks = mutableListOf<LinkItemInfo>() | ||
| val selectedLinks = remember { mutableStateListOf<LinkItemInfo>() } | ||
|
|
||
| val scope = rememberCoroutineScope() | ||
|
|
||
|
|
@@ -75,15 +77,17 @@ fun LinkCategorizationBottomSheet( | |
| title = "${folderStateViewModel.selectedTopFolder?.folderName?:""} 폴더의 미분류 링크 목록", | ||
| body = "하위폴더에 추가하실 링크를 선택해주세요!", | ||
| buttonText = "추가", | ||
| isReady = selectedLinks.isNotEmpty(), | ||
| visible = folderStateViewModel.linkCategorizationBottomSheetVisible, | ||
| onOkay = { | ||
| scope.launch{ | ||
| selectedLinks.map { | ||
| fileViewModel.updateLinkFolder( | ||
| it, | ||
| folderStateViewModel.selectedBottomFolder?.folderId!! | ||
| ) | ||
| val folderId = requireNotNull(folderStateViewModel.selectedBottomFolder?.folderId) | ||
|
|
||
| selectedLinks.forEach { | ||
| fileViewModel.updateLinkFolder(it, folderId) | ||
| } | ||
|
|
||
| selectedLinks.clear() | ||
|
Comment on lines
+80
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "LinkCategorizationBottomSheet.kt" -type fRepository: LinkYou-2025/LinkU_Android Length of output: 164 🏁 Script executed: wc -l ./feature/file/src/main/java/com/example/file/ui/bottom/sheet/LinkCategorizationBottomSheet.ktRepository: LinkYou-2025/LinkU_Android Length of output: 168 🏁 Script executed: cat -n ./feature/file/src/main/java/com/example/file/ui/bottom/sheet/LinkCategorizationBottomSheet.ktRepository: LinkYou-2025/LinkU_Android Length of output: 11453 🏁 Script executed: find . -name "FolderStateViewModel.kt" -type fRepository: LinkYou-2025/LinkU_Android Length of output: 162 🏁 Script executed: wc -l ./feature/file/src/main/java/com/example/file/viewmodel/folder/state/FolderStateViewModel.ktRepository: LinkYou-2025/LinkU_Android Length of output: 166 🏁 Script executed: cat -n ./feature/file/src/main/java/com/example/file/viewmodel/folder/state/FolderStateViewModel.ktRepository: LinkYou-2025/LinkU_Android Length of output: 6378
🛡️ 제안 수정안- isReady = selectedLinks.isNotEmpty(),
+ isReady = selectedLinks.isNotEmpty() &&
+ folderStateViewModel.selectedBottomFolder?.folderId != null,
visible = folderStateViewModel.linkCategorizationBottomSheetVisible,
onOkay = {
scope.launch{
- val folderId = requireNotNull(folderStateViewModel.selectedBottomFolder?.folderId)
+ val folderId =
+ folderStateViewModel.selectedBottomFolder?.folderId ?: return@launch
selectedLinks.forEach {
fileViewModel.updateLinkFolder(it, folderId)
}
selectedLinks.clear()
}
},🤖 Prompt for AI Agents |
||
| } | ||
| }, | ||
| onDismiss = { folderStateViewModel.updateLinkCategorizationBottomSheetVisible(false) } | ||
|
|
@@ -95,7 +99,7 @@ fun LinkCategorizationBottomSheet( | |
| verticalArrangement = Arrangement.spacedBy(10.dp) | ||
| ) { | ||
| items(links) { | ||
| val l = it | ||
| val link = it | ||
| val title = it.title | ||
| val url = it.url | ||
| val icon = domainLogoPainterOrNull(it.url)?:painterResource(R.drawable.link_categorization_default) | ||
|
|
@@ -104,64 +108,71 @@ fun LinkCategorizationBottomSheet( | |
| var checked by remember { mutableStateOf(false)} | ||
| Row( | ||
| modifier = Modifier | ||
| //.height(60.dp) | ||
| .height(60.dp) | ||
| .offset(x = (-20).dp) | ||
| .noRippleClickable{ | ||
| if(checked){ | ||
| Log.d("LinkCategorizationBottomSheet", "checked: $it") | ||
| selectedLinks.remove(l) | ||
| checked = selectedLinks.contains(l) | ||
| selectedLinks.remove(link) | ||
| checked = selectedLinks.contains(link) | ||
| } else { | ||
| Log.d("LinkCategorizationBottomSheet", "checked: $it") | ||
| selectedLinks.add(l) | ||
| checked = selectedLinks.contains(l) | ||
| selectedLinks.add(link) | ||
| checked = selectedLinks.contains(link) | ||
| } | ||
| }, | ||
| horizontalArrangement = Arrangement.spacedBy(14.dp) | ||
| horizontalArrangement = Arrangement.spacedBy(10.dp), | ||
| verticalAlignment = Alignment.CenterVertically | ||
| ) { | ||
| Checkbox( | ||
| modifier = Modifier | ||
| .clip(RoundedCornerShape(18.dp)), | ||
| checked = checked, | ||
| onCheckedChange = { | ||
| if(checked){ | ||
| Log.d("LinkCategorizationBottomSheet", "checked: $it") | ||
| selectedLinks.remove(l) | ||
| checked = selectedLinks.contains(l) | ||
| selectedLinks.remove(link) | ||
| checked = selectedLinks.contains(link) | ||
| } else { | ||
| Log.d("LinkCategorizationBottomSheet", "checked: $it") | ||
| selectedLinks.add(l) | ||
| checked = selectedLinks.contains(l) | ||
| selectedLinks.add(link) | ||
| checked = selectedLinks.contains(link) | ||
| } | ||
| }, | ||
| colors = CheckboxDefaults.colors( | ||
| checkedColor = Purple200, | ||
| uncheckedColor = Basic.gray[200], | ||
| ) | ||
| ) | ||
|
|
||
| Box( | ||
| modifier = Modifier | ||
| .height(60.dp) | ||
| .background(Gray100), | ||
| //.height(60.dp) | ||
| .background( | ||
| color = Gray100, | ||
| shape = RoundedCornerShape(18.dp) | ||
| ) | ||
| /*.clip(RoundedCornerShape(18.dp))*/, | ||
| contentAlignment = Alignment.Center | ||
| ) { | ||
| Image( | ||
| modifier = Modifier | ||
| .fillMaxHeight() | ||
| .clip(RoundedCornerShape(18.dp)), | ||
| .fillMaxHeight(), | ||
| painter = img, | ||
| contentDescription = null | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxHeight() | ||
| .padding(vertical = 8.dp), | ||
| modifier = Modifier.fillMaxHeight(), | ||
| //verticalArrangement = Arrangement.SpaceBetween | ||
|
|
||
| ) { | ||
| // 링크 상단 패딩 | ||
| Spacer(modifier = Modifier.height(7.dp)) | ||
|
|
||
| Text( | ||
| text = title, | ||
| fontSize = 15.sp, | ||
| lineHeight = 22.sp, | ||
| fontFamily = DefaultFont, | ||
| fontWeight = FontWeight(500), | ||
| color = Black, | ||
|
|
@@ -194,15 +205,17 @@ fun LinkCategorizationBottomSheet( | |
| Text( | ||
| text = url, | ||
| fontSize = 12.sp, | ||
| lineHeight = 14.sp, | ||
| fontFamily = DefaultFont, | ||
| fontWeight = FontWeight(400), | ||
| color = Gray800, | ||
| maxLines = 1, | ||
| overflow = TextOverflow.Ellipsis | ||
| ) | ||
| } | ||
| // 링크 하단 패딩 | ||
| Spacer(modifier = Modifier.height(7.dp)) | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
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.
검색했을 때, 한 글자만 검색한 사용자 입장에서 왜 검색이 안되지? 싶을 수 있어서, 디자이너와 상의 후 관련 ui 추가하는 건 어떠실까요?
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.
윤다인과 이다현의 TODO. 한글자일 때 비활성화+상태메시지 ui