diff --git a/posthog/CHANGELOG.md b/posthog/CHANGELOG.md index d8ead894..a4a3b9af 100644 --- a/posthog/CHANGELOG.md +++ b/posthog/CHANGELOG.md @@ -1,5 +1,7 @@ ## Next +- update android types for new survey customization options ([#399](https://github.com/PostHog/posthog-android/pull/399)) + ## 6.3.0 - 2025-01-21 - chore: do not capture $set events if user props have not changed ([#375](https://github.com/PostHog/posthog-android/pull/375)) diff --git a/posthog/api/posthog.api b/posthog/api/posthog.api index 2aa9aaeb..d0608ed0 100644 --- a/posthog/api/posthog.api +++ b/posthog/api/posthog.api @@ -1287,14 +1287,18 @@ public final class com/posthog/surveys/PostHogDisplaySurvey$Companion { public final class com/posthog/surveys/PostHogDisplaySurveyAppearance { public fun ()V - public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;)V - public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/String; public final fun component10 ()Ljava/lang/String; - public final fun component11 ()Z + public final fun component11 ()Ljava/lang/String; public final fun component12 ()Ljava/lang/String; public final fun component13 ()Ljava/lang/String; - public final fun component14 ()Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType; + public final fun component14 ()Z + public final fun component15 ()Ljava/lang/String; + public final fun component16 ()Ljava/lang/String; + public final fun component17 ()Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType; + public final fun component18 ()Ljava/lang/String; public final fun component2 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; @@ -1303,20 +1307,24 @@ public final class com/posthog/surveys/PostHogDisplaySurveyAppearance { public final fun component7 ()Ljava/lang/String; public final fun component8 ()Ljava/lang/String; public final fun component9 ()Ljava/lang/String; - public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;)Lcom/posthog/surveys/PostHogDisplaySurveyAppearance; - public static synthetic fun copy$default (Lcom/posthog/surveys/PostHogDisplaySurveyAppearance;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;ILjava/lang/Object;)Lcom/posthog/surveys/PostHogDisplaySurveyAppearance; + public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;Ljava/lang/String;)Lcom/posthog/surveys/PostHogDisplaySurveyAppearance; + public static synthetic fun copy$default (Lcom/posthog/surveys/PostHogDisplaySurveyAppearance;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType;Ljava/lang/String;ILjava/lang/Object;)Lcom/posthog/surveys/PostHogDisplaySurveyAppearance; public fun equals (Ljava/lang/Object;)Z public final fun getBackgroundColor ()Ljava/lang/String; public final fun getBorderColor ()Ljava/lang/String; public final fun getDescriptionTextColor ()Ljava/lang/String; public final fun getDisplayThankYouMessage ()Z public final fun getFontFamily ()Ljava/lang/String; + public final fun getInputBackground ()Ljava/lang/String; + public final fun getInputTextColor ()Ljava/lang/String; public final fun getPlaceholder ()Ljava/lang/String; public final fun getRatingButtonActiveColor ()Ljava/lang/String; public final fun getRatingButtonColor ()Ljava/lang/String; public final fun getSubmitButtonColor ()Ljava/lang/String; public final fun getSubmitButtonText ()Ljava/lang/String; public final fun getSubmitButtonTextColor ()Ljava/lang/String; + public final fun getTextColor ()Ljava/lang/String; + public final fun getThankYouMessageCloseButtonText ()Ljava/lang/String; public final fun getThankYouMessageDescription ()Ljava/lang/String; public final fun getThankYouMessageDescriptionContentType ()Lcom/posthog/surveys/PostHogDisplaySurveyTextContentType; public final fun getThankYouMessageHeader ()Ljava/lang/String; @@ -1498,25 +1506,28 @@ public final class com/posthog/surveys/Survey { } public final class com/posthog/surveys/SurveyAppearance { - public fun (Lcom/posthog/surveys/SurveyAppearancePosition;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/SurveyTextContentType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Double;Lcom/posthog/surveys/SurveyAppearanceWidgetType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public fun (Lcom/posthog/surveys/SurveyAppearancePosition;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/SurveyTextContentType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Double;Lcom/posthog/surveys/SurveyAppearanceWidgetType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V public final fun component1 ()Lcom/posthog/surveys/SurveyAppearancePosition; public final fun component10 ()Ljava/lang/String; - public final fun component11 ()Ljava/lang/Boolean; - public final fun component12 ()Ljava/lang/Boolean; - public final fun component13 ()Ljava/lang/Boolean; - public final fun component14 ()Ljava/lang/String; - public final fun component15 ()Ljava/lang/String; - public final fun component16 ()Lcom/posthog/surveys/SurveyTextContentType; + public final fun component11 ()Ljava/lang/String; + public final fun component12 ()Ljava/lang/String; + public final fun component13 ()Ljava/lang/String; + public final fun component14 ()Ljava/lang/Boolean; + public final fun component15 ()Ljava/lang/Boolean; + public final fun component16 ()Ljava/lang/Boolean; public final fun component17 ()Ljava/lang/String; public final fun component18 ()Ljava/lang/String; - public final fun component19 ()Ljava/lang/String; + public final fun component19 ()Lcom/posthog/surveys/SurveyTextContentType; public final fun component2 ()Ljava/lang/String; - public final fun component20 ()Ljava/lang/Boolean; - public final fun component21 ()Ljava/lang/Double; - public final fun component22 ()Lcom/posthog/surveys/SurveyAppearanceWidgetType; - public final fun component23 ()Ljava/lang/String; - public final fun component24 ()Ljava/lang/String; - public final fun component25 ()Ljava/lang/String; + public final fun component20 ()Ljava/lang/String; + public final fun component21 ()Ljava/lang/String; + public final fun component22 ()Ljava/lang/String; + public final fun component23 ()Ljava/lang/Boolean; + public final fun component24 ()Ljava/lang/Double; + public final fun component25 ()Lcom/posthog/surveys/SurveyAppearanceWidgetType; + public final fun component26 ()Ljava/lang/String; + public final fun component27 ()Ljava/lang/String; + public final fun component28 ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Ljava/lang/String; @@ -1524,8 +1535,8 @@ public final class com/posthog/surveys/SurveyAppearance { public final fun component7 ()Ljava/lang/String; public final fun component8 ()Ljava/lang/String; public final fun component9 ()Ljava/lang/String; - public final fun copy (Lcom/posthog/surveys/SurveyAppearancePosition;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/SurveyTextContentType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Double;Lcom/posthog/surveys/SurveyAppearanceWidgetType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/posthog/surveys/SurveyAppearance; - public static synthetic fun copy$default (Lcom/posthog/surveys/SurveyAppearance;Lcom/posthog/surveys/SurveyAppearancePosition;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/SurveyTextContentType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Double;Lcom/posthog/surveys/SurveyAppearanceWidgetType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/posthog/surveys/SurveyAppearance; + public final fun copy (Lcom/posthog/surveys/SurveyAppearancePosition;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/SurveyTextContentType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Double;Lcom/posthog/surveys/SurveyAppearanceWidgetType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/posthog/surveys/SurveyAppearance; + public static synthetic fun copy$default (Lcom/posthog/surveys/SurveyAppearance;Lcom/posthog/surveys/SurveyAppearancePosition;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;Lcom/posthog/surveys/SurveyTextContentType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Double;Lcom/posthog/surveys/SurveyAppearanceWidgetType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/posthog/surveys/SurveyAppearance; public fun equals (Ljava/lang/Object;)Z public final fun getAutoDisappear ()Ljava/lang/Boolean; public final fun getBackgroundColor ()Ljava/lang/String; @@ -1533,6 +1544,8 @@ public final class com/posthog/surveys/SurveyAppearance { public final fun getDescriptionTextColor ()Ljava/lang/String; public final fun getDisplayThankYouMessage ()Ljava/lang/Boolean; public final fun getFontFamily ()Ljava/lang/String; + public final fun getInputBackground ()Ljava/lang/String; + public final fun getInputTextColor ()Ljava/lang/String; public final fun getPlaceholder ()Ljava/lang/String; public final fun getPosition ()Lcom/posthog/surveys/SurveyAppearancePosition; public final fun getRatingButtonActiveColor ()Ljava/lang/String; @@ -1543,6 +1556,7 @@ public final class com/posthog/surveys/SurveyAppearance { public final fun getSubmitButtonText ()Ljava/lang/String; public final fun getSubmitButtonTextColor ()Ljava/lang/String; public final fun getSurveyPopupDelaySeconds ()Ljava/lang/Double; + public final fun getTextColor ()Ljava/lang/String; public final fun getThankYouMessageCloseButtonText ()Ljava/lang/String; public final fun getThankYouMessageDescription ()Ljava/lang/String; public final fun getThankYouMessageDescriptionContentType ()Lcom/posthog/surveys/SurveyTextContentType; diff --git a/posthog/src/main/java/com/posthog/surveys/PostHogDisplaySurveyAppearance.kt b/posthog/src/main/java/com/posthog/surveys/PostHogDisplaySurveyAppearance.kt index dba29e4b..0f117708 100644 --- a/posthog/src/main/java/com/posthog/surveys/PostHogDisplaySurveyAppearance.kt +++ b/posthog/src/main/java/com/posthog/surveys/PostHogDisplaySurveyAppearance.kt @@ -9,14 +9,18 @@ package com.posthog.surveys * @property submitButtonColor Optional background color for the submit button as web color * @property submitButtonText Optional custom text for the submit button * @property submitButtonTextColor Optional text color for the submit button as web color + * @property textColor Optional primary text color as web color * @property descriptionTextColor Optional color for description text as web color * @property ratingButtonColor Optional color for rating buttons as web color * @property ratingButtonActiveColor Optional color for active/selected rating buttons as web color + * @property inputBackground Optional background color for input fields as web color + * @property inputTextColor Optional text color for input fields as web color * @property placeholder Optional placeholder text for input fields * @property displayThankYouMessage Whether to show a thank you message after survey completion * @property thankYouMessageHeader Optional header text for the thank you message * @property thankYouMessageDescription Optional description text for the thank you message * @property thankYouMessageDescriptionContentType Optional content type for the thank you message description + * @property thankYouMessageCloseButtonText Optional custom text for the thank you message close button */ public data class PostHogDisplaySurveyAppearance( val fontFamily: String? = null, @@ -25,14 +29,18 @@ public data class PostHogDisplaySurveyAppearance( val submitButtonColor: String? = null, val submitButtonText: String? = null, val submitButtonTextColor: String? = null, + val textColor: String? = null, val descriptionTextColor: String? = null, val ratingButtonColor: String? = null, val ratingButtonActiveColor: String? = null, + val inputBackground: String? = null, + val inputTextColor: String? = null, val placeholder: String? = null, val displayThankYouMessage: Boolean = false, val thankYouMessageHeader: String? = null, val thankYouMessageDescription: String? = null, val thankYouMessageDescriptionContentType: PostHogDisplaySurveyTextContentType? = null, + val thankYouMessageCloseButtonText: String? = null, ) { internal companion object { /** @@ -56,14 +64,18 @@ public data class PostHogDisplaySurveyAppearance( submitButtonColor = appearance.submitButtonColor, submitButtonText = appearance.submitButtonText, submitButtonTextColor = appearance.submitButtonTextColor, + textColor = appearance.textColor, descriptionTextColor = appearance.descriptionTextColor, ratingButtonColor = appearance.ratingButtonColor, ratingButtonActiveColor = appearance.ratingButtonActiveColor, + inputBackground = appearance.inputBackground, + inputTextColor = appearance.inputTextColor, placeholder = appearance.placeholder, displayThankYouMessage = appearance.displayThankYouMessage ?: false, thankYouMessageHeader = appearance.thankYouMessageHeader, thankYouMessageDescription = appearance.thankYouMessageDescription, thankYouMessageDescriptionContentType = thankYouContentType, + thankYouMessageCloseButtonText = appearance.thankYouMessageCloseButtonText, ) } } diff --git a/posthog/src/main/java/com/posthog/surveys/SurveyAppearance.kt b/posthog/src/main/java/com/posthog/surveys/SurveyAppearance.kt index 572e5021..833d33df 100644 --- a/posthog/src/main/java/com/posthog/surveys/SurveyAppearance.kt +++ b/posthog/src/main/java/com/posthog/surveys/SurveyAppearance.kt @@ -7,10 +7,13 @@ public data class SurveyAppearance( val submitButtonColor: String?, val submitButtonText: String?, val submitButtonTextColor: String?, + val textColor: String?, val descriptionTextColor: String?, val ratingButtonColor: String?, val ratingButtonActiveColor: String?, val ratingButtonHoverColor: String?, + val inputBackground: String?, + val inputTextColor: String?, val whiteLabel: Boolean?, val autoDisappear: Boolean?, val displayThankYouMessage: Boolean?,