Skip to content

Commit

Permalink
Merge pull request #173 from AII-the-time/fix/#172-qa
Browse files Browse the repository at this point in the history
[Fix/#172] v1.4.0 배포 전 자잘한 오류 수정
  • Loading branch information
915dbfl authored Nov 23, 2023
2 parents fd68d31 + 48187b1 commit 6050840
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 49 deletions.
Binary file modified app/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ abstract class BaseDialogFiltering : BaseDialog<BaseDialogFilteringBinding>(R.la
binding.customCalendar.initCustomCalendarViewModel(customCalendarViewModel)
}

abstract fun onFilteringBtnClick(startDate: Date, endDate: Date?)
abstract fun onFilteringBtnClick(startDate: Date)


private fun setBtnFilteringSearchClickListener() {
binding.btnFilteringSearch.setOnClickListener {
dismiss()
val startDate = customCalendarViewModel.startDate.value
val endDate = customCalendarViewModel.endDate.value
if (startDate != null) {
onFilteringBtnClick(startDate, endDate)
onFilteringBtnClick(startDate)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ class CustomCalendarViewModel: BaseViewModel() {
set(Calendar.SECOND, 0)
set(Calendar.MILLISECOND, 0) }.time)
val startDate: LiveData<Date?> = _startDate
private val _endDate = MutableLiveData<Date?>(null)
val endDate: LiveData<Date?> = _endDate

fun setStartDate(date: Date) {
_startDate.postValue(date)
_endDate.postValue(null)
}

fun setEndDate(date: Date) {
_endDate.postValue(date)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@ class CustomCalendarAdapter(
holder.bind(item, baseDateFormat.format(item))
holder.itemView.apply {
setOnClickListener {
if (!isDatePicker && customCalendarViewModel.endDate.value == null) {
if (customCalendarViewModel.startDate.value!! >= item) {
customCalendarViewModel.setStartDate(item)
} else {
customCalendarViewModel.setEndDate(item)
}
} else {
customCalendarViewModel.setStartDate(item)
}
customCalendarViewModel.setStartDate(item)
}
}
}
Expand All @@ -71,29 +63,14 @@ class CustomCalendarDateViewHolder(
viewModel.startDate.observe(lifecycleOwner) {
changeBackground(date)
}
viewModel.endDate.observe(lifecycleOwner) {
changeBackground(date)
}
}

@SuppressLint("ResourceAsColor")
private fun changeBackground(date: Date) {
val background = if(viewModel.endDate.value == null) {
if (viewModel.startDate.value == date) {
R.drawable.shape_oval_date
} else {
R.color.white
}
val background = if (viewModel.startDate.value == date) {
R.drawable.shape_oval_date
} else {
if (viewModel.startDate.value == date) {
R.drawable.shape_round_start_date
} else if (viewModel.endDate.value == date) {
R.drawable.shape_round_end_date
} else if (date in viewModel.startDate.value!!..viewModel.endDate.value!!) {
R.color.main_trans
} else {
R.color.white
}
R.color.white
}
binding.tvCalendarDate.setBackgroundResource(background)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.swm.att.data.remote.response.StockWithMixedListDTO
import org.swm.att.data.remote.response.StockWithStateListDTO
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
Expand Down Expand Up @@ -141,19 +142,19 @@ interface AttPosService {
@Body stock: StockDTO
): Response<StockIdDTO>

@PUT("stock/{stockId}")
@DELETE("stock/{stockId}")
suspend fun deleteStock(
@Header("storeId") storeId: Int,
@Path("stockId") stockId: Int
): Response<StockIdDTO>

@PUT("preorder/{preOrderId}")
@DELETE("preorder/{preOrderId}")
suspend fun deletePreorder(
@Header("storeId") storeId: Int,
@Path("preOrderId") preorderId: Int
): Response<PreorderIdDTO>

@PUT("menu/{menuId}")
@DELETE("menu/{menuId}")
suspend fun deleteMenu(
@Header("storeId") storeId: Int,
@Path("menuId") menuId: Int
Expand All @@ -165,7 +166,7 @@ interface AttPosService {
@Body preOrderedMenus: PreOrderedMenusDTO
): Response<PreorderIdDTO>

@PUT("order/{orderId}")
@DELETE("order/{orderId}")
suspend fun cancelOrder(
@Header("storeId") storeId: Int,
@Path("orderId") orderId: Int
Expand All @@ -177,7 +178,7 @@ interface AttPosService {
@Body menu: NewMenuDTO
): Response<MenuIdDTO>

@PUT("menu/category/{categoryId}")
@DELETE("menu/category/{categoryId}")
suspend fun deleteCategory(
@Header("storeId") storeId: Int,
@Path("categoryId") categoryId: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.Date
class DialogBillFiltering(
private val billViewModel: BillViewModel
): BaseDialogFiltering() {
override fun onFilteringBtnClick(startDate: Date, endDate: Date?) {
override fun onFilteringBtnClick(startDate: Date) {
billViewModel.getBillsForFilteringDates(startDate)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.Date
class DialogPreorderFiltering(
private val preorderViewModel: PreorderViewModel
): BaseDialogFiltering() {
override fun onFilteringBtnClick(startDate: Date, endDate: Date?) {
override fun onFilteringBtnClick(startDate: Date) {
preorderViewModel.getPreordersForFilteringDates(startDate)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MenuRecipeViewHolder(
ArrayAdapter(binding.root.context, org.swm.att.home.R.layout.item_simple_text, unitArray)
binding.actMenuUnit.apply {
setAdapter(arrayAdapter)
// setText(unit, false)
setText(unit, false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.Date
class DialogInventoryDatePicker(
private val stockViewModel: StockViewModel
): BaseDialogFiltering() {
override fun onFilteringBtnClick(startDate: Date, endDate: Date?) {
override fun onFilteringBtnClick(startDate: Date) {
stockViewModel.setLastInventoryDate(startDate)
}
}
3 changes: 1 addition & 2 deletions feature/main/src/main/res/layout/fragment_stock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edt_register_stock_name"
android:maxLength="6"
android:maxLines="1"
android:paddingStart="10dp"
android:paddingEnd="10dp"
Expand All @@ -277,6 +276,7 @@
app:setEditTextStyleByIsModify="@{stockViewModel.isCreate || stockViewModel.isModify}"
android:backgroundTint="@{stockViewModel.isCreate || stockViewModel.isModify ? @color/main_trans : @color/white}"
tools:text="@string/edt_register_stock_name"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -294,7 +294,6 @@
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:enabled="@{stockViewModel.isCreate || stockViewModel.isModify}"
app:layout_constraintHorizontal_weight="2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/cl_stock_name_with_state"
Expand Down
1 change: 0 additions & 1 deletion feature/main/src/main/res/layout/item_menu_recipe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
<AutoCompleteTextView
android:id="@+id/act_menu_unit"
android:padding="0dp"
android:text="@{recipeVO.unit}"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

Expand Down

0 comments on commit 6050840

Please sign in to comment.