Skip to content

Commit

Permalink
enable page collection page feature for the tool content parser
Browse files Browse the repository at this point in the history
  • Loading branch information
frett committed Jan 23, 2025
1 parent 608c05a commit 8605493
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
implementation(libs.androidx.appcompat)
implementation(libs.androidx.datastore.preferences)

implementation(libs.firebase.config)
api(libs.firebase.config)

implementation(libs.gtoSupport.androidx.core)
implementation(libs.gtoSupport.androidx.lifecycle)
Expand Down
4 changes: 3 additions & 1 deletion library/base/src/main/kotlin/org/cru/godtools/base/Config.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.cru.godtools.base

const val CONFIG_TOOL_CONTENT_FEATURE_PAGE_COLLECTION = "tool_content_feature_page_collection_page_enabled"
const val CONFIG_UI_DASHBOARD_HOME_FAVORITE_TOOLS = "ui_dashboard_home_favorite_tool_cards_count"
const val CONFIG_UI_GLOBAL_ACTIVITY_ENABLED = "ui_account_globalactivity_enabled"

internal val CONFIG_DEFAULTS = mapOf(
CONFIG_TOOL_CONTENT_FEATURE_PAGE_COLLECTION to true,
CONFIG_UI_DASHBOARD_HOME_FAVORITE_TOOLS to 5,
CONFIG_UI_GLOBAL_ACTIVITY_ENABLED to true
CONFIG_UI_GLOBAL_ACTIVITY_ENABLED to true,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cru.godtools.base.tool

import android.content.Context
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import dagger.Binds
import dagger.Module
import dagger.Provides
Expand All @@ -12,6 +13,7 @@ import dagger.multibindings.IntoSet
import javax.inject.Named
import org.ccci.gto.android.common.androidx.lifecycle.net.isConnectedLiveData
import org.ccci.gto.android.common.dagger.eager.EagerSingleton
import org.cru.godtools.base.CONFIG_TOOL_CONTENT_FEATURE_PAGE_COLLECTION
import org.cru.godtools.base.ToolFileSystem
import org.cru.godtools.base.tool.service.ContentEventAnalyticsHandler
import org.cru.godtools.shared.tool.parser.ManifestParser
Expand All @@ -20,6 +22,7 @@ import org.cru.godtools.shared.tool.parser.ParserConfig.Companion.FEATURE_ANIMAT
import org.cru.godtools.shared.tool.parser.ParserConfig.Companion.FEATURE_CONTENT_CARD
import org.cru.godtools.shared.tool.parser.ParserConfig.Companion.FEATURE_FLOW
import org.cru.godtools.shared.tool.parser.ParserConfig.Companion.FEATURE_MULTISELECT
import org.cru.godtools.shared.tool.parser.ParserConfig.Companion.FEATURE_PAGE_COLLECTION
import org.cru.godtools.shared.tool.parser.model.DeviceType
import org.cru.godtools.shared.tool.parser.xml.AndroidXmlPullParserFactory
import org.greenrobot.eventbus.meta.SubscriberInfoIndex
Expand All @@ -42,9 +45,19 @@ abstract class BaseToolRendererModule {

@Provides
@Reusable
fun parserConfig(@ApplicationContext context: Context) = ParserConfig()
fun parserConfig(@ApplicationContext context: Context, remoteConfig: FirebaseRemoteConfig) = ParserConfig()
.withAppVersion(DeviceType.ANDROID, context.versionName?.substringBefore("-"))
.withSupportedFeatures(setOf(FEATURE_ANIMATION, FEATURE_CONTENT_CARD, FEATURE_FLOW, FEATURE_MULTISELECT))
.withSupportedFeatures(
buildSet {
add(FEATURE_ANIMATION)
add(FEATURE_CONTENT_CARD)
add(FEATURE_FLOW)
add(FEATURE_MULTISELECT)
if (remoteConfig.getBoolean(CONFIG_TOOL_CONTENT_FEATURE_PAGE_COLLECTION)) {
add(FEATURE_PAGE_COLLECTION)
}
}
)

@Provides
@Reusable
Expand Down

0 comments on commit 8605493

Please sign in to comment.