migration 14.10.x to 14.11.x - infobip/mobile-messaging-sdk-android GitHub Wiki

Migration from '14.10.x' to '14.11.x'

Changes for the in-app chat

Version 14.11.0 onwards introduces the following changes to error handling and styling:

Removed:

The following components and attributes have been removed:

Removed Component/Attribute Replacement Migration
Network Connection Error Banner component Snackbar-based error display No action required - automatic
ibChatNetworkConnectionErrorIconVisible attribute Icon always shown if provided Remove attribute from XML
InAppChatStyle.networkConnectionErrorIconVisible Icon always shown if provided Remove property from code

Renamed:

Error styling attributes have been renamed for better clarity. The old ibChatError* attributes are now prefixed with ibChatFullScreenError* to distinguish them from the new snackbar error styling:

Old Attribute/Property New Attribute/Property Migration
ibChatErrorTitleText ibChatFullScreenErrorTitleText Rename in XML theme
ibChatErrorTitleTextColor ibChatFullScreenErrorTitleTextColor Rename in XML theme
ibChatErrorTitleTextAppearance ibChatFullScreenErrorTitleTextAppearance Rename in XML theme
ibChatErrorDescriptionText ibChatFullScreenErrorDescriptionText Rename in XML theme
ibChatErrorDescriptionTextColor ibChatFullScreenErrorDescriptionTextColor Rename in XML theme
ibChatErrorDescriptionTextAppearance ibChatFullScreenErrorDescriptionTextAppearance Rename in XML theme
ibChatErrorBackgroundColor ibChatFullScreenErrorBackgroundColor Rename in XML theme
ibChatErrorIcon ibChatFullScreenErrorIcon Rename in XML theme
ibChatErrorIconTint ibChatFullScreenErrorIconTint Rename in XML theme
ibChatErrorRefreshButtonText ibChatFullScreenErrorRefreshButtonText Rename in XML theme
ibChatErrorRefreshButtonTextColor ibChatFullScreenErrorRefreshButtonTextColor Rename in XML theme
ibChatErrorRefreshButtonVisible ibChatFullScreenErrorRefreshButtonVisible Rename in XML theme
InAppChatStyle.errorTitleText InAppChatStyle.chatFullScreenErrorTitleText Rename property in code
InAppChatStyle.errorTitleTextRes InAppChatStyle.chatFullScreenErrorTitleTextRes Rename property in code
InAppChatStyle.errorTitleTextColor InAppChatStyle.chatFullScreenErrorTitleTextColor Rename property in code
InAppChatStyle.errorTitleTextAppearance InAppChatStyle.chatFullScreenErrorTitleTextAppearance Rename property in code
InAppChatStyle.errorDescriptionText InAppChatStyle.chatFullScreenErrorDescriptionText Rename property in code
InAppChatStyle.errorDescriptionTextRes InAppChatStyle.chatFullScreenErrorDescriptionTextRes Rename property in code
InAppChatStyle.errorDescriptionTextColor InAppChatStyle.chatFullScreenErrorDescriptionTextColor Rename property in code
InAppChatStyle.errorDescriptionTextAppearance InAppChatStyle.chatFullScreenErrorDescriptionTextAppearance Rename property in code
InAppChatStyle.errorBackgroundColor InAppChatStyle.chatFullScreenErrorBackgroundColor Rename property in code
InAppChatStyle.errorIcon InAppChatStyle.chatFullScreenErrorIcon Rename property in code
InAppChatStyle.errorIconTint InAppChatStyle.chatFullScreenErrorIconTint Rename property in code
InAppChatStyle.errorRefreshButtonText InAppChatStyle.chatFullScreenErrorRefreshButtonText Rename property in code
InAppChatStyle.errorRefreshButtonTextRes InAppChatStyle.chatFullScreenErrorRefreshButtonTextRes Rename property in code
InAppChatStyle.errorRefreshButtonTextColor InAppChatStyle.chatFullScreenErrorRefreshButtonTextColor Rename property in code
InAppChatStyle.errorRefreshButtonVisible InAppChatStyle.chatFullScreenErrorRefreshButtonVisible Rename property in code

New:

New snackbar error styling attributes for customizing chat operation errors:

New Attribute/Property Description
ibChatSnackbarErrorTextColor Text color for chat error snackbar
ibChatSnackbarErrorTextAppearance Text appearance for chat error snackbar
ibChatSnackbarErrorBackgroundColor Background color for chat error snackbar
ibChatSnackbarErrorIcon Icon for chat error snackbar
ibChatSnackbarErrorIconTint Icon tint color for chat error snackbar
InAppChatStyle.chatSnackbarErrorTextColor Text color for chat error snackbar (programmatic)
InAppChatStyle.chatSnackbarErrorTextAppearance Text appearance for chat error snackbar (programmatic)
InAppChatStyle.chatSnackbarErrorBackgroundColor Background color for chat error snackbar (programmatic)
InAppChatStyle.chatSnackbarErrorIcon Icon for chat error snackbar (programmatic)
InAppChatStyle.chatSnackbarErrorIconTint Icon tint color for chat error snackbar (programmatic)

Migration Examples:

XML Theme Migration:

Before:

<style name="MyChat" parent="IB.Chat">
    <!-- Network error -->
    <item name="ibChatNetworkConnectionErrorBackgroundColor">@color/error_red</item>
    <item name="ibChatNetworkConnectionErrorIconVisible">true</item>

    <!-- Full screen error (when chat fails to load) -->
    <item name="ibChatErrorTitleText">Something went wrong</item>
    <item name="ibChatErrorTitleTextColor">@android:color/black</item>
    <item name="ibChatErrorBackgroundColor">@android:color/white</item>
    <item name="ibChatErrorRefreshButtonText">Try Again</item>
</style>

After:

<style name="MyChat" parent="IB.Chat">
    <!-- Network connection error (snackbar) -->
    <item name="ibChatNetworkConnectionErrorBackgroundColor">@color/error_red</item>
    <!-- ibChatNetworkConnectionErrorIconVisible removed - icon shown if provided -->

    <!-- Chat operation errors (snackbar) -->
    <item name="ibChatSnackbarErrorBackgroundColor">@color/error_orange</item>
    <item name="ibChatSnackbarErrorTextColor">@android:color/white</item>
    <item name="ibChatSnackbarErrorIcon">@drawable/ic_error</item>

    <!-- Full screen error (when chat fails to load completely) -->
    <item name="ibChatFullScreenErrorTitleText">Something went wrong</item>
    <item name="ibChatFullScreenErrorTitleTextColor">@android:color/black</item>
    <item name="ibChatFullScreenErrorBackgroundColor">@android:color/white</item>
    <item name="ibChatFullScreenErrorRefreshButtonText">Try Again</item>
</style>

Kotlin Programmatic Migration:

Before:

val style = InAppChatStyle.Builder()
    .setNetworkConnectionErrorBackgroundColor(Color.RED)
    .setNetworkConnectionErrorIconVisible(true)
    .setErrorTitleText("Error occurred")
    .setErrorTitleTextColor(Color.BLACK)
    .setErrorBackgroundColor(Color.WHITE)
    .build()

InAppChat.getInstance(context).setTheme(
    InAppChatTheme(chatStyle = style, /* ... */)
)

After:

val style = InAppChatStyle.Builder()
    // Network connection error (snackbar)
    .setNetworkConnectionErrorBackgroundColor(Color.RED)
    // setNetworkConnectionErrorIconVisible removed - icon shown if provided

    // Chat operation errors (snackbar)
    .setChatSnackbarErrorBackgroundColor(Color.parseColor("#FF9800"))
    .setChatSnackbarErrorTextColor(Color.WHITE)
    .setChatSnackbarErrorIcon(ContextCompat.getDrawable(context, R.drawable.ic_error))

    // Full screen error (when chat fails to load completely)
    .setChatFullScreenErrorTitleText("Error occurred")
    .setChatFullScreenErrorTitleTextColor(Color.BLACK)
    .setChatFullScreenErrorBackgroundColor(Color.WHITE)
    .build()

InAppChat.getInstance(context).setTheme(
    InAppChatTheme(chatStyle = style, /* ... */)
)
Java

Before:

InAppChatStyle.Builder builder = new InAppChatStyle.Builder()
    .setNetworkConnectionErrorBackgroundColor(Color.RED)
    .setNetworkConnectionErrorIconVisible(true)
    .setErrorTitleText("Error occurred")
    .setErrorTitleTextColor(Color.BLACK)
    .setErrorBackgroundColor(Color.WHITE);

InAppChat.getInstance(context).setTheme(
    new InAppChatTheme(/* ... */, builder.build(), /* ... */)
);

After:

InAppChatStyle.Builder builder = new InAppChatStyle.Builder()
    // Network connection error (snackbar)
    .setNetworkConnectionErrorBackgroundColor(Color.RED)
    // setNetworkConnectionErrorIconVisible removed - icon shown if provided

    // Chat operation errors (snackbar)
    .setChatSnackbarErrorBackgroundColor(Color.parseColor("#FF9800"))
    .setChatSnackbarErrorTextColor(Color.WHITE)
    .setChatSnackbarErrorIcon(ContextCompat.getDrawable(context, R.drawable.ic_error))

    // Full screen error (when chat fails to load completely)
    .setChatFullScreenErrorTitleText("Error occurred")
    .setChatFullScreenErrorTitleTextColor(Color.BLACK)
    .setChatFullScreenErrorBackgroundColor(Color.WHITE);

InAppChat.getInstance(context).setTheme(
    new InAppChatTheme(/* ... */, builder.build(), /* ... */)
);

Behavior Changes:

  • Network connection errors are now displayed as snackbars instead of a sliding banner view
  • Chat operation errors (e.g., message send failures, API errors) are displayed as snackbars with separate styling options
  • Full screen errors (chat fails to load completely) remain as a full-screen view but with renamed styling attributes
⚠️ **GitHub.com Fallback** ⚠️