Skip to content
Closed
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
Expand Up @@ -29,4 +29,8 @@ interface Navigator {
fun navigateToStore(
context: Context
): Intent

fun navigateToChatRoom(
context: Context
): Intent
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package `in`.koreatech.koin.domain.util

import java.text.SimpleDateFormat
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.util.Calendar
import java.util.Date
import java.util.Locale
Expand All @@ -19,11 +20,12 @@ object DateFormatUtil {
/**
* yyyy-MM-dd HH:mm:ss -> MM.dd
*/
fun getSimpleMonthAndDay(dateString: String): String {
val originalFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
val targetFormat = SimpleDateFormat("MM.dd", Locale.getDefault())
val date = originalFormat.parse(dateString)
return targetFormat.format(date)
fun getSimpleMonthAndDay(date: LocalDate): String {
return DateTimeFormatter.ofPattern("MM.dd").format(date)
}

fun getFullDate(date: LocalDate): String {
Copy link
Contributor

Choose a reason for hiding this comment

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

getSimple 로직이랑 유사한것 같은데 파라미터로 포맷 enum으로 받는거는 어떨까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

사용하지 않는 함수라 일단 제거하겠습니다!

return DateTimeFormatter.ofPattern("yyyy-MM-dd").format(date)
}

fun dayOfWeekToIndex(dayOfWeek: String): Int {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ plugins {
}

android {
namespace = "in.koreatech.koin.feature.lostandfound"
namespace = "in.koreatech.koin.feature.article"

buildFeatures {
dataBinding = true
viewBinding = true
}
}

dependencies {
Expand All @@ -14,13 +19,17 @@ dependencies {
implementation(projects.core.onboarding)
implementation(projects.core.designsystem)
implementation(projects.core.analytics)
implementation(projects.core.navigation)

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.material)

implementation(libs.coil.compose)
implementation(libs.coil.gif)
implementation(libs.glide)

implementation(libs.timber)
}
29 changes: 29 additions & 0 deletions feature/article/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity
android:name=".ArticleActivity"
android:exported="true"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="keyword" />

<category android:name="android.intent.category.DEFAULT" />

<data
android:host="article"
android:pathPrefix="/activity"
android:scheme="koin" />
</intent-filter>
</activity>

<activity
android:name=".LostAndFoundReportActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.ui.article
package `in`.koreatech.koin.feature.article

import android.content.Intent
import android.os.Bundle
Expand All @@ -10,7 +10,6 @@ import androidx.core.view.updatePadding
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import dagger.hilt.android.AndroidEntryPoint
import `in`.koreatech.koin.R
import `in`.koreatech.koin.core.activity.ActivityBase
import `in`.koreatech.koin.core.analytics.AnalyticsConstant
import `in`.koreatech.koin.core.analytics.EventAction
Expand All @@ -20,9 +19,11 @@ import `in`.koreatech.koin.core.navigation.utils.EXTRA_BOARD_ID
import `in`.koreatech.koin.core.navigation.utils.EXTRA_ID
import `in`.koreatech.koin.core.util.dataBinding
import `in`.koreatech.koin.core.util.whiteStatusBar
import `in`.koreatech.koin.databinding.ActivityArticleBinding
import `in`.koreatech.koin.ui.article.ArticleDetailFragment.Companion.ARTICLE_ID
import `in`.koreatech.koin.ui.article.ArticleDetailFragment.Companion.NAVIGATED_BOARD_ID
import `in`.koreatech.koin.feature.article.databinding.ActivityArticleBinding
import `in`.koreatech.koin.feature.article.enums.ArticleBoardType
import `in`.koreatech.koin.feature.article.model.ArticleToolbarState
import `in`.koreatech.koin.feature.article.ui.article.detail.ArticleDetailFragment.Companion.ARTICLE_ID
import `in`.koreatech.koin.feature.article.ui.article.detail.ArticleDetailFragment.Companion.NAVIGATED_BOARD_ID
import timber.log.Timber

@AndroidEntryPoint
Expand All @@ -48,10 +49,9 @@ class ArticleActivity : ActivityBase() {

window.whiteStatusBar()

val navHostFragment =
supportFragmentManager.findFragmentById(
R.id.nav_host_article_fragment
) as NavHostFragment
val navHostFragment = supportFragmentManager.findFragmentById(
R.id.nav_host_article_fragment
) as NavHostFragment
navController = navHostFragment.navController

navController.addOnDestinationChangedListener { _, dest, _ ->
Expand All @@ -63,9 +63,11 @@ class ArticleActivity : ActivityBase() {
R.id.articleLostAndFoundWriteLostFragment -> setToolbar(
ArticleToolbarState.ARTICLE_LOSTANDFOUND_LOST_ITEM
)

R.id.articleLostAndFoundWriteFoundFragment -> setToolbar(
ArticleToolbarState.ARTICLE_LOSTANDFOUND_FOUND_ITEM
)

R.id.articleLostAndFoundDetailFragment -> setToolbar(
ArticleToolbarState.ARTICLE_DETAIL
)
Expand Down Expand Up @@ -99,6 +101,7 @@ class ArticleActivity : ActivityBase() {
R.id.articleKeywordFragment
) // See ArticleKeywordFragment, LoginActivity
}

"article_detail" -> {
setNavigationGraph()
val articleId = uri.getQueryParameter("article_id")?.toIntOrNull() ?: 0
Expand All @@ -112,9 +115,11 @@ class ArticleActivity : ActivityBase() {
)
)
}

"article_lost_and_found" -> {
setNavigationGraph(ArticleBoardType.LOSTANDFOUND.id)
}

null -> {
val bundle = intent.getBundleExtra(BUNDLE_ARTICLE_EXTRA_KEY)
bundle?.getInt(START_BOARD)?.let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.feature.lostandfound
package `in`.koreatech.koin.feature.article

const val IMAGE_MAX_COUNT = 10
const val DESCRIPTION_MAX_LENGTH = 1000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.ui.article.lostandfound
package `in`.koreatech.koin.feature.article

import android.content.Intent
import android.os.Bundle
Expand All @@ -7,10 +7,8 @@ import androidx.activity.compose.setContent
import androidx.core.os.bundleOf
import dagger.hilt.android.AndroidEntryPoint
import `in`.koreatech.koin.core.designsystem.util.enableEdgeToEdgeWithDarkStatusBar
import `in`.koreatech.koin.feature.lostandfound.ui.report.LostAndFoundReport
import `in`.koreatech.koin.ui.article.ArticleActivity
import `in`.koreatech.koin.ui.article.ArticleActivity.Companion.BUNDLE_ARTICLE_EXTRA_KEY
import `in`.koreatech.koin.ui.article.ArticleBoardType
import `in`.koreatech.koin.feature.article.enums.ArticleBoardType
import `in`.koreatech.koin.feature.article.ui.lostandfound.report.LostAndFoundReport

@AndroidEntryPoint
class LostAndFoundReportActivity : ComponentActivity() {
Expand All @@ -24,9 +22,9 @@ class LostAndFoundReportActivity : ComponentActivity() {
startActivity(
Intent(this, ArticleActivity::class.java).apply {
putExtra(
BUNDLE_ARTICLE_EXTRA_KEY,
ArticleActivity.Companion.BUNDLE_ARTICLE_EXTRA_KEY,
bundleOf(
ArticleActivity.START_BOARD to ArticleBoardType.LOSTANDFOUND.id
ArticleActivity.Companion.START_BOARD to ArticleBoardType.LOSTANDFOUND.id
)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.feature.lostandfound.component
package `in`.koreatech.koin.feature.article.component

import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
Expand Down Expand Up @@ -26,7 +26,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import `in`.koreatech.koin.core.designsystem.noRippleClickable
import `in`.koreatech.koin.core.designsystem.theme.KoinTheme
import `in`.koreatech.koin.feature.lostandfound.R
import `in`.koreatech.koin.feature.article.R

/**
* Dropdown Component
Expand All @@ -49,8 +49,7 @@ fun Dropdown(
)

Row(
modifier =
Modifier
modifier = Modifier
.clip(KoinTheme.shapes.medium)
.background(
color = KoinTheme.colors.info200
Expand Down Expand Up @@ -81,8 +80,7 @@ fun Dropdown(
* @see [androidx.compose.material3.DropdownMenu]
*/
DropdownMenu(
modifier =
Modifier
modifier = Modifier
.width(96.dp)
.padding(0.dp),
expanded = isDropdownExpanded,
Expand All @@ -92,8 +90,7 @@ fun Dropdown(
shadowElevation = 0.dp
) {
Box(
modifier =
Modifier
modifier = Modifier
.fillMaxSize()
.clip(KoinTheme.shapes.medium)
.background(
Expand All @@ -106,8 +103,7 @@ fun Dropdown(
text = it,
style = KoinTheme.typography.medium14.copy(textAlign = TextAlign.Center),
color = KoinTheme.colors.primary600,
modifier =
Modifier
modifier = Modifier
.fillMaxWidth()
.noRippleClickable {
onItemSelected(index)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.feature.lostandfound.component
package `in`.koreatech.koin.feature.article.component

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -18,9 +18,9 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import `in`.koreatech.koin.core.designsystem.noRippleClickable
import `in`.koreatech.koin.core.designsystem.theme.KoinTheme
import `in`.koreatech.koin.feature.lostandfound.R
import `in`.koreatech.koin.feature.lostandfound.enums.ArticleBoardType
import `in`.koreatech.koin.feature.lostandfound.model.ArticleHeaderState
import `in`.koreatech.koin.feature.article.R
import `in`.koreatech.koin.feature.article.enums.ArticleBoardType
import `in`.koreatech.koin.feature.article.model.ArticleHeaderState

@Composable
fun HotArticle(
Expand All @@ -37,8 +37,7 @@ fun HotArticle(

hotArticleList.forEach { hotArticle ->
HotArticleItem(
hotArticleData =
HotArticleData(
hotArticleData = HotArticleData(
articleId = hotArticle.id,
articleTitle = hotArticle.title,
board = hotArticle.board
Expand All @@ -57,17 +56,15 @@ fun HotArticleItem(
navigateToHotArticle: (HotArticleData) -> Unit
) {
Row(
modifier =
modifier
modifier = modifier
.fillMaxWidth()
.noRippleClickable { navigateToHotArticle(hotArticleData) }
.padding(vertical = 12.dp, horizontal = 24.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(hotArticleData.board.koreanName),
style =
KoinTheme.typography.bold12.copy(
style = KoinTheme.typography.bold12.copy(
fontWeight = FontWeight.SemiBold,
color = KoinTheme.colors.primary600
)
Expand All @@ -77,8 +74,7 @@ fun HotArticleItem(
text = hotArticleData.articleTitle,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style =
KoinTheme.typography.bold14.copy(
style = KoinTheme.typography.bold14.copy(
fontWeight = FontWeight.SemiBold,
color = Color.Black
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.feature.lostandfound.component
package `in`.koreatech.koin.feature.article.component

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
Expand All @@ -8,7 +8,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import `in`.koreatech.koin.feature.lostandfound.enums.LostItemCategory
import `in`.koreatech.koin.feature.article.enums.LostItemCategory

@Composable
fun ItemTypeChip(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.feature.lostandfound.component
package `in`.koreatech.koin.feature.article.component

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
Expand Down Expand Up @@ -118,8 +118,7 @@ internal fun LostAndFoundTextChipScrollGroup(
.drawWithContent {
drawContent()
drawRect(
brush =
Brush.horizontalGradient(
brush = Brush.horizontalGradient(
0f to Color.White,
0.1f to Color.Transparent,
0.9f to Color.Transparent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package `in`.koreatech.koin.feature.lostandfound.component
package `in`.koreatech.koin.feature.article.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Row
Expand All @@ -16,7 +16,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import `in`.koreatech.koin.core.designsystem.theme.KoinTheme
import `in`.koreatech.koin.feature.lostandfound.R
import `in`.koreatech.koin.feature.article.R

@Composable
fun LoadingDialog() {
Expand All @@ -25,8 +25,7 @@ fun LoadingDialog() {
properties = DialogProperties(dismissOnBackPress = false, dismissOnClickOutside = false)
) {
Row(
modifier =
Modifier
modifier = Modifier
.background(KoinTheme.colors.primary500)
.padding(vertical = 24.dp, horizontal = 24.dp),
verticalAlignment = Alignment.CenterVertically
Expand Down
Loading