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/#124] 전체 그래픽 추가 작업 #147

Merged
merged 24 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a3bc0e5
[ADD/#124] 이미지 파일 추가
boiledEgg-s Jul 18, 2024
0f4638d
[UI/#124] 로그인 화면 추가
boiledEgg-s Jul 18, 2024
4cd6153
Merge branch 'develop' of https://github.com/teamterning/Terning-Andr…
leeeyubin Jul 18, 2024
71489f0
Merge branch 'develop' of https://github.com/teamterning/Terning-Andr…
leeeyubin Jul 18, 2024
d430ae9
[FEAT/#124] 카카오 버튼 UI
leeeyubin Jul 18, 2024
24d7f4a
[UI/#124] SignInScreen UI
leeeyubin Jul 18, 2024
f8e542d
[UI/#124] 이미지 추가 및 버튼 영역 넓히기
leeeyubin Jul 18, 2024
0f07d93
[UI/#124] 이미지 UI
leeeyubin Jul 18, 2024
2f0b485
[UI/#124] 이미지 UI
leeeyubin Jul 18, 2024
811f0fe
[UI/#124] 이미지 크기 수정
leeeyubin Jul 18, 2024
2975e2c
[FEAT/#124] 온보딩 쪽 수정
leeeyubin Jul 18, 2024
d37c915
Merge remote-tracking branch 'origin/develop' into ui/#124-image-graphic
boiledEgg-s Jul 18, 2024
0784c55
Merge remote-tracking branch 'origin/develop' into ui/#124-image-graphic
boiledEgg-s Jul 18, 2024
899e468
[UI/#124] 프로필 선택 효과 적용
boiledEgg-s Jul 18, 2024
5f3418e
[UI/#124] 온보딩 시작 화면 그래픽 추가
boiledEgg-s Jul 18, 2024
a6afe93
[MOD/#124] 온보딩 시작화면 패딩 수정
boiledEgg-s Jul 18, 2024
2e77be1
[UI/#124] 온보딩 종료 그래픽 추가
boiledEgg-s Jul 18, 2024
e35b715
[UI/#124] 탑바 로고 추가
boiledEgg-s Jul 18, 2024
d482800
[ADD/#124] core 모듈 lottie 추가
boiledEgg-s Jul 18, 2024
f74ef49
[ADD/#124] 스크랩 취소 그래픽 추가
boiledEgg-s Jul 18, 2024
4487b58
[UI/#124] 반복 재생 제거
boiledEgg-s Jul 18, 2024
be2b301
[UI/#124] 마이페이지 이미지 추가
boiledEgg-s Jul 18, 2024
4ac2f64
Merge remote-tracking branch 'origin/develop' into ui/#124-image-graphic
boiledEgg-s Jul 18, 2024
b01b039
[CHORE/#124] 인터셉터 수정
boiledEgg-s Jul 18, 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
76 changes: 38 additions & 38 deletions app/src/main/java/com/terning/point/di/AuthInterceptor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,51 @@ class AuthInterceptor @Inject constructor(

Timber.d("GET REFRESH TOKEN : ${terningDataStore.refreshToken}")

val authRequest = if (terningDataStore.accessToken.isNotBlank()) {
val authRequest = if (terningDataStore.refreshToken.isNotBlank()) {
originalRequest.newBuilder().newAuthBuilder().build()
} else {
originalRequest
}

val response = chain.proceed(authRequest)

when (response.code) {
CODE_TOKEN_EXPIRED -> {
try {
runBlocking {
tokenReissueRepository.postReissueToken(
terningDataStore.refreshToken
)
}.onSuccess { data ->
terningDataStore.apply {
refreshToken = data.refreshToken
}

response.close()

val newRequest =
authRequest.newBuilder().removeHeader(AUTHORIZATION).newAuthBuilder()
.build()

return chain.proceed(newRequest)
}
} catch (t: Throwable) {
Timber.d(t.message)
}

terningDataStore.clearInfo()

Handler(Looper.getMainLooper()).post {
context.stringToast(TOKEN_EXPIRED_ERROR)
Handler(Looper.getMainLooper()).post {
ProcessPhoenix.triggerRebirth(
context,
Intent(context, MainActivity::class.java)
)
}
}
}
}
// when (response.code) {
// CODE_TOKEN_EXPIRED -> {
// try {
// runBlocking {
// tokenReissueRepository.postReissueToken(
// terningDataStore.refreshToken
// )
// }.onSuccess { data ->
// terningDataStore.apply {
// refreshToken = data.refreshToken
// }
//
// response.close()
//
// val newRequest =
// authRequest.newBuilder().removeHeader(AUTHORIZATION).newAuthBuilder()
// .build()
//
// return chain.proceed(newRequest)
// }
// } catch (t: Throwable) {
// Timber.d(t.message)
// }
//
// terningDataStore.clearInfo()
//
// Handler(Looper.getMainLooper()).post {
// context.stringToast(TOKEN_EXPIRED_ERROR)
// Handler(Looper.getMainLooper()).post {
// ProcessPhoenix.triggerRebirth(
// context,
// Intent(context, MainActivity::class.java)
// )
// }
// }
// }
// }
return response
}

Expand Down
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ dependencies {
//ThirdPartyDependencies
implementation(libs.compose.coil)
implementation(libs.okhttp)
implementation(libs.lottie)
}
1 change: 1 addition & 0 deletions core/src/main/assets/terning_scrap_cancel.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions core/src/main/assets/terning_start_home.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
package com.terning.core.designsystem.component.bottomsheet

import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
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.padding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.itemsIndexed
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
import androidx.compose.material3.rememberModalBottomSheetState
Expand All @@ -20,11 +26,15 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.terning.core.R
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.extension.noRippleClickable
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -88,12 +98,12 @@ fun RadioButtonGroup(
onOptionSelected: (Int) -> Unit
) {
val options = listOf(
R.drawable.ic_character1,
R.drawable.ic_character2,
R.drawable.ic_character3,
R.drawable.ic_character4,
R.drawable.ic_character5,
R.drawable.ic_character6
R.drawable.ic_terning_profile_00,
R.drawable.ic_terning_profile_01,
R.drawable.ic_terning_profile_02,
R.drawable.ic_terning_profile_03,
R.drawable.ic_terning_profile_04,
R.drawable.ic_terning_profile_05
)

var selectedOption by rememberSaveable { mutableIntStateOf(options[0]) }
Expand All @@ -106,19 +116,40 @@ fun RadioButtonGroup(
.padding(horizontal = 42.dp)
) {
itemsIndexed(options) { index, option ->
val imageModifier = if (selectedOption == options[index]) {
modifier
.border(
color = TerningMain,
width = 2.dp,
shape = CircleShape
)
} else {
modifier
}

Image(
painter = painterResource(
id = if (option == selectedOption) R.drawable.ic_selected_character
else option
id = option
),
contentDescription = stringResource(id = R.string.sign_up_bottom_sheet_description),
modifier = modifier
modifier = imageModifier
.aspectRatio(1f)
.noRippleClickable {
onOptionSelected(index)
selectedOption = option
}
.clip(shape = CircleShape)
)
}
}
}

@Preview(showBackground = true)
@Composable
fun SignUpBottomSheetPreview() {
TerningPointTheme {
RadioButtonGroup(
onOptionSelected = {}
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
import com.airbnb.lottie.compose.rememberLottieComposition
import com.terning.core.R
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.component.item.TerningLottieAnimation
import com.terning.core.designsystem.theme.Grey200
import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.Grey500
Expand All @@ -34,7 +41,7 @@ fun ScrapCancelDialogContent(
Box(
modifier = Modifier
.fillMaxWidth()
.padding(top = 60.dp),
.padding(top = 50.dp),
contentAlignment = Alignment.TopCenter
) {
Column(
Expand All @@ -43,34 +50,16 @@ fun ScrapCancelDialogContent(
.padding(horizontal = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Image(
painter = painterResource(
id = R.drawable.ic_character1
),
modifier = Modifier
.padding(horizontal = 4.dp)
.fillMaxWidth()
.aspectRatio(1.3f)
.background(
Grey200,
shape = RoundedCornerShape(size = 15.dp)
)
.border(
width = 1.dp,
color = TerningMain,
shape = RoundedCornerShape(size = 15.dp)
),
contentDescription = null,
contentScale = ContentScale.Fit,
alignment = Alignment.Center
TerningLottieAnimation(
jsonString = "terning_scrap_cancel.json",
modifier = Modifier.fillMaxWidth().aspectRatio(1f)
)

Text(
text = stringResource(id = R.string.dialog_content_scrap_cancel_main_title),
textAlign = TextAlign.Center,
style = TerningTheme.typography.title4,
color = Grey500,
modifier = Modifier.padding(top = 21.dp)
)
Text(
text = stringResource(id = R.string.dialog_content_scrap_cancel_sub_title),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.terning.core.designsystem.component.item

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.rememberLottieComposition

@Composable
fun TerningLottieAnimation(
jsonString: String,
modifier: Modifier = Modifier
) {
val lottieComposition by rememberLottieComposition(LottieCompositionSpec.Asset(jsonString))
LottieAnimation(
modifier = modifier,
composition = lottieComposition
)
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
package com.terning.core.designsystem.component.topappbar

import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.terning.core.R
import com.terning.core.designsystem.theme.TerningMain

@Composable
fun LogoTopAppBar(
modifier: Modifier = Modifier
) {
val configuration = LocalConfiguration.current
val heightRatio = 780f / configuration.screenHeightDp
val widthRatio = 360f / configuration.screenWidthDp
Comment on lines +20 to +21
Copy link
Member

Choose a reason for hiding this comment

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

세심한 사람...⭐


TerningBasicTopAppBar(
showBackButton = false,
actions = listOf {
Icon(
painter = painterResource(id = R.drawable.ic_logo),
painter = painterResource(id = R.drawable.ic_terning_logo_typo),
contentDescription = stringResource(id = R.string.ic_logo),
tint = TerningMain,
modifier = Modifier
.padding(start = 24.dp, end = 16.dp, top = 16.dp)
.size(width = (109 * widthRatio).dp, height = (26 * heightRatio).dp)
)
},
modifier = modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ val CalPink = Color(0xFFF260AC)

// Other
val WarningRed = Color(0xFFF54645)
val SundayRed = Color(0xFFEB1211)
val SundayRed = Color(0xFFEB1211)
val KakaoYellow = Color(0xFFFEE500)
9 changes: 0 additions & 9 deletions core/src/main/res/drawable/ic_character1.xml

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/main/res/drawable/ic_character2.xml

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/main/res/drawable/ic_character3.xml

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/main/res/drawable/ic_character4.xml

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/main/res/drawable/ic_character5.xml

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/main/res/drawable/ic_character6.xml

This file was deleted.

Loading
Loading