Skip to content

Commit

Permalink
Set WebViewCardAdapter as a default CustomCardAdapter
Browse files Browse the repository at this point in the history
MOB-2513
  • Loading branch information
AH-MOC authored and andrews-moc committed Aug 10, 2023
1 parent 273c5a3 commit d1a781a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 6 additions & 2 deletions widgetssdk/src/main/java/com/glia/widgets/GliaWidgets.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class GliaWidgets {
public static final String CHAT_TYPE = "chat_type";

@Nullable
private static CustomCardAdapter customCardAdapter;
private static CustomCardAdapter customCardAdapter = new WebViewCardAdapter();

/**
* Should be called when the application is starting in {@link Application}.onCreate()
Expand Down Expand Up @@ -274,8 +274,12 @@ public static void getVisitorInfo(Consumer<GliaVisitorInfo> visitorCallback, Con

/**
* Allows configuring custom response cards based on metadata.
* <p>
* Glia SDK uses {@link WebViewCardAdapter} by default.
* This method allows setting the custom implementation of {@link CustomCardAdapter}.
*
* @param customCardAdapter an instance of {@link CustomCardAdapter}.
* @param customCardAdapter an instance of {@link CustomCardAdapter}
* or {@code null} for the default, not Custom Card, Glia message implementation.
* @see CustomCardAdapter
* @see WebViewCardAdapter
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@
import androidx.annotation.Nullable;

import com.glia.androidsdk.chat.ChatMessage;
import com.glia.widgets.GliaWidgets;
import com.glia.widgets.UiTheme;
import com.glia.widgets.chat.adapter.holder.CustomCardViewHolder;
import com.glia.widgets.chat.adapter.holder.WebViewViewHolder;

/**
* The implementation of {@link CustomCardAdapter} allows displaying all card messages in WebViews.
* <p>
* It provides a simple way to set up {@link GliaWidgets#setCustomCardAdapter(CustomCardAdapter)}.
* <p>
* <b>Usage example:</b>
* <pre>{@code
* GliaWidgets.setCustomCardAdapter(new WebViewCardAdapter());
* }<pre/>
* @see CustomCardAdapter
* @see WebViewViewHolder
*/
Expand Down

0 comments on commit d1a781a

Please sign in to comment.