diff --git a/app/src/main/java/org/openedx/app/MainFragment.kt b/app/src/main/java/org/openedx/app/MainFragment.kt index a798c4a3f..fdb6b991c 100644 --- a/app/src/main/java/org/openedx/app/MainFragment.kt +++ b/app/src/main/java/org/openedx/app/MainFragment.kt @@ -17,9 +17,7 @@ import org.openedx.core.config.Config import org.openedx.core.presentation.global.app_upgrade.UpgradeRequiredFragment import org.openedx.core.presentation.global.viewBinding import org.openedx.dashboard.presentation.DashboardFragment -import org.openedx.discovery.presentation.DiscoveryNavigator import org.openedx.discovery.presentation.DiscoveryRouter -import org.openedx.discovery.presentation.program.ProgramFragment import org.openedx.profile.presentation.profile.ProfileFragment class MainFragment : Fragment(R.layout.fragment_main) { @@ -47,24 +45,14 @@ class MainFragment : Fragment(R.layout.fragment_main) { binding.bottomNavView.setOnItemSelectedListener { when (it.itemId) { - R.id.fragmentHome -> { - viewModel.logDiscoveryTabClickedEvent() - binding.viewPager.setCurrentItem(0, false) - } - R.id.fragmentDashboard -> { viewModel.logMyCoursesTabClickedEvent() - binding.viewPager.setCurrentItem(1, false) - } - - R.id.fragmentPrograms -> { - viewModel.logMyProgramsTabClickedEvent() - binding.viewPager.setCurrentItem(2, false) + binding.viewPager.setCurrentItem(0, false) } R.id.fragmentProfile -> { viewModel.logProfileTabClickedEvent() - binding.viewPager.setCurrentItem(3, false) + binding.viewPager.setCurrentItem(1, false) } } true @@ -77,9 +65,9 @@ class MainFragment : Fragment(R.layout.fragment_main) { } viewLifecycleOwner.lifecycleScope.launch { - viewModel.navigateToDiscovery.collect { shouldNavigateToDiscovery -> - if (shouldNavigateToDiscovery) { - binding.bottomNavView.selectedItemId = R.id.fragmentHome + viewModel.navigateToHome.collect { shouldNavigateToHome -> + if (shouldNavigateToHome) { + binding.bottomNavView.selectedItemId = R.id.fragmentDashboard } } } @@ -105,18 +93,8 @@ class MainFragment : Fragment(R.layout.fragment_main) { binding.viewPager.orientation = ViewPager2.ORIENTATION_HORIZONTAL binding.viewPager.offscreenPageLimit = 4 - val discoveryFragment = DiscoveryNavigator(viewModel.isDiscoveryTypeWebView) - .getDiscoveryFragment() - val programFragment = if (viewModel.isProgramTypeWebView) { - ProgramFragment(true) - } else { - InDevelopmentFragment() - } - adapter = MainNavigationFragmentAdapter(this).apply { - addFragment(discoveryFragment) addFragment(DashboardFragment()) - addFragment(programFragment) addFragment(ProfileFragment()) } binding.viewPager.adapter = adapter diff --git a/app/src/main/java/org/openedx/app/MainViewModel.kt b/app/src/main/java/org/openedx/app/MainViewModel.kt index 6a30533ea..2e4d00b38 100644 --- a/app/src/main/java/org/openedx/app/MainViewModel.kt +++ b/app/src/main/java/org/openedx/app/MainViewModel.kt @@ -25,9 +25,9 @@ class MainViewModel( val isBottomBarEnabled: LiveData get() = _isBottomBarEnabled - private val _navigateToDiscovery = MutableSharedFlow() - val navigateToDiscovery: SharedFlow - get() = _navigateToDiscovery.asSharedFlow() + private val _navigateToHome = MutableSharedFlow() + val navigateToHome: SharedFlow + get() = _navigateToHome.asSharedFlow() val isDiscoveryTypeWebView get() = config.getDiscoveryConfig().isViewTypeWebView() @@ -37,7 +37,7 @@ class MainViewModel( super.onCreate(owner) notifier.notifier.onEach { if (it is NavigationToDiscovery) { - _navigateToDiscovery.emit(true) + _navigateToHome.emit(true) } }.distinctUntilChanged().launchIn(viewModelScope) } diff --git a/app/src/main/res/menu/bottom_view_menu.xml b/app/src/main/res/menu/bottom_view_menu.xml index 60ba4f78c..5600c523f 100644 --- a/app/src/main/res/menu/bottom_view_menu.xml +++ b/app/src/main/res/menu/bottom_view_menu.xml @@ -1,24 +1,12 @@ - - - - Do not sell my personal information View FAQ Terms of Use + Contact Support Profile Cancel Search diff --git a/default_config/dev/config.yaml b/default_config/dev/config.yaml index e1582bfcf..a76ad2660 100644 --- a/default_config/dev/config.yaml +++ b/default_config/dev/config.yaml @@ -1,17 +1,18 @@ -API_HOST_URL: 'http://localhost:8000' +API_HOST_URL: 'https://lms.quince-sandbox.eshe.opencraft.hosting' APPLICATION_ID: 'org.openedx.app' -ENVIRONMENT_DISPLAY_NAME: 'Localhost' +ENVIRONMENT_DISPLAY_NAME: 'Eshe dev' URI_SCHEME: '' FEEDBACK_EMAIL_ADDRESS: 'support@example.com' FAQ_URL: '' -OAUTH_CLIENT_ID: 'OAUTH_CLIENT_ID' +OAUTH_CLIENT_ID: 'android-app-client-id' # Keep empty to hide setting AGREEMENT_URLS: PRIVACY_POLICY_URL: '' COOKIE_POLICY_URL: '' DATA_SELL_CONSENT_URL: '' - TOS_URL: '' + CONTACT_SUPPORT_URL: 'https://eshemoeasu.my.site.com/help/s/' + TOS_URL: 'https://courses.ethernet.edu.et/terms' EULA_URL: '' SUPPORTED_LANGUAGES: [ ] #en is default language diff --git a/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt b/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt index bec24967f..2920fde94 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/profile/compose/ProfileView.kt @@ -39,7 +39,6 @@ import androidx.compose.ui.unit.dp import org.openedx.core.R import org.openedx.core.UIMessage import org.openedx.core.ui.HandleUIMessage -import org.openedx.core.ui.OpenEdXOutlinedButton import org.openedx.core.ui.Toolbar import org.openedx.core.ui.WindowSize import org.openedx.core.ui.WindowType @@ -142,17 +141,6 @@ internal fun ProfileView( subtitle = "@${uiState.account.username}" ) ProfileInfoSection(uiState.account) - OpenEdXOutlinedButton( - modifier = Modifier - .fillMaxWidth(), - text = stringResource(id = org.openedx.profile.R.string.profile_edit_profile), - onClick = { - onAction(ProfileViewAction.EditAccountClick) - }, - borderColor = MaterialTheme.appColors.buttonBackground, - textColor = MaterialTheme.appColors.textAccent - ) - Spacer(modifier = Modifier.height(12.dp)) } } } diff --git a/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsFragment.kt b/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsFragment.kt index fbdd0b4af..4e92cdbd9 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsFragment.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsFragment.kt @@ -68,7 +68,9 @@ class SettingsFragment : Fragment() { SettingsScreenAction.FaqClick -> viewModel.faqClicked() SettingsScreenAction.SupportClick -> { - viewModel.emailSupportClicked(requireContext()) + viewModel.emailSupportClicked( + requireActivity().supportFragmentManager + ) } SettingsScreenAction.TermsClick -> { diff --git a/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsScreenUI.kt b/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsScreenUI.kt index f5c0a7bc5..3ec79a0a5 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsScreenUI.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsScreenUI.kt @@ -167,12 +167,6 @@ internal fun SettingsScreen( .verticalScroll(rememberScrollState()), horizontalAlignment = Alignment.CenterHorizontally ) { - Spacer(Modifier.height(30.dp)) - - ManageAccountSection(onManageAccountClick = { - onAction(SettingsScreenAction.ManageAccount) - }) - Spacer(modifier = Modifier.height(24.dp)) SettingsSection(onVideoSettingsClick = { @@ -269,7 +263,7 @@ private fun SupportInfoSection( backgroundColor = MaterialTheme.appColors.cardViewBackground ) { Column(Modifier.fillMaxWidth()) { - if (uiState.configuration.supportEmail.isNotBlank()) { + if (uiState.configuration.agreementUrls.contactSupportUrl.isNotBlank()) { SettingsItem(text = stringResource(id = profileR.string.profile_contact_support)) { onAction(SettingsScreenAction.SupportClick) } diff --git a/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsViewModel.kt b/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsViewModel.kt index 2c7471ebd..557e95a23 100644 --- a/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsViewModel.kt +++ b/profile/src/main/java/org/openedx/profile/presentation/settings/SettingsViewModel.kt @@ -25,7 +25,6 @@ import org.openedx.core.system.AppCookieManager import org.openedx.core.system.ResourceManager import org.openedx.core.system.notifier.AppUpgradeEvent import org.openedx.core.system.notifier.AppUpgradeNotifier -import org.openedx.core.utils.EmailUtil import org.openedx.profile.domain.interactor.ProfileInteractor import org.openedx.profile.domain.model.Configuration import org.openedx.profile.presentation.ProfileAnalytics @@ -168,11 +167,11 @@ class SettingsViewModel( logProfileEvent(ProfileAnalyticsEvent.TERMS_OF_USE_CLICKED) } - fun emailSupportClicked(context: Context) { - EmailUtil.showFeedbackScreen( - context = context, - feedbackEmailAddress = config.getFeedbackEmailAddress(), - appVersion = appData.versionName + fun emailSupportClicked(fragmentManager: FragmentManager) { + router.navigateToWebContent( + fm = fragmentManager, + title = resourceManager.getString(R.string.core_contact_support), + url = configuration.agreementUrls.contactSupportUrl, ) logProfileEvent(ProfileAnalyticsEvent.CONTACT_SUPPORT_CLICKED) }