Skip to content

Commit

Permalink
[feat] #33 ktlintFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyunniiii committed May 24, 2024
1 parent 5cd8e6a commit db82c88
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 136 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
package org.sopt.kream.data.service


import org.sopt.kream.data.model.request.RequestDeleteScrapDto

import org.sopt.kream.data.model.request.RequestPostScrapDto
import org.sopt.kream.data.model.response.ResponseProductDetailDto
import org.sopt.kream.data.model.response.ResponseRecommendProductDto

import org.sopt.kream.data.model.response.ResponseReleaseProductDto
import org.sopt.kream.data.model.response.ResponseSearchProductDto
import org.sopt.kream.util.base.BaseResponse
import org.sopt.kream.util.base.NullableBaseResponse
import retrofit2.http.Body

import retrofit2.http.DELETE

import retrofit2.http.GET
import retrofit2.http.HTTP
import retrofit2.http.Header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import org.sopt.kream.data.datasourceimpl.ProductRemoteDataSourceImpl
import org.sopt.kream.data.repository.DummyRepositoryImpl
import org.sopt.kream.data.repository.ProductRepositoryImpl
import org.sopt.kream.presentation.ui.dummy.DummyViewModel
import org.sopt.kream.presentation.ui.main.home.release.ReleaseProductViewModel
import org.sopt.kream.presentation.ui.main.home.recommend.RecommendViewModel
import org.sopt.kream.presentation.ui.main.home.release.ReleaseProductViewModel
import org.sopt.kream.presentation.ui.productdetail.ProductDetailViewModel

import org.sopt.kream.presentation.ui.search.SearchViewModel

class ViewModelFactory : ViewModelProvider.Factory {
Expand All @@ -21,12 +20,10 @@ class ViewModelFactory : ViewModelProvider.Factory {
return SearchViewModel(ProductRepositoryImpl(ProductRemoteDataSourceImpl())) as T
} else if (modelClass.isAssignableFrom(ReleaseProductViewModel::class.java)) {
return ReleaseProductViewModel(ProductRepositoryImpl(ProductRemoteDataSourceImpl())) as T

} else if (modelClass.isAssignableFrom(ProductDetailViewModel::class.java)) {
return ProductDetailViewModel(ProductRepositoryImpl(ProductRemoteDataSourceImpl())) as T
} else if (modelClass.isAssignableFrom(RecommendViewModel::class.java)) {
return RecommendViewModel(ProductRepositoryImpl(ProductRemoteDataSourceImpl())) as T

}
throw IllegalArgumentException("Unknown ViewModel Class")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RecommendAdvertisementViewPagerAdapter() : ListAdapter<Int, RecommendAdver
ItemDiffCallback<Int>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old == new },
)
),
) {
override fun onBindViewHolder(
holder: RecommendAdvertisementViewHolder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class RecommendCircleMenuAdapter() : ListAdapter<RecommendCircleMenuType, Recomm
ItemDiffCallback<RecommendCircleMenuType>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old.name == new.name },
)
),
) {
override fun onCreateViewHolder(
parent: ViewGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class RecommendForYouAdapter(
private val navigateToProductDetail: (Int) -> Unit,
private val page: Int,
) : ListAdapter<RecommendForYouProductModel, RecommendForYouViewHolder>(
ItemDiffCallback<RecommendForYouProductModel>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old.engTitle == new.engTitle },
),
) {
ItemDiffCallback<RecommendForYouProductModel>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old.engTitle == new.engTitle },
),
) {
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class RecommendForYouViewPagerAdapter(
private val navigateToProductDetail: (Int) -> Unit,
private val navigateToSearch: (String) -> Unit,
) : ListAdapter<List<RecommendForYouProductModel>, RecommendForYouViewPagerViewHolder>(
ItemDiffCallback<List<RecommendForYouProductModel>>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old[0].engTitle == new[0].engTitle },
),
) {
ItemDiffCallback<List<RecommendForYouProductModel>>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old[0].engTitle == new[0].engTitle },
),
) {
override fun onBindViewHolder(
holder: RecommendForYouViewPagerViewHolder,
position: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ class RecommendFragment : BindingFragment<FragmentRecommendBinding>({ FragmentRe
rvRecommendJustDroppedContent.adapter = justDroppedAdapter
rvRecommendStyle.adapter = styleAdapter

vpRecommendForYouContent.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
tvRecommendForYouCurrentPage.text = (position + 1).toString()
}
})
vpRecommendForYouContent.registerOnPageChangeCallback(
object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
tvRecommendForYouCurrentPage.text = (position + 1).toString()
}
},
)
}

advertisementAdapter.submitList(RecommendAdvertisementType.RECOMMEND_ADVERTISEMENT.advertisementList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import org.sopt.kream.util.view.ItemDiffCallback
class RecommendJustDroppedAdapter(
private val navigateToProductDetail: (Int) -> Unit,
private val postScrapProduct: (Int) -> Unit,
private val deleteScrapProduct: (Int) -> Unit
private val deleteScrapProduct: (Int) -> Unit,
) : ListAdapter<
RecommendJustDroppedProductModel,
RecommendJustDroppedViewHolder,
>(
ItemDiffCallback<RecommendJustDroppedProductModel>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old == new },
),
) {
ItemDiffCallback<RecommendJustDroppedProductModel>(
onContentsTheSame = { old, new -> old == new },
onItemsTheSame = { old, new -> old == new },
),
) {
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int,
Expand All @@ -32,7 +32,7 @@ class RecommendJustDroppedAdapter(
),
navigateToProductDetail,
postScrapProduct,
deleteScrapProduct
deleteScrapProduct,
)

override fun onBindViewHolder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class RecommendViewModel(
private val _deleteScrapState = MutableStateFlow<UiState<Int>>(UiState.Empty)
val deleteScrapState get() = _postScrapState.asStateFlow()


private val _instagramList =
listOf(
InstagramModel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ fun ReleaseAdvertisementViewPager(
Advertisement(
imgResource = advertisement.imgResource,
modifier =
Modifier
.fillMaxSize()
.aspectRatio(1f),
Modifier
.fillMaxSize()
.aspectRatio(1f),
)
if (page == 0) {
CountdownTimer(targetTimeInMillis, textStyle = robotoBold)
Expand Down Expand Up @@ -87,9 +87,9 @@ fun CountdownTimer(

Row(
modifier =
Modifier
.fillMaxWidth()
.padding(top = 42.dp),
Modifier
.fillMaxWidth()
.padding(top = 42.dp),
horizontalArrangement = Arrangement.Center,
) {
Text(text = formattedDays, style = textStyle)
Expand Down Expand Up @@ -121,4 +121,4 @@ fun Advertisement(
modifier = Modifier.fillMaxSize(),
)
}
}
}
Loading

0 comments on commit db82c88

Please sign in to comment.