Skip to content

Commit

Permalink
Merge pull request #99 from Nexters/feature/ready-to-deploy
Browse files Browse the repository at this point in the history
[FEAT] 출시를 위한 디테일 구현
  • Loading branch information
easyhooon authored Feb 29, 2024
2 parents 7805de4 + 76c7914 commit 6f3ab9e
Show file tree
Hide file tree
Showing 37 changed files with 502 additions and 185 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
echo "SERVER_BASE_URL=${{ secrets.SERVER_BASE_URL }}" >> secrets.properties
echo "KAKAO_NATIVE_APP_KEY=${{ secrets.KAKAO_NATIVE_APP_KEY }}" >> secrets.properties
- name: Generate keystore.properties
run: |
echo "STORE_FILE=${{ secrets.STORE_FILE }}" >> keystore.properties
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> keystore.properties
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> keystore.properties
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> keystore.properties
- name: test Detekt
run: ./gradlew detekt
- name: test Ktlint
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@ keystore.properties
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json
*.google-services.json

# Secrets Properties
secrets.properties

# report module
/report/*
/report/*
16 changes: 16 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
@file:Suppress("INLINE_FROM_HIGHER_PLATFORM")

import java.util.Properties

plugins {
alias(libs.plugins.ilab.android.application)
alias(libs.plugins.ilab.android.application.compose)
alias(libs.plugins.ilab.android.application.firebase)
alias(libs.plugins.ilab.android.hilt)
alias(libs.plugins.google.secrets)
}

android {
namespace = "com.nexters.ilab.android"

signingConfigs {
create("release") {
val propertiesFile = rootProject.file("keystore.properties")
val properties = Properties()
properties.load(propertiesFile.inputStream())
storeFile = file(properties["STORE_FILE"] as String)
storePassword = properties["STORE_PASSWORD"] as String
keyAlias = properties["KEY_ALIAS"] as String
keyPassword = properties["KEY_PASSWORD"] as String
}
}

buildFeatures {
buildConfig = true
}
Expand Down Expand Up @@ -55,6 +70,7 @@ dependencies {
projects.feature.login,
projects.feature.main,
projects.feature.navigator,
projects.feature.myalbum,
projects.feature.mypage,
projects.feature.setting,
projects.feature.uploadphoto,
Expand Down
48 changes: 48 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "398737028254",
"project_id": "ilab-30193",
"storage_bucket": "ilab-30193.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:398737028254:android:6ba3775e6739a58cdff78f",
"android_client_info": {
"package_name": "com.nexters.ilab.android"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDM_j9pb7lTw_vF2-_q9T2GiFxJL6Mo8Vg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:398737028254:android:7c8d06598157705fdff78f",
"android_client_info": {
"package_name": "com.nexters.ilab.android.dev"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDM_j9pb7lTw_vF2-_q9T2GiFxJL6Mo8Vg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class AndroidApplicationFirebaseConventionPlugin : BuildLogicConvention
applyPlugins(Plugins.GoogleServices, Plugins.FirebaseCrashlytics)

dependencies {
implementation(libs.firebase.bom)
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
}
Expand Down
2 changes: 1 addition & 1 deletion core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.ilab.android.library.compose)
alias(libs.plugins.ilab.android.hilt)
alias(libs.plugins.ilab.android.retrofit)
id("kotlin-parcelize")
}

android {
Expand All @@ -13,7 +14,6 @@ android {

dependencies {
implementations(
libs.kotlinx.datetime,
libs.androidx.core,
libs.androidx.hilt.navigation.compose,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ interface ErrorHandlerActions {
fun handleException(exception: Throwable, actions: ErrorHandlerActions) {
when (exception) {
is HttpException -> {
if (exception.code() == 500) {
if (exception.code() in 500..511) {
actions.openServerErrorDialog()
} else {
Timber.e(exception)
}
}

is UnknownHostException -> {
actions.openNetworkErrorDialog()
}

is SocketTimeoutException -> {
actions.openServerErrorDialog()
}

else -> {
Timber.e(exception)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.nexters.ilab.android.core.common

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize
data class MyAlbumModel(
val styleName: String = "",
val myAlbumImageUrlList: List<String> = emptyList(),
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ package com.nexters.ilab.android.core.domain.entity
import androidx.compose.runtime.Stable

@Stable
data class UserAlbumImageStyleEntity(
data class UserInfoEntity(
val id: Long = 0L,
val uuid: Long = 0L,
val email: String = "",
val nickname: String = "",
val profileImageUrl: String = "",
val thumbnails: List<UserThumbnailEntity> = emptyList(),
)

@Stable
data class UserThumbnailEntity(
val id: Int = 0,
val name: String = "",
val images: List<UserAlbumImageEntity> = emptyList(),
)

@Stable
Expand All @@ -16,17 +26,7 @@ data class UserAlbumImageEntity(
)

@Stable
data class UserThumbnailEntity(
data class UserAlbumImageStyleEntity(
val id: Int = 0,
val images: List<UserAlbumImageEntity> = emptyList(),
)

@Stable
data class UserInfoEntity(
val id: Long = 0L,
val uuid: Long = 0L,
val email: String = "",
val nickname: String = "",
val profileImageUrl: String = "",
val thumbnails: List<UserThumbnailEntity> = emptyList(),
val name: String = "",
)
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import com.nexters.ilab.feature.createimage.viewmodel.CreateImageSideEffect
import com.nexters.ilab.feature.createimage.viewmodel.CreateImageState
import com.nexters.ilab.feature.createimage.viewmodel.CreateImageViewModel

// TODO 시간이 지나면 주기적으로 텍스트 갱신
@Composable
internal fun CreateImageRoute(
onCloseClick: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,25 @@ import com.nexters.ilab.core.ui.component.PagerIndicator
import com.nexters.ilab.core.ui.component.ServerErrorDialog
import com.nexters.ilab.core.ui.component.TopAppBarNavigationType

// TODO 하단 스타일과 스타일 입력 화면 연동
@Composable
internal fun HomeRoute(
padding: PaddingValues,
onSettingClick: () -> Unit,
onGenerateImgBtnClick: (String) -> Unit,
onNavigateToUploadPhoto: (String) -> Unit,
viewModel: HomeViewModel = hiltViewModel(),
) {
val uiState by viewModel.container.stateFlow.collectAsStateWithLifecycle()

LaunchedEffect(viewModel) {
viewModel.container.sideEffectFlow.collect { sideEffect ->
when (sideEffect) {
is HomeSideEffect.NavigateToUploadPhoto -> {
onGenerateImgBtnClick(sideEffect.selectedStyle)
is HomeSideEffect.OnCreateImageButtonClickFromStyle -> {
onNavigateToUploadPhoto(sideEffect.selectedStyle)
}

is HomeSideEffect.OnCreateImageButtonClickFromProfile -> {
onNavigateToUploadPhoto(sideEffect.selectedProfile)
}
}
}
Expand All @@ -94,7 +99,8 @@ internal fun HomeRoute(
uiState = uiState,
padding = padding,
onSettingClick = onSettingClick,
onGenerateImgBtnClick = viewModel::onGenerateImgBtnClick,
onCreateImageButtonClickFromStyle = viewModel::onCreateImageButtonClickFromStyle,
onCreateImageButtonClickFromProfile = viewModel::onCreateImageButtonClickFromProfile,
openProfileImageDialog = viewModel::openProfileImageDialog,
dismissProfileImageDialog = viewModel::dismissProfileImageDialog,
getStyleProfileList = viewModel::getStyleProfileList,
Expand All @@ -109,7 +115,8 @@ internal fun HomeScreen(
uiState: HomeState,
padding: PaddingValues,
onSettingClick: () -> Unit,
onGenerateImgBtnClick: () -> Unit,
onCreateImageButtonClickFromStyle: () -> Unit,
onCreateImageButtonClickFromProfile: () -> Unit,
openProfileImageDialog: (Int) -> Unit,
dismissProfileImageDialog: () -> Unit,
getStyleProfileList: () -> Unit,
Expand Down Expand Up @@ -144,19 +151,19 @@ internal fun HomeScreen(
}
if (uiState.isProfileImageDialogVisible) {
ProfileImageDialog(
profileImage = uiState.selectedProfileEntity,
profileImage = uiState.selectedProfileImage,
onCloseClick = dismissProfileImageDialog,
onGenerateImgBtnClickClick = {
onCreateImageButtonClickFromProfile = {
dismissProfileImageDialog()
onGenerateImgBtnClick()
onCreateImageButtonClickFromProfile()
},
)
}
HomeTopAppBar(onSettingClick)
HomeContent(
styleImageList = uiState.styleImageList,
profileImageList = uiState.profileImageList,
onGenerateImgBtnClick = onGenerateImgBtnClick,
onCreateImageButtonClickFromStyle = onCreateImageButtonClickFromStyle,
openProfileImageDialog = openProfileImageDialog,
setSelectedStyleImage = setSelectedStyleImage,
)
Expand All @@ -182,7 +189,7 @@ internal fun HomeTopAppBar(onSettingClick: () -> Unit) {
internal fun HomeContent(
styleImageList: List<StyleEntity>,
profileImageList: List<ProfileEntity>,
onGenerateImgBtnClick: () -> Unit,
onCreateImageButtonClickFromStyle: () -> Unit,
openProfileImageDialog: (Int) -> Unit,
setSelectedStyleImage: (Int) -> Unit,
) {
Expand All @@ -198,7 +205,7 @@ internal fun HomeContent(
item(span = StaggeredGridItemSpan.FullLine) {
HomeKeywordView(
styleImageList = styleImageList,
onGenerateImgBtnClick = onGenerateImgBtnClick,
onCreateImageButtonClickFromStyle = onCreateImageButtonClickFromStyle,
setSelectedStyleImage = setSelectedStyleImage,
)
}
Expand All @@ -214,7 +221,6 @@ internal fun HomeContent(
startDp = startDp,
endDp = endDp,
openProfileImageDialog = {
setSelectedStyleImage(index)
openProfileImageDialog(index)
},
)
Expand All @@ -230,7 +236,7 @@ internal fun HomeContent(
@Composable
internal fun HomeKeywordView(
styleImageList: List<StyleEntity>,
onGenerateImgBtnClick: () -> Unit,
onCreateImageButtonClickFromStyle: () -> Unit,
setSelectedStyleImage: (Int) -> Unit,
) {
val pageCount = styleImageList.size
Expand Down Expand Up @@ -290,7 +296,7 @@ internal fun HomeKeywordView(
)
Spacer(modifier = Modifier.height(32.dp))
ILabButton(
onClick = onGenerateImgBtnClick,
onClick = onCreateImageButtonClickFromStyle,
modifier = Modifier
.fillMaxWidth()
.padding(start = 20.dp, end = 20.dp)
Expand Down Expand Up @@ -358,7 +364,7 @@ internal fun ProfileImageItem(
internal fun ProfileImageDialog(
profileImage: ProfileEntity,
onCloseClick: () -> Unit,
onGenerateImgBtnClickClick: () -> Unit,
onCreateImageButtonClickFromProfile: () -> Unit,
) {
BasicAlertDialog(
onDismissRequest = onCloseClick,
Expand Down Expand Up @@ -403,7 +409,7 @@ internal fun ProfileImageDialog(
)
Spacer(modifier = Modifier.height(24.dp))
ILabButton(
onClick = onGenerateImgBtnClickClick,
onClick = onCreateImageButtonClickFromProfile,
modifier = Modifier
.fillMaxWidth()
.padding(start = 20.dp, end = 20.dp, bottom = 16.dp)
Expand All @@ -429,7 +435,8 @@ internal fun HomeScreenPreview() {
uiState = HomeState(),
padding = PaddingValues(0.dp),
onSettingClick = {},
onGenerateImgBtnClick = {},
onCreateImageButtonClickFromStyle = {},
onCreateImageButtonClickFromProfile = {},
openProfileImageDialog = {},
dismissProfileImageDialog = {},
getStyleProfileList = {},
Expand All @@ -445,6 +452,6 @@ fun ProfileImageDialogPreview() {
ProfileImageDialog(
profileImage = ProfileEntity("", "", ""),
onCloseClick = {},
onGenerateImgBtnClickClick = {},
onCreateImageButtonClickFromProfile = {},
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ fun NavController.navigateToHome(navOptions: NavOptions) {
fun NavGraphBuilder.homeNavGraph(
padding: PaddingValues,
onSettingClick: () -> Unit,
onGenerateImgBtnClick: (String) -> Unit,
onNavigateToUploadPhoto: (String) -> Unit,
) {
composable(route = HOME_ROUTE) {
HomeRoute(
padding = padding,
onSettingClick = onSettingClick,
onGenerateImgBtnClick = onGenerateImgBtnClick,
onNavigateToUploadPhoto = onNavigateToUploadPhoto,
)
}
}
Loading

0 comments on commit 6f3ab9e

Please sign in to comment.