Class VendorsViewModel
-
- All Implemented Interfaces:
@Singleton() public class VendorsViewModel extends ViewModel
-
-
Field Summary
Fields Modifier and Type Field Description private BooleanignoreVendorDataChangesprivate final List<InternalVendor>allRequiredVendorsprivate final BooleanshouldHandleAllVendorsStateprivate final MutableLiveData<InternalVendor>selectedVendorprivate final MutableLiveData<DidomiToggle.State>selectedVendorConsentStateprivate final MutableLiveData<DidomiToggle.State>selectedVendorLegIntStateprivate final MutableLiveData<Boolean>selectedVendorDeviceStorageDisclosuresLoadedprivate final BooleanshouldHideDidomiLogoprivate final AccessibilitycloseButtonAccessibilityprivate final AccessibilitycloseDetailsButtonAccessibilityprivate final VendorItem.BulkvendorItemBulkprivate final LogoProviderlogoProvider
-
Constructor Summary
Constructors Constructor Description VendorsViewModel(ApiEventsRepository apiEventsRepository, ConfigurationRepository configurationRepository, EventsRepository eventsRepository, LanguagesHelper languagesHelper, ThemeProvider themeProvider, UserChoicesInfoProvider userChoicesInfoProvider, VendorRepository vendorRepository, LogoProvider logoProvider)
-
Method Summary
Modifier and Type Method Description final BooleangetIgnoreVendorDataChanges()final UnitsetIgnoreVendorDataChanges(Boolean ignoreVendorDataChanges)final List<InternalVendor>getAllRequiredVendors()final BooleangetShouldHandleAllVendorsState()final MutableLiveData<InternalVendor>getSelectedVendor()final MutableLiveData<DidomiToggle.State>getSelectedVendorConsentState()final MutableLiveData<DidomiToggle.State>getSelectedVendorLegIntState()final MutableLiveData<Boolean>getSelectedVendorDeviceStorageDisclosuresLoaded()final BooleangetShouldHideDidomiLogo()Return the shouldHideDidomiLogo flag from the app object. final AccessibilitygetCloseButtonAccessibility()final AccessibilitygetCloseDetailsButtonAccessibility()final VendorItem.BulkgetVendorItemBulk()final LogoProvidergetLogoProvider()final UnitsetSelectedVendorConsentState(DidomiToggle.State selectedVendorConsentState)final UnitinitializeSelectedVendorStates(InternalVendor selectedVendor)final UnitsetSelectedVendorLegIntState(DidomiToggle.State selectedVendorLegIntState)final UnitsetSelectedVendor(InternalVendor vendor)final BooleanhasLoadedVendorDeviceStorageDisclosures()Whether device storage disclosures list is currently loaded final UnitloadVendorDeviceStorageDisclosures(InternalVendor vendor)Starts loading asynchronously device storage disclosures list for the specified vendor. final UnittriggerEvent(Event event)Method used to trigger an event through the eventsRepository. final BooleanhasIabDisclaimer(InternalVendor vendor)Whether specified vendor should be displayed as IAB vendor final CharSequencegetVendorNameWithTag(InternalVendor vendor)Get the vendor name with the "IAB TCF" tag, with styled Spans, if needed final Pair<String, List<DataProcessingDisplay>>getConsentDataProcessingDescription(InternalVendor vendor)Get the description of the consent based data processing for a specific vendor final BooleanshouldDisplayDeviceStorageDisclosuresList(InternalVendor vendor)Whether the specified vendor should have a Device storage disclosures section final BooleanshouldDisplayDeviceStorageDisclosuresLink(InternalVendor vendor)Whether the specified vendor should have a Device storage disclosures link final SpannedgetDeviceStorageDisclosuresLink(InternalVendor vendor)Compute device storage link for selected vendor final Pair<String, List<DataProcessingDisplay>>getAdditionalDataProcessingDescription(InternalVendor vendor)Get additional data processing paragraph for a vendor final Pair<String, List<DataProcessingDisplay>>getEssentialPurposesDescription(InternalVendor vendor)Method used to get the essential purposes list formatted with bullets. final Pair<String, List<DataProcessingDisplay>>getLegitimateInterestDataProcessingDescription(InternalVendor vendor)Get the description of the legitimate interest based data processing for a specific vendor final Pair<String, List<DataCategoryDisplay>>getDataCategories(InternalVendor vendor)Get the Data Categories for a selected Vendor final UnitupdateAllVendors(DidomiToggle.State status)Method used to handle the case when the user select or unselect all vendors. final BooleanallVendorsEnabled()Method used to check if all vendors are enabled. final BooleanallVendorsDisabled()Method used to check if all vendors are disabled. final DidomiToggle.StategetVendorSwitchStatus(InternalVendor vendor)Get the status of a vendor final BooleanshouldHandleLegitimateInterestState(InternalVendor vendor)Verify if vendor legitimate interest state can be changed by the user final BooleanshouldHandleConsentState(InternalVendor vendor)Verify if consent state can be changed by the user final BooleanshouldHandleState(InternalVendor vendor)Verify if vendor state can be changed by the user final AccessibilitygetSelectedVendorConsentAccessibility()Accessibility information for vendor details Consent switch final AccessibilitygetSelectedVendorLegIntAccessibility()Accessibility information for vendor details Legitimate Interest switch final UnitonBulkVendorSwitchWasToggled(DidomiToggle.State state)final UnitonVendorSwitchWasToggled()Trigger Vendor changed event final UnitonVendorsWasShown()Trigger Vendor shown event final UnitonGlobalVendorSwitchChanged(InternalVendor vendor, DidomiToggle.State state)final UnithandleVendorConsentSwitchChanged(InternalVendor vendor, DidomiToggle.State consentStatus)final UnithandleVendorLegIntSwitchChanged(InternalVendor vendor, DidomiToggle.State legIntState)final VendorItem.Vendor.DetailedInfogetVendorItemDetails(InternalVendor vendor)Get info specific to the vendor final VendorItem.VendorgetVendorItem(InternalVendor vendor)Get Vendor item with all info final List<VendorItem>getVendorItemList()Get Vendor list item -
-
Constructor Detail
-
VendorsViewModel
VendorsViewModel(ApiEventsRepository apiEventsRepository, ConfigurationRepository configurationRepository, EventsRepository eventsRepository, LanguagesHelper languagesHelper, ThemeProvider themeProvider, UserChoicesInfoProvider userChoicesInfoProvider, VendorRepository vendorRepository, LogoProvider logoProvider)
-
-
Method Detail
-
getIgnoreVendorDataChanges
final Boolean getIgnoreVendorDataChanges()
-
setIgnoreVendorDataChanges
final Unit setIgnoreVendorDataChanges(Boolean ignoreVendorDataChanges)
-
getAllRequiredVendors
final List<InternalVendor> getAllRequiredVendors()
-
getShouldHandleAllVendorsState
final Boolean getShouldHandleAllVendorsState()
-
getSelectedVendor
final MutableLiveData<InternalVendor> getSelectedVendor()
-
getSelectedVendorConsentState
final MutableLiveData<DidomiToggle.State> getSelectedVendorConsentState()
-
getSelectedVendorLegIntState
final MutableLiveData<DidomiToggle.State> getSelectedVendorLegIntState()
-
getSelectedVendorDeviceStorageDisclosuresLoaded
final MutableLiveData<Boolean> getSelectedVendorDeviceStorageDisclosuresLoaded()
-
getShouldHideDidomiLogo
final Boolean getShouldHideDidomiLogo()
Return the shouldHideDidomiLogo flag from the app object.
-
getCloseButtonAccessibility
final Accessibility getCloseButtonAccessibility()
-
getCloseDetailsButtonAccessibility
final Accessibility getCloseDetailsButtonAccessibility()
-
getVendorItemBulk
final VendorItem.Bulk getVendorItemBulk()
-
getLogoProvider
final LogoProvider getLogoProvider()
-
setSelectedVendorConsentState
final Unit setSelectedVendorConsentState(DidomiToggle.State selectedVendorConsentState)
-
initializeSelectedVendorStates
final Unit initializeSelectedVendorStates(InternalVendor selectedVendor)
-
setSelectedVendorLegIntState
final Unit setSelectedVendorLegIntState(DidomiToggle.State selectedVendorLegIntState)
-
setSelectedVendor
final Unit setSelectedVendor(InternalVendor vendor)
-
hasLoadedVendorDeviceStorageDisclosures
final Boolean hasLoadedVendorDeviceStorageDisclosures()
Whether device storage disclosures list is currently loaded
-
loadVendorDeviceStorageDisclosures
final Unit loadVendorDeviceStorageDisclosures(InternalVendor vendor)
Starts loading asynchronously device storage disclosures list for the specified vendor. Use hasLoadedVendorDeviceStorageDisclosures to be notified when loading is complete.
-
triggerEvent
final Unit triggerEvent(Event event)
Method used to trigger an event through the eventsRepository.
- Parameters:
event- event to be triggered.
-
hasIabDisclaimer
final Boolean hasIabDisclaimer(InternalVendor vendor)
Whether specified vendor should be displayed as IAB vendor
- Parameters:
vendor- the vendor to check
-
getVendorNameWithTag
final CharSequence getVendorNameWithTag(InternalVendor vendor)
Get the vendor name with the "IAB TCF" tag, with styled Spans, if needed
- Parameters:
vendor- the specified vendor
-
getConsentDataProcessingDescription
final Pair<String, List<DataProcessingDisplay>> getConsentDataProcessingDescription(InternalVendor vendor)
Get the description of the consent based data processing for a specific vendor
- Parameters:
vendor- vendor from which we want to get the description.
-
shouldDisplayDeviceStorageDisclosuresList
final Boolean shouldDisplayDeviceStorageDisclosuresList(InternalVendor vendor)
Whether the specified vendor should have a Device storage disclosures section
- Parameters:
vendor- as InternalVendor
-
shouldDisplayDeviceStorageDisclosuresLink
final Boolean shouldDisplayDeviceStorageDisclosuresLink(InternalVendor vendor)
Whether the specified vendor should have a Device storage disclosures link
- Parameters:
vendor- as InternalVendor
-
getDeviceStorageDisclosuresLink
final Spanned getDeviceStorageDisclosuresLink(InternalVendor vendor)
Compute device storage link for selected vendor
- Parameters:
vendor- as InternalVendor
-
getAdditionalDataProcessingDescription
final Pair<String, List<DataProcessingDisplay>> getAdditionalDataProcessingDescription(InternalVendor vendor)
Get additional data processing paragraph for a vendor
- Parameters:
vendor- as InternalVendor
-
getEssentialPurposesDescription
final Pair<String, List<DataProcessingDisplay>> getEssentialPurposesDescription(InternalVendor vendor)
Method used to get the essential purposes list formatted with bullets.
- Parameters:
vendor- the vendor to display
-
getLegitimateInterestDataProcessingDescription
final Pair<String, List<DataProcessingDisplay>> getLegitimateInterestDataProcessingDescription(InternalVendor vendor)
Get the description of the legitimate interest based data processing for a specific vendor
- Parameters:
vendor- vendor from which we want to get the description.
-
getDataCategories
final Pair<String, List<DataCategoryDisplay>> getDataCategories(InternalVendor vendor)
Get the Data Categories for a selected Vendor
- Parameters:
vendor- the selected InternalVendor
-
updateAllVendors
final Unit updateAllVendors(DidomiToggle.State status)
Method used to handle the case when the user select or unselect all vendors.
-
allVendorsEnabled
final Boolean allVendorsEnabled()
Method used to check if all vendors are enabled.
-
allVendorsDisabled
final Boolean allVendorsDisabled()
Method used to check if all vendors are disabled.
-
getVendorSwitchStatus
final DidomiToggle.State getVendorSwitchStatus(InternalVendor vendor)
Get the status of a vendor
- Parameters:
vendor- affected vendor
-
shouldHandleLegitimateInterestState
final Boolean shouldHandleLegitimateInterestState(InternalVendor vendor)
Verify if vendor legitimate interest state can be changed by the user
-
shouldHandleConsentState
final Boolean shouldHandleConsentState(InternalVendor vendor)
Verify if consent state can be changed by the user
-
shouldHandleState
final Boolean shouldHandleState(InternalVendor vendor)
Verify if vendor state can be changed by the user
-
getSelectedVendorConsentAccessibility
final Accessibility getSelectedVendorConsentAccessibility()
Accessibility information for vendor details Consent switch
-
getSelectedVendorLegIntAccessibility
final Accessibility getSelectedVendorLegIntAccessibility()
Accessibility information for vendor details Legitimate Interest switch
-
onBulkVendorSwitchWasToggled
final Unit onBulkVendorSwitchWasToggled(DidomiToggle.State state)
-
onVendorSwitchWasToggled
final Unit onVendorSwitchWasToggled()
Trigger Vendor changed event
-
onVendorsWasShown
final Unit onVendorsWasShown()
Trigger Vendor shown event
-
onGlobalVendorSwitchChanged
final Unit onGlobalVendorSwitchChanged(InternalVendor vendor, DidomiToggle.State state)
-
handleVendorConsentSwitchChanged
final Unit handleVendorConsentSwitchChanged(InternalVendor vendor, DidomiToggle.State consentStatus)
-
handleVendorLegIntSwitchChanged
final Unit handleVendorLegIntSwitchChanged(InternalVendor vendor, DidomiToggle.State legIntState)
-
getVendorItemDetails
final VendorItem.Vendor.DetailedInfo getVendorItemDetails(InternalVendor vendor)
Get info specific to the vendor
- Parameters:
vendor- as InternalVendor
-
getVendorItem
final VendorItem.Vendor getVendorItem(InternalVendor vendor)
Get Vendor item with all info
- Parameters:
vendor- as InternalVendor
-
getVendorItemList
final List<VendorItem> getVendorItemList()
Get Vendor list item
-
-
-
-