Skip to content

Commit

Permalink
Removed TopicReviewViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Talesra committed Oct 14, 2019
1 parent ff2245f commit 3d4183a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class TopicReviewFragmentPresenter @Inject constructor(
activity: AppCompatActivity,
private val fragment: Fragment,
private val logger: Logger,
private val topicController: TopicController,
private val viewModelProvider: ViewModelProvider<TopicReviewViewModel>
private val topicController: TopicController
): ReviewSkillSelector{

private val routeToReviewListener = activity as RouteToReviewListener
Expand All @@ -45,7 +44,6 @@ class TopicReviewFragmentPresenter @Inject constructor(
layoutManager = GridLayoutManager(context, /* spanCount= */ 2)
}
binding.let {
it.viewModel = getTopicReviewViewModel()
it.lifecycleOwner = fragment
}
subscribeToTopicLiveData()
Expand Down Expand Up @@ -79,8 +77,4 @@ class TopicReviewFragmentPresenter @Inject constructor(
}
return topic.getOrDefault(Topic.getDefaultInstance())
}

private fun getTopicReviewViewModel(): TopicReviewViewModel {
return viewModelProvider.getForFragment(fragment, TopicReviewViewModel::class.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import org.oppia.domain.topic.TopicController
import javax.inject.Inject

/**
* [ViewModel] for showing a list of topic summaries. Note that this can only be hosted in fragments that implement
* [ReviewSkillSelector].
* [ViewModel] for showing a list of topic review-skills.
*/
@FragmentScope
class TopicReviewViewModel @Inject constructor(fragment: Fragment) : ViewModel() {}
6 changes: 0 additions & 6 deletions app/src/main/res/layout/topic_review_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View"/>
<variable
name="viewModel"
type="org.oppia.app.topic.review.TopicReviewViewModel"/>
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down

0 comments on commit 3d4183a

Please sign in to comment.