Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.into.websoso.ui.createFeed.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.into.websoso.core.common.ui.component.AdaptationImage

Choose a reason for hiding this comment

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

🚫 [ktlint] standard:no-unused-imports reported by reviewdog 🐶
Unused import

import com.into.websoso.core.common.util.clickableWithoutRipple
import com.into.websoso.core.designsystem.component.NetworkImage
import com.into.websoso.core.designsystem.theme.WebsosoTheme
import com.into.websoso.core.resource.R.drawable.ic_feed_remove_image

@Composable
fun CreateFeedImageContainer(
imageUrls: List<String>,
onRemoveClick: (index: Int) -> Unit,
) {
LazyRow(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(10.dp),
contentPadding = PaddingValues(horizontal = 20.dp),
) {
items(imageUrls.size) { index ->
CreateFeedImageBox(
imageUrl = imageUrls[index],
onRemoveClick = {
onRemoveClick(index)
},
)
}
}
}

@Composable
private fun CreateFeedImageBox(
imageUrl: String,
onRemoveClick: () -> Unit,
) {
Box(
modifier = Modifier
.size(100.dp)
.aspectRatio(1f)
.clip(RoundedCornerShape(8.dp)),
) {
Image(
painter = painterResource(ic_feed_remove_image),
contentDescription = null,
modifier = Modifier
.size(38.dp)
.padding(10.dp)
.align(Alignment.TopEnd)
.clickableWithoutRipple { onRemoveClick() },
)
NetworkImage(
imageUrl = imageUrl,
contentScale = ContentScale.Crop,
)
}
}

@Preview
@Composable
private fun CreateFeedImageContainerPreview() {
WebsosoTheme {
CreateFeedImageContainer(
imageUrls = listOf(
"https://github.com/user-attachments/assets/e89a02bb-549f-414d-809f-0ab1e8f72c5f",
"https://github.com/user-attachments/assets/e89a02bb-549f-414d-809f-0ab1e8f72c5f",
"https://github.com/user-attachments/assets/e89a02bb-549f-414d-809f-0ab1e8f72c5f",
),
onRemoveClick = {},
)
}
}
15 changes: 12 additions & 3 deletions app/src/main/res/layout/activity_create_feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="비공개 기록"
android:text="@string/create_feed_private"
android:textAppearance="@style/title3"
android:textColor="@color/white" />

Expand All @@ -85,8 +85,8 @@
android:id="@+id/sc_create_feed_lock_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="@={!viewModel.isPublic}"
android:background="@null"
android:checked="@={!viewModel.isPublic}"
android:thumb="@drawable/bg_create_feed_toggle_thumb"
app:track="@drawable/bg_create_feed_toggle" />
</LinearLayout>
Expand Down Expand Up @@ -218,6 +218,15 @@
app:track="@drawable/bg_create_feed_toggle" />
</LinearLayout>

<androidx.compose.ui.platform.ComposeView
android:id="@+id/cv_create_feed_image"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_create_feed_spoiler" />

<TextView
android:id="@+id/tv_create_feed_connect_novel"
android:layout_width="wrap_content"
Expand All @@ -228,7 +237,7 @@
android:textAppearance="@style/title2"
android:textColor="@color/black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_create_feed_spoiler" />
app:layout_constraintTop_toBottomOf="@id/cv_create_feed_image" />

<com.into.websoso.core.common.ui.custom.WebsosoSearchEditText
android:id="@+id/wset_create_feed_search_novel"
Expand Down
14 changes: 5 additions & 9 deletions app/src/main/res/layout/item_feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,13 @@
android:id="@+id/cl_feed_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="28dp"
android:layout_marginVertical="10dp"
android:layout_marginStart="12dp"
android:onClick="@{(cl_feed_like) -> onClick.onLikeButtonClick(cl_feed_like, feed.id)}"
app:isVisible="@{feed.isPublic}"
app:layout_constraintBottom_toTopOf="@+id/view_feed_indicator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cl_feed_novel_info"
tools:visibility="gone">
app:layout_constraintTop_toBottomOf="@+id/cl_feed_novel_info">

<ImageView
android:id="@+id/iv_feed_thumb_up"
Expand Down Expand Up @@ -253,8 +251,7 @@
app:isVisible="@{feed.isPublic}"
app:layout_constraintBottom_toBottomOf="@+id/cl_feed_like"
app:layout_constraintStart_toEndOf="@+id/cl_feed_like"
app:layout_constraintTop_toTopOf="@+id/cl_feed_like"
tools:visibility="gone">
app:layout_constraintTop_toTopOf="@+id/cl_feed_like">

<ImageView
android:id="@+id/iv_feed_comment"
Expand Down Expand Up @@ -289,8 +286,7 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="28dp"
android:layout_marginVertical="10dp"
android:gravity="center_vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="10dp"
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/item_feed_detail_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@
android:id="@+id/cl_feed_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="28dp"
android:layout_marginStart="12dp"
android:layout_marginVertical="10dp"
android:onClick="@{(cl_feed_like) -> onClick.onLikeButtonClick(cl_feed_like, feed.id)}"
app:layout_constraintBottom_toTopOf="@+id/view_feed_indicator"
app:layout_constraintStart_toStartOf="parent"
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/res/layout/item_my_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@
android:id="@+id/cl_my_activity_like"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="10dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="28dp"
android:onClick="@{(cl_my_activity_like) -> onClick.onLikeButtonClick(cl_my_activity_like, activity.feedId)}"
app:isVisible="@{activity.isPublic}"
app:layout_constraintBottom_toTopOf="@+id/view_my_activity_indicator"
Expand Down Expand Up @@ -304,8 +303,7 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="28dp"
android:layout_marginVertical="10dp"
android:gravity="center_vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="10dp"
Expand Down
21 changes: 21 additions & 0 deletions core/resource/src/main/res/drawable/ic_feed_remove_image.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="19dp"
android:height="18dp"
android:viewportWidth="19"
android:viewportHeight="18">
<path
android:pathData="M9.469,9m-9,0a9,9 0,1 1,18 0a9,9 0,1 1,-18 0"
android:fillColor="#EEEEF2"/>
<path
android:strokeWidth="1"
android:pathData="M12.469,6L6.469,12"
android:fillColor="#00000000"
android:strokeColor="#949399"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M6.469,6L12.469,12"
android:fillColor="#00000000"
android:strokeColor="#949399"
android:strokeLineCap="round"/>
</vector>
3 changes: 2 additions & 1 deletion core/resource/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<string name="feed_removed_feed_snackbar">해당 글을 찾을 수 없어요</string>
<string name="feed_no_more_title">게시글이 없어요</string>
<string name="feed_no_more_content">새 글을 남겨보세요!</string>
<string name="feed_private_label">비공개 기록이에요.</string>
<string name="feed_private_label">나만 보는 기록이에요.</string>

<!-- 피드 상세 뷰 -->
<string name="feed_detail_title">게시글</string>
Expand Down Expand Up @@ -400,6 +400,7 @@
<string name="tv_remove_popup_menu_stop_creating">글 작성을 그만하시겠어요?</string>
<string name="remove_popup_menu_stop_creating">그만하기</string>
<string name="remove_popup_menu_keep_creating">계속 작성</string>
<string name="create_feed_private">나만 보는 기록</string>

<!-- 서재 뷰 -->
<string name="storage_storage">서재</string>
Expand Down