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 #4448: Hide promoted story section for the first time user #4430

Merged
merged 22 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b699b4b
add number_of_logins field to profile proto
JishnuGoyal Jul 8, 2022
7628b0c
add increment login count function
JishnuGoyal Jul 8, 2022
9dab178
add tests
JishnuGoyal Jul 8, 2022
97ccd51
init number of logins to 0 when new profile is added
JishnuGoyal Jul 8, 2022
3b55eea
hide promoted stories for the first time user
JishnuGoyal Jul 9, 2022
0ac7796
add cta text
JishnuGoyal Jul 9, 2022
ad3b7d7
modify header text
JishnuGoyal Jul 12, 2022
464d96e
shorten line length
JishnuGoyal Jul 12, 2022
2f16164
Merge branch 'develop' into 1.5_hide_promoted_stories
JishnuGoyal Jul 23, 2022
349b8cc
merge with develop
JishnuGoyal Jul 27, 2022
79c7543
modify tests so that number of logins are two
JishnuGoyal Aug 4, 2022
c4d8443
modify tests so that number of logins are two
JishnuGoyal Aug 4, 2022
d3179c4
modify tests so that number of logins are two
JishnuGoyal Aug 4, 2022
d9bd8a3
modify tests so that number of logins are two
JishnuGoyal Aug 4, 2022
02dc919
shorten lines: optional nit
JishnuGoyal Aug 6, 2022
ab87f32
remove all topics string resource
JishnuGoyal Aug 6, 2022
be31afe
add new test for not displaying promoted stories
JishnuGoyal Aug 8, 2022
7e3972d
remove unused resource (build was failing)
JishnuGoyal Aug 8, 2022
912330d
add new test case
JishnuGoyal Aug 8, 2022
c45f476
use suggested method to reduce function size
JishnuGoyal Aug 10, 2022
1a45e33
change tests to account for changing the loginIntoProfile method insi…
JishnuGoyal Aug 10, 2022
eeabd2e
correction: change tests to account for changing the loginIntoProfile…
JishnuGoyal Aug 10, 2022
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: 8 additions & 4 deletions app/src/main/java/org/oppia/android/app/home/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ class HomeViewModel(
promotedActivityListSummaryDataProvider,
PROFILE_AND_PROMOTED_ACTIVITY_COMBINED_PROVIDER_ID
) { profile, promotedActivityList ->
listOfNotNull(
computeWelcomeViewModel(profile),
computePromotedActivityListViewModel(promotedActivityList)
)
if (profile.numberOfLogins > 1) {
listOfNotNull(
computeWelcomeViewModel(profile),
computePromotedActivityListViewModel(promotedActivityList)
)
} else {
listOfNotNull(computeWelcomeViewModel(profile))
}
}.combineWith(
topicListSummaryDataProvider,
HOME_FRAGMENT_COMBINED_PROVIDER_ID
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/all_topics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_marginEnd="@dimen/all_topics_text_margin_end"
android:layout_marginBottom="@dimen/all_topics_text_margin_bottom"
android:fontFamily="sans-serif-medium"
android:text="@string/all_topics"
android:text="@string/select_a_topic_to_start"
android:textColor="@color/oppia_primary_text"
android:textSize="18sp" />
</FrameLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:text="@string/all_topics"
android:text="@string/select_a_topic_to_start"
android:padding="10dp"
android:background="@color/color_def_oppia_stroke_blue"
android:textColor="@color/oppia_primary_text"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
<string name="ongoing_story_last_month">تم تشغيلها خلال الشهر الماضي</string>
<string name="story_activity_title">قائمة الفصول</string>
<string name="lesson_thumbnail_content_description">صورة %s</string>
<string name="all_topics">كل المواضيع</string>
<string name="stories_you_can_play">القصص التي باستطاعتك تشغيلها</string>
<string name="navigate_up">العودة للسابق</string>
<string name="recently_played_activity">القصص التي تم تشغيلها مؤخرًا</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
<string name="ongoing_story_last_month">Reproduzidas no Último Mês</string>
<string name="story_activity_title">Lista de Capítulos</string>
<string name="lesson_thumbnail_content_description">Imagem para %s</string>
<string name="all_topics">Todos os Tópicos</string>
<string name="stories_you_can_play">Histórias que Você Pode Reproduzir</string>
<string name="navigate_up">Navegar para cima</string>
<string name="recently_played_activity">Histórias Reproduzidas Recentemente</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
<string name="ongoing_story_last_month">zilizochezwa ndani ya Mwezi uliopita</string>
<string name="story_activity_title">Orodha ya Sura</string>
<string name="lesson_thumbnail_content_description">Picha ya %s</string>
<string name="all_topics">Mada Zote</string>
<string name="stories_you_can_play">Hadithi Unazoweza Kucheza</string>
<string name="navigate_up">Nenda juu/enda juu</string>
<string name="recently_played_activity">Hadithi Zilizochezwa Hivi Karibuni</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
<string name="ongoing_story_last_month">Played within the Last Month</string>
<string name="story_activity_title">Chapter List</string>
<string name="lesson_thumbnail_content_description">Image for %s</string>
<string name="all_topics">All Topics</string>
<string name="stories_you_can_play">Stories You Can Play</string>
<string name="navigate_up">Navigate up</string>
<string name="recently_played_activity">Recently-Played Stories</string>
Expand Down Expand Up @@ -544,4 +543,5 @@
<string name="faq_answer_9"><![CDATA[<p>If you cannot find your question or would like to report a bug, contact us at [email protected].</p>]]></string>
<string name="profile_edit_fragment_test_activity_label">Profile Edit Fragment Test Activity</string>
<string name="administrator_controls_fragment_test_activity_label">Administrator Controls Fragment Test Activity</string>
<string name="select_a_topic_to_start">Select a Topic to Start</string>
</resources>
Loading