Skip to content

Task/sdk 4048/ctas pt #786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
05a92b9
POC for FG service based timer notif
Anush-Shand Oct 10, 2024
ed1b104
Merge branch 'refs/heads/develop' into cta_trial
Anush-Shand Apr 2, 2025
afc9256
task(SDK-4048) - Adds CTAs in the remote view for push templates belo…
Anush-Shand Apr 3, 2025
5abda12
Merge branch 'task/SDK-1556/replace_multi_layouts_with_dimens' into t…
Anush-Shand Apr 3, 2025
6f4a592
Merge branch 'task/SDK-1556/replace_multi_layouts_with_dimens' into t…
Anush-Shand Apr 3, 2025
91aa031
task(SDK-4048) - Reverts rating view changes
Anush-Shand Apr 3, 2025
3de3c00
Rename .java to .kt
Anush-Shand Apr 4, 2025
a7a7140
task(SDK-4048) - Adds action buttons to remote view
Anush-Shand Apr 4, 2025
cb938e3
task(SDK-4048) - Resolves comments
Anush-Shand Apr 8, 2025
9be8689
task(SDK-4048) - Resolves comments
Anush-Shand Apr 8, 2025
8cc5ef3
task(SDK-4048) - Resolves comments
Anush-Shand Apr 8, 2025
7f73116
task(SDK-4048) - Resolves comments
Anush-Shand Apr 8, 2025
6b1fe0d
task(SDK-4048) - Testing
Anush-Shand Apr 8, 2025
c39abb4
Merge branch 'task/SDK-1556/replace_multi_layouts_with_dimens' into t…
Anush-Shand Apr 16, 2025
ad4cbf3
task(SDK-4537) - Removes extra space from manual_carousel.xml (#794)
Anush-Shand Apr 28, 2025
5d36b83
task(SDK-4048) - Removes dependency from core-sdk
Anush-Shand Apr 29, 2025
a1caa26
Merge branch 'task/SDK-1556/replace_multi_layouts_with_dimens' into t…
Anush-Shand Apr 29, 2025
fe3dd4a
task(SDK-4040) - Adds CTA for manual carousel
Anush-Shand Apr 30, 2025
e14953f
task(SDK-4040) - Adds CTA for auto carousel
Anush-Shand Apr 30, 2025
ab6137e
task(SDK-4048) - Compresses forward and backward arrows for manual ca…
Anush-Shand May 6, 2025
572465c
task(SDK-4048) - Separates PendingIntent from ActionButton.kt
Anush-Shand May 8, 2025
facbbc7
task(SDK-4048) - Uses composition instead of inheritance for action b…
Anush-Shand May 8, 2025
0ef1ed2
task(SDK-4048) - Fixes image in rating template
Anush-Shand May 9, 2025
fd4d98c
task(SDK-4048) - Fixes string resource name
Anush-Shand May 9, 2025
2bb0cd4
task(SDK-4048) - Fixes rating template padding
Anush-Shand May 20, 2025
50475b9
task(SDK-4048) - Minor PR comments
Anush-Shand May 23, 2025
77e80fd
task(SDK-4655) - Dark mode for push templates (#795)
Anush-Shand May 27, 2025
e83fa37
Merge branch 'task/SDK-1556/replace_multi_layouts_with_dimens' into t…
Anush-Shand May 27, 2025
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
3 changes: 3 additions & 0 deletions clevertap-pushtemplates/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ dependencies {
implementation (libs.androidx.appcompat)

testImplementation (libs.test.junit)
testImplementation project(':clevertap-core')
testImplementation(libs.test.mockk)
testImplementation(libs.test.robolectric)

androidTestImplementation (libs.test.ext.junit)
androidTestImplementation (libs.test.espresso.core)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.clevertap.android.pushtemplates

// Data class for action button information
data class ActionButton(
val id: String,
val label: String,
val icon: Int
)

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.clevertap.android.pushtemplates;

import java.util.Set;

@SuppressWarnings("WeakerAccess")
//Using common keys from core-sdk constants
public class PTConstants {
Expand Down Expand Up @@ -56,6 +58,8 @@ public class PTConstants {

public static final String PT_TITLE_COLOR = "pt_title_clr";

public static final String PT_DARK_MODE_SUFFIX = "_dark";

public static final String PT_MSG_COLOR = "pt_msg_clr";

public static final String PT_BG = "pt_bg";
Expand Down Expand Up @@ -136,6 +140,8 @@ public class PTConstants {

public static final String PT_BUY_NOW = "buynow";

public static final String PT_SCALE_TYPE = "pt_scale_type";

public static final String TEXT_ONLY = "text_only";

public static final String PT_SUBTITLE = "pt_subtitle";
Expand All @@ -152,21 +158,24 @@ public class PTConstants {

public static final String PT_DOT_SEP = "pt_dot_sep";

public static final String PT_COLOUR_WHITE = "#FFFFFF";

public static final String PT_COLOUR_GREY = "#A6A6A6";

public static final String PT_COLOUR_BLACK = "#000000";

public static final String PT_META_CLR_DEFAULTS = PT_COLOUR_GREY;

public static final String PT_PRODUCT_DISPLAY_ACTION_CLR_DEFAULTS = "#FFBB33";

public static final String PT_PRODUCT_DISPLAY_ACTION_TEXT_CLR_DEFAULT = PT_COLOUR_WHITE;

public static final int PT_FLIP_INTERVAL_TIME = 4 * ONE_SECOND;

public static final String KEY_CLICKED_STAR = "clickedStar";

public static final String KEY_REQUEST_CODES = "requestCodes";

public static final Set<String> COLOR_KEYS = Set.of(
PT_TITLE_COLOR,
PT_MSG_COLOR,
PT_BG,
PT_META_CLR,
PT_SMALL_ICON_COLOUR,
PT_CHRONO_TITLE_COLOUR,
PT_PRODUCT_DISPLAY_ACTION_COLOUR,
PT_PRODUCT_DISPLAY_ACTION_TEXT_COLOUR);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.clevertap.android.pushtemplates

enum class PTScaleType {
FIT_CENTER,
CENTER_CROP;

companion object {
fun fromString(value: String?): PTScaleType {
return values().firstOrNull {
it.name.equals(value, ignoreCase = true)
} ?: CENTER_CROP
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.clevertap.android.pushtemplates

import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract

@OptIn(ExperimentalContracts::class)
fun String?.isNotNullAndEmpty() : Boolean {
contract { returns(true) implies (this@isNotNullAndEmpty != null) }
return isNullOrEmpty().not()
}
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,6 @@ private void setKeysFromDashboard(Bundle extras) {
if (pt_subtitle == null || pt_subtitle.isEmpty()) {
pt_subtitle = extras.getString(Constants.WZRK_SUBTITLE);
}
if (pt_small_icon_clr == null || pt_small_icon_clr.isEmpty()) {
pt_small_icon_clr = extras.getString(Constants.WZRK_COLOR);
}
}

private void setToast(Context context, String message,
Expand Down
Loading