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 #2546 :Renaming ongoingstory to promoted story #3640

Closed
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

2 changes: 1 addition & 1 deletion app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ VIEW_MODELS = [
"src/main/java/org/oppia/android/app/hintsandsolution/SolutionViewModel.kt",
"src/main/java/org/oppia/android/app/home/HomeItemViewModel.kt",
"src/main/java/org/oppia/android/app/home/promotedlist/ComingSoonTopicListViewModel.kt",
"src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt",
"src/main/java/org/oppia/android/app/home/recentlyplayed/PrmotedStoryViewModel.kt",
"src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedItemViewModel.kt",
"src/main/java/org/oppia/android/app/home/recentlyplayed/SectionTitleViewModel.kt",
"src/main/java/org/oppia/android/app/home/topiclist/AllTopicsViewModel.kt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class OngoingListAdapter(
}
VIEW_TYPE_SECTION_STORY_ITEM -> {
storyGridPosition = position - titleIndex
(holder as OngoingStoryViewHolder).bind(itemList[position] as OngoingStoryViewModel)
(holder as OngoingStoryViewHolder).bind(itemList[position] as PromotedStoryViewModel)
val marginMin =
(activity as Context).resources.getDimensionPixelSize(R.dimen.recently_played_margin_min)
val marginMax =
Expand Down Expand Up @@ -166,7 +166,7 @@ class OngoingListAdapter(
is SectionTitleViewModel -> {
VIEW_TYPE_SECTION_TITLE_TEXT
}
is OngoingStoryViewModel -> {
is PromotedStoryViewModel -> {
VIEW_TYPE_SECTION_STORY_ITEM
}
else -> throw IllegalArgumentException(
Expand Down Expand Up @@ -194,7 +194,7 @@ class OngoingListAdapter(
private class OngoingStoryViewHolder(
val binding: OngoingStoryCardBinding
) : RecyclerView.ViewHolder(binding.root) {
internal fun bind(ongoingStoryViewModel: OngoingStoryViewModel) {
internal fun bind(ongoingStoryViewModel: PromotedStoryViewModel) {
binding.viewModel = ongoingStoryViewModel
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.oppia.android.app.model.PromotedStory
// TODO(#297): Add download status information to promoted-story-card.

/** [ViewModel] for displaying a promoted story. */
class OngoingStoryViewModel(
class PromotedStoryViewModel(
val ongoingStory: PromotedStory,
val entityType: String,
private val ongoingStoryClickListener: OngoingStoryClickListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ class RecentlyPlayedFragmentPresenter @Inject constructor(
}
binding.lifecycleOwner = fragment

subscribeToOngoingStoryList()
subscribeToPromotedStoryList()
return binding.root
}

private val ongoingStoryListSummaryResultLiveData:
private val promotedStoryListSummaryResultLiveData:
LiveData<AsyncResult<PromotedActivityList>>
by lazy {
topicListController.getPromotedActivityList(
ProfileId.newBuilder().setInternalId(internalProfileId).build()
).toLiveData()
}

private fun subscribeToOngoingStoryList() {
private fun subscribeToPromotedStoryList() {
getAssumedSuccessfulPromotedActivityList().observe(
fragment,
{
Expand Down Expand Up @@ -115,7 +115,7 @@ class RecentlyPlayedFragmentPresenter @Inject constructor(
}

private fun getOngoingStoryViewModel(promotedStory: PromotedStory): RecentlyPlayedItemViewModel {
return OngoingStoryViewModel(
return PromotedStoryViewModel(
promotedStory,
entityType,
fragment as OngoingStoryClickListener
Expand Down Expand Up @@ -152,7 +152,7 @@ class RecentlyPlayedFragmentPresenter @Inject constructor(

private fun getAssumedSuccessfulPromotedActivityList(): LiveData<PromotedActivityList> {
// If there's an error loading the data, assume the default.
return Transformations.map(ongoingStoryListSummaryResultLiveData) {
return Transformations.map(promotedStoryListSummaryResultLiveData) {
it.getOrDefault(
PromotedActivityList.getDefaultInstance()
)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout-land/ongoing_story_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<variable
name="viewModel"
type="org.oppia.android.app.home.recentlyplayed.OngoingStoryViewModel" />
type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" />
</data>

<com.google.android.material.card.MaterialCardView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<variable
name="viewModel"
type="org.oppia.android.app.home.recentlyplayed.OngoingStoryViewModel" />
type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" />
</data>

<com.google.android.material.card.MaterialCardView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<variable
name="viewModel"
type="org.oppia.android.app.home.recentlyplayed.OngoingStoryViewModel" />
type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" />
</data>

<com.google.android.material.card.MaterialCardView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/ongoing_story_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<variable
name="viewModel"
type="org.oppia.android.app.home.recentlyplayed.OngoingStoryViewModel" />
type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" />
</data>

<com.google.android.material.card.MaterialCardView
Expand Down