Skip to content

Commit

Permalink
[MERGE] #165 -> develop
Browse files Browse the repository at this point in the history
[FIX/#165] 리디자인 1차 QA
  • Loading branch information
Marchbreeze authored Nov 5, 2024
2 parents 763638b + 2ce5557 commit 2400d13
Show file tree
Hide file tree
Showing 61 changed files with 461 additions and 261 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ object Constants {
const val compileSdk = 34
const val minSdk = 28
const val targetSdk = 34
const val versionCode = 15
const val versionName = "1.2.0"
const val versionCode = 16
const val versionName = "2.0.0"
}
9 changes: 7 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ object RetrofitDependencies {

object ThirdPartyDependencies {
const val coil = "io.coil-kt:coil:${Versions.coilVersion}"
const val glide = "com.github.bumptech.glide:glide:${Versions.glideVersion}"
const val glideTransformations =
"jp.wasabeef:glide-transformations:${Versions.glideTransformationsVersion}"
const val amplitude = "com.amplitude:analytics-android:${Versions.amplitudeVersion}"
const val timber = "com.jakewharton.timber:timber:${Versions.timberVersion}"
const val progressView = "com.github.skydoves:progressview:${Versions.progressViewVersion}"
Expand All @@ -71,8 +74,10 @@ object ThirdPartyDependencies {

object ClassPathPlugins {
const val gradle = "com.android.tools.build:gradle:${Versions.gradleVersion}"
const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}"
const val hiltGradlePlugin = "com.google.dagger:hilt-android-gradle-plugin:${Versions.hiltVersion}"
const val kotlinGradlePlugin =
"org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}"
const val hiltGradlePlugin =
"com.google.dagger:hilt-android-gradle-plugin:${Versions.hiltVersion}"

const val googleServices = "com.google.gms:google-services:${Versions.googleServicesVersion}"
const val crashlyticsGradle =
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ object Versions {
const val lifecycleVersion = "2.6.1"
const val splashVersion = "1.0.1"
const val coilVersion = "2.4.0"
const val glideVersion = "4.12.0"
const val glideTransformationsVersion = "4.3.0"
const val retrofitVersion = "2.9.0"
const val jsonConverterVersion = "1.0.0"
const val okHttpVersion = "4.11.0"
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/kr/genti/core/base/BaseBottomSheet.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kr.genti.core.base

import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand All @@ -26,6 +27,12 @@ abstract class BaseBottomSheet<T : ViewDataBinding>(
return binding.root
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return super.onCreateDialog(savedInstanceState).apply {
window?.setDimAmount(0.8f)
}
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
Expand Down
9 changes: 9 additions & 0 deletions core/src/main/java/kr/genti/core/base/BaseDialog.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package kr.genti.core.base

import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand All @@ -8,6 +9,7 @@ import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.DialogFragment
import kr.genti.core.R

abstract class BaseDialog<T : ViewDataBinding>(
@LayoutRes private val layoutRes: Int,
Expand All @@ -26,6 +28,13 @@ abstract class BaseDialog<T : ViewDataBinding>(
return binding.root
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return super.onCreateDialog(savedInstanceState).apply {
window?.setWindowAnimations(R.style.DialogAnimation)
window?.setDimAmount(0.8f)
}
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/res/anim/fade_in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fromAlpha="0.0"
android:toAlpha="1.0"/>
5 changes: 5 additions & 0 deletions core/src/main/res/anim/fade_out.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fromAlpha="1.0"
android:toAlpha="0.0"/>
8 changes: 8 additions & 0 deletions core/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="DialogAnimation">
<item name="android:windowEnterAnimation">@anim/fade_in</item>
<item name="android:windowExitAnimation">@anim/fade_out</item>
</style>
</resources>
2 changes: 2 additions & 0 deletions presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ dependencies {

ThirdPartyDependencies.run {
implementation(coil)
implementation(glide)
implementation(glideTransformations)
implementation(timber)
implementation(amplitude)
implementation(progressView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>(R.layout.activity_login
imageView.imageMatrix = matrix

val animator = ObjectAnimator.ofFloat(0f, imageView.width - scaledWidth).apply {
duration = 5000
duration = 8000
addUpdateListener { animation ->
val translateX = animation.animatedValue as Float
matrix.setScale(scale, scale)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package kr.genti.presentation.auth.onboarding

import android.animation.ObjectAnimator
import android.content.Intent
import android.os.Bundle
import androidx.core.view.isVisible
import dagger.hilt.android.AndroidEntryPoint
import kr.genti.core.base.BaseActivity
import kr.genti.core.extension.initOnBackPressedListener
import kr.genti.core.extension.setOnSingleClickListener
import kr.genti.presentation.R
import kr.genti.presentation.databinding.ActivityOnboardingBinding
Expand All @@ -23,6 +25,7 @@ class OnboardingActivity : BaseActivity<ActivityOnboardingBinding>(R.layout.acti
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initOnBackPressedListener(binding.root)
initViewPager()
initNextBtnListener()
initFinishBtnListener()
Expand All @@ -44,11 +47,15 @@ class OnboardingActivity : BaseActivity<ActivityOnboardingBinding>(R.layout.acti
mapOf(PROPERTY_BTN to "next"),
)
with(binding) {
btnNext.setOnSingleClickListener {
btnNext.setOnClickListener {
vpOnboarding.currentItem += 1
if (vpOnboarding.currentItem == 2) {
btnNext.isVisible = false
btnFinish.isVisible = true
ObjectAnimator.ofFloat(ivOnboardingThird, "alpha", 0f, 1f).apply {
duration = 1000
start()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package kr.genti.presentation.auth.onboarding

import androidx.appcompat.content.res.AppCompatResources
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import kr.genti.presentation.R
import kr.genti.presentation.databinding.ItemOnboardingBinding

class OnboardingViewHolder(
Expand All @@ -11,14 +13,14 @@ class OnboardingViewHolder(
with(binding) {
ivOnboardingFirst.isVisible = position == 0
ivOnboardingSecond.isVisible = position == 1
ivOnboardingThird.isVisible = position == 2
if (position == 1) {
tvOnboardingSubtitle.text = "얼굴 사진 3장만 골라요."
tvOnboardingBody.text = "사진 생성에 이용할 본인 사진 3장을 골라주세요."
}
if (position == 2) {
tvOnboardingSubtitle.text = "나만의 특별한 사진 완성!"
tvOnboardingBody.text = "지금 젠티하러 가볼까요?"
root.background = AppCompatResources.getDrawable(root.context, R.color.transparent)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CreateActivity() : BaseActivity<ActivityCreateBinding>(R.layout.activity_c
}

private fun initBackBtnListener() {
binding.btnBack.setOnSingleClickListener {
binding.btnBack.setOnClickListener {
when (navController.currentDestination?.id) {
R.id.defineFragment -> finish()
R.id.poseFragment -> navigateBackFragment("create2", -33)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ package kr.genti.presentation.generate.finished
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.ViewGroup
import androidx.activity.OnBackPressedCallback
import androidx.activity.viewModels
import androidx.core.content.FileProvider
import androidx.core.view.isVisible
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import coil.load
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import dagger.hilt.android.AndroidEntryPoint
import jp.wasabeef.glide.transformations.BlurTransformation
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kr.genti.core.base.BaseActivity
import kr.genti.core.extension.setGusianBlur
import kr.genti.core.extension.dpToPx
import kr.genti.core.extension.setOnSingleClickListener
import kr.genti.core.extension.stringOf
import kr.genti.core.extension.toast
import kr.genti.domain.enums.PictureRatio
import kr.genti.presentation.R
import kr.genti.presentation.databinding.ActivityFinishedBinding
import kr.genti.presentation.main.profile.ProfileImageDialog.Companion.FILE_PROVIDER_AUTORITY
Expand All @@ -27,6 +32,7 @@ import kr.genti.presentation.util.AmplitudeManager
import kr.genti.presentation.util.AmplitudeManager.EVENT_CLICK_BTN
import kr.genti.presentation.util.AmplitudeManager.PROPERTY_BTN
import kr.genti.presentation.util.AmplitudeManager.PROPERTY_PAGE
import kr.genti.presentation.util.GlideResultListener
import kr.genti.presentation.util.downloadImage
import java.io.File

Expand Down Expand Up @@ -130,27 +136,50 @@ class FinishedActivity : BaseActivity<ActivityFinishedBinding>(R.layout.activity
}

private fun getIntentInfo() {
viewModel.finishedImageId = intent.getLongExtra(EXTRA_RESPONSE_ID, -1)
viewModel.finishedImageUrl = intent.getStringExtra(EXTRA_URL).orEmpty()
with(viewModel) {
finishedImageId = intent.getLongExtra(EXTRA_RESPONSE_ID, -1)
finishedImageUrl = intent.getStringExtra(EXTRA_URL).orEmpty()
finishedImageRatio = intent.getStringExtra(EXTRA_RATIO).orEmpty()
}
setImageLayout()
}

private fun setImageLayout() {
with(binding) {
ivFinishedBackground.apply {
load(viewModel.finishedImageUrl)
setGusianBlur(50f)
if (viewModel.finishedImageRatio == PictureRatio.RATIO_GARO.name) {
setGaroImageMargin()
}
ivFinishedImage.load(viewModel.finishedImageUrl) {
listener(
onSuccess = { _, _ ->
ivFinishedImage.load(viewModel.finishedImageUrl)
ivFinishedBackground.apply {
Glide.with(this.context)
.load(viewModel.finishedImageUrl)
.apply(RequestOptions.bitmapTransform(BlurTransformation(50)))
.listener(GlideResultListener {
binding.layoutLoading.isVisible = false
}
)
})
.into(this)
}
}
}

private fun setGaroImageMargin() {
with(binding) {
cvFinishedImage.layoutParams =
(cvFinishedImage.layoutParams as ViewGroup.MarginLayoutParams).apply {
marginStart = 16.dpToPx(this@FinishedActivity)
marginEnd = 16.dpToPx(this@FinishedActivity)
}
btnDownload.layoutParams =
(btnDownload.layoutParams as ViewGroup.MarginLayoutParams).apply {
marginEnd = 16.dpToPx(this@FinishedActivity)
}
tvFinishedSubtitle.layoutParams =
(tvFinishedSubtitle.layoutParams as ViewGroup.MarginLayoutParams).apply {
bottomMargin = 64.dpToPx(this@FinishedActivity)
}
}
}

private fun observeDownloadCacheImage() {
viewModel.isImageDownloaded
.flowWithLifecycle(lifecycle)
Expand Down Expand Up @@ -190,16 +219,19 @@ class FinishedActivity : BaseActivity<ActivityFinishedBinding>(R.layout.activity

private const val EXTRA_RESPONSE_ID = "EXTRA_RESPONSE_ID"
private const val EXTRA_URL = "EXTRA_URL"
private const val EXTRA_RATIO = "EXTRA_RATIO"

@JvmStatic
fun createIntent(
context: Context,
id: Long,
url: String,
ratio: String,
): Intent =
Intent(context, FinishedActivity::class.java).apply {
putExtra(EXTRA_RESPONSE_ID, id)
putExtra(EXTRA_URL, url)
putExtra(EXTRA_RATIO, ratio)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class FinishedImageDialog : BaseDialog<DialogFinishedImageBinding>(R.layout.dial
)
setBackgroundDrawableResource(R.color.transparent)
}
requireActivity()
.window.decorView.rootView
.setGusianBlur(50f)
}

override fun onViewCreated(
Expand All @@ -44,6 +41,7 @@ class FinishedImageDialog : BaseDialog<DialogFinishedImageBinding>(R.layout.dial

private fun initExitBtnListener() {
binding.btnExit.setOnSingleClickListener { dismiss() }
binding.root.setOnSingleClickListener { dismiss() }
}

private fun initDownloadBtnListener() {
Expand All @@ -59,11 +57,4 @@ class FinishedImageDialog : BaseDialog<DialogFinishedImageBinding>(R.layout.dial
private fun setImage() {
binding.ivFinished.load(viewModel.finishedImageUrl)
}

override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
requireActivity()
.window.decorView.rootView
.setGusianBlur(null)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class FinishedRatingDialog :
)
setBackgroundDrawableResource(R.color.transparent)
}
requireActivity()
.window.decorView.rootView
.setGusianBlur(50f)
}

override fun onViewCreated(
Expand Down Expand Up @@ -102,11 +99,4 @@ class FinishedRatingDialog :
}
}.launchIn(lifecycleScope)
}

override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
requireActivity()
.window.decorView.rootView
.setGusianBlur(null)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class FinishedReportDialog :
)
setBackgroundDrawableResource(R.color.transparent)
}
requireActivity()
.window.decorView.rootView
.setGusianBlur(50f)
}

override fun onViewCreated(
Expand Down Expand Up @@ -94,11 +91,4 @@ class FinishedReportDialog :
}
}.launchIn(lifecycleScope)
}

override fun onDismiss(dialog: DialogInterface) {
super.onDismiss(dialog)
requireActivity()
.window.decorView.rootView
.setGusianBlur(null)
}
}
Loading

0 comments on commit 2400d13

Please sign in to comment.