Skip to content

Commit

Permalink
[MERGE] v2.1.0 -> production
Browse files Browse the repository at this point in the history
[PRODUCTION] v2.1.0
  • Loading branch information
Marchbreeze authored Dec 4, 2024
2 parents a0b09e7 + ff8d840 commit e972759
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 112 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
🗃️app
┗ 📂di
🗃️buildSrc
🗃️build-logic
🗃️core
┣ 📂base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Constants {
const val minSdk = 28
const val targetSdk = 34

const val versionCode = 21
const val versionCode = 23
const val versionName = "2.1.0"

const val jvmVersion = "17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import coil.load
import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.Purchase
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.launchIn
Expand Down Expand Up @@ -113,7 +114,9 @@ class SelfieFragment : BaseFragment<FragmentSelfieBinding>(R.layout.fragment_sel

override fun onBillingFailure(responseCode: Int) {
viewModel.resetValidProcessLoading()
toast(stringOf(R.string.error_msg))
if (responseCode != BillingClient.BillingResponseCode.USER_CANCELED) {
toast(stringOf(R.string.error_msg))
}

}
},
Expand Down Expand Up @@ -159,7 +162,6 @@ class SelfieFragment : BaseFragment<FragmentSelfieBinding>(R.layout.fragment_sel
EVENT_CLICK_BTN, amplitudePage, mapOf(PROPERTY_BTN to "createpic"),
)
with(viewModel) {
isCompleted.value = false
if (isCreatingParentPic) {
startValidProcessLoading()
manager.purchaseProduct()
Expand Down Expand Up @@ -203,6 +205,9 @@ class SelfieFragment : BaseFragment<FragmentSelfieBinding>(R.layout.fragment_sel
if (viewModel.isCreatingParentPic) {
if (viewModel.selectedNumber.value == PictureNumber.ONE) {
tvSelfieTitle.text = stringOf(R.string.selfie_tv_title_parent_one)
ivExImage1.load(R.drawable.img_parent_ex_1)
ivExImage2.load(R.drawable.img_parent_ex_2)
ivExImage3.load(R.drawable.img_parent_ex_3)
} else {
tvSelfieTitle.text = stringOf(R.string.selfie_tv_title_parent_two)
layoutExampleImage.isVisible = false
Expand Down Expand Up @@ -306,12 +311,13 @@ class SelfieFragment : BaseFragment<FragmentSelfieBinding>(R.layout.fragment_sel
}

private fun TextView.updateButton(isEmpty: Boolean) {
text = if (isEmpty) stringOf(R.string.selfie_tv_btn_select)
else stringOf(R.string.selfie_tv_btn_reselect)
setTextColor(
if (isEmpty) colorOf(R.color.genti_green)
else colorOf(R.color.white_60)
)
if (isEmpty) {
text = stringOf(R.string.selfie_tv_btn_select)
setTextColor(colorOf(R.color.genti_green))
} else {
text = stringOf(R.string.selfie_tv_btn_reselect)
setTextColor(colorOf(R.color.white_60))
}
}

private fun observeGeneratingState() {
Expand Down Expand Up @@ -348,6 +354,7 @@ class SelfieFragment : BaseFragment<FragmentSelfieBinding>(R.layout.fragment_sel
.setMessage(getString(R.string.pay_error_dialog_msg))
.setPositiveButton(getString(R.string.pay_error_dialog_btn)) { dialog, _ -> dialog.dismiss() }
.create().show()
viewModel.resetValidProcessLoading()
}

override fun onDestroyView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package kr.genti.presentation.generate.finished
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import androidx.activity.OnBackPressedCallback
import androidx.activity.viewModels
Expand Down Expand Up @@ -128,10 +129,10 @@ class FinishedActivity : BaseActivity<ActivityFinishedBinding>(R.layout.activity
if (intent.getBooleanExtra(EXTRA_IS_PAID, false)) {
with(binding) {
tvFinishedTitle.text = stringOf(R.string.finished_tv_title_paid)
btnDownload.isVisible = false
ivFinishedTooltip.isVisible = false
btnShare.isVisible = false
btnSavePaid.isVisible = true
btnDownload.visibility = View.INVISIBLE
ivFinishedTooltip.visibility = View.INVISIBLE
btnShare.visibility = View.INVISIBLE
btnSavePaid.visibility = View.VISIBLE
}
amplitudeType = mapOf(PROPERTY_TYPE to TYPE_ORIGINAL)
amplitudePage = mapOf(PROPERTY_PAGE to "picdone")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package kr.genti.presentation.main

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.MotionEvent
import android.view.View
import android.view.WindowManager
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kr.genti.core.base.BaseDialog
import kr.genti.core.extension.setOnSingleClickListener
import kr.genti.presentation.R
import kr.genti.presentation.create.CreateActivity
import kr.genti.presentation.databinding.DialogCreateSelectBinding
Expand Down Expand Up @@ -37,13 +39,36 @@ class CreateSelectDialog : BaseDialog<DialogCreateSelectBinding>(R.layout.dialog

private fun initCreateBtnListeners() {
with(binding) {
layoutDefaultCreate.setOnSingleClickListener {
AmplitudeManager.trackEvent("click_mypicture")
navigateToCreate(false)
}
layoutParentCreate.setOnSingleClickListener {
AmplitudeManager.trackEvent("click_parentpicture")
navigateToCreate(true)
layoutDefaultCreate.setCustomTouchListener(false)
layoutParentCreate.setCustomTouchListener(true)
}
}

@SuppressLint("ClickableViewAccessibility")
private fun ConstraintLayout.setCustomTouchListener(isCreatingParentPic: Boolean) {
this.setOnTouchListener { view, event ->
when (event.action) {
MotionEvent.ACTION_DOWN -> {
if (isCreatingParentPic) {
this.setBackgroundResource(R.drawable.shape_gray_fill_green_line_6_rect)
binding.layoutDefaultCreate.alpha = 0.6F
} else {
this.setBackgroundResource(R.drawable.shape_gray_fill_green_line_6_rect)
binding.layoutParentCreate.alpha = 0.6F
}
view.performClick()
true
}
MotionEvent.ACTION_UP -> {
if (isCreatingParentPic) {
AmplitudeManager.trackEvent("click_parentpicture")
} else {
AmplitudeManager.trackEvent("click_mypicture")
}
navigateToCreate(isCreatingParentPic)
true
}
else -> false
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="1dp"
android:color="@color/genti_green" />
<corners android:radius="6dp" />
<solid android:color="@color/gray" />
</shape>
3 changes: 2 additions & 1 deletion presentation/src/main/res/layout/activity_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
android:gravity="center"
android:lineSpacingMultiplier="1.1"
android:text="@string/signup_tv_title"
android:textSize="24sp"
android:textSize="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -44,6 +44,7 @@
android:gravity="center"
android:text="@string/signup_tv_subtitle"
android:textColor="@color/white_60"
android:textSize="14dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_signup_title" />
Expand Down
112 changes: 70 additions & 42 deletions presentation/src/main/res/layout/fragment_number.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,42 @@
android:id="@+id/bg_number_one"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="40dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="4dp"
android:background="@drawable/shape_green_gradation_6_rect"
android:visibility="@{vm.selectedNumber == pictureNumber.ONE ? View.VISIBLE : View.INVISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toStartOf="@id/bg_number_two"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_number_title" />
app:layout_constraintBottom_toBottomOf="@id/btn_number_one"
app:layout_constraintEnd_toEndOf="@id/btn_number_one"
app:layout_constraintStart_toStartOf="@id/btn_number_one"
app:layout_constraintTop_toTopOf="@id/btn_number_one" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/btn_number_one"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="@{vm.selectedNumber == pictureNumber.ONE ? @drawable/shape_gray_green_fill_6_rect : @drawable/shape_gray_fill_6_rect}"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="4dp"
android:onClick="@{() -> vm.selectNumber(pictureNumber.ONE)}"
app:layout_constraintBottom_toBottomOf="@id/bg_number_one"
app:layout_constraintEnd_toEndOf="@id/bg_number_one"
app:layout_constraintStart_toStartOf="@id/bg_number_one"
app:layout_constraintTop_toTopOf="@id/bg_number_one"
tools:background="@drawable/shape_gray_green_fill_6_rect">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/btn_number_two"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_number_title">

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="@{vm.selectedNumber == pictureNumber.ONE ? @drawable/shape_gray_green_fill_6_rect : @drawable/shape_gray_fill_6_rect}"
app:layout_constraintBottom_toBottomOf="@id/view_bottom_one"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/iv_number_one"
tools:background="@drawable/shape_gray_green_fill_6_rect" />

<ImageView
android:id="@+id/iv_number_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingTop="16dp"
android:src="@drawable/img_number_one"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -85,61 +92,75 @@
style="@style/TextAppearance.Genti.Body_14_Bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/number_btn_one_title"
app:layout_constraintBottom_toTopOf="@id/tv_number_one_subtitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_number_one"
app:layout_constraintVertical_chainStyle="packed" />
app:layout_constraintTop_toBottomOf="@id/iv_number_one" />

<TextView
android:id="@+id/tv_number_one_subtitle"
style="@style/TextAppearance.Genti.Body_14_Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/number_btn_one_subtitle"
android:textColor="@color/white_60"
android:textSize="14dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_number_one_title" />

<View
android:id="@+id/view_bottom_one"
android:layout_width="0dp"
android:layout_height="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_number_one_subtitle" />

</androidx.constraintlayout.widget.ConstraintLayout>

<View
android:id="@+id/bg_number_two"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="4dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="40dp"
android:background="@drawable/shape_green_gradation_6_rect"
android:visibility="@{vm.selectedNumber == pictureNumber.TWO ? View.VISIBLE : View.INVISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/bg_number_one"
app:layout_constraintTop_toBottomOf="@id/tv_number_title" />
app:layout_constraintBottom_toBottomOf="@id/btn_number_two"
app:layout_constraintEnd_toEndOf="@id/btn_number_two"
app:layout_constraintStart_toStartOf="@id/btn_number_two"
app:layout_constraintTop_toTopOf="@id/btn_number_two" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/btn_number_two"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="@{vm.selectedNumber == pictureNumber.TWO ? @drawable/shape_gray_green_fill_6_rect : @drawable/shape_gray_fill_6_rect}"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="40dp"
android:onClick="@{() -> vm.selectNumber(pictureNumber.TWO)}"
app:layout_constraintBottom_toBottomOf="@id/bg_number_two"
app:layout_constraintEnd_toEndOf="@id/bg_number_two"
app:layout_constraintStart_toStartOf="@id/bg_number_two"
app:layout_constraintTop_toTopOf="@id/bg_number_two"
tools:background="@drawable/shape_gray_green_fill_6_rect">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_number_one"
app:layout_constraintTop_toBottomOf="@id/tv_number_title">

<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="1dp"
android:background="@{vm.selectedNumber == pictureNumber.TWO ? @drawable/shape_gray_green_fill_6_rect : @drawable/shape_gray_fill_6_rect}"
app:layout_constraintBottom_toBottomOf="@id/view_bottom_two"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/iv_number_two"
tools:background="@drawable/shape_gray_green_fill_6_rect" />

<ImageView
android:id="@+id/iv_number_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingTop="16dp"
android:src="@drawable/img_number_two"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -150,26 +171,33 @@
style="@style/TextAppearance.Genti.Body_14_Bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/number_btn_two_title"
app:layout_constraintBottom_toTopOf="@id/tv_number_two_subtitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_number_two"
app:layout_constraintVertical_chainStyle="packed" />
app:layout_constraintTop_toBottomOf="@id/iv_number_two" />

<TextView
android:id="@+id/tv_number_two_subtitle"
style="@style/TextAppearance.Genti.Body_14_Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/number_btn_two_subtitle"
android:textColor="@color/white_60"
android:textSize="14dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_number_two_title" />

<View
android:id="@+id/view_bottom_two"
android:layout_width="0dp"
android:layout_height="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_number_two_subtitle" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
Loading

0 comments on commit e972759

Please sign in to comment.