-
Notifications
You must be signed in to change notification settings - Fork 32
[MOB-5473] Embedded GA Release #698
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
Merged
Changes from all commits
Commits
Show all changes
175 commits
Select commit
Hold shift + click to select a range
9ec4867
sets up embedded message class
evantk91 8b0c881
excludes kotlin files from javadoc check
evantk91 490f736
sets up embedded message serialization
evantk91 af8862f
minor update to naming
evantk91 3fa9ff9
Merge branch 'evan/MOB-5393-embedded-message-data-types' into evan/MO…
evangreer91 d0bf768
Merge pull request #513 from Iterable/evan/MOB-5393-embedded-message-…
evangreer91 6983930
restructures serialization functions
evantk91 a807d64
updates isProof
evantk91 4228601
sets up serialization unit test
evantk91 d71cee8
adds unit tests
evantk91 f53b38b
reverts changes
evantk91 0bc952b
adds null check for elements json
evantk91 1e343e4
adds serialization tests
evantk91 c7ebae5
Merge branch 'embedded' into evan/MOB-5395-embedded-message-serializa…
evangreer91 088fe7e
updates tests
evantk91 e642955
Merge branch 'evan/MOB-5395-embedded-message-serialization' of github…
evantk91 e8742cb
minor edits
evantk91 8a2d2cf
Merge pull request #514 from Iterable/evan/MOB-5395-embedded-message-…
evangreer91 82f4d6b
Feature/embedded/manager (#527)
Ayyanchira 41cd02b
[MOB-6425] align impression tracking signatures (#590)
evantk91 c1042a3
[MOB-6443] remove polling logic and adds callbacks to embedded sessio…
evantk91 4e674a0
[MOB-6664] adds placement class to IterableEmbeddedMessage (#610)
evantk91 4de642e
[MOB-6587] updates campaign id to int type (#602)
evantk91 4fd7118
[MOB-6665] updates get messages to pull messages from placement (#611)
evantk91 7a9a853
[MOB-6490] toggle off impression tracking if no embedded messages (#601)
evantk91 f25d6a8
sets up placement support
c63104b
sets up update local messages for placement support
58ee154
Merge branch 'master' into embedded-updated-w-master
9a0202e
Merge pull request #625 from Iterable/embedded-updated-w-master
evantk91 ceb9192
creates base embedded OOTB views
33db76b
combines ootb views under IterableEmbeddedView
21a5abc
updates view to take in and render message
3f661ac
adds embedded manager reset to logoutPreviousUser
ff31f39
corrects typo
6c2e5f8
stashed changes
acc6c1a
updates embedded manager calls
ad026d8
Revert "updates embedded manager calls"
4551318
updates embedded manager calls
a41c080
stashed changes
0205cdd
Merge pull request #639 from Iterable/evan/MOB-7044-reset-embedded-ma…
evantk91 89d0d88
Merge branch 'evan/feature/placement-support' into evan/MOB-6733-upda…
evantk91 3a5c98a
removes testing function
10d9586
Merge pull request #645 from Iterable/evan/MOB-7186-updating-embedded…
evantk91 173fd04
adds logic to add query parameters when placement ids are passed as a…
85dd6db
stashed changes
3dd0ffd
updates endpoint
9f65c94
stashed changes
a947d89
updates impression payload
19f8c23
updates unit tests
c1ea512
addresses unit tests
36ce32a
updates placement ids to long values
fe45314
stashed changes
6774d8f
stashed changes
6ad95ef
Merge pull request #650 from Iterable/evan/MOB-7218-impression-tracki…
evantk91 f325d8d
adds configure method and associated IterableEmbeddedViewConfig type
8edba2c
adds sync messages unit test
42075f5
updates reset function for placement support
a8e12c5
resolves checks
2294a66
Merge pull request #647 from Iterable/evan/MOB-6733-update-local-stor…
evantk91 b8b7f39
stashed changes
379188f
addresses checks
be6ef1b
Merge pull request #652 from Iterable/evan/MOB-7179-reset-function-pl…
evantk91 707abd3
sets up click handler
59bf501
minor changes
64a72ca
updates handleEmbeddedClick to take in a url and associated logic
d5d8dae
updates config to store embedded base url
05e0ffb
resets embedded classes and cleans up manager
e997ad4
hides action handling and clean up
36fb11d
clean up
1ae2bc1
removes track click call
963e64b
updates update handler naming
ecc4ed2
Merge pull request #653 from Iterable/evan/MOB-7246-sets-up-click-han…
evantk91 7f16994
adds unit tests for syncing messages and reset
5318c5d
adds unit tests for onMessagesUpdated
41fbf78
cleanup
fedc2dd
cleanup
3c2e238
removes update handler from config and manager constructor
13a7145
refactors requestNewAuthToken
c35735f
stashed changes
dab4f8d
Revert "refactors requestNewAuthToken"
0d34c39
Merge branch 'master' into embedded
46f9fc2
updates pointers
b1a64c9
Merge pull request #663 from Iterable/evan/MOB-7312-prepare-for-3.5.0…
evantk91 8e15033
minor edits
d14c67a
minor edits
01014a9
minor edits
1de62bb
stashed changes
05946e3
adds unit tests for track calls and onEmbeddedMessagingDisabled hook
1abda6a
updates packages
0ccbefa
removes unused imports
bd93494
adds custom actions to handleEmbeddedClick
d7b4ccf
Merge pull request #659 from Iterable/evan/MOB-7286-embedded-manager-…
evantk91 0275dd5
resolves merge conflicts
94deaa1
updates unit tests
420c7c5
updates manager unit tests
04552e4
adds serialization tests for multiple placements
f031136
adds public methods for get messages for specific ids
eb0fb63
Merge branch 'evan/feature/placement-support' into evan/MOB-6731-upda…
d5f0743
stashed changes
b81fcae
Merge pull request #665 from Iterable/evan/MOB-7349-placements-deseri…
evantk91 233a018
minor updates
4b617db
minor edits
a49c20c
clean up
27331ce
comments out test placements
476b8a8
stashed changes
a3afc1c
Merge branch 'evan/feature/placement-support' into evan/MOB-6891-OOTB…
f3744cd
sets up IterableEmbeddedViewType class
d5f42f9
resolves checks
3426a74
minor cleanup
ed0950e
updates configuration logic
9d6134d
minor cleanup
a954139
Merge pull request #666 from Iterable/evan/MOB-7315-sets-up-custom-ac…
evantk91 bdee6a2
sets up logic for adjusting default background color and border color…
2d24a97
adds bindNotification function
2b9f5f4
Merge pull request #649 from Iterable/evan/MOB-6731-update-get-messag…
evantk91 c4864e8
minor cleanup
2a77ff7
adds unit tests for placement removal
826ee4a
added comments
e540a2a
Merge branch 'embedded' into evan/feature/placement-support
b5b1983
Merge branch 'evan/feature/placement-support' into evan/MOB-6891-OOTB…
c833048
updates references in comments
2135e84
updates references
05fe038
adds additional customizations
4bdfbf9
adds image processing
a3e664c
updates unit tests and adds check if local messages is empty
101a6c7
adds unit test for update handler with empty local storage
ee7a42d
Merge pull request #664 from Iterable/evan/feature/placement-support
evantk91 bf5d3a8
refactoring
3f308cd
adds updates to layout files and filtering for default button background
71b7f0c
adds first button border color to config
8afee01
adds logic to hide image view
ed764ab
adding kotlin file exclusion for javadoc check
1d20a07
addresses comments
855d6b4
removes color and updates content descriptions
955b3b8
Merge branch 'embedded' into evan/MOB-6891-OOTB-view-customization
evantk91 8f29725
Merge pull request #669 from Iterable/evan/MOB-6891-OOTB-view-customi…
evantk91 d5b3ff8
adds second button customization
3d5d2d5
adds view type specific customization
72117a9
updates margin between buttons when second button is customized
177f6b0
minor edits
658aaea
updates button naming
5cfd65b
Merge pull request #673 from Iterable/evan/MOB-6876-update-button-naming
evantk91 b18de76
removes border color customizations
0608b2d
Merge branch 'embedded' into evan/MOB-7461-second-button-customization
c45aecf
cleans up variable naming
13283b9
support mid session eligibility
hani-iterable 1a4008f
resolve build issue
hani-iterable 26b82cd
adds content description to image view from payload
133edc6
Merge pull request #676 from Iterable/mid-session-eligibility
evantk91 8a64b2b
Merge branch 'evan/MOB-7460-adds-content-description-to-ootb-view' in…
davidtruong ec55d8a
Merge branch 'evan/MOB-7461-second-button-customization' into embedde…
davidtruong 679f1f5
updates number of lines for title and body
2dc0092
updates unit tests
e67429c
Merge pull request #683 from Iterable/evan/MOB-7625-ootb-layout-clean-up
evantk91 46767db
sets up constraint layout
f80ddfc
adds layout updates for all three view types
86097e8
resets android versions
25f0228
cleanup
288beb3
updates button container constraints
3ddad26
Merge pull request #687 from Iterable/evan/MOB-7678-constraint-finali…
evantk91 06681bd
Adding in new config and disabling accessing Embedded syncMessages by…
davidtruong ae741f4
Merge branch 'master' into embedded-clean-merge
davidtruong 6e2cac4
Test fix
9f7b654
Merge pull request #697 from Iterable/test-fix-on-embedded-clean-merge
davidtruong 51e4799
adds dimen value for card text container height
9201f7a
Merge branch 'embedded-clean-merge' into evan/MOB-7749-card-text-cont…
evantk91 786746d
Merge pull request #699 from Iterable/evan/MOB-7749-card-text-contain…
davidtruong f6ca9b6
Full qualified name for style resource
62151ae
sets width of text to match parent
d35abb1
Merge pull request #701 from Iterable/evan/final-layout-updates
evantk91 2e16077
Merge branch 'embedded-clean-merge' into fully-qualified-style-name
evantk91 cbf0e96
Merge pull request #700 from Iterable/fully-qualified-style-name
evantk91 23fd76d
updates changelog
07f2fa8
updates changelog
006c993
Merge pull request #702 from Iterable/evan/update-changelog
evantk91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -7,7 +7,7 @@ android { | |
namespace 'com.iterable.iterableapi.ui' | ||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
minSdkVersion 16 | ||
targetSdkVersion 28 | ||
vectorDrawables.useSupportLibrary = true | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
|
@@ -37,17 +37,21 @@ dependencies { | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
implementation 'androidx.appcompat:appcompat:1.0.0' | ||
implementation 'androidx.recyclerview:recyclerview:1.0.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
implementation 'com.google.android.flexbox:flexbox:3.0.0' | ||
implementation 'androidx.cardview:cardview:1.0.0' | ||
implementation "com.github.bumptech.glide:glide:4.8.0" | ||
implementation 'com.google.android.material:material:1.2.0' | ||
|
||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||
androidTestImplementation 'androidx.test:runner:1.2.0' | ||
androidTestImplementation 'androidx.test:rules:1.2.0' | ||
|
||
} | ||
|
||
ext { | ||
libraryName = 'iterableapi-ui' | ||
libraryVersion = '3.4.17' | ||
libraryVersion = '3.5.0-beta1' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be updated when releasing the new version |
||
} | ||
|
||
if (hasProperty("mavenPublishEnabled")) { | ||
|
@@ -57,6 +61,8 @@ if (hasProperty("mavenPublishEnabled")) { | |
task javadoc(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
|
||
exclude '**/*.kt' | ||
} | ||
|
||
// A hack to import the classpath and BuildConfig into the javadoc task | ||
|
191 changes: 191 additions & 0 deletions
191
iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/embedded/IterableEmbeddedView.kt
This file contains hidden or 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,191 @@ | ||
package com.iterable.iterableapi.ui.embedded | ||
|
||
import android.graphics.drawable.GradientDrawable | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.Button | ||
import android.widget.ImageView | ||
import android.widget.LinearLayout | ||
import android.widget.TextView | ||
import androidx.core.content.ContextCompat | ||
import androidx.fragment.app.Fragment | ||
import com.bumptech.glide.Glide | ||
import com.google.android.flexbox.FlexboxLayout | ||
import com.iterable.iterableapi.EmbeddedMessageElementsButton | ||
import com.iterable.iterableapi.IterableApi | ||
import com.iterable.iterableapi.IterableEmbeddedMessage | ||
import com.iterable.iterableapi.ui.R | ||
|
||
class IterableEmbeddedView( | ||
private var viewType: IterableEmbeddedViewType, | ||
private var message: IterableEmbeddedMessage, | ||
private var config: IterableEmbeddedViewConfig? | ||
): Fragment() { | ||
|
||
private val defaultBackgroundColor : Int by lazy { getDefaultColor(viewType, R.color.notification_background_color, R.color.banner_background_color, R.color.banner_background_color) } | ||
private val defaultBorderColor : Int by lazy { getDefaultColor(viewType, R.color.notification_border_color, R.color.banner_border_color, R.color.banner_border_color) } | ||
private val defaultPrimaryBtnBackgroundColor: Int by lazy { getDefaultColor(viewType, R.color.white, R.color.white, R.color.banner_button_color) } | ||
private val defaultPrimaryBtnTextColor: Int by lazy { getDefaultColor(viewType, R.color.notification_text_color, R.color.banner_button_color, R.color.white) } | ||
private val defaultSecondaryBtnBackgroundColor: Int by lazy { getDefaultColor(viewType, R.color.notification_background_color, R.color.white, R.color.white) } | ||
private val defaultSecondaryBtnTextColor: Int by lazy { getDefaultColor(viewType, R.color.notification_text_color, R.color.banner_button_color, R.color.banner_button_color) } | ||
private val defaultTitleTextColor: Int by lazy { getDefaultColor(viewType, R.color.notification_text_color, R.color.title_text_color, R.color.title_text_color) } | ||
private val defaultBodyTextColor: Int by lazy { getDefaultColor(viewType, R.color.notification_text_color, R.color.body_text_color, R.color.body_text_color) } | ||
private val defaultBorderWidth = 1 | ||
private val defaultBorderCornerRadius = 8f | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
|
||
val view = when (viewType) { | ||
IterableEmbeddedViewType.BANNER -> { | ||
val bannerView = inflater.inflate(R.layout.banner_view, container, false) | ||
bind(viewType, bannerView, message) | ||
bannerView | ||
} | ||
IterableEmbeddedViewType.CARD -> { | ||
val cardView = inflater.inflate(R.layout.card_view, container, false) | ||
bind(viewType, cardView, message) | ||
cardView | ||
} | ||
IterableEmbeddedViewType.NOTIFICATION -> { | ||
val notificationView = inflater.inflate(R.layout.notification_view, container, false) | ||
bind(viewType, notificationView, message) | ||
notificationView | ||
} | ||
} | ||
|
||
setDefaultAction(view, message) | ||
configure(view, viewType, config) | ||
|
||
return view | ||
} | ||
|
||
private fun configure(view: View, viewType: IterableEmbeddedViewType, config: IterableEmbeddedViewConfig?) { | ||
|
||
val backgroundColor = config?.backgroundColor.takeIf { it != null } ?: defaultBackgroundColor | ||
val borderColor = config?.borderColor.takeIf { it != null } ?: defaultBorderColor | ||
val borderWidth = config?.borderWidth.takeIf { it != null } ?: defaultBorderWidth | ||
val borderCornerRadius = config?.borderCornerRadius.takeIf { it != null } ?: defaultBorderCornerRadius | ||
|
||
val primaryBtnBackgroundColor = config?.primaryBtnBackgroundColor.takeIf { it != null } ?: defaultPrimaryBtnBackgroundColor | ||
val primaryBtnTextColor = config?.primaryBtnTextColor.takeIf { it != null } ?: defaultPrimaryBtnTextColor | ||
|
||
val secondaryBtnBackgroundColor = config?.secondaryBtnBackgroundColor.takeIf { it != null } ?: defaultSecondaryBtnBackgroundColor | ||
val secondaryBtnTextColor = config?.secondaryBtnTextColor.takeIf { it != null } ?: defaultSecondaryBtnTextColor | ||
|
||
val titleTextColor = config?.titleTextColor.takeIf { it != null } ?: defaultTitleTextColor | ||
val bodyTextColor = config?.bodyTextColor.takeIf { it != null } ?: defaultBodyTextColor | ||
|
||
val gradientDrawable = GradientDrawable() | ||
|
||
gradientDrawable.setColor(backgroundColor) | ||
gradientDrawable.setStroke(borderWidth, borderColor) | ||
gradientDrawable.cornerRadius = borderCornerRadius | ||
view.setBackgroundDrawable(gradientDrawable) | ||
|
||
val firstButton = view.findViewById<Button>(R.id.embedded_message_first_button) | ||
val secondButton = view.findViewById<Button>(R.id.embedded_message_second_button) | ||
|
||
val titleText = view.findViewById<TextView>(R.id.embedded_message_title) | ||
val bodyText = view.findViewById<TextView>(R.id.embedded_message_body) | ||
|
||
if(config?.primaryBtnBackgroundColor != null) { | ||
val primaryBtnBackgroundDrawable = if(viewType == IterableEmbeddedViewType.NOTIFICATION) | ||
ContextCompat.getDrawable(requireContext(), R.drawable.primary_notification_button_background) as? GradientDrawable | ||
else ContextCompat.getDrawable(requireContext(), R.drawable.primary_banner_button_background) as? GradientDrawable | ||
primaryBtnBackgroundDrawable?.setColor(primaryBtnBackgroundColor) | ||
|
||
firstButton.setBackgroundDrawable(primaryBtnBackgroundDrawable) | ||
} | ||
|
||
if(config?.secondaryBtnBackgroundColor != null) { | ||
val secondaryBtnBackgroundDrawable = if(viewType == IterableEmbeddedViewType.NOTIFICATION) | ||
ContextCompat.getDrawable(requireContext(), R.drawable.secondary_notification_button_background) as? GradientDrawable | ||
else ContextCompat.getDrawable(requireContext(), R.drawable.secondary_banner_button_background) as? GradientDrawable | ||
secondaryBtnBackgroundDrawable?.setColor(secondaryBtnBackgroundColor) | ||
|
||
secondButton.setBackgroundDrawable(secondaryBtnBackgroundDrawable) | ||
} | ||
|
||
firstButton.setTextColor(primaryBtnTextColor) | ||
secondButton.setTextColor(secondaryBtnTextColor) | ||
|
||
titleText.setTextColor(titleTextColor) | ||
bodyText.setTextColor(bodyTextColor) | ||
} | ||
|
||
private fun bind(viewType: IterableEmbeddedViewType, view: View, message: IterableEmbeddedMessage): View { | ||
val embeddedMessageViewTitle: TextView = view.findViewById(R.id.embedded_message_title) | ||
val embeddedMessageViewBody: TextView = view.findViewById(R.id.embedded_message_body) | ||
val embeddedMessageViewButton: Button = view.findViewById(R.id.embedded_message_first_button) | ||
val embeddedMessageViewButton2: Button = view.findViewById(R.id.embedded_message_second_button) | ||
|
||
if(viewType != IterableEmbeddedViewType.NOTIFICATION) { | ||
val embeddedMessageImageView: ImageView = view.findViewById(R.id.embedded_message_image) | ||
|
||
if(message.elements?.mediaURL?.isEmpty() == true) { | ||
embeddedMessageImageView.visibility = View.GONE | ||
} else { | ||
Glide.with(view.context).load(message.elements?.mediaURL).into(embeddedMessageImageView) | ||
embeddedMessageImageView.contentDescription = message.elements?.mediaUrlCaption | ||
} | ||
} | ||
|
||
embeddedMessageViewTitle.text = message.elements?.title | ||
embeddedMessageViewBody.text = message.elements?.body | ||
|
||
val buttons = message.elements?.buttons | ||
|
||
if (buttons != null) { | ||
setButton(embeddedMessageViewButton, buttons.getOrNull(0), message) | ||
|
||
if (buttons.size > 1) { | ||
setButton(embeddedMessageViewButton2, buttons.getOrNull(1), message) | ||
} else { | ||
embeddedMessageViewButton2.visibility = View.GONE | ||
} | ||
|
||
} else { | ||
embeddedMessageViewButton.visibility = View.GONE | ||
embeddedMessageViewButton2.visibility = View.GONE | ||
} | ||
|
||
return view | ||
} | ||
|
||
private fun setDefaultAction(view: View, message: IterableEmbeddedMessage) { | ||
if(message.elements?.defaultAction != null) { | ||
val clickedUrl = message.elements?.defaultAction?.data.takeIf { it?.isNotEmpty() == true } ?: message.elements?.defaultAction?.type | ||
|
||
view.setOnClickListener { | ||
IterableApi.getInstance().embeddedManager.handleEmbeddedClick(message, null, clickedUrl) | ||
IterableApi.getInstance().trackEmbeddedClick(message, null, clickedUrl) | ||
} | ||
} | ||
} | ||
|
||
private fun setButton(buttonView: Button, button: EmbeddedMessageElementsButton?, message: IterableEmbeddedMessage) { | ||
buttonView.visibility = if (button?.title == null) View.GONE else View.VISIBLE | ||
buttonView.text = button?.title.orEmpty() | ||
|
||
val clickedUrl = if (button?.action?.data?.isNotEmpty() == true) button.action?.data else button?.action?.type | ||
|
||
buttonView.setOnClickListener { | ||
IterableApi.getInstance().embeddedManager.handleEmbeddedClick(message, button?.id, clickedUrl) | ||
IterableApi.getInstance().trackEmbeddedClick(message, button?.id, clickedUrl) | ||
} | ||
} | ||
|
||
private fun getDefaultColor(viewType: IterableEmbeddedViewType, notificationColor: Int, cardColor: Int, bannerColor: Int): Int { | ||
return when (viewType) { | ||
IterableEmbeddedViewType.NOTIFICATION -> ContextCompat.getColor(requireContext(), notificationColor) | ||
IterableEmbeddedViewType.CARD -> ContextCompat.getColor(requireContext(), cardColor) | ||
else -> ContextCompat.getColor(requireContext(), bannerColor) | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...leapi-ui/src/main/java/com/iterable/iterableapi/ui/embedded/IterableEmbeddedViewConfig.kt
This file contains hidden or 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,16 @@ | ||
package com.iterable.iterableapi.ui.embedded | ||
|
||
import android.graphics.Color | ||
|
||
data class IterableEmbeddedViewConfig( | ||
val backgroundColor: Int?, | ||
val borderColor: Int?, | ||
val borderWidth: Int?, | ||
val borderCornerRadius: Float?, | ||
val primaryBtnBackgroundColor: Int?, | ||
val primaryBtnTextColor: Int?, | ||
val secondaryBtnBackgroundColor: Int?, | ||
val secondaryBtnTextColor: Int?, | ||
val titleTextColor: Int?, | ||
val bodyTextColor: Int? | ||
) |
7 changes: 7 additions & 0 deletions
7
...ableapi-ui/src/main/java/com/iterable/iterableapi/ui/embedded/IterableEmbeddedViewType.kt
This file contains hidden or 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,7 @@ | ||
package com.iterable.iterableapi.ui.embedded | ||
|
||
public enum class IterableEmbeddedViewType { | ||
BANNER, | ||
CARD, | ||
NOTIFICATION | ||
} |
13 changes: 13 additions & 0 deletions
13
iterableapi-ui/src/main/res/drawable/banner_card_border.xml
This file contains hidden or 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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<stroke | ||
android:width="1dp" | ||
android:color="@color/banner_border_color" /> | ||
|
||
<solid android:color="@color/banner_background_color" /> | ||
|
||
<corners | ||
android:radius="8dp" /> | ||
</shape> |
This file contains hidden or 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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shapeable | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="#FFFFFF" /> | ||
<corners | ||
android:topLeftRadius="16dp" | ||
android:topRightRadius="16dp" | ||
android:bottomLeftRadius="0dp" | ||
android:bottomRightRadius="0dp" | ||
/> | ||
</shapeable> |
13 changes: 13 additions & 0 deletions
13
iterableapi-ui/src/main/res/drawable/notification_view_border.xml
This file contains hidden or 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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<stroke | ||
android:width="1dp" | ||
android:color="@color/notification_background_color" /> | ||
|
||
<solid android:color="@color/notification_border_color" /> | ||
|
||
<corners | ||
android:radius="8dp" /> | ||
</shape> |
9 changes: 9 additions & 0 deletions
9
iterableapi-ui/src/main/res/drawable/primary_banner_button_background.xml
This file contains hidden or 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,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<solid android:color="@color/banner_button_color" /> | ||
|
||
<corners | ||
android:radius="32dp" /> | ||
</shape> |
13 changes: 13 additions & 0 deletions
13
iterableapi-ui/src/main/res/drawable/primary_card_button_background.xml
This file contains hidden or 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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<solid android:color="@color/white" /> | ||
|
||
<stroke | ||
android:width="1dp" | ||
android:color="@color/white" /> | ||
|
||
<corners | ||
android:radius="32dp" /> | ||
</shape> |
13 changes: 13 additions & 0 deletions
13
iterableapi-ui/src/main/res/drawable/primary_notification_button_background.xml
This file contains hidden or 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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<solid android:color="@color/white" /> | ||
|
||
<stroke | ||
android:width="1dp" | ||
android:color="@color/notification_button_border_color" /> | ||
|
||
<corners | ||
android:radius="32dp" /> | ||
</shape> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glide library can be discarded. Good that for now its in api-ui and not the api.