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

[FIX/#264] 온보딩 뷰 / 2차 QA 반영 #266

Merged
merged 10 commits into from
Sep 27, 2024
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
24 changes: 19 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
Expand All @@ -8,7 +8,20 @@ plugins {
alias(libs.plugins.ksp)
}

val properties = Properties().apply {
load(rootProject.file("local.properties").inputStream())
}

android {
signingConfigs {
create("release") {
keyAlias = properties.getProperty("release.keyAlias")
keyPassword = properties.getProperty("release.keyPassword")
storeFile = file(properties.getProperty("release.storeFile") + "/terning/terning.jks")
storePassword = properties.getProperty("release.storePassword")
}
}

namespace = "com.terning.point"
compileSdk = libs.versions.compileSdk.get().toInt()

Expand All @@ -27,31 +40,32 @@ android {
buildConfigField(
"String",
"NATIVE_APP_KEY",
gradleLocalProperties(rootDir, providers).getProperty("native.app.key"),
properties.getProperty("native.app.key"),
)
manifestPlaceholders["NATIVE_APP_KEY"] =
gradleLocalProperties(rootDir, providers).getProperty("nativeAppKey")
properties.getProperty("nativeAppKey")
}

buildTypes {
debug {
buildConfigField(
"String",
"BASE_URL",
gradleLocalProperties(rootDir, providers).getProperty("test.base.url")
properties.getProperty("test.base.url")
)
}
release {
buildConfigField(
"String",
"BASE_URL",
gradleLocalProperties(rootDir, providers).getProperty("base.url")
properties.getProperty("base.url")
)
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun NameTextField(
val trimmedName: String
var isNameOutOfBounds = false
if (value.length > MAX_LENGTH) {
trimmedName = value.substring(0, MAX_LENGTH + 1)
trimmedName = value.substring(0, MAX_LENGTH)
isNameOutOfBounds = true
} else {
trimmedName = value
Expand Down
6 changes: 4 additions & 2 deletions feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ android {

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")

buildConfigField("String", "VERSION_NAME", "\"${libs.versions.versionName.get()}\"")
}

buildTypes {
Expand Down Expand Up @@ -92,8 +94,8 @@ dependencies {
implementation(libs.lottie)
implementation(libs.process.phoenix)
implementation(libs.accompanist.systemuicontroller)
implementation (libs.androidx.core.splashscreen)
implementation (libs.androidx.browser)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.browser)

// Compose Preview
implementation(libs.compose.ui.tooling)
Expand Down
1 change: 1 addition & 0 deletions feature/src/main/assets/terning_sign_in.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import com.terning.core.designsystem.theme.White
import com.terning.core.extension.noRippleClickable
import com.terning.core.extension.toast
import com.terning.core.state.UiState
import com.terning.feature.BuildConfig
import com.terning.feature.R
import com.terning.feature.main.MainActivity
import com.terning.feature.mypage.component.MyPageProfile
Expand All @@ -55,7 +56,6 @@ import com.terning.feature.mypage.mypage.util.MyPageDefaults.NOTICE_URL
import com.terning.feature.mypage.mypage.util.MyPageDefaults.OPINION_URL
import com.terning.feature.mypage.mypage.util.MyPageDefaults.PERSONAL_URL
import com.terning.feature.mypage.mypage.util.MyPageDefaults.SERVICE_URL
import com.terning.feature.mypage.mypage.util.MyPageDefaults.VERSION

@Composable
fun MyPageRoute(
Expand Down Expand Up @@ -386,7 +386,7 @@ fun ServiceInfo(
)
MyPageItem(
text = stringResource(id = R.string.my_page_version),
version = VERSION,
version = BuildConfig.VERSION_NAME,
icon = R.drawable.ic_my_page_version
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.terning.feature.mypage.mypage.util

object MyPageDefaults {
const val VERSION = "1.1.0"
const val NOTICE_URL =
"https://abundant-quiver-13f.notion.site/Android-49b3cc2390ee4dc389e25a5097736944"
const val OPINION_URL = "https://forms.gle/AaLpVptfg6cATYWa7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.terning.feature.onboarding.signin

import android.content.Context
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
Expand All @@ -12,6 +14,7 @@ import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand All @@ -21,10 +24,12 @@ import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.flowWithLifecycle
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.rememberLottieComposition
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.kakao.sdk.auth.model.OAuthToken
import com.kakao.sdk.user.UserApiClient
import com.terning.core.designsystem.component.image.TerningImage
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.White
import com.terning.core.extension.toast
Expand All @@ -39,6 +44,7 @@ fun SignInRoute(
) {

val systemUiController = rememberSystemUiController()

SideEffect {
systemUiController.setStatusBarColor(
color = White
Expand All @@ -47,6 +53,7 @@ fun SignInRoute(
color = White
)
}

val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current

Expand All @@ -66,7 +73,8 @@ fun SignInRoute(
}

is SignInSideEffect.SignInFailure ->
signInFailure(context = context,
signInFailure(
context = context,
error = sideEffect.error,
signInResult = { token, error ->
viewModel.signInResult(token = token, error = error)
Expand All @@ -83,9 +91,7 @@ fun SignInRoute(
SignInScreen(
onSignInClick = {
viewModel.startKakaoLogIn(
isKakaoAvailable = UserApiClient.instance.isKakaoTalkLoginAvailable(
context
)
isKakaoAvailable = UserApiClient.instance.isKakaoTalkLoginAvailable(context)
)
}
)
Expand All @@ -101,23 +107,37 @@ fun SignInScreen(
.background(color = White)
.statusBarsPadding()
.navigationBarsPadding()
.padding(horizontal = 20.dp),
horizontalAlignment = Alignment.CenterHorizontally
.padding(horizontal = 20.dp)
.padding(bottom = 82.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Bottom
) {
Spacer(modifier = Modifier.weight(1f))
TerningImage(
painter = R.drawable.ic_terning_login,
modifier = Modifier.fillMaxWidth()
)
SignInLottie()
Spacer(modifier = Modifier.weight(1f))
KakaoButton(
title = stringResource(id = R.string.sign_in_kakao_button),
onSignInClick = onSignInClick
onSignInClick = onSignInClick,
)
Spacer(modifier = Modifier.weight(1f))
}
}

@Composable
private fun SignInLottie() {
val lottieComposition by rememberLottieComposition(LottieCompositionSpec.Asset("terning_sign_in.json"))
LottieAnimation(
modifier = Modifier
.fillMaxWidth()
.aspectRatio(
(lottieComposition?.bounds
?.width()
?.toFloat()
?: 1f) / (lottieComposition?.bounds?.height() ?: 1)
),
composition = lottieComposition,
)
}

private fun startKakoTalkLogIn(
context: Context,
signInResult: (OAuthToken?, Throwable?) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.feature.onboarding.signin.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
Expand All @@ -10,9 +11,9 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.component.image.TerningImage
import com.terning.core.designsystem.theme.KakaoYellow
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
Expand All @@ -37,9 +38,10 @@ fun KakaoButton(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
TerningImage(
painter = R.drawable.ic_signin_kakao,
modifier = Modifier.padding(horizontal = 8.dp)
Image(
painter = painterResource(R.drawable.ic_signin_kakao),
modifier = Modifier.padding(horizontal = 8.dp),
contentDescription = "kakao login icon"
Comment on lines +41 to +44
Copy link
Contributor

Choose a reason for hiding this comment

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

contentDescription는 의도하신건가엽?

Copy link
Member Author

Choose a reason for hiding this comment

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

넵..! 관련 설명 써주면 좋을 것 같아서 넣었습니다:)

)
Text(
text = title,
Expand Down
Loading
Loading