Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Part of #4938: Introduce Onboarding profile type screen #5378

Merged
merged 84 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
5d86f13
Add drawable resources
adhiamboperes Mar 27, 2024
a17713d
Make SurveyOnboardingBackgroundView generic for reuse.
adhiamboperes Mar 27, 2024
7c11bcd
Create app language selection UI
adhiamboperes Mar 27, 2024
722c759
Add tests for the new app language screen
adhiamboperes Mar 27, 2024
0a24f11
Fix UI
adhiamboperes Mar 27, 2024
1462eb7
Fix buildifier issue
adhiamboperes Mar 27, 2024
a337b9b
Merge remote-tracking branch 'upstream/new-onboarding-screen' into on…
adhiamboperes Apr 2, 2024
785716e
Add OnboardingProfileTypeActivity
adhiamboperes Apr 3, 2024
3067ff2
Add drawable resources
adhiamboperes Apr 3, 2024
5a41256
Add profile type selection UI with navigation.
adhiamboperes Apr 3, 2024
40d188f
Add tests
adhiamboperes Apr 3, 2024
434d9dc
Add test file exemptions
adhiamboperes Apr 3, 2024
5bd5239
Fix ktlint issue
adhiamboperes Apr 3, 2024
5fb890e
Addressed general feedback
adhiamboperes Apr 3, 2024
adbdbed
Fix curve background for landscape orientation
adhiamboperes Apr 3, 2024
4f0c57b
Flatten Bg drawable
adhiamboperes Apr 3, 2024
187726c
Merge branch 'develop' of github.com:oppia/oppia-android into new-onb…
adhiamboperes Apr 3, 2024
3d2313c
Merge remote-tracking branch 'upstream/new-onboarding-screen' into on…
adhiamboperes Apr 3, 2024
6ccba79
Fix self review comments
adhiamboperes Apr 9, 2024
0bc5547
Merge branch 'develop' into new-onboarding-screen
adhiamboperes Apr 9, 2024
f31e23d
Create tablet layouts and darkmode bg
adhiamboperes Apr 9, 2024
3e6c7b3
Merge branch 'new-onboarding-screen' of github.com:oppia/oppia-androi…
adhiamboperes Apr 9, 2024
f1d9092
Fix formatting
adhiamboperes Apr 9, 2024
3e2166e
Fix failing test
adhiamboperes Apr 9, 2024
3b4e235
Fix paint style for OppiaCurveBackgroundView.kt
adhiamboperes Apr 17, 2024
b7935e1
Merge branch 'develop' of github.com:oppia/oppia-android into new-onb…
adhiamboperes Apr 17, 2024
b722e49
Merge branch 'new-onboarding-screen' of github.com:oppia/oppia-androi…
adhiamboperes Apr 17, 2024
8f7e355
Adjust height of the otter drawable
adhiamboperes Apr 17, 2024
b411179
Improve styling for phone layouts
adhiamboperes May 22, 2024
bad32c5
Improve styling for tablet layouts
adhiamboperes May 22, 2024
7345107
Clean up padding and text size dimensions
adhiamboperes May 22, 2024
30b26e0
Clean up padding and text size dimensions
adhiamboperes May 22, 2024
2c10cd2
Remove space
adhiamboperes May 22, 2024
3d7cf86
Fix failing test
adhiamboperes May 22, 2024
e67a2f0
Merge branch 'new-onboarding-screen' into onboarding-profile-type-screen
adhiamboperes May 23, 2024
4f53fb5
Update styling
adhiamboperes May 23, 2024
70fac4a
Remove unnecessary tests
adhiamboperes May 23, 2024
8d5c408
Fix indentation
adhiamboperes May 23, 2024
73874b8
Fix general review comments
adhiamboperes May 23, 2024
9547f8d
Create style for back navigation button
adhiamboperes May 23, 2024
cd54544
Fix mobile landscape layout
adhiamboperes May 23, 2024
16c9a97
Fix tests and add tests for mobile landscape layout
adhiamboperes May 23, 2024
0ea7456
Fix ktlint
adhiamboperes May 23, 2024
076c7f0
Fix ktlint
adhiamboperes May 23, 2024
114ae78
Revert formatting changes in the styles file
adhiamboperes May 23, 2024
fde105c
Merge branch 'develop' of github.com:oppia/oppia-android into new-onb…
adhiamboperes May 23, 2024
01c45af
Merge branch 'new-onboarding-screen' into onboarding-profile-type-screen
adhiamboperes May 23, 2024
0bdd447
Fix margin and update with develop
adhiamboperes May 24, 2024
bbe7221
Refactor existing OnboardingFragmentPresenter to OnboardingFragmentPr…
adhiamboperes May 28, 2024
05f598d
Refactor the dropdown
adhiamboperes May 31, 2024
6565d73
Refactor the dropdown in alternate layouts
adhiamboperes May 31, 2024
d67f5ed
Refactor custom background to a binding adapter
adhiamboperes Jun 2, 2024
7c69c15
Fix failing tests and set up bazel test
adhiamboperes Jun 2, 2024
0a7c600
Merge remote-tracking branch 'upstream/develop' into new-onboarding-s…
adhiamboperes Jun 2, 2024
1c0494f
Fix ktlint
adhiamboperes Jun 2, 2024
a8c207a
Replace otter png with SVG
adhiamboperes Jun 3, 2024
1172ff6
Fix failing tests and general cleanup
adhiamboperes Jun 3, 2024
4612e6b
Fix test file exemption
adhiamboperes Jun 3, 2024
d3451ab
Fix accessibility label exemption
adhiamboperes Jun 3, 2024
6095c54
Fix drawable vector hex exemption
adhiamboperes Jun 3, 2024
2540989
Fix unused exemption
adhiamboperes Jun 3, 2024
65d9f11
Fix failing test
adhiamboperes Jun 3, 2024
3bf91c3
Move files to onboarding package
adhiamboperes Jun 3, 2024
18ba375
Merge remote-tracking branch 'upstream/new-onboarding-screen' into on…
adhiamboperes Jun 3, 2024
05d05f1
Resolve merge conflicts
adhiamboperes Jun 3, 2024
1067e57
Added oxford comma
adhiamboperes Jun 3, 2024
e79b69b
Removed leftover exemption
adhiamboperes Jun 3, 2024
c694f51
Fix tests
adhiamboperes Jun 3, 2024
12fbcad
Fix static check errors
adhiamboperes Jun 4, 2024
f14bbb1
Merge remote-tracking branch 'upstream/develop' into new-onboarding-s…
adhiamboperes Jun 11, 2024
ea056af
Merge branch 'new-onboarding-screen' into onboarding-profile-type-screen
adhiamboperes Jun 11, 2024
3fdf74f
Fix merge conflict
adhiamboperes Jun 11, 2024
c2c244b
Merge branch 'new-onboarding-screen' into onboarding-profile-type-screen
adhiamboperes Jun 11, 2024
72624f5
Merge branch 'develop' into new-onboarding-screen
adhiamboperes Jun 17, 2024
13d9ac5
Merge branch 'new-onboarding-screen' into onboarding-profile-type-screen
adhiamboperes Jun 17, 2024
485dc54
Replace Lifecycle.State check with activity.isFinishing
adhiamboperes Jun 18, 2024
33624d7
Flatten layout
adhiamboperes Jun 19, 2024
2b10f80
Resolve merge conflicts
adhiamboperes Jun 19, 2024
1bb7508
Merge branch 'develop' into onboarding-profile-type-screen
adhiamboperes Jun 24, 2024
6e0401f
Update test_file_exemptions to the new format
adhiamboperes Jun 24, 2024
2f84098
Fix indent
adhiamboperes Jun 24, 2024
04acfa9
Merge branch 'develop' into onboarding-profile-type-screen
adhiamboperes Jun 30, 2024
223150b
Replace png images with svgs
adhiamboperes Jun 30, 2024
90428af
Add exemptions for new svgs
adhiamboperes Jun 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@
android:name=".app.classroom.ClassroomListActivity"
android:label="@string/classroom_list_activity_title"
android:theme="@style/OppiaThemeWithoutActionBar" />
<activity
android:name=".app.onboarding.OnboardingProfileTypeActivity"
android:label="@string/onboarding_profile_type_activity_title"
android:theme="@style/OppiaThemeWithoutActionBar" />

<provider
android:name="androidx.work.impl.WorkManagerInitializer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.oppia.android.app.home.HomeActivity
import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity
import org.oppia.android.app.mydownloads.MyDownloadsActivity
import org.oppia.android.app.onboarding.OnboardingActivity
import org.oppia.android.app.onboarding.OnboardingProfileTypeActivity
import org.oppia.android.app.ongoingtopiclist.OngoingTopicListActivity
import org.oppia.android.app.options.AppLanguageActivity
import org.oppia.android.app.options.AudioLanguageActivity
Expand Down Expand Up @@ -220,4 +221,5 @@ interface ActivityComponentImpl :
fun inject(surveyActivity: SurveyActivity)
fun inject(colorBindingAdaptersTestActivity: ColorBindingAdaptersTestActivity)
fun inject(classroomListActivity: ClassroomListActivity)
fun inject(onboardingProfileTypeActivity: OnboardingProfileTypeActivity)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import org.oppia.android.app.notice.GeneralAvailabilityUpgradeNoticeDialogFragme
import org.oppia.android.app.notice.OptionalAppDeprecationNoticeDialogFragment
import org.oppia.android.app.notice.OsDeprecationNoticeDialogFragment
import org.oppia.android.app.onboarding.OnboardingFragment
import org.oppia.android.app.onboarding.OnboardingProfileTypeFragment
import org.oppia.android.app.ongoingtopiclist.OngoingTopicListFragment
import org.oppia.android.app.options.AppLanguageFragment
import org.oppia.android.app.options.AudioLanguageFragment
Expand Down Expand Up @@ -196,4 +197,5 @@ interface FragmentComponentImpl : FragmentComponent, ViewComponentBuilderInjecto
fun inject(surveyWelcomeDialogFragment: SurveyWelcomeDialogFragment)
fun inject(surveyOutroDialogFragment: SurveyOutroDialogFragment)
fun inject(classroomListFragment: ClassroomListFragment)
fun inject(onboardingProfileTypeFragment: OnboardingProfileTypeFragment)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.oppia.android.app.onboarding
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import org.oppia.android.R
import org.oppia.android.app.fragment.FragmentScope
Expand All @@ -13,6 +14,7 @@ import javax.inject.Inject
/** The presenter for [OnboardingFragment]. */
@FragmentScope
class OnboardingFragmentPresenter @Inject constructor(
private val activity: AppCompatActivity,
private val fragment: Fragment,
private val appLanguageResourceHandler: AppLanguageResourceHandler
) {
Expand All @@ -33,6 +35,12 @@ class OnboardingFragmentPresenter @Inject constructor(
R.string.onboarding_language_activity_title,
appLanguageResourceHandler.getStringInLocale(R.string.app_name)
)

onboardingLanguageLetsGoButton.setOnClickListener {
val intent =
OnboardingProfileTypeActivity.createOnboardingProfileTypeActivityIntent(activity)
fragment.startActivity(intent)
}
}

return binding.root
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.oppia.android.app.onboarding

import android.content.Context
import android.content.Intent
import android.os.Bundle
import org.oppia.android.app.activity.ActivityComponentImpl
import org.oppia.android.app.activity.InjectableAutoLocalizedAppCompatActivity
import org.oppia.android.app.model.ScreenName.ONBOARDING_PROFILE_TYPE_ACTIVITY
import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName
import javax.inject.Inject

/** 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(ONBOARDING_PROFILE_TYPE_ACTIVITY)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.oppia.android.app.onboarding

import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
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"

/** 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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.oppia.android.app.onboarding

import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
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

/** Fragment that contains the profile type selection 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)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.oppia.android.app.onboarding

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import org.oppia.android.app.profile.ProfileChooserActivity
import org.oppia.android.databinding.OnboardingProfileTypeFragmentBinding
import javax.inject.Inject

/** The presenter for [OnboardingProfileTypeFragment]. */
class OnboardingProfileTypeFragmentPresenter @Inject constructor(
private val fragment: Fragment,
private val activity: AppCompatActivity
) {
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.apply {
lifecycleOwner = fragment

profileTypeSupervisorNavigationCard.setOnClickListener {
val intent = ProfileChooserActivity.createProfileChooserActivity(activity)
fragment.startActivity(intent)
}

onboardingNavigationBack.setOnClickListener {
activity.finish()
}
}
return binding.root
}
}
Loading
Loading