Skip to content
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

[UI] 미션 제안 상세 화면 UI 작업(compose 활용) (#206) #207

Merged
merged 69 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
9e867c8
[FEAT] mission-recommendation 모듈에 dashboard 폴더 추가
915dbfl Jan 30, 2024
f5b16b4
[FEAT] SuggestionDetail layout, activity, viewmodel 생성(로직x) (#206)
915dbfl Jan 30, 2024
4a6b810
[CHORE] compose 의존성 추가 (#206)
915dbfl Jan 30, 2024
ddaa666
[FEAT] LGTMTypography 추가 (#206)
915dbfl Jan 31, 2024
a62dcd5
[CHORE] sdk 버전 33 -> 34 변경, gradleplugin 버전 업데이트
915dbfl Jan 31, 2024
7023dd9
[FEAT] BackButton / Menu Button compose component 추가(로직x) (#206)
915dbfl Jan 31, 2024
e7ec1cc
[FEAT] LikeButton compose component 추가(로직x) (#206)
915dbfl Jan 31, 2024
3487861
[FEAT] DateTimeText compose component 추가(로직x) (#206)
915dbfl Jan 31, 2024
fd191aa
[FEAT] SuggestionDetail 뷰 compose 구현(로직x) (#206)
915dbfl Jan 31, 2024
800c2df
[FEAT] 미션 제안 상세 조회 api 로직 retrofit / dataSource / repository에 추가(적용x)…
915dbfl Jan 31, 2024
bba6558
[FEAT] navigate 함수 recommendation -> suggestion으로 워딩 변경
915dbfl Jan 31, 2024
63efdce
[FIX] 미션 제안 상세 조회 api에 suggeestionId를 Path로 설정해 api 호출 오류 해결 (#206)
915dbfl Jan 31, 2024
311dbb7
[FEAT] 미션 대시보드 -> 미션 제안 상세 페이지 navigation 로직 작성 (#206)
915dbfl Jan 31, 2024
f9c994d
[FEAT] 미션 제안 상세 페이지 activity manifest에 정의 (#206)
915dbfl Jan 31, 2024
6698058
[FEAT] 미션 대시보드 -> 미션 제안 상세 페이지 navigation 적용 (#206)
915dbfl Jan 31, 2024
61fb44f
[FEAT] activity_suggestion_detail에 composeView 포함 (#206)
915dbfl Jan 31, 2024
10ad84d
[FEAT] SuggestionDetailState 정의 & SuggestionDetailViewModel 로직 구현 (#206)
915dbfl Jan 31, 2024
17fb783
[FEAT] SuggestionUI를 적용한 SuggestionDetailScreen 화면에 표시 (#206)
915dbfl Jan 31, 2024
9f158b5
[UI] LikeButton text에 minWidth 적용 및 center 정렬 (#206)
915dbfl Jan 31, 2024
c3306ac
[UI] DateTimeText divider색 gray_3으로 지정 (#206)
915dbfl Jan 31, 2024
aebec1e
Merge c3306acd64eac9dfa0da29d97ba2d5ac1fc25dab into 26d44219512df39ca…
915dbfl Jan 31, 2024
c65603c
[REFACTOR] kotlin compiler version version catalog로 정의 (#206)
915dbfl Jan 31, 2024
98dbf4c
[REFACTOR] compose 의존성 api로 적용 (#206)
915dbfl Jan 31, 2024
c08b664
[REFACTOR] generic uiState 정의 및 적용 (#206)
915dbfl Jan 31, 2024
f1049a9
[REFACTOR] suggestionDetailScreen 추가 로직 별도의 함수로 분리 (#206)
915dbfl Jan 31, 2024
86021de
Merge branch 'ui/suggestion-detail' of https://github.com/hellokitty-…
915dbfl Jan 31, 2024
4aeb0c3
[UI] 회원가입 로직 description 수정 (#208)
KxxHyoRim Feb 1, 2024
90b5122
[FEAT] Notification Center Timestamp 추가를 위한 class 필드 변경 (#208)
KxxHyoRim Feb 2, 2024
5b7c816
[FEAT] DateTimeFormatter 한국 locale 명시적으로 지정 (#208)
KxxHyoRim Feb 2, 2024
26a9e7c
[FEAT] notification center UI에 timestamp 추가 (#208)
KxxHyoRim Feb 2, 2024
f95d2c9
Merge 26a9e7c7e1cad381a82f27815c4ccc8e4b5354c3 into 26d44219512df39ca…
KxxHyoRim Feb 2, 2024
c4375f8
[CHORE] DateFormatter 네이밍 수정 (#208)
KxxHyoRim Feb 2, 2024
fdf5ac0
Merge remote-tracking branch 'origin/ui/change_notification_center_ti…
KxxHyoRim Feb 2, 2024
352d18d
[UI] fragment_position.xml / editText constraint 수정 (#208)
KxxHyoRim Feb 2, 2024
998bdfe
[FIX] MyPageViewModel / UI mapper 수정에 따른 파라미터 제거 (#208)
KxxHyoRim Feb 2, 2024
c96a19d
[UI] fragment_create_mission_step1 description 추가 및 미션 가이드 버튼 생성 (#208)
KxxHyoRim Feb 2, 2024
03f47eb
[FEAT] lgtm navigator를 활용한 미션 생성 가이드 노션 링크 연동 (#208)
KxxHyoRim Feb 2, 2024
3aaf0d3
Merge pull request #209 from hellokitty-coding-club/ui/change_notific…
KxxHyoRim Feb 3, 2024
1691ec7
[UI] 미션생성 과정 description 개선 (#208)
KxxHyoRim Feb 4, 2024
e19a18d
Merge 1691ec7da7ccd9ba047252a11c02f00cf93d2102 into 3aaf0d3278c463fbb…
KxxHyoRim Feb 4, 2024
cc164b4
Merge pull request #210 from hellokitty-coding-club/ui/change_minor_d…
KxxHyoRim Feb 4, 2024
eae4732
[FEAT] mission-recommendation 모듈에 dashboard 폴더 추가
915dbfl Jan 30, 2024
fda34ac
[FEAT] SuggestionDetail layout, activity, viewmodel 생성(로직x) (#206)
915dbfl Jan 30, 2024
1e953ed
[CHORE] compose 의존성 추가 (#206)
915dbfl Jan 30, 2024
e2b63e9
[FEAT] LGTMTypography 추가 (#206)
915dbfl Jan 31, 2024
8297ad7
[CHORE] sdk 버전 33 -> 34 변경, gradleplugin 버전 업데이트
915dbfl Jan 31, 2024
48b8bbf
[FEAT] BackButton / Menu Button compose component 추가(로직x) (#206)
915dbfl Jan 31, 2024
8af83d2
[FEAT] LikeButton compose component 추가(로직x) (#206)
915dbfl Jan 31, 2024
a8fb60b
[FEAT] DateTimeText compose component 추가(로직x) (#206)
915dbfl Jan 31, 2024
b57e3f4
[FEAT] SuggestionDetail 뷰 compose 구현(로직x) (#206)
915dbfl Jan 31, 2024
7b84a5c
[FEAT] 미션 제안 상세 조회 api 로직 retrofit / dataSource / repository에 추가(적용x)…
915dbfl Jan 31, 2024
15373a1
[FEAT] navigate 함수 recommendation -> suggestion으로 워딩 변경
915dbfl Jan 31, 2024
2503b30
[FIX] 미션 제안 상세 조회 api에 suggeestionId를 Path로 설정해 api 호출 오류 해결 (#206)
915dbfl Jan 31, 2024
8b0efd5
[FEAT] 미션 대시보드 -> 미션 제안 상세 페이지 navigation 로직 작성 (#206)
915dbfl Jan 31, 2024
ee67492
[FEAT] 미션 제안 상세 페이지 activity manifest에 정의 (#206)
915dbfl Jan 31, 2024
fcfd04f
[FEAT] 미션 대시보드 -> 미션 제안 상세 페이지 navigation 적용 (#206)
915dbfl Jan 31, 2024
4b14bdc
[FEAT] activity_suggestion_detail에 composeView 포함 (#206)
915dbfl Jan 31, 2024
facc1db
[FEAT] SuggestionDetailState 정의 & SuggestionDetailViewModel 로직 구현 (#206)
915dbfl Jan 31, 2024
7b95a20
[FEAT] SuggestionUI를 적용한 SuggestionDetailScreen 화면에 표시 (#206)
915dbfl Jan 31, 2024
7129919
[UI] LikeButton text에 minWidth 적용 및 center 정렬 (#206)
915dbfl Jan 31, 2024
d7cf92a
[UI] DateTimeText divider색 gray_3으로 지정 (#206)
915dbfl Jan 31, 2024
e702fb4
[REFACTOR] kotlin compiler version version catalog로 정의 (#206)
915dbfl Jan 31, 2024
49387db
[REFACTOR] compose 의존성 api로 적용 (#206)
915dbfl Jan 31, 2024
0876008
[REFACTOR] generic uiState 정의 및 적용 (#206)
915dbfl Jan 31, 2024
eebc94f
[REFACTOR] suggestionDetailScreen 추가 로직 별도의 함수로 분리 (#206)
915dbfl Jan 31, 2024
643617f
[FEAT] BaseComposeActivity 추가 (#206)
915dbfl Feb 3, 2024
40792ca
[FEAT] BaseComposeActivity 적용 (#206)
915dbfl Feb 3, 2024
b2585fc
[FIX] develop rebase 후 BaseComposeActivity에 LgtmNavigator 적용 (#206)
915dbfl Feb 4, 2024
b20ba0b
Merge branch 'ui/suggestion-detail' of https://github.com/hellokitty-…
915dbfl Feb 4, 2024
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
6 changes: 5 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@
android:exported="false" />

<activity
android:name=".mission_recommendation.ui.SuggestionDashboardActivity"
android:name=".mission_recommendation.ui.dashboard.SuggestionDashboardActivity"
android:exported="false" />

<activity
android:name=".mission_recommendation.ui.detail.SuggestionDetailActivity"
android:exported="false" />

</application>
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/lgtm/android/di/NavigatorModule.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.lgtm.android.di

import com.lgtm.android.common_ui.navigator.FakeLgtmNavigator
import com.lgtm.android.navigator.LgtmNavigator
import com.lgtm.android.common_ui.navigator.LgtmNavigator
import com.lgtm.android.navigator.LgtmNavigatorImpl
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
Expand All @@ -13,7 +13,7 @@ import dagger.hilt.components.SingletonComponent
interface NavigatorModule {
@Binds
fun bindsLgtmNavigator(
lgtmNavigator: LgtmNavigator
): FakeLgtmNavigator
lgtmNavigatorImpl: LgtmNavigatorImpl,
): LgtmNavigator

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ package com.lgtm.android.navigator

import android.content.Context
import android.content.Intent
import android.net.Uri
import com.lgtm.android.auth.ui.SignInActivity
import com.lgtm.android.common_ui.navigator.FakeLgtmNavigator
import com.lgtm.android.common_ui.navigator.LgtmNavigator
import com.lgtm.android.create_mission.CreateMissionActivity
import com.lgtm.android.main.MainActivity
import com.lgtm.android.main.notification.NotificationCenterActivity
import com.lgtm.android.manage_mission.dashboard.DashboardActivity
import com.lgtm.android.manage_mission.ping_pong_junior.PingPongJuniorActivity
import com.lgtm.android.mission_detail.MissionDetailActivity
import com.lgtm.android.mission_recommendation.ui.SuggestionDashboardActivity
import com.lgtm.android.mission_recommendation.ui.dashboard.SuggestionDashboardActivity
import com.lgtm.android.mission_recommendation.ui.detail.SuggestionDetailActivity
import com.lgtm.android.profile.ProfileActivity
import javax.inject.Inject

class LgtmNavigator @Inject constructor(
) : FakeLgtmNavigator {
class LgtmNavigatorImpl @Inject constructor(
) : LgtmNavigator {
override fun navigateToSignIn(context: Context) {
val intent = Intent(context, SignInActivity::class.java)
context.startActivity(intent)
Expand Down Expand Up @@ -64,8 +66,23 @@ class LgtmNavigator @Inject constructor(
context.startActivity(intent)
}

override fun navigateToRecommendationDashboard(context: Context) {
override fun navigateToSuggestionDashboard(context: Context) {
val intent = Intent(context, SuggestionDashboardActivity::class.java)
context.startActivity(intent)
}

override fun navigateToSuggestionDetail(context: Context, suggestionId: Int) {
val intent = Intent(context, SuggestionDetailActivity::class.java).apply {
putExtra(SuggestionDetailActivity.SUGGESTION_ID, suggestionId)
}
context.startActivity(intent)
}

override fun openUrlInBrowser(context: Context, url: String) {
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse(url)
flags = Intent.FLAG_ACTIVITY_NEW_TASK
}
context.startActivity(intent)
}
}
20 changes: 20 additions & 0 deletions common-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ plugins {

android {
namespace = "com.lgtm.android.common_ui"

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.kotlin.compiler.get()
}
}

dependencies {
Expand All @@ -23,4 +31,16 @@ dependencies {
implementation(libs.bundles.basic.test)
implementation(libs.hilt)
kapt(libs.hilt.kapt)

//compose
val composePlatform = platform(libs.compose.bom)
api(composePlatform)
api(libs.compose.ui)
api(libs.compose.ui.tooling)
api(libs.compose.preview)
api(libs.compose.activity)
api(libs.compose.material)
api(libs.compose.foundation)
api(libs.compose.constraintlayout)
api(libs.compose.appcompat.theme)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,29 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.ListAdapter
import com.lgtm.android.common_ui.util.ItemDiffCallback
import com.lgtm.android.common_ui.viewholder.MissionSuggestionBaseViewHolder
import com.lgtm.android.common_ui.viewholder.MissionSuggestionContentViewHolder
import com.lgtm.android.common_ui.viewholder.getSuggestionViewHolder
import com.lgtm.domain.mission_suggestion.SuggestionContent
import com.lgtm.domain.mission_suggestion.SuggestionViewType

class MissionSuggestionAdapter: ListAdapter<SuggestionContent, MissionSuggestionBaseViewHolder>(
class MissionSuggestionAdapter(
private val onSuggestionClickListener: (Int) -> Unit
): ListAdapter<SuggestionContent, MissionSuggestionBaseViewHolder>(
ItemDiffCallback<SuggestionContent>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old == new }
)
) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MissionSuggestionBaseViewHolder {
return getSuggestionViewHolder(parent, SuggestionViewType.getViewTypeByOrdinal(viewType))
val viewHolder = getSuggestionViewHolder(parent, SuggestionViewType.getViewTypeByOrdinal(viewType))

when(viewType) {
SuggestionViewType.CONTENT.ordinal -> setOnSuggestionClickListener(viewHolder)
else -> Unit
}

return viewHolder
}

override fun onBindViewHolder(holder: MissionSuggestionBaseViewHolder, position: Int) {
Expand All @@ -26,4 +36,9 @@ class MissionSuggestionAdapter: ListAdapter<SuggestionContent, MissionSuggestion
override fun getItemViewType(position: Int): Int {
return getItem(position).viewType.ordinal
}

private fun setOnSuggestionClickListener(viewHolder: MissionSuggestionBaseViewHolder) {
viewHolder as MissionSuggestionContentViewHolder
viewHolder.setNavigateToSuggestionDetail(onSuggestionClickListener)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.lgtm.android.common_ui.navigator.FakeLgtmNavigator
import com.lgtm.android.common_ui.navigator.LgtmInjector
import com.lgtm.android.common_ui.navigator.LgtmNavigator
import dagger.hilt.android.EntryPointAccessors

abstract class BaseActivity<T : ViewDataBinding>(
Expand All @@ -16,7 +16,7 @@ abstract class BaseActivity<T : ViewDataBinding>(
protected lateinit var binding: T
var viewModel: BaseViewModel? = null

val lgtmNavigator: FakeLgtmNavigator by lazy {
val lgtmNavigator: LgtmNavigator by lazy {
EntryPointAccessors.fromActivity(
this, LgtmInjector.LgtmNavigatorInjector::class.java
).lgtmNavigator()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.lgtm.android.common_ui.base

import android.os.Bundle
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.runtime.Composable
import com.lgtm.android.common_ui.navigator.LgtmInjector
import com.lgtm.android.common_ui.navigator.LgtmNavigator
import dagger.hilt.android.EntryPointAccessors

abstract class BaseComposeActivity: ComponentActivity() {
var viewModel: BaseViewModel? = null

val lgtmNavigator: LgtmNavigator by lazy {
EntryPointAccessors.fromActivity(
this, LgtmInjector.LgtmNavigatorInjector::class.java
).lgtmNavigator()
}

abstract fun initializeViewModel()

@Composable
abstract fun content()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initializeViewModel()
setContent {
content()
}
}

fun moveToSignInActivity() {
viewModel?.moveToSignIn?.observe(this) {
lgtmNavigator.navigateToSignIn(this)
finishAffinity()
}
}

fun makeToast() {
viewModel?.unknownError?.observe(this) {
Toast.makeText(this, it, Toast.LENGTH_SHORT).show()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment
import com.lgtm.android.common_ui.navigator.FakeLgtmNavigator
import com.lgtm.android.common_ui.navigator.LgtmInjector
import com.lgtm.android.common_ui.navigator.LgtmNavigator
import com.lgtm.android.common_ui.util.KeyboardUtil
import dagger.hilt.android.EntryPointAccessors

Expand All @@ -25,7 +25,7 @@ abstract class BaseFragment<T : ViewDataBinding>(

lateinit var viewModel: BaseViewModel

val lgtmNavigator: FakeLgtmNavigator by lazy {
val lgtmNavigator: LgtmNavigator by lazy {
EntryPointAccessors.fromActivity(
requireActivity(), LgtmInjector.LgtmNavigatorInjector::class.java
).lgtmNavigator()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.lgtm.android.common_ui.components.buttons

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.lgtm.android.common_ui.R

@Composable
fun BackButton(
modifier: Modifier = Modifier
) {
Box(
modifier = modifier
.border(
width = 1.dp,
color = colorResource(id = R.color.gray_3),
shape = RoundedCornerShape(10.dp)
)
.background(
color = Color.White,
shape = RoundedCornerShape(10.dp)
)
.padding(7.dp)
) {
Image(
painter = painterResource(id = R.drawable.ic_back),
contentDescription = null
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.lgtm.android.common_ui.components.buttons

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.lgtm.android.common_ui.R
import com.lgtm.android.common_ui.theme.body3R

@Composable
fun LikeButton(
likeNum: String,
isLiked: Boolean,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.border(
width = 1.dp,
color = colorResource(id = R.color.gray_2),
shape = RoundedCornerShape(10.dp)
)
.background(
color = Color.White,
shape = RoundedCornerShape(10.dp)
)
.padding(
horizontal = 6.dp,
vertical = 9.dp
)
) {

Text(
modifier = Modifier
.requiredWidth(30.dp),
text = likeNum,
textAlign = TextAlign.Center,
style = Typography.body3R
)

Image(
modifier = Modifier.padding(start = 2.dp),
imageVector = ImageVector.vectorResource(id = R.drawable.ic_like_selected),
contentDescription = null
)
}
}

@Preview
@Composable
fun LikeButtonPreview() {
MaterialTheme {
LikeButton(
likeNum = "22",
isLiked = true
)
}
}
Loading
Loading