File tree Expand file tree Collapse file tree 7 files changed +28
-0
lines changed
app/src/main/java/org/openedx/app
core/src/main/java/org/openedx/core/config Expand file tree Collapse file tree 7 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ class MainFragment : Fragment(R.layout.fragment_main) {
4242 override fun onViewCreated (view : View , savedInstanceState : Bundle ? ) {
4343 super .onViewCreated(view, savedInstanceState)
4444
45+ if (! viewModel.isDatesFragmentEnabled) {
46+ binding.bottomNavView.menu.removeItem(R .id.fragmentDates)
47+ }
48+
4549 initViewPager()
4650
4751 binding.bottomNavView.setOnItemSelectedListener {
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ class MainViewModel(
3333 val isDiscoveryTypeWebView get() = config.getDiscoveryConfig().isViewTypeWebView()
3434 val getDiscoveryFragment get() = DiscoveryNavigator (isDiscoveryTypeWebView).getDiscoveryFragment()
3535
36+ val isDatesFragmentEnabled get() = config.getDatesConfig().isEnabled
37+
3638 override fun onCreate (owner : LifecycleOwner ) {
3739 super .onCreate(owner)
3840 notifier.notifier
Original file line number Diff line number Diff line change @@ -92,6 +92,10 @@ class Config(context: Context) {
9292 return getObjectOrNewInstance(DASHBOARD , DashboardConfig ::class .java)
9393 }
9494
95+ fun getDatesConfig (): DatesConfig {
96+ return getObjectOrNewInstance(DATES , DatesConfig ::class .java)
97+ }
98+
9599 fun getBranchConfig (): BranchConfig {
96100 return getObjectOrNewInstance(BRANCH , BranchConfig ::class .java)
97101 }
@@ -179,6 +183,7 @@ class Config(context: Context) {
179183 private const val DISCOVERY = " DISCOVERY"
180184 private const val PROGRAM = " PROGRAM"
181185 private const val DASHBOARD = " DASHBOARD"
186+ private const val DATES = " DATES"
182187 private const val BRANCH = " BRANCH"
183188 private const val UI_COMPONENTS = " UI_COMPONENTS"
184189 private const val PLATFORM_NAME = " PLATFORM_NAME"
Original file line number Diff line number Diff line change 1+ package org.openedx.core.config
2+
3+ import com.google.gson.annotations.SerializedName
4+
5+ data class DatesConfig (
6+ @SerializedName(" ENABLED" )
7+ val isEnabled : Boolean = true ,
8+ )
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ PROGRAM:
3131DASHBOARD :
3232 TYPE : ' gallery'
3333
34+ DATES :
35+ ENABLED : true
36+
3437FIREBASE :
3538 ENABLED : false
3639 CLOUD_MESSAGING_ENABLED : false
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ PROGRAM:
3131DASHBOARD :
3232 TYPE : ' gallery'
3333
34+ DATES :
35+ ENABLED : true
36+
3437FIREBASE :
3538 ENABLED : false
3639 CLOUD_MESSAGING_ENABLED : false
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ PROGRAM:
3131DASHBOARD :
3232 TYPE : ' gallery'
3333
34+ DATES :
35+ ENABLED : true
36+
3437FIREBASE :
3538 ENABLED : false
3639 CLOUD_MESSAGING_ENABLED : false
You can’t perform that action at this time.
0 commit comments