-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
619 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
presentation/src/main/java/co/orange/presentation/buy/confirm/BuyConfirmActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package co.orange.presentation.buy.confirm | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import coil.load | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import kr.genti.core.base.BaseActivity | ||
import kr.genti.core.extension.setNumberForm | ||
import kr.genti.core.extension.setOnSingleClickListener | ||
import kr.genti.presentation.R | ||
import kr.genti.presentation.databinding.ActivityBuyConfirmBinding | ||
|
||
@AndroidEntryPoint | ||
class BuyConfirmActivity : BaseActivity<ActivityBuyConfirmBinding>(R.layout.activity_buy_confirm) { | ||
private val viewModel by viewModels<BuyConfirmViewModel>() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
initExitBtnListener() | ||
initDeliveryChangeBtnListener() | ||
initTermBtnListener() | ||
initConfirmBtnListener() | ||
getIntentInfo() | ||
setIntentUi() | ||
} | ||
|
||
private fun initExitBtnListener() { | ||
binding.btnExit.setOnSingleClickListener { finish() } | ||
} | ||
|
||
private fun initDeliveryChangeBtnListener() { | ||
// TODO | ||
binding.btnChangeDelivery.setOnSingleClickListener { } | ||
} | ||
|
||
private fun initTermBtnListener() { | ||
//TODO | ||
binding.btnTermAll.setOnSingleClickListener { } | ||
binding.btnTermFirst.setOnSingleClickListener { } | ||
binding.btnTermSecond.setOnSingleClickListener { } | ||
binding.btnTermThird.setOnSingleClickListener { } | ||
} | ||
|
||
private fun initConfirmBtnListener() { | ||
// TODO | ||
binding.btnConfirmPurchase.setOnSingleClickListener { } | ||
} | ||
|
||
private fun getIntentInfo() { | ||
with(viewModel) { | ||
imageUrl = intent.getStringExtra(EXTRA_PRODUCT_URL).orEmpty() | ||
originPrice = intent.getIntExtra(EXTRA_ORIGIN_PRICE, 0) | ||
salePrice = intent.getIntExtra(EXTRA_SALE_PRICE, 0) | ||
name = intent.getStringExtra(EXTRA_NAME).orEmpty() | ||
} | ||
} | ||
|
||
private fun setIntentUi() { | ||
with(binding) { | ||
tvConfirmProductName.text = viewModel.name | ||
ivConfirmProduct.load(viewModel.imageUrl) | ||
tvConfirmProductPrice.text = viewModel.salePrice.setNumberForm() | ||
tvConfirmPriceMoney.text = viewModel.salePrice.setNumberForm() | ||
// TODO | ||
tvConfirmPriceDiscount.text = "-3,000" | ||
tvConfirmPriceCharge.text = "+350" | ||
tvConfirmPriceTotal.text = "21,350" | ||
} | ||
} | ||
|
||
|
||
companion object { | ||
private const val EXTRA_PRODUCT_URL = "EXTRA_PRODUCT_URL" | ||
private const val EXTRA_ORIGIN_PRICE = "EXTRA_ORIGIN_PRICE" | ||
private const val EXTRA_SALE_PRICE = "EXTRA_SALE_PRICE" | ||
private const val EXTRA_NAME = "EXTRA_NAME" | ||
|
||
@JvmStatic | ||
fun createIntent( | ||
context: Context, | ||
productUrl: String, | ||
originPrice: Int, | ||
salePrice: Int, | ||
name: String | ||
): Intent = Intent(context, BuyConfirmActivity::class.java).apply { | ||
putExtra(EXTRA_PRODUCT_URL, productUrl) | ||
putExtra(EXTRA_ORIGIN_PRICE, originPrice) | ||
putExtra(EXTRA_SALE_PRICE, salePrice) | ||
putExtra(EXTRA_NAME, name) | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
presentation/src/main/java/co/orange/presentation/buy/confirm/BuyConfirmViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package co.orange.presentation.buy.confirm | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class BuyConfirmViewModel | ||
@Inject | ||
constructor( | ||
// private val feedRepository: FeedRepository, | ||
) : ViewModel() { | ||
|
||
var imageUrl: String = "" | ||
var originPrice: Int = 0 | ||
var salePrice: Int = 0 | ||
var name: String = "" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
presentation/src/main/res/drawable/ic_check_term_selected.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="16dp" | ||
android:height="16dp" | ||
android:viewportWidth="16" | ||
android:viewportHeight="16"> | ||
<path | ||
android:pathData="M6.102,14.445C5.766,14.445 5.523,14.297 5.289,13.992L1.234,8.828C1.086,8.641 1.008,8.438 1.008,8.258C1.008,7.828 1.313,7.523 1.758,7.523C2.039,7.523 2.234,7.633 2.43,7.906L6.07,12.672L13.086,1.492C13.273,1.195 13.445,1.094 13.758,1.094C14.188,1.094 14.469,1.375 14.469,1.805C14.469,1.984 14.414,2.156 14.273,2.383L6.891,14.008C6.703,14.297 6.438,14.445 6.102,14.445Z" | ||
android:fillColor="#484848"/> | ||
</vector> |
9 changes: 9 additions & 0 deletions
9
presentation/src/main/res/drawable/ic_check_term_unselected.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="16dp" | ||
android:height="16dp" | ||
android:viewportWidth="16" | ||
android:viewportHeight="16"> | ||
<path | ||
android:pathData="M6.102,14.445C5.766,14.445 5.523,14.297 5.289,13.992L1.234,8.828C1.086,8.641 1.008,8.438 1.008,8.258C1.008,7.828 1.313,7.523 1.758,7.523C2.039,7.523 2.234,7.633 2.43,7.906L6.07,12.672L13.086,1.492C13.273,1.195 13.445,1.094 13.758,1.094C14.188,1.094 14.469,1.375 14.469,1.805C14.469,1.984 14.414,2.156 14.273,2.383L6.891,14.008C6.703,14.297 6.438,14.445 6.102,14.445Z" | ||
android:fillColor="#D9D9D9"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M4.744,19.449C4.402,19.117 4.412,18.551 4.744,18.219L10.994,11.959L4.744,5.709C4.412,5.377 4.412,4.82 4.744,4.479C5.076,4.127 5.652,4.137 5.984,4.479L12.234,10.729L18.484,4.479C18.816,4.137 19.383,4.137 19.725,4.479C20.066,4.811 20.057,5.377 19.725,5.709L13.475,11.959L19.725,18.219C20.057,18.551 20.057,19.107 19.725,19.449C19.393,19.791 18.816,19.781 18.484,19.449L12.234,13.199L5.984,19.449C5.652,19.781 5.086,19.781 4.744,19.449Z" | ||
android:fillColor="#000000"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/ic_check_term_selected" android:state_checked="true" /> | ||
<item android:drawable="@drawable/ic_check_term_unselected" android:state_checked="false" /> | ||
</selector> |
6 changes: 6 additions & 0 deletions
6
presentation/src/main/res/drawable/shape_gray1_line_5_rect.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<stroke android:width="1dp" /> | ||
<stroke android:color="@color/gray_1" /> | ||
<corners android:radius="5dp"/> | ||
</shape> |
8 changes: 8 additions & 0 deletions
8
presentation/src/main/res/drawable/shape_gray2_dash_line_5_rect.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:dashWidth="10dp" | ||
android:dashGap="5dp"/> | ||
<stroke android:color="@color/gray_2" /> | ||
<corners android:radius="5dp"/> | ||
</shape> |
6 changes: 6 additions & 0 deletions
6
presentation/src/main/res/drawable/shape_gray3_line_5_rect.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<stroke android:width="1dp" /> | ||
<stroke android:color="@color/gray_3" /> | ||
<corners android:radius="5dp"/> | ||
</shape> |
Oops, something went wrong.