Skip to content

Commit

Permalink
task(SDK - 3906) - Remove cross btn from five icons (#632)
Browse files Browse the repository at this point in the history
* task(SDK - 3906) -
- Removes cross btn from five-icons
- Removes setOngoing(true) to make it non-sticky across all OS versions
- Deletes unused icon

* task(SDK - 3906) - Removes unused code

* task(SDK - 3906) - Updates docs

* task(SDK - 3906) - Updates docs

* task(SDK - 3906) - Updates docs

---------

Co-authored-by: CTLalit <[email protected]>
  • Loading branch information
Anush-Shand and CTLalit authored Jul 9, 2024
1 parent b59b817 commit 09fd33b
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class TemplateRenderer : INotificationRenderer, AudibleNotification {
extras,
notificationId,
nb
).setOngoing(true)
)

/**
* Checks whether the imageUrls are perfect to download icon's bitmap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class FiveIconBigContentView constructor(
}
}
}
Utils.loadImageRidIntoRemoteView(R.id.close, R.drawable.pt_close, remoteView)

extras.putInt(PTConstants.PT_NOTIF_ID, renderer.notificationId)
extras.putBoolean(Constants.CLOSE_SYSTEM_DIALOGS, true)
Expand Down Expand Up @@ -142,14 +141,6 @@ class FiveIconBigContentView constructor(
)
}

remoteView.setOnClickPendingIntent(
R.id.close, PendingIntentFactory.getPendingIntent(
context,
renderer.notificationId, extras, false, FIVE_ICON_CLOSE_PENDING_INTENT, renderer
)
)


if (imageCounter > 2) {
PTLog.debug("More than 2 images were not retrieved in 5CTA Notification, not displaying Notification.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class FiveIconSmallContentView constructor(
}
}
}
Utils.loadImageRidIntoRemoteView(R.id.close, R.drawable.pt_close, remoteView)

extras.putInt(PTConstants.PT_NOTIF_ID, renderer.notificationId)
extras.putBoolean(Constants.CLOSE_SYSTEM_DIALOGS, true)
Expand Down Expand Up @@ -142,14 +141,6 @@ class FiveIconSmallContentView constructor(
)
}

remoteView.setOnClickPendingIntent(
R.id.close, PendingIntentFactory.getPendingIntent(
context,
renderer.notificationId, extras, false, FIVE_ICON_CLOSE_PENDING_INTENT, renderer
)
)


if (imageCounter > 2) {
PTLog.debug("More than 2 images were not retrieved in 5CTA Notification, not displaying Notification.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const val RATING_CLICK3_PENDING_INTENT = 10
const val RATING_CLICK4_PENDING_INTENT = 11
const val RATING_CLICK5_PENDING_INTENT = 12
const val FIVE_ICON_CONTENT_PENDING_INTENT = 13
const val FIVE_ICON_CLOSE_PENDING_INTENT = 19
const val PRODUCT_DISPLAY_CONTENT_PENDING_INTENT = 20
const val PRODUCT_DISPLAY_DL1_PENDING_INTENT = 21
const val PRODUCT_DISPLAY_DL2_PENDING_INTENT = 22
Expand Down Expand Up @@ -208,13 +207,6 @@ internal object PendingIntentFactory {
return setPendingIntent(context, notificationId, extras, launchIntent, requestCode)
}

FIVE_ICON_CLOSE_PENDING_INTENT -> {
launchIntent!!.putExtra("close", true)
launchIntent!!.putExtra(PTConstants.PT_NOTIF_ID, notificationId)
launchIntent!!.putExtras(extras)
return PendingIntent.getBroadcast(context, requestCode, launchIntent!!, flagsLaunchPendingIntent)
}

PRODUCT_DISPLAY_DL1_PENDING_INTENT -> {
launchIntent!!.putExtras(extras)
launchIntent!!.putExtra(PTConstants.PT_CURRENT_POSITION, 0)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,4 @@
android:layout_margin="4dp"
android:visibility="gone"
android:src="@drawable/pt_image" />

<ImageView
android:id="@+id/close"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dip"
android:src="@drawable/pt_close" />

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,4 @@
android:layout_margin="4dp"
android:visibility="gone"
android:src="@drawable/pt_image" />

<ImageView
android:id="@+id/close"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dp"
android:src="@drawable/pt_close" />

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,4 @@
android:layout_margin="4dp"
android:visibility="gone"
android:src="@drawable/pt_image" />

<ImageView
android:id="@+id/close"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/pt_close" />

</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,4 @@
android:layout_margin="4dp"
android:visibility="gone"
android:src="@drawable/pt_image" />

<ImageView
android:id="@+id/close"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dp"
android:src="@drawable/pt_close" />

</LinearLayout>
4 changes: 2 additions & 2 deletions docs/CTPUSHTEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ pt_product_display_linear | Optional | `true`

## Five Icons Template

Five icons template is a sticky push notification with no text, just 5 icons and a close button which can help your users go directly to the functionality of their choice with a button's click.
Five icons template is a push notification with no text, just 5 icons which can help your users go directly to the functionality of their choice with a button's click.

If at least 3 icons are not retrieved, the library doesn't render any notification. The bifurcation of each CTA is captured in the event Notification Clicked with in the property `wzrk_c2a`.

If user clicks on any notification area except the five & close icons, then by default it will launch an activity intent.
If user clicks on any notification area except the five icons, then by default it will launch an activity intent.

<img src="https://github.com/CleverTap/clevertap-android-sdk/blob/master/static/fiveicon.png" width="412" height="100">

Expand Down
2 changes: 1 addition & 1 deletion docs/CTPUSHTEMPLATESANDROID12.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Product catalog template lets you show case different images of a product (or a

## Five Icons Template

Five icons template is a sticky push notification with no text, just 5 icons and a close button which can help your users go directly to the functionality of their choice with a button's click.
Five icons template is a push notification with no text, just 5 icons which can help your users go directly to the functionality of their choice with a button's click.

If at least 3 icons are not retrieved, the library doesn't render any notification. The bifurcation of each CTA is captured in the event Notification Clicked with in the property `wzrk_c2a`.

Expand Down
4 changes: 2 additions & 2 deletions templates/CTPUSHTEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ pt_product_display_linear | Optional | `true`

## Five Icons Template

Five icons template is a sticky push notification with no text, just 5 icons and a close button which can help your users go directly to the functionality of their choice with a button's click.
Five icons template is a push notification with no text, just 5 icons which can help your users go directly to the functionality of their choice with a button's click.

If at least 3 icons are not retrieved, the library doesn't render any notification. The bifurcation of each CTA is captured in the event Notification Clicked with in the property `wzrk_c2a`.

If user clicks on any notification area except the five & close icons, then by default it will launch an activity intent.
If user clicks on any notification area except the five icons, then by default it will launch an activity intent.

<img src="https://github.com/CleverTap/clevertap-android-sdk/blob/master/static/fiveicon.png" width="412" height="100">

Expand Down
2 changes: 1 addition & 1 deletion templates/CTPUSHTEMPLATESANDROID12.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Product catalog template lets you show case different images of a product (or a

## Five Icons Template

Five icons template is a sticky push notification with no text, just 5 icons and a close button which can help your users go directly to the functionality of their choice with a button's click.
Five icons template is a push notification with no text, just 5 icons which can help your users go directly to the functionality of their choice with a button's click.

If at least 3 icons are not retrieved, the library doesn't render any notification. The bifurcation of each CTA is captured in the event Notification Clicked with in the property `wzrk_c2a`.

Expand Down

0 comments on commit 09fd33b

Please sign in to comment.