-
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.
- Loading branch information
1 parent
f5bab79
commit 3f8d373
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
presentation/src/main/java/co/orange/presentation/sell/progress/SellDateBottomSheet.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,44 @@ | ||
package co.orange.presentation.sell.progress | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.fragment.app.activityViewModels | ||
import co.orange.core.base.BaseBottomSheet | ||
import co.orange.core.extension.setOnSingleClickListener | ||
import kr.genti.presentation.R | ||
import kr.genti.presentation.databinding.BottomSheetSellDateBinding | ||
import java.util.Calendar | ||
|
||
class SellDateBottomSheet : | ||
BaseBottomSheet<BottomSheetSellDateBinding>(R.layout.bottom_sheet_sell_date) { | ||
private val viewModel by activityViewModels<SellProgressViewModel>() | ||
|
||
override fun onStart() { | ||
super.onStart() | ||
dialog?.window?.setBackgroundDrawableResource(R.color.transparent) | ||
} | ||
|
||
override fun onViewCreated( | ||
view: View, | ||
savedInstanceState: Bundle?, | ||
) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
initSubmitBtnListener() | ||
setDatePicker() | ||
} | ||
|
||
private fun initSubmitBtnListener() { | ||
binding.btnSubmit.setOnSingleClickListener { } | ||
} | ||
|
||
private fun setDatePicker() { | ||
binding.dpSell.apply { | ||
val calendar = Calendar.getInstance() | ||
calendar.add(Calendar.DAY_OF_YEAR, -7) | ||
minDate = calendar.timeInMillis | ||
calendar.add(Calendar.DAY_OF_YEAR, 14) | ||
maxDate = calendar.timeInMillis | ||
} | ||
} | ||
} |
File renamed without changes.