From 4662fb39802df46cca99bccfcda3db7f60251f33 Mon Sep 17 00:00:00 2001 From: Rohit1173 Date: Wed, 4 Aug 2021 13:39:38 +0530 Subject: [PATCH 1/3] Renaming Ongoingstory to Promoted Story --- .idea/misc.xml | 16 ++++++++++++++-- .idea/runConfigurations.xml | 12 ------------ app/BUILD.bazel | 2 +- .../home/recentlyplayed/OngoingListAdapter.kt | 6 +++--- .../home/recentlyplayed/OngoingStoryViewModel.kt | 2 +- .../RecentlyPlayedFragmentPresenter.kt | 10 +++++----- .../main/res/layout-land/ongoing_story_card.xml | 2 +- .../layout-sw600dp-land/ongoing_story_card.xml | 2 +- .../layout-sw600dp-port/ongoing_story_card.xml | 2 +- app/src/main/res/layout/ongoing_story_card.xml | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index f06c82261e6..80f072c7289 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,9 +1,21 @@ - + + + + - + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 9b6e38d6425..00000000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/app/BUILD.bazel b/app/BUILD.bazel index dda6627d2a8..f0aea1b8c65 100644 --- a/app/BUILD.bazel +++ b/app/BUILD.bazel @@ -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", diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingListAdapter.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingListAdapter.kt index 39d435cea95..12227d723f9 100644 --- a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingListAdapter.kt +++ b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingListAdapter.kt @@ -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 = @@ -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( @@ -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 } } diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt index ca4754524e0..8b539dd14a0 100755 --- a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt +++ b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt @@ -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 diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt index 25a4ff444d5..0e429c5c829 100755 --- a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt @@ -60,11 +60,11 @@ class RecentlyPlayedFragmentPresenter @Inject constructor( } binding.lifecycleOwner = fragment - subscribeToOngoingStoryList() + subscribeToPromotedStoryList() return binding.root } - private val ongoingStoryListSummaryResultLiveData: + private val promotedStoryListSummaryResultLiveData: LiveData> by lazy { topicListController.getPromotedActivityList( @@ -72,7 +72,7 @@ class RecentlyPlayedFragmentPresenter @Inject constructor( ).toLiveData() } - private fun subscribeToOngoingStoryList() { + private fun subscribeToPromotedStoryList() { getAssumedSuccessfulPromotedActivityList().observe( fragment, { @@ -115,7 +115,7 @@ class RecentlyPlayedFragmentPresenter @Inject constructor( } private fun getOngoingStoryViewModel(promotedStory: PromotedStory): RecentlyPlayedItemViewModel { - return OngoingStoryViewModel( + return PromotedStoryViewModel( promotedStory, entityType, fragment as OngoingStoryClickListener @@ -152,7 +152,7 @@ class RecentlyPlayedFragmentPresenter @Inject constructor( private fun getAssumedSuccessfulPromotedActivityList(): LiveData { // If there's an error loading the data, assume the default. - return Transformations.map(ongoingStoryListSummaryResultLiveData) { + return Transformations.map(promotedStoryListSummaryResultLiveData) { it.getOrDefault( PromotedActivityList.getDefaultInstance() ) diff --git a/app/src/main/res/layout-land/ongoing_story_card.xml b/app/src/main/res/layout-land/ongoing_story_card.xml index 03d1b69123e..1c2a640cbfb 100755 --- a/app/src/main/res/layout-land/ongoing_story_card.xml +++ b/app/src/main/res/layout-land/ongoing_story_card.xml @@ -8,7 +8,7 @@ + type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" /> + type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" /> + type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" /> + type="org.oppia.android.app.home.recentlyplayed.PromotedStoryViewModel" /> Date: Wed, 4 Aug 2021 13:41:46 +0530 Subject: [PATCH 2/3] Renaming Ongoingstory to Promoted Story --- .../{OngoingStoryViewModel.kt => PromotedStoryViewModel.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/src/main/java/org/oppia/android/app/home/recentlyplayed/{OngoingStoryViewModel.kt => PromotedStoryViewModel.kt} (100%) mode change 100755 => 100644 diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/PromotedStoryViewModel.kt old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/java/org/oppia/android/app/home/recentlyplayed/OngoingStoryViewModel.kt rename to app/src/main/java/org/oppia/android/app/home/recentlyplayed/PromotedStoryViewModel.kt From 136309856a7d012769327110e088f63f17ad9956 Mon Sep 17 00:00:00 2001 From: SAI ROHIT CHAPPA <78897906+Rohit1173@users.noreply.github.com> Date: Wed, 4 Aug 2021 13:52:02 +0530 Subject: [PATCH 3/3] Update misc.xml --- .idea/misc.xml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 80f072c7289..f06c82261e6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,21 +1,9 @@ - - - - + - \ No newline at end of file +