From 3435a0844d3a91f82d757d8e81b0bd107f329ca0 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Mon, 30 Oct 2023 17:50:16 +0300
Subject: [PATCH 01/13] Refactor SurveyOnboardingBackgroundView to be a generic
OppiaCurveBackgroundView
Since many new designs include this custom shape, we can now reuse this view by passing in the desired background color.
---
...undView.kt => OppiaCurveBackgroundView.kt} | 33 +++++++++----------
.../android/app/view/ViewComponentImpl.kt | 4 +--
.../survey_welcome_dialog_fragment.xml | 8 +++--
.../survey_welcome_dialog_fragment.xml | 7 ++--
.../layout/survey_outro_dialog_fragment.xml | 3 +-
.../layout/survey_welcome_dialog_fragment.xml | 5 +--
app/src/main/res/values/attrs.xml | 4 +++
7 files changed, 36 insertions(+), 28 deletions(-)
rename app/src/main/java/org/oppia/android/app/customview/{SurveyOnboardingBackgroundView.kt => OppiaCurveBackgroundView.kt} (77%)
diff --git a/app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt b/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
similarity index 77%
rename from app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt
rename to app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
index 4ef674dc6ab..1b9063aa4f3 100644
--- a/app/src/main/java/org/oppia/android/app/customview/SurveyOnboardingBackgroundView.kt
+++ b/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
@@ -1,13 +1,13 @@
package org.oppia.android.app.customview
import android.content.Context
+import android.content.res.TypedArray
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.util.AttributeSet
import android.view.View
-import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
@@ -18,13 +18,16 @@ import org.oppia.android.app.view.ViewComponentImpl
import javax.inject.Inject
/**
- * CustomView to add a background to [SurveyWelcomeDialogFragment] and [SurveyOutroDialogFragment].
- * Without chaptersFinished and totalChapters values this custom-view cannot be created.
+ * CustomView to add a background to views that require a bezier curve background.
*
* Reference: // https://proandroiddev.com/how-i-drew-custom-shapes-in-bottom-bar-c4539d86afd7 and
* // https://ciechanow.ski/drawing-bezier-curves/
*/
-class SurveyOnboardingBackgroundView : View {
+class OppiaCurveBackgroundView @JvmOverloads constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
+) : View(context, attrs, defStyleAttr) {
@Inject
lateinit var resourceHandler: AppLanguageResourceHandler
@@ -32,19 +35,18 @@ class SurveyOnboardingBackgroundView : View {
resourceHandler.getLayoutDirection() == ViewCompat.LAYOUT_DIRECTION_RTL
}
+ private var customBackgroundColor = Color.WHITE // Default color
+
private lateinit var paint: Paint
private lateinit var path: Path
private var strokeWidth = 2f
- constructor(context: Context) : super(context)
- constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
- constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
- context,
- attrs,
- defStyleAttr
- )
-
init {
+ val typedArray: TypedArray =
+ context.obtainStyledAttributes(attrs, R.styleable.OppiaCurveBackgroundView)
+ customBackgroundColor =
+ typedArray.getColor(R.styleable.OppiaCurveBackgroundView_customBackgroundColor, Color.WHITE)
+ typedArray.recycle()
setupCurvePaint()
}
@@ -91,11 +93,8 @@ class SurveyOnboardingBackgroundView : View {
paint = Paint(Paint.ANTI_ALIAS_FLAG)
paint.apply {
style = Paint.Style.FILL_AND_STROKE
- strokeWidth = this@SurveyOnboardingBackgroundView.strokeWidth
- color = ContextCompat.getColor(
- context,
- R.color.component_color_survey_popup_background_color
- )
+ strokeWidth = this@OppiaCurveBackgroundView.strokeWidth
+ color = customBackgroundColor
}
setBackgroundColor(Color.TRANSPARENT)
}
diff --git a/app/src/main/java/org/oppia/android/app/view/ViewComponentImpl.kt b/app/src/main/java/org/oppia/android/app/view/ViewComponentImpl.kt
index 08726cc7f49..ecb07ff3e28 100644
--- a/app/src/main/java/org/oppia/android/app/view/ViewComponentImpl.kt
+++ b/app/src/main/java/org/oppia/android/app/view/ViewComponentImpl.kt
@@ -6,9 +6,9 @@ import dagger.Subcomponent
import org.oppia.android.app.customview.ChapterNotStartedContainerConstraintLayout
import org.oppia.android.app.customview.ContinueButtonView
import org.oppia.android.app.customview.LessonThumbnailImageView
+import org.oppia.android.app.customview.OppiaCurveBackgroundView
import org.oppia.android.app.customview.PromotedStoryCardView
import org.oppia.android.app.customview.SegmentedCircularProgressView
-import org.oppia.android.app.customview.SurveyOnboardingBackgroundView
import org.oppia.android.app.home.promotedlist.ComingSoonTopicsListView
import org.oppia.android.app.home.promotedlist.PromotedStoryListView
import org.oppia.android.app.player.state.DragDropSortInteractionView
@@ -42,7 +42,7 @@ interface ViewComponentImpl : ViewComponent {
fun inject(promotedStoryCardView: PromotedStoryCardView)
fun inject(promotedStoryListView: PromotedStoryListView)
fun inject(segmentedCircularProgressView: SegmentedCircularProgressView)
- fun inject(surveyOnboardingBackgroundView: SurveyOnboardingBackgroundView)
+ fun inject(curveBackgroundView: OppiaCurveBackgroundView)
fun inject(surveyMultipleChoiceOptionView: SurveyMultipleChoiceOptionView)
fun inject(surveyNpsItemOptionView: SurveyNpsItemOptionView)
}
diff --git a/app/src/main/res/layout-land/survey_welcome_dialog_fragment.xml b/app/src/main/res/layout-land/survey_welcome_dialog_fragment.xml
index 9a41b4cf558..86fd12d45b6 100644
--- a/app/src/main/res/layout-land/survey_welcome_dialog_fragment.xml
+++ b/app/src/main/res/layout-land/survey_welcome_dialog_fragment.xml
@@ -10,9 +10,10 @@
android:id="@+id/survey_onboarding_title_text"
style="@style/SurveyPopupHeaderStyle"
android:text="@string/survey_onboarding_title_text"
+
+ app:layout_constraintBottom_toTopOf="@id/survey_onboarding_title_guide"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintBottom_toTopOf="@id/survey_onboarding_title_guide"
app:layout_constraintTop_toTopOf="parent" />
-
-
-
-
+
+
+
+
From 4df3f6057d846d021c710d303247c18087f4a2a5 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 1 Nov 2023 12:27:53 +0300
Subject: [PATCH 02/13] Add onboarding language selection layout: wip
---
.../app_language_selection_fragment.xml | 92 +++++++++++++++++++
app/src/main/res/values/component_colors.xml | 3 +
app/src/main/res/values/dimens.xml | 7 ++
app/src/main/res/values/strings.xml | 11 +++
app/src/main/res/values/styles.xml | 61 ++++++++++++
5 files changed, 174 insertions(+)
create mode 100644 app/src/main/res/layout/app_language_selection_fragment.xml
diff --git a/app/src/main/res/layout/app_language_selection_fragment.xml b/app/src/main/res/layout/app_language_selection_fragment.xml
new file mode 100644
index 00000000000..87bc1519dd1
--- /dev/null
+++ b/app/src/main/res/layout/app_language_selection_fragment.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/component_colors.xml b/app/src/main/res/values/component_colors.xml
index 9c312ee2ed0..6ca967cc1ec 100644
--- a/app/src/main/res/values/component_colors.xml
+++ b/app/src/main/res/values/component_colors.xml
@@ -303,4 +303,7 @@
@color/color_palette_button_text_color
@color/color_palette_edit_text_unselected_color
@color/color_palette_button_shadow_color
+
+ @color/color_palette_white_text_color
+ @color/color_palette_primary_color
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 4361dce5674..d1d275c16ce 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -769,4 +769,11 @@
28dp
32dp
8dp
+
+
+ 28dp
+ 28dp
+ 36sp
+ 24sp
+ 16sp
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 97547bc1638..4e3a004f534 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -645,4 +645,15 @@
Lock Icon
Download Status
html Content
+
+
+ Welcome to %s!
+ Learn math for free, anytime!
+ Made for students aged 7 to 14
+ Select a language to start
+ You can change your language selection anytime in the app settings
+ Let\'s go!
+
+ - English
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 815ceccc4b7..f058ca837ca 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -636,4 +636,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
From 434580105cbf431a5c9fc5674344cb2f10a1f37c Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Tue, 12 Dec 2023 01:19:09 +0300
Subject: [PATCH 03/13] Create onboarding app language selection UI portrait
---
.../customview/OppiaCurveBackgroundView.kt | 8 +-
.../onboarding/OnboardingFragmentPresenter.kt | 97 +++++++------
.../main/res/drawable/dropdown_background.xml | 9 ++
.../drawable/ic_language_icon_black_24dp.xml | 10 ++
app/src/main/res/drawable/img_otter.xml | 130 ++++++++++++++++++
.../app_language_selection_fragment.xml | 81 +++++++++--
.../onboarding_language_dropdown_item.xml | 16 +++
app/src/main/res/values/dimens.xml | 11 +-
app/src/main/res/values/styles.xml | 13 +-
9 files changed, 303 insertions(+), 72 deletions(-)
create mode 100644 app/src/main/res/drawable/dropdown_background.xml
create mode 100644 app/src/main/res/drawable/ic_language_icon_black_24dp.xml
create mode 100644 app/src/main/res/drawable/img_otter.xml
create mode 100644 app/src/main/res/layout/onboarding_language_dropdown_item.xml
diff --git a/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt b/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
index 1b9063aa4f3..ae9ef4642f5 100644
--- a/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
+++ b/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
@@ -11,11 +11,11 @@ import android.view.View
import androidx.core.view.ViewCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
+import javax.inject.Inject
import org.oppia.android.R
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.view.ViewComponentFactory
import org.oppia.android.app.view.ViewComponentImpl
-import javax.inject.Inject
/**
* CustomView to add a background to views that require a bezier curve background.
@@ -63,11 +63,11 @@ class OppiaCurveBackgroundView @JvmOverloads constructor(
val width = this.width.toFloat()
val height = this.height.toFloat()
- val controlPoint1X = width * 0.5f
+ val controlPoint1X = width * 0.4f
val controlPoint1Y = 0f
- val controlPoint2X = width * 0.5f
- val controlPoint2Y = height * 0.2f
+ val controlPoint2X = width * 0.6f
+ val controlPoint2Y = height * 0.16f
val controlPoint3X = width * 1f
val controlPoint3Y = height * 0.1f
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt
index 1551e6c4199..68000e710b8 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt
@@ -3,11 +3,12 @@ package org.oppia.android.app.onboarding
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.widget.ArrayAdapter
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
-import androidx.viewpager2.widget.ViewPager2
+import javax.inject.Inject
import org.oppia.android.R
import org.oppia.android.app.fragment.FragmentScope
import org.oppia.android.app.model.PolicyPage
@@ -15,13 +16,12 @@ import org.oppia.android.app.policies.RouteToPoliciesListener
import org.oppia.android.app.recyclerview.BindableAdapter
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.viewmodel.ViewModelProvider
-import org.oppia.android.databinding.OnboardingFragmentBinding
+import org.oppia.android.databinding.AppLanguageSelectionFragmentBinding
import org.oppia.android.databinding.OnboardingSlideBinding
import org.oppia.android.databinding.OnboardingSlideFinalBinding
import org.oppia.android.util.parser.html.HtmlParser
import org.oppia.android.util.parser.html.PolicyType
import org.oppia.android.util.statusbar.StatusBarColor
-import javax.inject.Inject
/** The presenter for [OnboardingFragment]. */
@FragmentScope
@@ -35,10 +35,10 @@ class OnboardingFragmentPresenter @Inject constructor(
private val multiTypeBuilderFactory: BindableAdapter.MultiTypeBuilder.Factory
) : OnboardingNavigationListener, HtmlParser.PolicyOppiaTagActionListener {
private val dotsList = ArrayList()
- private lateinit var binding: OnboardingFragmentBinding
+ private lateinit var binding: AppLanguageSelectionFragmentBinding
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View {
- binding = OnboardingFragmentBinding.inflate(
+ binding = AppLanguageSelectionFragmentBinding.inflate(
inflater,
container,
/* attachToRoot= */ false
@@ -47,11 +47,18 @@ class OnboardingFragmentPresenter @Inject constructor(
// data-bound view models.
binding.let {
it.lifecycleOwner = fragment
- it.presenter = this
- it.viewModel = getOnboardingViewModel()
+// it.presenter = this
+// it.viewModel = getOnboardingViewModel()
}
setUpViewPager()
addDots()
+
+ binding.onboardingLanguageDropdown.adapter = ArrayAdapter(
+ fragment.requireContext(),
+ R.layout.onboarding_language_dropdown_item,
+ R.id.language_text_view,
+ arrayOf("English")
+ )
return binding.root
}
@@ -71,33 +78,33 @@ class OnboardingFragmentPresenter @Inject constructor(
getOnboardingSlideFinalViewModel()
)
)
- binding.onboardingSlideViewPager.adapter = onboardingViewPagerBindableAdapter
- binding.onboardingSlideViewPager.registerOnPageChangeCallback(
- object : ViewPager2.OnPageChangeCallback() {
- override fun onPageScrollStateChanged(state: Int) {
- }
-
- override fun onPageScrolled(
- position: Int,
- positionOffset: Float,
- positionOffsetPixels: Int
- ) {
- }
-
- override fun onPageSelected(position: Int) {
- if (position == TOTAL_NUMBER_OF_SLIDES - 1) {
- binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
- getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
- } else {
- getOnboardingViewModel().slideChanged(
- ViewPagerSlide.getSlideForPosition(position)
- .ordinal
- )
- }
- selectDot(position)
- onboardingStatusBarColorUpdate(position)
- }
- })
+ /* binding.onboardingSlideViewPager.adapter = onboardingViewPagerBindableAdapter
+ binding.onboardingSlideViewPager.registerOnPageChangeCallback(
+ object : ViewPager2.OnPageChangeCallback() {
+ override fun onPageScrollStateChanged(state: Int) {
+ }
+
+ override fun onPageScrolled(
+ position: Int,
+ positionOffset: Float,
+ positionOffsetPixels: Int
+ ) {
+ }
+
+ override fun onPageSelected(position: Int) {
+ if (position == TOTAL_NUMBER_OF_SLIDES - 1) {
+ binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
+ getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
+ } else {
+ getOnboardingViewModel().slideChanged(
+ ViewPagerSlide.getSlideForPosition(position)
+ .ordinal
+ )
+ }
+ selectDot(position)
+ onboardingStatusBarColorUpdate(position)
+ }
+ })*/
}
private fun createViewPagerAdapter(): BindableAdapter {
@@ -197,18 +204,18 @@ class OnboardingFragmentPresenter @Inject constructor(
}
override fun clickOnSkip() {
- binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
+ //binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
}
override fun clickOnNext() {
- val position: Int = binding.onboardingSlideViewPager.currentItem + 1
- binding.onboardingSlideViewPager.currentItem = position
- if (position != TOTAL_NUMBER_OF_SLIDES - 1) {
- getOnboardingViewModel().slideChanged(ViewPagerSlide.getSlideForPosition(position).ordinal)
- } else {
- getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
- }
- selectDot(position)
+ /* val position: Int = binding.onboardingSlideViewPager.currentItem + 1
+ binding.onboardingSlideViewPager.currentItem = position
+ if (position != TOTAL_NUMBER_OF_SLIDES - 1) {
+ getOnboardingViewModel().slideChanged(ViewPagerSlide.getSlideForPosition(position).ordinal)
+ } else {
+ getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
+ }
+ selectDot(position)*/
}
private fun getOnboardingViewModel(): OnboardingViewModel {
@@ -216,7 +223,7 @@ class OnboardingFragmentPresenter @Inject constructor(
}
private fun addDots() {
- val dotsLayout = binding.slideDotsContainer
+ //val dotsLayout = binding.slideDotsContainer
val dotIdList = ArrayList()
dotIdList.add(R.id.onboarding_dot_0)
dotIdList.add(R.id.onboarding_dot_1)
@@ -237,7 +244,7 @@ class OnboardingFragmentPresenter @Inject constructor(
0,
0
)
- dotsLayout.addView(dotView, params)
+ //dotsLayout.addView(dotView, params)
dotsList.add(dotView)
}
selectDot(0)
diff --git a/app/src/main/res/drawable/dropdown_background.xml b/app/src/main/res/drawable/dropdown_background.xml
new file mode 100644
index 00000000000..6a5e135bbdb
--- /dev/null
+++ b/app/src/main/res/drawable/dropdown_background.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_language_icon_black_24dp.xml b/app/src/main/res/drawable/ic_language_icon_black_24dp.xml
new file mode 100644
index 00000000000..e89dd7a2a58
--- /dev/null
+++ b/app/src/main/res/drawable/ic_language_icon_black_24dp.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/drawable/img_otter.xml b/app/src/main/res/drawable/img_otter.xml
new file mode 100644
index 00000000000..b74a96015b6
--- /dev/null
+++ b/app/src/main/res/drawable/img_otter.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/app_language_selection_fragment.xml b/app/src/main/res/layout/app_language_selection_fragment.xml
index 87bc1519dd1..e9a8ddf8f39 100644
--- a/app/src/main/res/layout/app_language_selection_fragment.xml
+++ b/app/src/main/res/layout/app_language_selection_fragment.xml
@@ -14,7 +14,7 @@
android:text="Welcome to Oppia"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ app:layout_constraintTop_toTopOf="@id/onboarding_language_header_guide" />
+
+
+
+
+ app:layout_constraintGuide_percent="0.45" />
+
+
+ app:layout_constraintTop_toBottomOf="@id/onboarding_language_center_guide" />
-
+ android:layout_margin="@dimen/onboarding_language_text_margin"
+ android:background="@drawable/dropdown_background"
+ android:elevation="8dp"
+ android:padding="@dimen/onboarding_language_dropdown_padding"
+ app:layout_constraintEnd_toEndOf="@id/onboarding_language_label"
+ app:layout_constraintStart_toStartOf="@id/onboarding_language_label"
+ app:layout_constraintTop_toBottomOf="@id/onboarding_language_label">
+
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/onboarding_language_dropdown_background" />
diff --git a/app/src/main/res/layout/onboarding_language_dropdown_item.xml b/app/src/main/res/layout/onboarding_language_dropdown_item.xml
new file mode 100644
index 00000000000..fc4dfb0b11f
--- /dev/null
+++ b/app/src/main/res/layout/onboarding_language_dropdown_item.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index e17d3d61ae4..ced1a908610 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -385,6 +385,9 @@
48dp
+
+ 144dp
+
12dp
@@ -775,9 +778,13 @@
3dp
- 28dp
+ 12dp
+ 28dp
+ 20dp
28dp
- 36sp
+ 16dp
+ 32sp
24sp
16sp
+ 8dp
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index f058ca837ca..18ca628527b 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -641,7 +641,6 @@
- wrap_content
- wrap_content
- @color/component_color_onboarding_language_white_text_color
- - @dimen/onboarding_language_text_margin
- @dimen/onboarding_language_title_text_size
- sans-serif-medium
@@ -650,7 +649,7 @@
- match_parent
- wrap_content
- @color/component_color_onboarding_language_white_text_color
- - @dimen/onboarding_language_text_margin
+ - @dimen/onboarding_language_subtitle_margin
- @dimen/onboarding_language_subtitle_text_size
- sans-serif
- false
@@ -660,23 +659,21 @@
- match_parent
- wrap_content
- @color/component_color_onboarding_language_white_text_color
- - @dimen/onboarding_language_text_margin
+ - @dimen/onboarding_language_explanation_text_margin
- @dimen/onboarding_language_message_text_size
- sans-serif
- false
@@ -648,7 +648,7 @@
@@ -686,7 +686,7 @@
From ee9ff7c38c175d81a1c3600ec907608a254d271c Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Tue, 19 Dec 2023 04:24:30 +0300
Subject: [PATCH 06/13] Fix explanation text padding
---
.../res/layout/onboarding_app_language_selection_fragment.xml | 1 +
app/src/main/res/values/dimens.xml | 1 +
2 files changed, 2 insertions(+)
diff --git a/app/src/main/res/layout/onboarding_app_language_selection_fragment.xml b/app/src/main/res/layout/onboarding_app_language_selection_fragment.xml
index d3085484fc3..12390fd5296 100644
--- a/app/src/main/res/layout/onboarding_app_language_selection_fragment.xml
+++ b/app/src/main/res/layout/onboarding_app_language_selection_fragment.xml
@@ -103,6 +103,7 @@
16sp
8dp
8dp
+ 16dp
32dp
20dp
8dp
From 3ced7e14a8bff8c3757ed15a1626b0e63c6ce14d Mon Sep 17 00:00:00 2001
From: Tejashwadeep Jha <110051718+Tejas-67@users.noreply.github.com>
Date: Wed, 31 Jan 2024 00:48:35 +0530
Subject: [PATCH 07/13] Fix #5250 : Add support for logging device DPI events
(#5270)
## Explanation
Fix #5250 In the EventBundleCreator class, introduced a new item in the
bundle to log the screen density of the device. Stored using the key
"screen_density" and value retrieved from
resources.displayMetrics.screenDensity .
## Essential Checklist
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).
## For UI-specific PRs only
If your PR includes UI-related changes, then:
- Add screenshots for portrait/landscape for both a tablet & phone of
the before & after UI changes
- For the screenshots above, include both English and pseudo-localized
(RTL) screenshots (see [RTL
guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines))
- Add a video showing the full UX flow with a screen reader enabled (see
[accessibility
guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide))
- For PRs introducing new UI elements or color changes, both light and
dark mode screenshots must be included
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing
---------
Co-authored-by: Tejas-67
Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
---
.../util/logging/EventBundleCreator.kt | 7 ++
.../util/logging/EventBundleCreatorTest.kt | 106 +++++++++---------
.../KenyaAlphaEventBundleCreatorTest.kt | 102 ++++++++---------
3 files changed, 111 insertions(+), 104 deletions(-)
diff --git a/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt b/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
index 100f1c86c4c..1684878eb70 100644
--- a/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
+++ b/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
@@ -1,6 +1,7 @@
package org.oppia.android.util.logging
import android.content.Context
+import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import org.oppia.android.app.model.AppLanguageSelection
@@ -129,6 +130,9 @@ class EventBundleCreator @Inject constructor(
private val appVersionCode by lazy { context.getVersionCode() }
private val appVersionName by lazy { context.getVersionName() }
private val eventCount by lazy { AtomicInteger() }
+ private val screenDensity by lazy {
+ Configuration().densityDpi
+ }
/**
* Fills the specified [bundle] with a logging-ready representation of [eventLog] and returns a
@@ -150,6 +154,9 @@ class EventBundleCreator @Inject constructor(
bundle.putString(
"oppia_audio_lang", eventLog.audioTranslationLanguageSelection.toAnalyticsText()
)
+ bundle.putInt(
+ "screen_density", screenDensity
+ )
return eventLog.context.convertToActivityContext().also { eventContext ->
// Only allow user IDs to be logged when the learner study feature is enabled.
eventContext.storeValue(
diff --git a/utility/src/test/java/org/oppia/android/util/logging/EventBundleCreatorTest.kt b/utility/src/test/java/org/oppia/android/util/logging/EventBundleCreatorTest.kt
index db424118e1f..7cb8ef98c35 100644
--- a/utility/src/test/java/org/oppia/android/util/logging/EventBundleCreatorTest.kt
+++ b/utility/src/test/java/org/oppia/android/util/logging/EventBundleCreatorTest.kt
@@ -176,7 +176,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(EventLog.getDefaultInstance(), bundle)
assertThat(typeName).isEqualTo("ERROR_internal_logging_failure")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(0)
assertThat(bundle).string("priority").isEqualTo("unspecified_priority")
assertThat(bundle).integer("event_type").isEqualTo(ACTIVITYCONTEXT_NOT_SET.number)
@@ -222,7 +222,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("ERROR_internal_logging_failure")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACTIVITYCONTEXT_NOT_SET.number)
@@ -570,7 +570,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_exploration_player_screen")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_EXPLORATION_ACTIVITY.number)
@@ -594,7 +594,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_exploration_player_screen")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_EXPLORATION_ACTIVITY.number)
@@ -620,7 +620,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("select_topic_info_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_INFO_TAB.number)
@@ -639,7 +639,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("select_topic_lessons_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_LESSONS_TAB.number)
@@ -821,7 +821,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("select_topic_practice_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_PRACTICE_TAB.number)
@@ -840,7 +840,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("select_topic_revision_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_REVISION_TAB.number)
@@ -859,7 +859,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_question_player_screen")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_QUESTION_PLAYER.number)
@@ -879,7 +879,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_story_chapter_list_screen")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_STORY_ACTIVITY.number)
@@ -899,7 +899,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_concept_card")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_CONCEPT_CARD.number)
@@ -918,7 +918,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_revision_card")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_REVISION_CARD.number)
@@ -938,7 +938,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("close_revision_card")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(CLOSE_REVISION_CARD.number)
@@ -958,7 +958,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("start_exploration_card")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_CARD_CONTEXT.number)
@@ -983,7 +983,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("start_exploration_card")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_CARD_CONTEXT.number)
@@ -1010,7 +1010,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("end_exploration_card")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(END_CARD_CONTEXT.number)
@@ -1035,7 +1035,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("end_exploration_card")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(END_CARD_CONTEXT.number)
@@ -1062,7 +1062,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("unlock_hint")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(HINT_UNLOCKED_CONTEXT.number)
@@ -1087,7 +1087,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("unlock_hint")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(HINT_UNLOCKED_CONTEXT.number)
@@ -1114,7 +1114,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("reveal_hint")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_HINT_CONTEXT.number)
@@ -1139,7 +1139,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("reveal_hint")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_HINT_CONTEXT.number)
@@ -1166,7 +1166,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("unlock_solution")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SOLUTION_UNLOCKED_CONTEXT.number)
@@ -1190,7 +1190,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("unlock_solution")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SOLUTION_UNLOCKED_CONTEXT.number)
@@ -1216,7 +1216,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("reveal_solution")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_SOLUTION_CONTEXT.number)
@@ -1240,7 +1240,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("reveal_solution")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_SOLUTION_CONTEXT.number)
@@ -1266,7 +1266,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("submit_answer")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SUBMIT_ANSWER_CONTEXT.number)
@@ -1292,7 +1292,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("submit_answer")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SUBMIT_ANSWER_CONTEXT.number)
@@ -1320,7 +1320,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("click_play_voiceover_button")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PLAY_VOICE_OVER_CONTEXT.number)
@@ -1346,7 +1346,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("click_play_voiceover_button")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PLAY_VOICE_OVER_CONTEXT.number)
@@ -1374,7 +1374,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("click_pause_voiceover_button")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PAUSE_VOICE_OVER_CONTEXT.number)
@@ -1400,7 +1400,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("click_pause_voiceover_button")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PAUSE_VOICE_OVER_CONTEXT.number)
@@ -1428,7 +1428,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("send_app_to_background")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_BACKGROUND_CONTEXT.number)
@@ -1446,7 +1446,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("send_app_to_background")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_BACKGROUND_CONTEXT.number)
@@ -1466,7 +1466,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("bring_app_to_foreground")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_FOREGROUND_CONTEXT.number)
@@ -1484,7 +1484,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("bring_app_to_foreground")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_FOREGROUND_CONTEXT.number)
@@ -1504,7 +1504,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("leave_exploration")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(EXIT_EXPLORATION_CONTEXT.number)
@@ -1528,7 +1528,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("leave_exploration")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(EXIT_EXPLORATION_CONTEXT.number)
@@ -1554,7 +1554,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("complete_exploration")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(FINISH_EXPLORATION_CONTEXT.number)
@@ -1578,7 +1578,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("complete_exploration")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(FINISH_EXPLORATION_CONTEXT.number)
@@ -1604,7 +1604,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("resume_in_progress_exploration")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(RESUME_EXPLORATION_CONTEXT.number)
@@ -1622,7 +1622,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("resume_in_progress_exploration")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(RESUME_EXPLORATION_CONTEXT.number)
@@ -1642,7 +1642,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("restart_in_progress_exploration")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_OVER_EXPLORATION_CONTEXT.number)
@@ -1660,7 +1660,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("restart_in_progress_exploration")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_OVER_EXPLORATION_CONTEXT.number)
@@ -1680,7 +1680,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("delete_profile")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(DELETE_PROFILE_CONTEXT.number)
@@ -1698,7 +1698,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("delete_profile")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(DELETE_PROFILE_CONTEXT.number)
@@ -1718,7 +1718,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_home_screen")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_HOME.number)
@@ -1736,7 +1736,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_profile_chooser_screen")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_PROFILE_CHOOSER.number)
@@ -1754,7 +1754,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("reach_invested_engagement")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(REACH_INVESTED_ENGAGEMENT.number)
@@ -1778,7 +1778,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("reach_invested_engagement")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(REACH_INVESTED_ENGAGEMENT.number)
@@ -1804,7 +1804,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("click_switch_language_in_lesson")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SWITCH_IN_LESSON_LANGUAGE.number)
@@ -1830,7 +1830,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("click_switch_language_in_lesson")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SWITCH_IN_LESSON_LANGUAGE.number)
@@ -1858,7 +1858,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("ERROR_internal_logging_failure")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(INSTALL_ID_FOR_FAILED_ANALYTICS_LOG.number)
@@ -1876,7 +1876,7 @@ class EventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("ERROR_internal_logging_failure")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(INSTALL_ID_FOR_FAILED_ANALYTICS_LOG.number)
diff --git a/utility/src/test/java/org/oppia/android/util/logging/KenyaAlphaEventBundleCreatorTest.kt b/utility/src/test/java/org/oppia/android/util/logging/KenyaAlphaEventBundleCreatorTest.kt
index 3ec4c2f5169..ccc9f65bf3f 100644
--- a/utility/src/test/java/org/oppia/android/util/logging/KenyaAlphaEventBundleCreatorTest.kt
+++ b/utility/src/test/java/org/oppia/android/util/logging/KenyaAlphaEventBundleCreatorTest.kt
@@ -132,7 +132,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(EventLog.getDefaultInstance(), bundle)
assertThat(typeName).isEqualTo("unknown_activity_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(0)
assertThat(bundle).string("priority").isEqualTo("unspecified_priority")
assertThat(bundle).integer("event_type").isEqualTo(ACTIVITYCONTEXT_NOT_SET.number)
@@ -150,7 +150,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("unknown_activity_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACTIVITYCONTEXT_NOT_SET.number)
@@ -190,7 +190,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_exploration_activity")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_EXPLORATION_ACTIVITY.number)
@@ -214,7 +214,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_exploration_activity")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_EXPLORATION_ACTIVITY.number)
@@ -240,7 +240,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_info_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_INFO_TAB.number)
@@ -259,7 +259,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_lessons_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_LESSONS_TAB.number)
@@ -278,7 +278,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_practice_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_PRACTICE_TAB.number)
@@ -297,7 +297,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_revision_tab")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_REVISION_TAB.number)
@@ -316,7 +316,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_question_player")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_QUESTION_PLAYER.number)
@@ -336,7 +336,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_story_activity")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_STORY_ACTIVITY.number)
@@ -356,7 +356,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_concept_card")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_CONCEPT_CARD.number)
@@ -375,7 +375,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_revision_card")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_REVISION_CARD.number)
@@ -395,7 +395,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("close_revision_card")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(CLOSE_REVISION_CARD.number)
@@ -415,7 +415,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("start_card_context")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_CARD_CONTEXT.number)
@@ -440,7 +440,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("start_card_context")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_CARD_CONTEXT.number)
@@ -467,7 +467,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("end_card_context")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(END_CARD_CONTEXT.number)
@@ -492,7 +492,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("end_card_context")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(END_CARD_CONTEXT.number)
@@ -519,7 +519,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("hint_offered_context")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(HINT_UNLOCKED_CONTEXT.number)
@@ -544,7 +544,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("hint_offered_context")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(HINT_UNLOCKED_CONTEXT.number)
@@ -571,7 +571,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("access_hint_context")
- assertThat(bundle).hasSize(17)
+ assertThat(bundle).hasSize(18)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_HINT_CONTEXT.number)
@@ -596,7 +596,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("access_hint_context")
- assertThat(bundle).hasSize(19)
+ assertThat(bundle).hasSize(20)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_HINT_CONTEXT.number)
@@ -623,7 +623,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("solution_offered_context")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SOLUTION_UNLOCKED_CONTEXT.number)
@@ -647,7 +647,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("solution_offered_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SOLUTION_UNLOCKED_CONTEXT.number)
@@ -673,7 +673,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("access_solution_context")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_SOLUTION_CONTEXT.number)
@@ -697,7 +697,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("access_solution_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(ACCESS_SOLUTION_CONTEXT.number)
@@ -723,7 +723,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("submit_answer_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SUBMIT_ANSWER_CONTEXT.number)
@@ -749,7 +749,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("submit_answer_context")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SUBMIT_ANSWER_CONTEXT.number)
@@ -777,7 +777,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("play_voice_over_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PLAY_VOICE_OVER_CONTEXT.number)
@@ -803,7 +803,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("play_voice_over_context")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PLAY_VOICE_OVER_CONTEXT.number)
@@ -831,7 +831,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("pause_voice_over_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PAUSE_VOICE_OVER_CONTEXT.number)
@@ -857,7 +857,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("pause_voice_over_context")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(PAUSE_VOICE_OVER_CONTEXT.number)
@@ -885,7 +885,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("app_in_background_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_BACKGROUND_CONTEXT.number)
@@ -903,7 +903,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("app_in_background_context")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_BACKGROUND_CONTEXT.number)
@@ -923,7 +923,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("app_in_foreground_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_FOREGROUND_CONTEXT.number)
@@ -941,7 +941,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("app_in_foreground_context")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(APP_IN_FOREGROUND_CONTEXT.number)
@@ -961,7 +961,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("exit_exploration_context")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(EXIT_EXPLORATION_CONTEXT.number)
@@ -985,7 +985,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("exit_exploration_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(EXIT_EXPLORATION_CONTEXT.number)
@@ -1011,7 +1011,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("finish_exploration_context")
- assertThat(bundle).hasSize(16)
+ assertThat(bundle).hasSize(17)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(FINISH_EXPLORATION_CONTEXT.number)
@@ -1035,7 +1035,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("finish_exploration_context")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(FINISH_EXPLORATION_CONTEXT.number)
@@ -1061,7 +1061,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("resume_exploration_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(RESUME_EXPLORATION_CONTEXT.number)
@@ -1079,7 +1079,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("resume_exploration_context")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(RESUME_EXPLORATION_CONTEXT.number)
@@ -1099,7 +1099,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("start_over_exploration_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_OVER_EXPLORATION_CONTEXT.number)
@@ -1117,7 +1117,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("start_over_exploration_context")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(START_OVER_EXPLORATION_CONTEXT.number)
@@ -1137,7 +1137,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("delete_profile_context")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(DELETE_PROFILE_CONTEXT.number)
@@ -1155,7 +1155,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("delete_profile_context")
- assertThat(bundle).hasSize(12)
+ assertThat(bundle).hasSize(13)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(DELETE_PROFILE_CONTEXT.number)
@@ -1175,7 +1175,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_home")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_HOME.number)
@@ -1193,7 +1193,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("open_profile_chooser")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(OPEN_PROFILE_CHOOSER.number)
@@ -1211,7 +1211,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("switch_in_lesson_language")
- assertThat(bundle).hasSize(18)
+ assertThat(bundle).hasSize(19)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SWITCH_IN_LESSON_LANGUAGE.number)
@@ -1237,7 +1237,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("switch_in_lesson_language")
- assertThat(bundle).hasSize(20)
+ assertThat(bundle).hasSize(21)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(SWITCH_IN_LESSON_LANGUAGE.number)
@@ -1265,7 +1265,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("failed_analytics_log")
- assertThat(bundle).hasSize(10)
+ assertThat(bundle).hasSize(11)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(INSTALL_ID_FOR_FAILED_ANALYTICS_LOG.number)
@@ -1283,7 +1283,7 @@ class KenyaAlphaEventBundleCreatorTest {
val typeName = eventBundleCreator.fillEventBundle(eventLog, bundle)
assertThat(typeName).isEqualTo("failed_analytics_log")
- assertThat(bundle).hasSize(11)
+ assertThat(bundle).hasSize(12)
assertThat(bundle).longInt("timestamp").isEqualTo(TEST_TIMESTAMP_1)
assertThat(bundle).string("priority").isEqualTo("essential")
assertThat(bundle).integer("event_type").isEqualTo(INSTALL_ID_FOR_FAILED_ANALYTICS_LOG.number)
From 6f0f6e40742cc6fa218abd21818fd38a707f700a Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 31 Jan 2024 13:23:37 +0300
Subject: [PATCH 08/13] Revert commented out code
---
.../onboarding/OnboardingFragmentPresenter.kt | 96 +++++++++----------
1 file changed, 45 insertions(+), 51 deletions(-)
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt
index 68000e710b8..80c4940d6bb 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragmentPresenter.kt
@@ -3,12 +3,11 @@ package org.oppia.android.app.onboarding
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import android.widget.ArrayAdapter
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
-import javax.inject.Inject
+import androidx.viewpager2.widget.ViewPager2
import org.oppia.android.R
import org.oppia.android.app.fragment.FragmentScope
import org.oppia.android.app.model.PolicyPage
@@ -16,12 +15,13 @@ import org.oppia.android.app.policies.RouteToPoliciesListener
import org.oppia.android.app.recyclerview.BindableAdapter
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.viewmodel.ViewModelProvider
-import org.oppia.android.databinding.AppLanguageSelectionFragmentBinding
+import org.oppia.android.databinding.OnboardingFragmentBinding
import org.oppia.android.databinding.OnboardingSlideBinding
import org.oppia.android.databinding.OnboardingSlideFinalBinding
import org.oppia.android.util.parser.html.HtmlParser
import org.oppia.android.util.parser.html.PolicyType
import org.oppia.android.util.statusbar.StatusBarColor
+import javax.inject.Inject
/** The presenter for [OnboardingFragment]. */
@FragmentScope
@@ -35,10 +35,10 @@ class OnboardingFragmentPresenter @Inject constructor(
private val multiTypeBuilderFactory: BindableAdapter.MultiTypeBuilder.Factory
) : OnboardingNavigationListener, HtmlParser.PolicyOppiaTagActionListener {
private val dotsList = ArrayList()
- private lateinit var binding: AppLanguageSelectionFragmentBinding
+ private lateinit var binding: OnboardingFragmentBinding
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View {
- binding = AppLanguageSelectionFragmentBinding.inflate(
+ binding = OnboardingFragmentBinding.inflate(
inflater,
container,
/* attachToRoot= */ false
@@ -47,18 +47,12 @@ class OnboardingFragmentPresenter @Inject constructor(
// data-bound view models.
binding.let {
it.lifecycleOwner = fragment
-// it.presenter = this
-// it.viewModel = getOnboardingViewModel()
+ it.presenter = this
+ it.viewModel = getOnboardingViewModel()
}
setUpViewPager()
addDots()
- binding.onboardingLanguageDropdown.adapter = ArrayAdapter(
- fragment.requireContext(),
- R.layout.onboarding_language_dropdown_item,
- R.id.language_text_view,
- arrayOf("English")
- )
return binding.root
}
@@ -78,33 +72,33 @@ class OnboardingFragmentPresenter @Inject constructor(
getOnboardingSlideFinalViewModel()
)
)
- /* binding.onboardingSlideViewPager.adapter = onboardingViewPagerBindableAdapter
- binding.onboardingSlideViewPager.registerOnPageChangeCallback(
- object : ViewPager2.OnPageChangeCallback() {
- override fun onPageScrollStateChanged(state: Int) {
- }
-
- override fun onPageScrolled(
- position: Int,
- positionOffset: Float,
- positionOffsetPixels: Int
- ) {
- }
-
- override fun onPageSelected(position: Int) {
- if (position == TOTAL_NUMBER_OF_SLIDES - 1) {
- binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
- getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
- } else {
- getOnboardingViewModel().slideChanged(
- ViewPagerSlide.getSlideForPosition(position)
- .ordinal
- )
- }
- selectDot(position)
- onboardingStatusBarColorUpdate(position)
- }
- })*/
+ binding.onboardingSlideViewPager.adapter = onboardingViewPagerBindableAdapter
+ binding.onboardingSlideViewPager.registerOnPageChangeCallback(
+ object : ViewPager2.OnPageChangeCallback() {
+ override fun onPageScrollStateChanged(state: Int) {
+ }
+
+ override fun onPageScrolled(
+ position: Int,
+ positionOffset: Float,
+ positionOffsetPixels: Int
+ ) {
+ }
+
+ override fun onPageSelected(position: Int) {
+ if (position == TOTAL_NUMBER_OF_SLIDES - 1) {
+ binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
+ getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
+ } else {
+ getOnboardingViewModel().slideChanged(
+ ViewPagerSlide.getSlideForPosition(position)
+ .ordinal
+ )
+ }
+ selectDot(position)
+ onboardingStatusBarColorUpdate(position)
+ }
+ })
}
private fun createViewPagerAdapter(): BindableAdapter {
@@ -204,18 +198,18 @@ class OnboardingFragmentPresenter @Inject constructor(
}
override fun clickOnSkip() {
- //binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
+ binding.onboardingSlideViewPager.currentItem = TOTAL_NUMBER_OF_SLIDES - 1
}
override fun clickOnNext() {
- /* val position: Int = binding.onboardingSlideViewPager.currentItem + 1
- binding.onboardingSlideViewPager.currentItem = position
- if (position != TOTAL_NUMBER_OF_SLIDES - 1) {
- getOnboardingViewModel().slideChanged(ViewPagerSlide.getSlideForPosition(position).ordinal)
- } else {
- getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
- }
- selectDot(position)*/
+ val position: Int = binding.onboardingSlideViewPager.currentItem + 1
+ binding.onboardingSlideViewPager.currentItem = position
+ if (position != TOTAL_NUMBER_OF_SLIDES - 1) {
+ getOnboardingViewModel().slideChanged(ViewPagerSlide.getSlideForPosition(position).ordinal)
+ } else {
+ getOnboardingViewModel().slideChanged(TOTAL_NUMBER_OF_SLIDES - 1)
+ }
+ selectDot(position)
}
private fun getOnboardingViewModel(): OnboardingViewModel {
@@ -223,7 +217,7 @@ class OnboardingFragmentPresenter @Inject constructor(
}
private fun addDots() {
- //val dotsLayout = binding.slideDotsContainer
+ val dotsLayout = binding.slideDotsContainer
val dotIdList = ArrayList()
dotIdList.add(R.id.onboarding_dot_0)
dotIdList.add(R.id.onboarding_dot_1)
@@ -244,7 +238,7 @@ class OnboardingFragmentPresenter @Inject constructor(
0,
0
)
- //dotsLayout.addView(dotView, params)
+ dotsLayout.addView(dotView, params)
dotsList.add(dotView)
}
selectDot(0)
From 52ae374b6123d75d18904181e431678f6e2d0cc2 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 31 Jan 2024 14:05:09 +0300
Subject: [PATCH 09/13] Set up new onboarding flow entry point
---
.../app/onboarding/OnboardingFragment.kt | 16 +++++-
.../OnboardingFragmentPresenter.kt | 55 +++++++++++++++++++
2 files changed, 70 insertions(+), 1 deletion(-)
create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
index 081abae41ee..52ff1826395 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
@@ -8,12 +8,22 @@ import android.view.ViewGroup
import org.oppia.android.app.fragment.FragmentComponentImpl
import org.oppia.android.app.fragment.InjectableFragment
import javax.inject.Inject
+import org.oppia.android.util.platformparameter.EnableOnboardingFlowV2
+import org.oppia.android.util.platformparameter.PlatformParameterValue
+import org.oppia.android.app.onboarding.onboardingv2.OnboardingFragmentPresenter as OnboardingFragmentPresenterV2
/** Fragment that contains an onboarding flow of the app. */
class OnboardingFragment : InjectableFragment() {
@Inject
lateinit var onboardingFragmentPresenter: OnboardingFragmentPresenter
+ @Inject
+ lateinit var onboardingFragmentPresenterV2: OnboardingFragmentPresenterV2
+
+ @Inject
+ @field:EnableOnboardingFlowV2
+ lateinit var enableOnboardingFlowV2: PlatformParameterValue
+
override fun onAttach(context: Context) {
super.onAttach(context)
(fragmentComponent as FragmentComponentImpl).inject(this)
@@ -24,6 +34,10 @@ class OnboardingFragment : InjectableFragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
- return onboardingFragmentPresenter.handleCreateView(inflater, container)
+ return if (enableOnboardingFlowV2.value) {
+ onboardingFragmentPresenterV2.handleCreateView(inflater, container)
+ } else {
+ onboardingFragmentPresenter.handleCreateView(inflater, container)
+ }
}
}
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt
new file mode 100644
index 00000000000..743828f7f71
--- /dev/null
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt
@@ -0,0 +1,55 @@
+package org.oppia.android.app.onboarding.onboardingv2
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ArrayAdapter
+import androidx.appcompat.app.AppCompatActivity
+import androidx.fragment.app.Fragment
+import javax.inject.Inject
+import org.oppia.android.R
+import org.oppia.android.app.fragment.FragmentScope
+import org.oppia.android.app.onboarding.OnboardingViewModel
+import org.oppia.android.app.translation.AppLanguageResourceHandler
+import org.oppia.android.app.viewmodel.ViewModelProvider
+import org.oppia.android.databinding.OnboardingAppLanguageSelectionFragmentBinding
+import org.oppia.android.domain.translation.TranslationController
+
+/** The presenter for [OnboardingFragment] V2. */
+@FragmentScope
+class OnboardingFragmentPresenter @Inject constructor(
+ private val activity: AppCompatActivity,
+ private val fragment: Fragment,
+ private val viewModelProvider: ViewModelProvider,
+ private val resourceHandler: AppLanguageResourceHandler,
+ private val translationController: TranslationController
+) {
+ private lateinit var binding: OnboardingAppLanguageSelectionFragmentBinding
+
+ fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View {
+ binding = OnboardingAppLanguageSelectionFragmentBinding.inflate(
+ inflater,
+ container,
+ /* attachToRoot= */ false
+ )
+ // NB: Both the view model and lifecycle owner must be set in order to correctly bind LiveData elements to
+ // data-bound view models.
+ binding.let {
+ it.lifecycleOwner = fragment
+// it.presenter = this
+// it.viewModel = getOnboardingViewModel()
+ }
+
+ binding.onboardingLanguageDropdown.adapter = ArrayAdapter(
+ fragment.requireContext(),
+ R.layout.onboarding_language_dropdown_item,
+ R.id.onboarding_language_text_view,
+ arrayOf("English")
+ )
+ return binding.root
+ }
+
+ private fun getOnboardingViewModel(): OnboardingViewModel {
+ return viewModelProvider.getForFragment(fragment, OnboardingViewModel::class.java)
+ }
+}
From b04b6374175045b0a73c2eec52bf67cfe032f8d3 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 31 Jan 2024 14:33:30 +0300
Subject: [PATCH 10/13] Set up onboarding fragment tests wth platform param
---
.../app/onboarding/OnboardingFragmentTest.kt | 40 +++++++++++++++----
1 file changed, 33 insertions(+), 7 deletions(-)
diff --git a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt
index 53de66687fb..c735b927495 100644
--- a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt
+++ b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt
@@ -133,21 +133,15 @@ class OnboardingFragmentTest {
@Inject
lateinit var testCoroutineDispatchers: TestCoroutineDispatchers
- @Inject
- lateinit var htmlParserFactory: HtmlParser.Factory
-
@Inject
lateinit var context: Context
@Inject
lateinit var appLanguageLocaleHandler: AppLanguageLocaleHandler
- @Inject
- @field:DefaultResourceBucketName
- lateinit var resourceBucketName: String
-
@Before
fun setUp() {
+ TestPlatformParameterModule.forceEnableOnboardingFlowV2(false)
Intents.init()
setUpTestApplicationComponent()
testCoroutineDispatchers.registerIdlingResource()
@@ -668,6 +662,38 @@ class OnboardingFragmentTest {
}
}
+ @Test
+ fun testOnboardingFragment_onboardingV2Enabled_languageSelectionScreenIsDisplayed() {
+ TestPlatformParameterModule.forceEnableOnboardingFlowV2(true)
+
+ launch(OnboardingActivity::class.java).use {
+ testCoroutineDispatchers.runCurrent()
+ onView(withText(R.string.onboarding_language_activity_select_label)).check(
+ matches(
+ isDisplayed()
+ )
+ )
+ }
+ }
+
+ @Test
+ fun testOnboardingFragment_onboardingV2Enabled_prefilledLanguageSelectionIsEnglish() {
+ TestPlatformParameterModule.forceEnableOnboardingFlowV2(true)
+
+ launch(OnboardingActivity::class.java).use {
+ testCoroutineDispatchers.runCurrent()
+ onView(withText(R.string.english_localized_language_name)).check(
+ matches(
+ isDisplayed()
+ )
+ )
+ }
+ }
+
+ //TODO add tests for supported app language default locales: arabic, portuguese, nigeria
+ // Add test for unsupported default locale eg french
+ // Add test for langauge list dropdown contents
+
private fun getResources(): Resources =
ApplicationProvider.getApplicationContext().resources
From a536e153f9bcaccf58aa87c5ccacfbd793292709 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 31 Jan 2024 22:54:23 +0300
Subject: [PATCH 11/13] Add onboarding profile type selection UI and navigation
---
app/src/main/AndroidManifest.xml | 21 ++-
.../app/activity/ActivityComponentImpl.kt | 2 +
.../app/fragment/FragmentComponentImpl.kt | 2 +
.../OnboardingFragmentPresenter.kt | 14 +-
.../OnboardingProfileTypeActivity.kt | 32 +++++
.../OnboardingProfileTypeActivityPresenter.kt | 42 ++++++
.../OnboardingProfileTypeFragment.kt | 29 ++++
.../OnboardingProfileTypeFragmentPresenter.kt | 28 ++++
.../OnboardingProfileTypeViewModel.kt | 4 +
.../app/survey/SurveyActivityPresenter.kt | 1 +
.../onboarding_profile_type_activity.xml | 16 +++
.../onboarding_profile_type_fragment.xml | 133 ++++++++++++++++++
app/src/main/res/values/component_colors.xml | 3 +-
app/src/main/res/values/strings.xml | 4 +
app/src/main/res/values/styles.xml | 8 ++
model/src/main/proto/screens.proto | 3 +
.../assets/kdoc_validity_exemptions.textproto | 1 -
.../util/logging/EventBundleCreator.kt | 1 +
18 files changed, 329 insertions(+), 15 deletions(-)
create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt
create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt
create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt
create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt
create mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt
create mode 100644 app/src/main/res/layout/onboarding_profile_type_activity.xml
create mode 100644 app/src/main/res/layout/onboarding_profile_type_fragment.xml
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c324a1a7119..36ec869f7f1 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -6,7 +6,6 @@
-
-
-
+
+
+
+ android:theme="@style/OppiaThemeWithoutActionBar" />
@@ -306,7 +310,8 @@
-
+
,
- private val resourceHandler: AppLanguageResourceHandler,
- private val translationController: TranslationController
+ private val viewModelProvider: ViewModelProvider
) {
private lateinit var binding: OnboardingAppLanguageSelectionFragmentBinding
@@ -36,8 +32,6 @@ class OnboardingFragmentPresenter @Inject constructor(
// data-bound view models.
binding.let {
it.lifecycleOwner = fragment
-// it.presenter = this
-// it.viewModel = getOnboardingViewModel()
}
binding.onboardingLanguageDropdown.adapter = ArrayAdapter(
@@ -46,6 +40,12 @@ class OnboardingFragmentPresenter @Inject constructor(
R.id.onboarding_language_text_view,
arrayOf("English")
)
+
+ binding.onboardingLanguageLetsGoButton.setOnClickListener {
+ val intent = OnboardingProfileTypeActivity.createOnboardingProfileTypeActivityIntent(activity)
+ fragment.startActivity(intent)
+ }
+
return binding.root
}
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt
new file mode 100644
index 00000000000..efa5a15811d
--- /dev/null
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt
@@ -0,0 +1,32 @@
+package org.oppia.android.app.onboarding.onboardingv2
+
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import javax.inject.Inject
+import org.oppia.android.app.activity.ActivityComponentImpl
+import org.oppia.android.app.activity.InjectableAutoLocalizedAppCompatActivity
+import org.oppia.android.app.model.ScreenName
+import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName
+
+/** The activity for showing the profile type selection screen. */
+class OnboardingProfileTypeActivity : InjectableAutoLocalizedAppCompatActivity() {
+ @Inject
+ lateinit var onboardingProfileTypeActivityPresenter: OnboardingProfileTypeActivityPresenter
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ (activityComponent as ActivityComponentImpl).inject(this)
+
+ onboardingProfileTypeActivityPresenter.handleOnCreate()
+ }
+
+ companion object {
+ /** Returns a new [Intent] open a [OnboardingProfileTypeActivity] with the specified params. */
+ fun createOnboardingProfileTypeActivityIntent(context: Context): Intent {
+ return Intent(context, OnboardingProfileTypeActivity::class.java).apply {
+ decorateWithScreenName(ScreenName.ONBOARDING_PROFILE_TYPE_ACTIVITY)
+ }
+ }
+ }
+}
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt
new file mode 100644
index 00000000000..6fc19c9597f
--- /dev/null
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt
@@ -0,0 +1,42 @@
+package org.oppia.android.app.onboarding.onboardingv2
+
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import javax.inject.Inject
+import org.oppia.android.R
+import org.oppia.android.app.activity.ActivityScope
+import org.oppia.android.databinding.OnboardingProfileTypeActivityBinding
+
+private const val TAG_PROFILE_TYPE_FRAGMENT = "TAG_PROFILE_TYPE_FRAGMENT"
+
+/** The Presenter for [OnboardingProfileTypeActivity]. */
+@ActivityScope
+class OnboardingProfileTypeActivityPresenter @Inject constructor(
+ private val activity: AppCompatActivity
+) {
+ private lateinit var binding: OnboardingProfileTypeActivityBinding
+
+ /** Handle creation and binding of the OnboardingProfileTypeActivity layout. */
+ fun handleOnCreate() {
+ binding = DataBindingUtil.setContentView(activity, R.layout.onboarding_profile_type_activity)
+ binding.apply {
+ lifecycleOwner = activity
+ }
+
+ if (getOnboardingProfileTypeFragment() == null) {
+ val onboardingProfileTypeFragment = OnboardingProfileTypeFragment()
+ activity.supportFragmentManager.beginTransaction().add(
+ R.id.profile_type_fragment_placeholder,
+ onboardingProfileTypeFragment,
+ TAG_PROFILE_TYPE_FRAGMENT
+ )
+ .commitNow()
+ }
+ }
+
+ private fun getOnboardingProfileTypeFragment(): OnboardingProfileTypeFragment? {
+ return activity.supportFragmentManager.findFragmentByTag(
+ TAG_PROFILE_TYPE_FRAGMENT
+ ) as? OnboardingProfileTypeFragment
+ }
+}
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt
new file mode 100644
index 00000000000..47dbae7bab2
--- /dev/null
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt
@@ -0,0 +1,29 @@
+package org.oppia.android.app.onboarding.onboardingv2
+
+import android.content.Context
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import javax.inject.Inject
+import org.oppia.android.app.fragment.FragmentComponentImpl
+import org.oppia.android.app.fragment.InjectableFragment
+
+/** Fragment that contains an onboarding flow of the app. */
+class OnboardingProfileTypeFragment : InjectableFragment() {
+ @Inject
+ lateinit var onboardingProfileTypeFragmentPresenter: OnboardingProfileTypeFragmentPresenter
+
+ override fun onAttach(context: Context) {
+ super.onAttach(context)
+ (fragmentComponent as FragmentComponentImpl).inject(this)
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ return onboardingProfileTypeFragmentPresenter.handleCreateView(inflater, container)
+ }
+}
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt
new file mode 100644
index 00000000000..8efdd0edd0a
--- /dev/null
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt
@@ -0,0 +1,28 @@
+package org.oppia.android.app.onboarding.onboardingv2
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import javax.inject.Inject
+import org.oppia.android.databinding.OnboardingProfileTypeFragmentBinding
+
+/** The presenter for [OnboardingProfileTypeFragment]. */
+class OnboardingProfileTypeFragmentPresenter @Inject constructor(
+ private val fragment: Fragment
+) {
+ private lateinit var binding: OnboardingProfileTypeFragmentBinding
+
+ /** Handle creation and binding of the OnboardingProfileTypeFragment layout. */
+ fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View {
+ binding = OnboardingProfileTypeFragmentBinding.inflate(
+ inflater,
+ container,
+ /* attachToRoot= */ false
+ )
+ binding.let {
+ it.lifecycleOwner = fragment
+ }
+ return binding.root
+ }
+}
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt
new file mode 100644
index 00000000000..c26f369897b
--- /dev/null
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt
@@ -0,0 +1,4 @@
+package org.oppia.android.app.onboarding.onboardingv2
+
+class OnboardingProfileTypeViewModel {
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/oppia/android/app/survey/SurveyActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/survey/SurveyActivityPresenter.kt
index 8020dfe8796..5e670f1ca6a 100644
--- a/app/src/main/java/org/oppia/android/app/survey/SurveyActivityPresenter.kt
+++ b/app/src/main/java/org/oppia/android/app/survey/SurveyActivityPresenter.kt
@@ -20,6 +20,7 @@ const val EXPLORATION_ID_ARGUMENT_KEY = "exploration_id"
class SurveyActivityPresenter @Inject constructor(private val activity: AppCompatActivity) {
private lateinit var binding: SurveyActivityBinding
+ /** Handle creation and binding of the SurveyActivity layout. */
fun handleOnCreate(
profileId: ProfileId,
topicId: String,
diff --git a/app/src/main/res/layout/onboarding_profile_type_activity.xml b/app/src/main/res/layout/onboarding_profile_type_activity.xml
new file mode 100644
index 00000000000..4e15bdfec9c
--- /dev/null
+++ b/app/src/main/res/layout/onboarding_profile_type_activity.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/onboarding_profile_type_fragment.xml b/app/src/main/res/layout/onboarding_profile_type_fragment.xml
new file mode 100644
index 00000000000..2e9192c5759
--- /dev/null
+++ b/app/src/main/res/layout/onboarding_profile_type_fragment.xml
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/component_colors.xml b/app/src/main/res/values/component_colors.xml
index f39a4964eaf..254d3c78eca 100644
--- a/app/src/main/res/values/component_colors.xml
+++ b/app/src/main/res/values/component_colors.xml
@@ -309,5 +309,6 @@
@color/color_palette_onboarding_primary_color
@color/color_palette_button_shadow_color
@color/color_palette_onboarding_primary_text_color
-
+
+ @color/color_palette_primary_text_color
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8067e66455b..3c71b3390f5 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -642,4 +642,8 @@
- English
+
+
+ Profile Type
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 35852d2374b..72573a4db3a 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -692,4 +692,12 @@
- @dimen/onboarding_language_message_text_size
- sans-serif
+
+
diff --git a/model/src/main/proto/screens.proto b/model/src/main/proto/screens.proto
index e0ee3599d6d..90a4c187136 100644
--- a/model/src/main/proto/screens.proto
+++ b/model/src/main/proto/screens.proto
@@ -158,6 +158,9 @@ enum ScreenName {
// Screen name value for the scenario when the survey activity is visible to the user.
SURVEY_ACTIVITY = 49;
+
+ // Screen name value for the scenario when the profile type activity is visible to the user.
+ ONBOARDING_PROFILE_TYPE_ACTIVITY = 50;
}
// Defines the current visible UI screen of the application.
diff --git a/scripts/assets/kdoc_validity_exemptions.textproto b/scripts/assets/kdoc_validity_exemptions.textproto
index 94f9f14c159..3cbe87a0622 100644
--- a/scripts/assets/kdoc_validity_exemptions.textproto
+++ b/scripts/assets/kdoc_validity_exemptions.textproto
@@ -191,7 +191,6 @@ exempted_file_path: "app/src/main/java/org/oppia/android/app/story/StoryViewMode
exempted_file_path: "app/src/main/java/org/oppia/android/app/story/storyitemviewmodel/StoryChapterSummaryViewModel.kt"
exempted_file_path: "app/src/main/java/org/oppia/android/app/survey/ExitSurveyConfirmationDialogFragment.kt"
exempted_file_path: "app/src/main/java/org/oppia/android/app/survey/ExitSurveyConfirmationDialogFragmentPresenter.kt"
-exempted_file_path: "app/src/main/java/org/oppia/android/app/survey/SurveyActivityPresenter.kt"
exempted_file_path: "app/src/main/java/org/oppia/android/app/survey/SurveyOutroDialogFragmentPresenter.kt"
exempted_file_path: "app/src/main/java/org/oppia/android/app/survey/SurveyViewModel.kt"
exempted_file_path: "app/src/main/java/org/oppia/android/app/survey/SurveyWelcomeDialogFragment.kt"
diff --git a/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt b/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
index 100f1c86c4c..5f19bc99fcc 100644
--- a/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
+++ b/utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
@@ -728,6 +728,7 @@ class EventBundleCreator @Inject constructor(
ScreenName.UNRECOGNIZED -> "unrecognized"
ScreenName.FOREGROUND_SCREEN -> "foreground_screen"
ScreenName.SURVEY_ACTIVITY -> "survey_activity"
+ ScreenName.ONBOARDING_PROFILE_TYPE_ACTIVITY -> "onboarding_profile_type_activity"
}
private fun AppLanguageSelection.toAnalyticsText(): String {
From 91fb562e35c24f428e73171a76361f13582de621 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 31 Jan 2024 22:58:08 +0300
Subject: [PATCH 12/13] Add onboarding profile type selection UI and navigation
---
.../oppia/android/app/customview/OppiaCurveBackgroundView.kt | 2 +-
.../org/oppia/android/app/onboarding/OnboardingFragment.kt | 2 +-
.../onboarding/onboardingv2/OnboardingFragmentPresenter.kt | 2 +-
.../onboarding/onboardingv2/OnboardingProfileTypeActivity.kt | 2 +-
.../onboardingv2/OnboardingProfileTypeActivityPresenter.kt | 2 +-
.../onboarding/onboardingv2/OnboardingProfileTypeFragment.kt | 2 +-
.../onboardingv2/OnboardingProfileTypeFragmentPresenter.kt | 2 +-
.../onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt | 4 ----
.../oppia/android/app/onboarding/OnboardingFragmentTest.kt | 4 +---
9 files changed, 8 insertions(+), 14 deletions(-)
delete mode 100644 app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt
diff --git a/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt b/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
index 66b04851b29..49be57e52eb 100644
--- a/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
+++ b/app/src/main/java/org/oppia/android/app/customview/OppiaCurveBackgroundView.kt
@@ -11,11 +11,11 @@ import android.view.View
import androidx.core.view.ViewCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
-import javax.inject.Inject
import org.oppia.android.R
import org.oppia.android.app.translation.AppLanguageResourceHandler
import org.oppia.android.app.view.ViewComponentFactory
import org.oppia.android.app.view.ViewComponentImpl
+import javax.inject.Inject
/**
* CustomView to add a background to views that require a bezier curve background.
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
index 52ff1826395..829717c988b 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/OnboardingFragment.kt
@@ -7,9 +7,9 @@ import android.view.View
import android.view.ViewGroup
import org.oppia.android.app.fragment.FragmentComponentImpl
import org.oppia.android.app.fragment.InjectableFragment
-import javax.inject.Inject
import org.oppia.android.util.platformparameter.EnableOnboardingFlowV2
import org.oppia.android.util.platformparameter.PlatformParameterValue
+import javax.inject.Inject
import org.oppia.android.app.onboarding.onboardingv2.OnboardingFragmentPresenter as OnboardingFragmentPresenterV2
/** Fragment that contains an onboarding flow of the app. */
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt
index a6af5b4c858..5bec327b02f 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingFragmentPresenter.kt
@@ -6,12 +6,12 @@ import android.view.ViewGroup
import android.widget.ArrayAdapter
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
-import javax.inject.Inject
import org.oppia.android.R
import org.oppia.android.app.fragment.FragmentScope
import org.oppia.android.app.onboarding.OnboardingViewModel
import org.oppia.android.app.viewmodel.ViewModelProvider
import org.oppia.android.databinding.OnboardingAppLanguageSelectionFragmentBinding
+import javax.inject.Inject
/** The presenter for [OnboardingFragment] V2. */
@FragmentScope
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt
index efa5a15811d..bea2bc36c83 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivity.kt
@@ -3,11 +3,11 @@ package org.oppia.android.app.onboarding.onboardingv2
import android.content.Context
import android.content.Intent
import android.os.Bundle
-import javax.inject.Inject
import org.oppia.android.app.activity.ActivityComponentImpl
import org.oppia.android.app.activity.InjectableAutoLocalizedAppCompatActivity
import org.oppia.android.app.model.ScreenName
import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName
+import javax.inject.Inject
/** The activity for showing the profile type selection screen. */
class OnboardingProfileTypeActivity : InjectableAutoLocalizedAppCompatActivity() {
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt
index 6fc19c9597f..f678ed058c3 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeActivityPresenter.kt
@@ -2,10 +2,10 @@ package org.oppia.android.app.onboarding.onboardingv2
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
-import javax.inject.Inject
import org.oppia.android.R
import org.oppia.android.app.activity.ActivityScope
import org.oppia.android.databinding.OnboardingProfileTypeActivityBinding
+import javax.inject.Inject
private const val TAG_PROFILE_TYPE_FRAGMENT = "TAG_PROFILE_TYPE_FRAGMENT"
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt
index 47dbae7bab2..662d95c4b2c 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragment.kt
@@ -5,9 +5,9 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import javax.inject.Inject
import org.oppia.android.app.fragment.FragmentComponentImpl
import org.oppia.android.app.fragment.InjectableFragment
+import javax.inject.Inject
/** Fragment that contains an onboarding flow of the app. */
class OnboardingProfileTypeFragment : InjectableFragment() {
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt
index 8efdd0edd0a..cd23af399f3 100644
--- a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt
+++ b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeFragmentPresenter.kt
@@ -4,8 +4,8 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
-import javax.inject.Inject
import org.oppia.android.databinding.OnboardingProfileTypeFragmentBinding
+import javax.inject.Inject
/** The presenter for [OnboardingProfileTypeFragment]. */
class OnboardingProfileTypeFragmentPresenter @Inject constructor(
diff --git a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt b/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt
deleted file mode 100644
index c26f369897b..00000000000
--- a/app/src/main/java/org/oppia/android/app/onboarding/onboardingv2/OnboardingProfileTypeViewModel.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.oppia.android.app.onboarding.onboardingv2
-
-class OnboardingProfileTypeViewModel {
-}
\ No newline at end of file
diff --git a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt
index c735b927495..2d3ecf8c7be 100644
--- a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt
+++ b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt
@@ -98,7 +98,6 @@ import org.oppia.android.testing.time.FakeOppiaClockModule
import org.oppia.android.util.accessibility.AccessibilityTestModule
import org.oppia.android.util.caching.AssetModule
import org.oppia.android.util.caching.testing.CachingTestModule
-import org.oppia.android.util.gcsresource.DefaultResourceBucketName
import org.oppia.android.util.gcsresource.GcsResourceModule
import org.oppia.android.util.locale.LocaleProdModule
import org.oppia.android.util.logging.EventLoggingConfigurationModule
@@ -107,7 +106,6 @@ import org.oppia.android.util.logging.SyncStatusModule
import org.oppia.android.util.logging.firebase.FirebaseLogUploaderModule
import org.oppia.android.util.networking.NetworkConnectionDebugUtilModule
import org.oppia.android.util.networking.NetworkConnectionUtilDebugModule
-import org.oppia.android.util.parser.html.HtmlParser
import org.oppia.android.util.parser.html.HtmlParserEntityTypeModule
import org.oppia.android.util.parser.image.GlideImageLoaderModule
import org.oppia.android.util.parser.image.ImageParsingModule
@@ -690,7 +688,7 @@ class OnboardingFragmentTest {
}
}
- //TODO add tests for supported app language default locales: arabic, portuguese, nigeria
+ // TODO add tests for supported app language default locales: arabic, portuguese, nigeria
// Add test for unsupported default locale eg french
// Add test for langauge list dropdown contents
From 0696b6a5ff34f37364b830f13ac998b0b96db4a4 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Wed, 31 Jan 2024 23:21:25 +0300
Subject: [PATCH 13/13] Move feature flags to FeatureFlagConstants.kt
---
.../PlatformParameterAlphaKenyaModule.kt | 12 ++++++++----
.../PlatformParameterAlphaModule.kt | 12 ++++++++----
.../platformparameter/PlatformParameterModule.kt | 12 ++++++++----
.../platformparameter/TestPlatformParameterModule.kt | 2 +-
.../util/platformparameter/FeatureFlagConstants.kt | 10 ++++++++++
.../platformparameter/PlatformParameterConstants.kt | 10 ----------
6 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt
index 68910e6ee08..9213fcc5a7f 100644
--- a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt
+++ b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt
@@ -17,6 +17,7 @@ import org.oppia.android.util.platformparameter.ENABLE_EXTRA_TOPIC_TABS_UI_DEFAU
import org.oppia.android.util.platformparameter.ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.ENABLE_NPS_SURVEY
import org.oppia.android.util.platformparameter.ENABLE_NPS_SURVEY_DEFAULT_VALUE
+import org.oppia.android.util.platformparameter.ENABLE_ONBOARDING_FLOW_V2
import org.oppia.android.util.platformparameter.ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION
import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE
@@ -326,9 +327,12 @@ class PlatformParameterAlphaKenyaModule {
@Provides
@EnableOnboardingFlowV2
- fun provideEnableNewOnboardingUi(): PlatformParameterValue {
- return PlatformParameterValue.createDefaultParameter(
- ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
- )
+ fun provideEnableOnboardingFlowV2(
+ platformParameterSingleton: PlatformParameterSingleton
+ ): PlatformParameterValue {
+ return platformParameterSingleton.getBooleanPlatformParameter(ENABLE_ONBOARDING_FLOW_V2)
+ ?: PlatformParameterValue.createDefaultParameter(
+ ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
+ )
}
}
diff --git a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaModule.kt b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaModule.kt
index fe41b3d2f98..e453cf5d94e 100644
--- a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaModule.kt
+++ b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaModule.kt
@@ -17,6 +17,7 @@ import org.oppia.android.util.platformparameter.ENABLE_EXTRA_TOPIC_TABS_UI_DEFAU
import org.oppia.android.util.platformparameter.ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.ENABLE_NPS_SURVEY
import org.oppia.android.util.platformparameter.ENABLE_NPS_SURVEY_DEFAULT_VALUE
+import org.oppia.android.util.platformparameter.ENABLE_ONBOARDING_FLOW_V2
import org.oppia.android.util.platformparameter.ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION
import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE
@@ -321,9 +322,12 @@ class PlatformParameterAlphaModule {
@Provides
@EnableOnboardingFlowV2
- fun provideEnableNewOnboardingUi(): PlatformParameterValue {
- return PlatformParameterValue.createDefaultParameter(
- ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
- )
+ fun provideEnableOnboardingFlowV2(
+ platformParameterSingleton: PlatformParameterSingleton
+ ): PlatformParameterValue {
+ return platformParameterSingleton.getBooleanPlatformParameter(ENABLE_ONBOARDING_FLOW_V2)
+ ?: PlatformParameterValue.createDefaultParameter(
+ ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
+ )
}
}
diff --git a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt
index ff967a1a869..6bf45843564 100644
--- a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt
+++ b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt
@@ -17,6 +17,7 @@ import org.oppia.android.util.platformparameter.ENABLE_EXTRA_TOPIC_TABS_UI_DEFAU
import org.oppia.android.util.platformparameter.ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.ENABLE_NPS_SURVEY
import org.oppia.android.util.platformparameter.ENABLE_NPS_SURVEY_DEFAULT_VALUE
+import org.oppia.android.util.platformparameter.ENABLE_ONBOARDING_FLOW_V2
import org.oppia.android.util.platformparameter.ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION
import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE
@@ -323,9 +324,12 @@ class PlatformParameterModule {
@Provides
@EnableOnboardingFlowV2
- fun provideEnableNewOnboardingUi(): PlatformParameterValue {
- return PlatformParameterValue.createDefaultParameter(
- ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
- )
+ fun provideEnableOnboardingFlowV2(
+ platformParameterSingleton: PlatformParameterSingleton
+ ): PlatformParameterValue {
+ return platformParameterSingleton.getBooleanPlatformParameter(ENABLE_ONBOARDING_FLOW_V2)
+ ?: PlatformParameterValue.createDefaultParameter(
+ ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE
+ )
}
}
diff --git a/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt b/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt
index 237b15d82d5..604eaf727e4 100644
--- a/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt
+++ b/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt
@@ -275,7 +275,7 @@ class TestPlatformParameterModule {
@Provides
@EnableOnboardingFlowV2
- fun provideEnableNewOnboardingUi(): PlatformParameterValue {
+ fun provideEnableOnboardingFlowV2(): PlatformParameterValue {
return PlatformParameterValue.createDefaultParameter(enableOnboardingFlowV2)
}
diff --git a/utility/src/main/java/org/oppia/android/util/platformparameter/FeatureFlagConstants.kt b/utility/src/main/java/org/oppia/android/util/platformparameter/FeatureFlagConstants.kt
index e69e34696dd..ba9dafdb620 100644
--- a/utility/src/main/java/org/oppia/android/util/platformparameter/FeatureFlagConstants.kt
+++ b/utility/src/main/java/org/oppia/android/util/platformparameter/FeatureFlagConstants.kt
@@ -166,3 +166,13 @@ const val ENABLE_NPS_SURVEY = "enable_nps_survey"
/** Default value of the feature flag corresponding to [EnableNpsSurvey]. */
const val ENABLE_NPS_SURVEY_DEFAULT_VALUE = false
+
+/** Qualifier for the feature flag that toggles the new onboarding flow. */
+@Qualifier
+annotation class EnableOnboardingFlowV2
+
+/** Name of the feature flag that toggles the new onboarding flow. */
+const val ENABLE_ONBOARDING_FLOW_V2 = "enable_onboarding_flow_v2"
+
+/** Default value of the feature flag corresponding to [EnableOnboardingFlowV2]. */
+const val ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE = false
diff --git a/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt b/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt
index 2d483dd571e..4648120ab79 100644
--- a/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt
+++ b/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt
@@ -224,13 +224,3 @@ const val NPS_SURVEY_MINIMUM_AGGREGATE_LEARNING_TIME_IN_A_TOPIC_IN_MINUTES =
* experience with the app.
*/
const val NPS_SURVEY_MINIMUM_AGGREGATE_LEARNING_TIME_IN_A_TOPIC_IN_MINUTES_DEFAULT_VALUE = 5
-
-/** Qualifier for the platform parameter that toggles the new onboarding flow. */
-@Qualifier
-annotation class EnableOnboardingFlowV2
-
-/** Name of the platform parameter that toggles the new onboarding flow. */
-const val ENABLE_ONBOARDING_FLOW_V2 = "enable_onboarding_flow_v2"
-
-/** Default value of the platform parameter corresponding to [EnableOnboardingFlowV2]. */
-const val ENABLE_ONBOARDING_FLOW_V2_DEFAULT_VALUE = false