public class ConsentNoticeViewModel extends BaseViewModel
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConsentNoticeViewModel.DisagreeButtonType |
BaseViewModel.VoidAsyncTask| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationRepository |
configurationRepository |
static int |
DISAGREE_HIGHLIGHT
Disagree button should be displayed as a primary button
|
static int |
DISAGREE_LINK
Disagree button should be displayed as a link
|
static int |
DISAGREE_NONE
Disagree button should not be displayed
|
static int |
DISAGREE_REGULAR
Disagree button should be displayed as a secondary button
|
protected io.didomi.sdk.resources.LanguagesHelper |
languagesHelper |
protected androidx.lifecycle.MutableLiveData<android.graphics.Bitmap> |
logoBitmapLiveData |
protected androidx.lifecycle.MutableLiveData<java.lang.Integer> |
logoResourceLiveData |
protected io.didomi.sdk.resources.ResourcesHelper |
resourcesHelper |
| Constructor and Description |
|---|
ConsentNoticeViewModel(ConfigurationRepository configurationRepository,
EventsRepository eventsRepository,
io.didomi.sdk.resources.LanguagesHelper languagesHelper,
io.didomi.sdk.resources.ResourcesHelper resourcesHelper) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAgreeButtonLabel()
Method used to get the translated label for the agree button.
|
java.lang.String |
getBannerContentText()
Method used to get the translated content text for the notice banner view.
|
java.lang.CharSequence |
getDisagreeButtonLabel(boolean asLink)
Method used to get the translated label for the disagree button.
|
int |
getDisagreeButtonType()
Get the type of disagree button
|
android.graphics.drawable.GradientDrawable |
getHighlightBackground()
Getter method for highlightBackground.
|
int |
getHighlightTextColor()
Getter method for highlightTextColor.
|
boolean |
getIsLinkColorSet()
Getter method for isLinkColorSet flag.
|
java.lang.CharSequence |
getLearnMoreButtonLabel(boolean asLink)
Method used to get the translated label for the learn more button.
|
int |
getLinkColor()
Getter method for linkColor.
|
androidx.lifecycle.MutableLiveData<android.graphics.Bitmap> |
getLogoBitmapLiveData() |
androidx.lifecycle.MutableLiveData<java.lang.Integer> |
getLogoResourceLiveData() |
java.lang.String |
getPartnersButtonLabel()
Method used to get the translated label for the partners button.
|
java.lang.String |
getPopupContentText()
Method used to get the translated content text for the notice popup view.
|
java.lang.String |
getPrivacyButtonLabel()
Method used to get the translated label for the privacy policy button.
|
android.graphics.drawable.GradientDrawable |
getRegularBackground()
Getter method for regularBackground.
|
int |
getRegularTextColor()
Getter method for regularTextColor.
|
java.lang.CharSequence |
getVendorsViewLabel()
Method used to get the text that goes in the vendors view.
|
boolean |
hasVendorLink(java.lang.String contentText)
Check if the text contains a link to the vendors page
|
void |
onAgreeButtonClicked() |
void |
onDisagreeButtonClicked() |
void |
onLearnMoreButtonClicked() |
void |
onPartnersButtonClicked() |
void |
triggerEvent(Event event)
Method used to trigger an event through the eventsRepository.
|
void |
updateLogo() |
runAsyncpublic static final int DISAGREE_NONE
public static final int DISAGREE_REGULAR
public static final int DISAGREE_HIGHLIGHT
public static final int DISAGREE_LINK
protected ConfigurationRepository configurationRepository
protected io.didomi.sdk.resources.LanguagesHelper languagesHelper
protected io.didomi.sdk.resources.ResourcesHelper resourcesHelper
protected final androidx.lifecycle.MutableLiveData<java.lang.Integer> logoResourceLiveData
protected final androidx.lifecycle.MutableLiveData<android.graphics.Bitmap> logoBitmapLiveData
public ConsentNoticeViewModel(ConfigurationRepository configurationRepository, EventsRepository eventsRepository, io.didomi.sdk.resources.LanguagesHelper languagesHelper, io.didomi.sdk.resources.ResourcesHelper resourcesHelper)
public androidx.lifecycle.MutableLiveData<java.lang.Integer> getLogoResourceLiveData()
public androidx.lifecycle.MutableLiveData<android.graphics.Bitmap> getLogoBitmapLiveData()
public android.graphics.drawable.GradientDrawable getHighlightBackground()
public android.graphics.drawable.GradientDrawable getRegularBackground()
public int getHighlightTextColor()
public int getRegularTextColor()
public int getLinkColor()
public boolean getIsLinkColorSet()
public void triggerEvent(Event event)
event - event to be triggered.public java.lang.CharSequence getLearnMoreButtonLabel(boolean asLink)
asLink - true if button has the link appearancepublic java.lang.CharSequence getDisagreeButtonLabel(boolean asLink)
asLink - true if button has the link appearancepublic int getDisagreeButtonType()
DISAGREE_NONE, DISAGREE_REGULAR,
DISAGREE_HIGHLIGHT, DISAGREE_LINKpublic java.lang.String getAgreeButtonLabel()
public java.lang.String getPrivacyButtonLabel()
public java.lang.String getPartnersButtonLabel()
public java.lang.String getBannerContentText()
public java.lang.String getPopupContentText()
public java.lang.CharSequence getVendorsViewLabel()
public boolean hasVendorLink(java.lang.String contentText)
contentText - the notice or popup content textpublic void onLearnMoreButtonClicked()
public void onAgreeButtonClicked()
public void onDisagreeButtonClicked()
public void updateLogo()
public void onPartnersButtonClicked()