-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge current
v7.7.0
changes to master
- Loading branch information
1 parent
e6d822e
commit ab97a3e
Showing
31 changed files
with
294 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...ava/com/rakuten/tech/mobile/inappmessaging/runtime/data/customjson/ApplyClickableImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.rakuten.tech.mobile.inappmessaging.runtime.data.customjson | ||
|
||
import com.rakuten.tech.mobile.inappmessaging.runtime.data.enums.ButtonActionType | ||
import com.rakuten.tech.mobile.inappmessaging.runtime.data.enums.InAppMessageType | ||
import com.rakuten.tech.mobile.inappmessaging.runtime.data.responses.ping.Content | ||
import com.rakuten.tech.mobile.inappmessaging.runtime.data.responses.ping.OnClickBehavior | ||
import com.rakuten.tech.mobile.inappmessaging.runtime.data.ui.UiMessage | ||
|
||
internal fun UiMessage.applyCustomClickableImage(clickableImage: ClickableImage?, isPushPrimer: Boolean): UiMessage { | ||
fun Int.campaignTypeCanBeClickable(): Boolean { | ||
return this in listOf( | ||
InAppMessageType.FULL.typeId, | ||
InAppMessageType.MODAL.typeId, | ||
) | ||
} | ||
|
||
@SuppressWarnings("ComplexCondition") | ||
if (clickableImage == null || | ||
clickableImage.url.isNullOrEmpty() || | ||
imageUrl.isNullOrEmpty() || | ||
!type.campaignTypeCanBeClickable() || | ||
isPushPrimer | ||
) { | ||
return this | ||
} | ||
|
||
val newOnclick = OnClickBehavior(action = ButtonActionType.REDIRECT.typeId, uri = clickableImage.url) | ||
return this.copy( | ||
content = if (this.content == null) { | ||
Content(onClick = newOnclick) | ||
} else { | ||
this.content.copy(onClick = newOnclick) | ||
}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.