PreferenceManager.SimplePreferenceComparisonCallback


class PreferenceManager.SimplePreferenceComparisonCallback : PreferenceManager.PreferenceComparisonCallback


A basic implementation of PreferenceComparisonCallback suitable for use with the default Preference classes. If the PreferenceScreen contains custom Preference subclasses, you must override arePreferenceContentsTheSame.

Summary

Public constructors

Public functions

Boolean

Called to determine if two objects will display the same data

Boolean

Called to determine if two objects represent the same item

Public constructors

SimplePreferenceComparisonCallback

Added in 1.0.0
SimplePreferenceComparisonCallback()

Public functions

arePreferenceContentsTheSame

Added in 1.3.0-alpha01
fun arePreferenceContentsTheSame(p1: Preference, p2: Preference): Boolean

Called to determine if two objects will display the same data

The result of this method is only valid for the default Preference objects, and custom subclasses which do not override onBindViewHolder. This method also assumes that if a preference object is being replaced by a new instance, the old instance was not modified after being removed from its containing PreferenceGroup.

arePreferenceItemsTheSame

Added in 1.3.0-alpha01
fun arePreferenceItemsTheSame(p1: Preference, p2: Preference): Boolean

Called to determine if two objects represent the same item

This method will not be able to track replaced Preference objects if they do not have a unique key.

See also
setKey