Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 bank-sdk/example-app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="gc_camera_title_color">#006ECF</color>
<color name="skonto_section_title_text_color">#006ECF</color>

<color name="gc_color_01">@color/gc_light_01</color>
<color name="gc_color_02">@color/gc_light_02</color>
<color name="gc_color_03">@color/gc_light_03</color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data class SkontoSectionColors(

@Composable
fun colors(
titleTextColor: Color = GiniTheme.colorScheme.text.primary,
titleTextColor: Color = GiniTheme.colorScheme.skontoSection.skontoSectionTitleTextColor,
switchColors: GiniSwitchColors = GiniSwitchColors.colors(),
cardBackgroundColor: Color = GiniTheme.colorScheme.card.container,
enabledHintTextColor: Color = GiniTheme.colorScheme.text.success,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import net.gini.android.capture.ui.theme.colors.GiniColorElementsPrimitives
import net.gini.android.capture.ui.theme.colors.GiniColorPrimitives
import net.gini.android.capture.ui.theme.colors.GiniColorScheme
import net.gini.android.capture.ui.theme.colors.giniDarkColorScheme
Expand All @@ -31,11 +32,13 @@ fun GiniTheme(
val context = LocalContext.current
val giniPrimitives =
remember { GiniColorPrimitives.buildColorPrimitivesBasedOnResources(context) }
val giniElementPrimitives =
remember { GiniColorElementsPrimitives.buildColorPrimitivesBasedOnResources(context) }

val colors = if (darkMode) {
giniDarkColorScheme(giniPrimitives)
giniDarkColorScheme(giniPrimitives, giniElementPrimitives)
} else {
giniLightColorScheme(giniPrimitives)
giniLightColorScheme(giniPrimitives, giniElementPrimitives)
}

val typography = extractGiniTypography()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.gini.android.capture.ui.theme.colors

import android.content.Context
import androidx.compose.ui.graphics.Color
import net.gini.android.capture.R

data class GiniColorElementsPrimitives(
val skontoSectionTitleTextColor: Color = Color(0xFF161616),

) {
companion object {
/**
* Bridge between old way of defining colors by overridden resources and Compose
*
* This function will define color primitives based on resources value at res/colors.xml
*/
internal fun buildColorPrimitivesBasedOnResources(context: Context) = GiniColorElementsPrimitives(
skontoSectionTitleTextColor = Color(context.getColor(R.color.skonto_section_title_text_color)),
)
Comment on lines +12 to +19

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The KDoc for buildColorPrimitivesBasedOnResources() says the values come from res/colors.xml, but these element overrides are defined in res/values/element_colors.xml (and may also be overridden elsewhere). Updating the comment would prevent confusion for anyone trying to override the resources.

Copilot uses AI. Check for mistakes.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ data class GiniColorScheme(
val checkbox: Checkbox = Checkbox(),
val contextMenu: ContextMenu = ContextMenu(),
val logo: Logo = Logo(),
val skontoSection: SkontoSection = SkontoSection()

) {

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GiniColorScheme is a public data class, and adding the new skontoSection constructor parameter changes the generated constructor/copy/componentN signatures. This is a binary-incompatible API change for any already-compiled consumers of the published SDK. To avoid breaking clients, consider a non-constructor property, or provide a compatibility secondary constructor matching the previous signature (or confirm this ships only with a major version bump).

Suggested change
// Binary-compatibility secondary constructor matching the previous signature (without skontoSection)
constructor(
background: Background = Background(),
bottomBar: BottomBar = BottomBar(),
topAppBar: TopAppBar = TopAppBar(),
placeholder: Placeholder = Placeholder(),
text: Text = Text(),
card: Card = Card(),
badge: Badge = Badge(),
button: Button = Button(),
buttonOutlined: ButtonOutlined = ButtonOutlined(),
progressBarButton: ProgressBarButton = ProgressBarButton(),
textField: TextField = TextField(),
toggles: Toggles = Toggles(),
dialogs: Dialogs = Dialogs(),
icons: Icons = Icons(),
datePicker: DatePicker = DatePicker(),
checkbox: Checkbox = Checkbox(),
contextMenu: ContextMenu = ContextMenu(),
logo: Logo = Logo(),
) : this(
background = background,
bottomBar = bottomBar,
topAppBar = topAppBar,
placeholder = placeholder,
text = text,
card = card,
badge = badge,
button = button,
buttonOutlined = buttonOutlined,
progressBarButton = progressBarButton,
textField = textField,
toggles = toggles,
dialogs = dialogs,
icons = icons,
datePicker = datePicker,
checkbox = checkbox,
contextMenu = contextMenu,
logo = logo,
skontoSection = SkontoSection(),
)

Copilot uses AI. Check for mistakes.
@Immutable
Expand Down Expand Up @@ -234,6 +236,10 @@ data class GiniColorScheme(
val contentOutlined: Color = Color.Unspecified,
)
}
@Immutable
data class SkontoSection(
val skontoSectionTitleTextColor: Color = Color.Unspecified,

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property name skontoSectionTitleTextColor inside SkontoSection is redundant/inconsistent with the rest of GiniColorScheme (e.g., Text.primary, Logo.tint). Renaming it to something like titleTextColor would avoid the skontoSection.skontoSectionTitleTextColor repetition and make the API easier to read.

Suggested change
val skontoSectionTitleTextColor: Color = Color.Unspecified,
val titleTextColor: Color = Color.Unspecified,

Copilot uses AI. Check for mistakes.
)

@Immutable
data class Logo(
Expand All @@ -245,7 +251,8 @@ data class GiniColorScheme(
* Created a light color scheme based on primitives.
*/
internal fun giniLightColorScheme(
giniColorPrimitives: GiniColorPrimitives = GiniColorPrimitives()
giniColorPrimitives: GiniColorPrimitives = GiniColorPrimitives(),
giniColorElementsPrimitives: GiniColorElementsPrimitives = GiniColorElementsPrimitives()
) = with(giniColorPrimitives) {
GiniColorScheme(
background = GiniColorScheme.Background(primary = light02),
Expand Down Expand Up @@ -373,6 +380,9 @@ internal fun giniLightColorScheme(
),
logo = GiniColorScheme.Logo(
tint = accent01
),
skontoSection = GiniColorScheme.SkontoSection(
skontoSectionTitleTextColor = giniColorElementsPrimitives.skontoSectionTitleTextColor
)
)
}
Expand All @@ -381,7 +391,8 @@ internal fun giniLightColorScheme(
* Created a dark color scheme based on primitives.
*/
internal fun giniDarkColorScheme(
giniColorPrimitives: GiniColorPrimitives = GiniColorPrimitives()
giniColorPrimitives: GiniColorPrimitives = GiniColorPrimitives(),
giniColorElementsPrimitives: GiniColorElementsPrimitives = GiniColorElementsPrimitives()
) = with(giniColorPrimitives) {
GiniColorScheme(
background = GiniColorScheme.Background(primary = dark01),
Expand Down Expand Up @@ -513,6 +524,9 @@ internal fun giniDarkColorScheme(
),
logo = GiniColorScheme.Logo(
tint = accent01
),
skontoSection = GiniColorScheme.SkontoSection(
skontoSectionTitleTextColor = giniColorElementsPrimitives.skontoSectionTitleTextColor
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion capture-sdk/sdk/src/main/res/layout/gc_fragment_camera.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
android:layout_marginBottom="@dimen/gc_large"
android:paddingTop="@dimen/gc_large"
android:text="@string/gc_camera_info_label_invoice_and_qr"
android:textColor="@color/gc_light_01"
android:textColor="@color/gc_camera_title_color"
app:layout_constraintBottom_toTopOf="@id/gc_button_camera_trigger"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
Expand Down
7 changes: 7 additions & 0 deletions capture-sdk/sdk/src/main/res/values/element_colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="gc_camera_title_color">@color/gc_light_01</color>
<color name="skonto_section_title_text_color">@color/gc_dark_02</color>

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skonto_section_title_text_color defaults to @color/gc_dark_02, but in the dark Compose color scheme the Skonto section title is rendered on a card with containerColor = dark02 (see GiniColorScheme.card.container). This results in very low contrast/unreadable text in dark mode. Consider providing a dark-mode default (e.g., values-night/element_colors.xml mapping it to a light color) or selecting different defaults in giniLightColorScheme vs giniDarkColorScheme while still keeping the override hook.

Suggested change
<color name="skonto_section_title_text_color">@color/gc_dark_02</color>
<color name="skonto_section_title_text_color">@color/gc_light_01</color>

Copilot uses AI. Check for mistakes.

</resources>
Loading