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 135: Topic issues fixes #285

Merged
merged 97 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e2ed1c4
multiple tabs
nikitamarysolomanpvt Oct 7, 2019
089ea5a
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
nikitamarysolomanpvt Oct 14, 2019
43016b6
nit changes
nikitamarysolomanpvt Oct 17, 2019
3a1a350
nit changes
nikitamarysolomanpvt Oct 17, 2019
405a45e
nit changes
nikitamarysolomanpvt Oct 17, 2019
72c7360
nit changes
nikitamarysolomanpvt Oct 17, 2019
c5ffa61
nit changes
nikitamarysolomanpvt Oct 17, 2019
47e2efc
nit changes
nikitamarysolomanpvt Oct 17, 2019
b4ed9bb
nit changes
nikitamarysolomanpvt Oct 17, 2019
9dd39b9
nit changes
nikitamarysolomanpvt Oct 17, 2019
b2fca59
nit changes
nikitamarysolomanpvt Oct 17, 2019
f0cb60f
cust_args
nikitamarysolomanpvt Oct 18, 2019
2d21695
multiple tabs will getting topic id from home
nikitamarysolomanpvt Oct 29, 2019
93b889b
test cases,multiple tabs will getting topic id from home
nikitamarysolomanpvt Oct 29, 2019
3130323
nit
nikitamarysolomanpvt Oct 29, 2019
bbe7cf3
nit
nikitamarysolomanpvt Oct 29, 2019
046e297
nit
nikitamarysolomanpvt Oct 30, 2019
ba506ab
nit
nikitamarysolomanpvt Oct 30, 2019
6f228d1
nit
nikitamarysolomanpvt Oct 30, 2019
24be11b
separate test cases for all four tabs
nikitamarysolomanpvt Oct 30, 2019
bfa2b78
nit
nikitamarysolomanpvt Oct 30, 2019
0c6d5d8
nit
nikitamarysolomanpvt Oct 30, 2019
f8f84f1
nit
nikitamarysolomanpvt Oct 30, 2019
efae9f7
nit
nikitamarysolomanpvt Oct 30, 2019
1ecfc2f
nit
nikitamarysolomanpvt Oct 30, 2019
293aa52
nit
nikitamarysolomanpvt Oct 30, 2019
949f89e
nit
nikitamarysolomanpvt Oct 30, 2019
71ae233
nit
nikitamarysolomanpvt Oct 30, 2019
423dd37
Topic Overview see more click and tab switch
nikitamarysolomanpvt Oct 31, 2019
d3458e1
Topic Overview see more click and tab switch
nikitamarysolomanpvt Oct 31, 2019
032cfeb
Topic Overview see more click and tab switch
nikitamarysolomanpvt Oct 31, 2019
7084858
topic id todo's are implemented, test cases updated as per new data t…
nikitamarysolomanpvt Oct 31, 2019
bb42cf1
Topic Overview see more click and tab switch
nikitamarysolomanpvt Oct 31, 2019
b4b7763
nit
nikitamarysolomanpvt Oct 31, 2019
8c67e7e
nit
nikitamarysolomanpvt Oct 31, 2019
f4451ea
merged with develop
nikitamarysolomanpvt Oct 31, 2019
a598fc7
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
nikitamarysolomanpvt Oct 31, 2019
203a5a2
merged with base branch
nikitamarysolomanpvt Oct 31, 2019
f1e3b48
merged with base branch
nikitamarysolomanpvt Oct 31, 2019
ad38ec6
nit
nikitamarysolomanpvt Oct 31, 2019
e137f99
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
92a6b26
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
413b811
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
344e153
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
8545a66
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
2304174
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
d5041b9
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
4934518
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
3410a17
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
3e366b6
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
12da7e9
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
41903fb
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
2339b10
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
bd1949f
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
8599de6
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
edf1a95
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
f19daa8
revert back to develop
nikitamarysolomanpvt Oct 31, 2019
916ccc2
nit changes
nikitamarysolomanpvt Nov 2, 2019
afdabd5
nit changes,
nikitamarysolomanpvt Nov 2, 2019
549a0b1
nit changes
nikitamarysolomanpvt Nov 2, 2019
758b7e6
nit changes
nikitamarysolomanpvt Nov 2, 2019
5b7312a
nit changes
nikitamarysolomanpvt Nov 2, 2019
45bc1d6
nit changes
nikitamarysolomanpvt Nov 2, 2019
0d5c057
nit changes
nikitamarysolomanpvt Nov 2, 2019
33753cc
nit changes
nikitamarysolomanpvt Nov 4, 2019
89b274a
set title on the basis of selected topic in topic screen.other nit ch…
nikitamarysolomanpvt Nov 5, 2019
1827e95
nit
nikitamarysolomanpvt Nov 5, 2019
d21250e
Merge branches 'develop' and 'topic-player-multiple-tabs' of https://…
nikitamarysolomanpvt Nov 5, 2019
e0c6b06
Merge branches 'develop' and 'topic-player-multiple-tabs' of https://…
nikitamarysolomanpvt Nov 5, 2019
3230c2f
Merge branches 'develop' and 'topic-player-multiple-tabs' of https://…
nikitamarysolomanpvt Nov 5, 2019
9695194
nit
nikitamarysolomanpvt Nov 5, 2019
40e449e
nit
nikitamarysolomanpvt Nov 5, 2019
51350f2
nit
nikitamarysolomanpvt Nov 5, 2019
10593a7
nit
nikitamarysolomanpvt Nov 5, 2019
772f98c
Merge branches 'develop' and 'topic-player-multiple-tabs' of https://…
nikitamarysolomanpvt Nov 5, 2019
f6569ff
Merge branches 'develop' and 'topic-player-multiple-tabs' of https://…
nikitamarysolomanpvt Nov 5, 2019
bacebd2
nit in TopicFragmentPresenter changed var to val in line number 69
nikitamarysolomanpvt Nov 5, 2019
a0c01af
Merge branches 'develop' and 'topic_issues_fixs' of https://github.co…
nikitamarysolomanpvt Nov 5, 2019
7d44c0a
nit
nikitamarysolomanpvt Nov 5, 2019
8cede53
shorten stackoverflow link,testcase method name change
nikitamarysolomanpvt Nov 5, 2019
61fe4d5
nit changes suggested by Rajat
nikitamarysolomanpvt Nov 5, 2019
83ad843
merged with develop
nikitamarysolomanpvt Nov 6, 2019
1aa955e
nit
nikitamarysolomanpvt Nov 6, 2019
5a2508c
Merge branches 'topic-player-multiple-tabs' and 'topic_issues_fixs' o…
nikitamarysolomanpvt Nov 6, 2019
e6b4532
nit
nikitamarysolomanpvt Nov 6, 2019
f806cc8
used enum to set current tab in TopicFragmentPresenter.
nikitamarysolomanpvt Nov 6, 2019
aedfd66
Merge branches 'develop' and 'topic_issues_fixs' of https://github.co…
nikitamarysolomanpvt Nov 6, 2019
321496c
nit
nikitamarysolomanpvt Nov 7, 2019
79a5dcf
nit
nikitamarysolomanpvt Nov 7, 2019
534905e
nit
nikitamarysolomanpvt Nov 7, 2019
94240b2
nit
nikitamarysolomanpvt Nov 7, 2019
d122006
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
nikitamarysolomanpvt Nov 7, 2019
9faff37
nit
nikitamarysolomanpvt Nov 7, 2019
bb6f4ce
nit
nikitamarysolomanpvt Nov 7, 2019
5c6ebe7
nit
nikitamarysolomanpvt Nov 7, 2019
1cc1af3
nit
nikitamarysolomanpvt Nov 7, 2019
7e93850
Merge branches 'develop' and 'topic_issues_fixs' of https://github.co…
nikitamarysolomanpvt Nov 7, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class HomeFragmentPresenter @Inject constructor(

private lateinit var topicListAdapter: TopicListAdapter
private lateinit var binding: HomeFragmentBinding

fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? {
binding = HomeFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false)
// NB: Both the view model and lifecycle owner must be set in order to correctly bind LiveData elements to
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/org/oppia/app/topic/TopicActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ const val TOPIC_ACTIVITY_TOPIC_ID_ARGUMENT_KEY = "TopicActivity.topic_id"
class TopicActivity : InjectableAppCompatActivity(), RouteToQuestionPlayerListener, RouteToConceptCardListener,
RouteToTopicPlayListener, RouteToStoryListener, RouteToExplorationListener {
private lateinit var topicId: String
private lateinit var storyId: String
@Inject
lateinit var topicActivityPresenter: TopicActivityPresenter

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
activityComponent.inject(this)
topicId = intent?.getStringExtra(org.oppia.app.topic.TOPIC_ACTIVITY_TOPIC_ID_ARGUMENT_KEY) ?: TEST_TOPIC_ID_0
topicId = checkNotNull(intent?.getStringExtra(org.oppia.app.topic.TOPIC_ACTIVITY_TOPIC_ID_ARGUMENT_KEY) ?: "")
{
"Expected topic ID to be included in intent for TopicActivity."
}
storyId = intent?.getStringExtra(TOPIC_ACTIVITY_STORY_ID_ARGUMENT_KEY) ?: ""
topicActivityPresenter.handleOnCreate(topicId)
}

Expand All @@ -37,7 +42,8 @@ class TopicActivity : InjectableAppCompatActivity(), RouteToQuestionPlayerListen
}

override fun routeToTopicPlayFragment() {
// TODO(#135): Change to play tab in this function.
val topicFragment = supportFragmentManager.findFragmentByTag(TOPIC_FRAGMENT_TAG) as TopicFragment
topicFragment.topicFragmentPresenter.setCurrentTab(TopicTab.PLAY)
}

override fun routeToConceptCard(skillId: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.oppia.app.R
import org.oppia.app.activity.ActivityScope
import javax.inject.Inject

const val TOPIC_FRAGMENT_TAG = "TopicFragment"
nikitamarysolomanpvt marked this conversation as resolved.
Show resolved Hide resolved
const val TOPIC_ID_ARGUMENT_KEY = "topic_id"

/** The presenter for [TopicActivity]. */
Expand All @@ -20,7 +21,7 @@ class TopicActivityPresenter @Inject constructor(private val activity: AppCompat
topicFragment.arguments = args
activity.supportFragmentManager.beginTransaction().add(
R.id.topic_fragment_placeholder,
topicFragment
topicFragment, TOPIC_FRAGMENT_TAG
).commitNow()
}
}
Expand Down
24 changes: 14 additions & 10 deletions app/src/main/java/org/oppia/app/topic/TopicFragmentPresenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.oppia.app.R
import org.oppia.app.databinding.TopicFragmentBinding
import org.oppia.app.fragment.FragmentScope
import org.oppia.app.model.Topic
import org.oppia.domain.topic.TEST_TOPIC_ID_0
import org.oppia.domain.topic.TopicController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
Expand All @@ -29,13 +28,14 @@ class TopicFragmentPresenter @Inject constructor(
) {
private lateinit var tabLayout: TabLayout
private lateinit var toolbar: Toolbar
private lateinit var topicId: String
private lateinit var viewPager: ViewPager
private val tabIcons =
intArrayOf(
R.drawable.ic_overview_icon_24dp,
R.drawable.ic_play_icon_24,
R.drawable.ic_train_icon_24,
R.drawable.ic_review_icon_24
R.drawable.ic_play_icon_24dp,
R.drawable.ic_train_icon_24dp,
R.drawable.ic_review_icon_24dp
)

fun handleCreateView(
Expand All @@ -48,19 +48,24 @@ class TopicFragmentPresenter @Inject constructor(
viewPager = binding.root.findViewById(R.id.topic_tabs_viewpager) as ViewPager
tabLayout = binding.root.findViewById(R.id.topic_tabs_container) as TabLayout
toolbar = binding.root.findViewById(R.id.toolbar) as Toolbar
this.topicId = topicId
setUpViewPager(viewPager, topicId)
subscribeToTopicLiveData()
return binding.root
}

fun setCurrentTab(tab: TopicTab) {
viewPager.setCurrentItem(tab.ordinal, true)
}

private fun setUpViewPager(viewPager: ViewPager, topicId: String?) {
val adapter = ViewPagerAdapter(fragment.fragmentManager!!, topicId!!)
viewPager.adapter = adapter
tabLayout.setupWithViewPager(viewPager)
tabLayout.getTabAt(0)!!.setText(TopicTab.getTabForPosition(0).name).setIcon(tabIcons[0])
tabLayout.getTabAt(1)!!.setText(TopicTab.getTabForPosition(1).name).setIcon(tabIcons[1])
tabLayout.getTabAt(2)!!.setText(TopicTab.getTabForPosition(2).name).setIcon(tabIcons[2])
tabLayout.getTabAt(3)!!.setText(TopicTab.getTabForPosition(3).name).setIcon(tabIcons[3])
tabLayout.getTabAt(0)!!.setText(fragment.getString(R.string.overview)).setIcon(tabIcons[0])
tabLayout.getTabAt(1)!!.setText(fragment.getString(R.string.play)).setIcon(tabIcons[1])
tabLayout.getTabAt(2)!!.setText(fragment.getString(R.string.train)).setIcon(tabIcons[2])
tabLayout.getTabAt(3)!!.setText(fragment.getString(R.string.review)).setIcon(tabIcons[3])
}

private val topicLiveData: LiveData<Topic> by lazy { getTopic() }
Expand All @@ -72,9 +77,8 @@ class TopicFragmentPresenter @Inject constructor(
})
}

// TODO(#135): Get this topic-id from [TopicFragment].
private val topicResultLiveData: LiveData<AsyncResult<Topic>> by lazy {
topicController.getTopic(TEST_TOPIC_ID_0)
topicController.getTopic(topicId = topicId)
}

private fun getTopic(): LiveData<Topic> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import org.oppia.app.databinding.TopicOverviewFragmentBinding
import org.oppia.app.fragment.FragmentScope
import org.oppia.app.model.Topic
import org.oppia.app.topic.RouteToTopicPlayListener
import org.oppia.app.topic.TOPIC_ID_ARGUMENT_KEY
import org.oppia.app.viewmodel.ViewModelProvider
import org.oppia.domain.topic.TEST_TOPIC_ID_0
import org.oppia.domain.topic.TopicController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
Expand All @@ -29,10 +29,13 @@ class TopicOverviewFragmentPresenter @Inject constructor(
private val topicController: TopicController
) {
private val routeToTopicPlayListener = activity as RouteToTopicPlayListener

private val topicOverviewViewModel = getTopicOverviewViewModel()
private val topicOverviewViewModel = getTopicOverviewViewModel()
private lateinit var topicId: String

fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? {
topicId = checkNotNull(fragment.arguments?.getString(TOPIC_ID_ARGUMENT_KEY)) {
"Expected topic ID to be included in arguments for TopicOverviewFragment."
}
val binding = TopicOverviewFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false)
subscribeToTopicLiveData()
binding.let {
Expand All @@ -59,9 +62,8 @@ class TopicOverviewFragmentPresenter @Inject constructor(
})
}

// TODO(#135): Get this topic-id from [TopicFragment].
private val topicResultLiveData: LiveData<AsyncResult<Topic>> by lazy {
topicController.getTopic(TEST_TOPIC_ID_0)
topicController.getTopic(topicId)
}

private fun getTopicList(): LiveData<Topic> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import org.oppia.app.model.ChapterSummary
import org.oppia.app.model.StorySummary
import org.oppia.app.model.Topic
import org.oppia.app.topic.RouteToStoryListener
import org.oppia.app.topic.TOPIC_ID_ARGUMENT_KEY
import org.oppia.domain.exploration.ExplorationDataController
import org.oppia.domain.topic.TEST_TOPIC_ID_0
import org.oppia.domain.topic.TopicController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
Expand All @@ -37,6 +37,7 @@ class TopicPlayFragmentPresenter @Inject constructor(
private var currentExpandedChapterListIndex: Int? = null

private lateinit var binding: TopicPlayFragmentBinding
private lateinit var topicId: String

private lateinit var expandedChapterListIndexListener: ExpandedChapterListIndexListener

Expand All @@ -46,9 +47,11 @@ class TopicPlayFragmentPresenter @Inject constructor(
currentExpandedChapterListIndex: Int?,
expandedChapterListIndexListener: ExpandedChapterListIndexListener
): View? {
topicId = checkNotNull(fragment.arguments?.getString(TOPIC_ID_ARGUMENT_KEY)) {
"Expected topic ID to be included in arguments for TopicPlayFragment."
}
this.currentExpandedChapterListIndex = currentExpandedChapterListIndex
this.expandedChapterListIndexListener = expandedChapterListIndexListener

binding = TopicPlayFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false)
binding.let {
it.lifecycleOwner = fragment
Expand All @@ -59,9 +62,8 @@ class TopicPlayFragmentPresenter @Inject constructor(

private val topicLiveData: LiveData<Topic> by lazy { getTopicList() }

// TODO(#135): Get this topic-id or get storyList from [StoryFragment].
private val topicResultLiveData: LiveData<AsyncResult<Topic>> by lazy {
topicController.getTopic(TEST_TOPIC_ID_0)
topicController.getTopic(topicId)
}

private fun subscribeToTopicLiveData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.oppia.app.fragment.FragmentScope
import org.oppia.app.model.SkillSummary
import org.oppia.app.model.Topic
import org.oppia.app.topic.RouteToConceptCardListener
import org.oppia.domain.topic.TEST_TOPIC_ID_0
import org.oppia.app.topic.TOPIC_ID_ARGUMENT_KEY
import org.oppia.domain.topic.TopicController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
Expand All @@ -28,14 +28,16 @@ class TopicReviewFragmentPresenter @Inject constructor(
private val logger: Logger,
private val topicController: TopicController
) : ReviewSkillSelector {

private lateinit var topicId: String
private val routeToReviewListener = activity as RouteToConceptCardListener

private lateinit var reviewSkillSelectionAdapter: ReviewSkillSelectionAdapter

fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View? {
topicId = checkNotNull(fragment.arguments?.getString(TOPIC_ID_ARGUMENT_KEY)) {
"Expected topic ID to be included in arguments for TopicReviewFragment."
}
val binding = TopicReviewFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false)

reviewSkillSelectionAdapter = ReviewSkillSelectionAdapter(this)
binding.reviewSkillRecyclerView.apply {
adapter = reviewSkillSelectionAdapter
Expand All @@ -55,9 +57,8 @@ class TopicReviewFragmentPresenter @Inject constructor(

private val topicLiveData: LiveData<Topic> by lazy { getTopicList() }

// TODO(#135): Get this topic-id or get skillList from [TopicFragment].
private val topicResultLiveData: LiveData<AsyncResult<Topic>> by lazy {
topicController.getTopic(TEST_TOPIC_ID_0)
topicController.getTopic(topicId)
}

private fun subscribeToTopicLiveData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import org.oppia.app.databinding.TopicTrainFragmentBinding
import org.oppia.app.fragment.FragmentScope
import org.oppia.app.model.Topic
import org.oppia.app.topic.RouteToQuestionPlayerListener
import org.oppia.app.topic.TOPIC_ID_ARGUMENT_KEY
import org.oppia.app.viewmodel.ViewModelProvider
import org.oppia.domain.topic.TEST_TOPIC_ID_0
import org.oppia.domain.topic.TopicController
import org.oppia.util.data.AsyncResult
import org.oppia.util.logging.Logger
Expand All @@ -29,12 +29,14 @@ class TopicTrainFragmentPresenter @Inject constructor(
private val viewModelProvider: ViewModelProvider<TopicTrainViewModel>
) : SkillSelector {
lateinit var selectedSkillIdList: ArrayList<String>

private lateinit var topicId: String
private val routeToQuestionPlayerListener = activity as RouteToQuestionPlayerListener

private lateinit var skillSelectionAdapter: SkillSelectionAdapter

fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?, skillList: ArrayList<String>): View? {
topicId = checkNotNull(fragment.arguments?.getString(TOPIC_ID_ARGUMENT_KEY)) {
"Expected topic ID to be included in arguments for TopicTrainFragment."
}
selectedSkillIdList = skillList
val binding = TopicTrainFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false)

Expand All @@ -52,9 +54,8 @@ class TopicTrainFragmentPresenter @Inject constructor(

private val topicLiveData: LiveData<Topic> by lazy { getTopicList() }

// TODO(#135): Get this topic-id or get skillList from [TopicFragment].
private val topicResultLiveData: LiveData<AsyncResult<Topic>> by lazy {
topicController.getTopic(TEST_TOPIC_ID_0)
topicController.getTopic(topicId)
}

private fun subscribeToTopicLiveData() {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<string name="state_learn_again_button">LEARN AGAIN</string>
<string name="topic_overview_see_more">See More</string>
<string name="topic_download_text">(%s MB)</string>
<string name="overview">Overview</string>
<string name="play">Play</string>
<string name="train">Train</string>
<string name="review">Review</string>
<string name="topic">Topic</string>
<string name="topic_story_progress_percentage">%s\%%</string>
<string name="recently_played_stories">Recently-Played Stories</string>
<string name="view_all">View All</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import androidx.test.core.app.ActivityScenario.launch
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.action.ViewActions.swipeLeft
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA
Expand Down Expand Up @@ -301,6 +302,16 @@ class TopicFragmentTest {
)
}
}
@Test
fun testTopicActivity_clickOnSeeMore_isPlayTabIsSelectedAndContentMatched() {
nikitamarysolomanpvt marked this conversation as resolved.
Show resolved Hide resolved
launch(TopicActivity::class.java).use {
onView(
withId(R.id.see_more_text_view)
).perform(scrollTo(), click())
onView(withId(R.id.topic_tabs_container)).check(matches(matchCurrentTabTitle("PLAY")))
onView(withText("First Story")).check(matches(isDisplayed()))
}
}

@Module
class TestModule {
Expand Down