-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#173 [UI] 메인 튜토리얼
- Loading branch information
Showing
97 changed files
with
702 additions
and
262 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
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
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/sopetit/softie/domain/entity/Tutorial.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,8 @@ | ||
package com.sopetit.softie.domain.entity | ||
|
||
import androidx.annotation.DrawableRes | ||
|
||
data class Tutorial( | ||
val tutorialId: Int, | ||
@DrawableRes val content: Int | ||
) |
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
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/sopetit/softie/domain/usecase/local/GetIsTutorialUseCase.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,11 @@ | ||
package com.sopetit.softie.domain.usecase.local | ||
|
||
import com.sopetit.softie.domain.repository.AuthRepository | ||
import javax.inject.Inject | ||
|
||
class GetIsTutorialUseCase @Inject constructor( | ||
private val authRepository: AuthRepository | ||
) { | ||
operator fun invoke() = | ||
authRepository.getTutorial() | ||
} |
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
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/sopetit/softie/domain/usecase/local/SetIsTutorialUseCase.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,11 @@ | ||
package com.sopetit.softie.domain.usecase.local | ||
|
||
import com.sopetit.softie.domain.repository.AuthRepository | ||
import javax.inject.Inject | ||
|
||
class SetIsTutorialUseCase @Inject constructor( | ||
private val authRepository: AuthRepository | ||
) { | ||
operator fun invoke(isTutorial: Boolean) = | ||
authRepository.setTutorial(isTutorial) | ||
} |
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
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
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
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
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/sopetit/softie/ui/main/home/HomeTutorialAdapter.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,38 @@ | ||
package com.sopetit.softie.ui.main.home | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.ListAdapter | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.sopetit.softie.databinding.ItemHomeTutorialBinding | ||
import com.sopetit.softie.domain.entity.Tutorial | ||
import com.sopetit.softie.util.ItemDiffCallback | ||
|
||
class HomeTutorialAdapter : | ||
ListAdapter<Tutorial, HomeTutorialViewHolder>( | ||
ItemDiffCallback<Tutorial>( | ||
onItemsTheSame = { oldItem, newItem -> oldItem.tutorialId == newItem.tutorialId }, | ||
onContentsTheSame = { oldItem, newItem -> oldItem == newItem } | ||
) | ||
) { | ||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HomeTutorialViewHolder { | ||
val binding = ItemHomeTutorialBinding.inflate( | ||
LayoutInflater.from(parent.context), | ||
parent, | ||
false | ||
) | ||
return HomeTutorialViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: HomeTutorialViewHolder, position: Int) { | ||
holder.onBind(getItem(position)) | ||
} | ||
} | ||
|
||
class HomeTutorialViewHolder( | ||
private val binding: ItemHomeTutorialBinding | ||
) : RecyclerView.ViewHolder(binding.root) { | ||
fun onBind(data: Tutorial) { | ||
binding.ivTutorialItem.setImageResource(data.content) | ||
} | ||
} |
Oops, something went wrong.