Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #138: Topic train fragment Low-fi UI (Part 2) #202

Merged
merged 7 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Nit changes
  • Loading branch information
Rajat Talesra committed Oct 4, 2019
commit 2764e3bae4c348a702219994e8562c1b4ed02bb1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.oppia.app.databinding.TopicTrainSkillViewBinding
/** Adapter to bind skills to [RecyclerView] inside [TopicTrainFragment]. */
class SkillSelectionAdapter(
private val skillList: List<String>,
private val skillInterface: SkillInterface
private val skillSelector: SkillSelector
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
Expand All @@ -24,7 +24,7 @@ class SkillSelectionAdapter(
inflater,
R.layout.topic_train_skill_view,
parent,
false
/* attachToParent= */false
)
return SkillViewHolder(binding)
}
Expand All @@ -43,9 +43,9 @@ class SkillSelectionAdapter(
binding.root.skill_check_box.setOnCheckedChangeListener { buttonView, isChecked ->
val skill = skillList[position]
if (isChecked) {
skillInterface.skillSelected(skill)
skillSelector.skillSelected(skill)
} else {
skillInterface.skillUnselected(skill)
skillSelector.skillUnselected(skill)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.oppia.app.topic.train

/** Interface to update the selectedSkillList in [TopicTrainFragmentPresenter]. */
interface SkillInterface {
interface SkillSelector {
/** This skill will get added to selectedSkillList in [TopicTrainFragmentPresenter]. */
fun skillSelected(skill: String)
/** This skill will get removed from selectedSkillList in [TopicTrainFragmentPresenter]. */
Expand Down