Skip to content

Commit

Permalink
remove unused lines
Browse files Browse the repository at this point in the history
  • Loading branch information
2018JunyoungLim committed Nov 23, 2023
1 parent d82d273 commit 0ec9030
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.goliath.emojihub.data_sources.api.EmojiApi
import com.goliath.emojihub.models.EmojiDto
import javax.inject.Inject

class EmojiPagingSource @Inject constructor(
class EmojiPagingSource @Inject constructor(
private val api: EmojiApi
): PagingSource<Int, EmojiDto>() {
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, EmojiDto> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ class EmojiRepositoryImpl @Inject constructor(
private val emojiApi: EmojiApi
): EmojiRepository {
override suspend fun fetchEmojiList(): Flow<PagingData<EmojiDto>> {
// try {
//
// val response = emojiApi.fetchEmojiList(1, 1, 10)
//
// if(response.isSuccessful && response.body() != null) {
// Log.d("Fetch_E_L", "Successfully fetched ${response.body()!!.size} emojis")
// return response.body()!!
// } else {
// val errorBody = response.errorBody()?.string() ?: "Unknown error"
// Log.d("Fetch_E_L", "Failed to fetch emojis: $errorBody")
// }
// } catch(e: Exception) {
// Log.e("Fetch_E_L", "Error fetching emojis", e)
// }
// return listOf()
return Pager(
config = PagingConfig(pageSize = 10, initialLoadSize = 10, enablePlaceholders = false),
pagingSourceFactory = { EmojiPagingSource(emojiApi) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class EmojiViewModel @Inject constructor(
var currentEmoji: Emoji? = null
var isBottomSheetShown by mutableStateOf(false)

// private val _emojiList = MutableStateFlow<List<Emoji>>(emptyList())
val emojiList = emojiUseCase.emojiList

private val _topK = 3
Expand All @@ -42,10 +41,6 @@ class EmojiViewModel @Inject constructor(
.collect {
emojiUseCase.updateEmojiList(it)
}

// val emojis = emojiUseCase.emojiListState.value.map { dto -> Emoji(dto) }
// _emojiList.emit(emojis)
// Log.d("Fetch_E_L", "VIEWMODEL DONE: $emojis")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ fun EmojiPage(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
// items(emojiList, key = { it.id }) { emoji ->
// EmojiCell(emoji = emoji) {
// viewModel.currentEmoji = emoji
// navController.navigate(NavigationDestination.PlayEmojiVideo)
// }
// }
items(emojiList.itemCount) { index ->
emojiList[index]?.let{
EmojiCell(emoji = it) { selectedEmoji ->
Expand Down

0 comments on commit 0ec9030

Please sign in to comment.