Protection

abstract class Protection(source)

An abstract class which describes a layer to be placed on the content of a window and underneath the system bar (which has a transparent background) to ensure the readability of the foreground elements (e.g., text, icons, ..., etc) of the system bar.

Concrete derived classes would describe how the protection should be drawn by supplying the Drawable.

The object of this class is stateful, and can only be used by one ProtectionLayout at a time.

See also

Inheritors

Constructors

Link copied to clipboard
constructor(side: Int)
Creates an instance associated with a WindowInsetsCompat.Side.

Functions

Link copied to clipboard
open fun animateAlpha(toAlpha: Float)
Animates the alpha from the current value to the specified one.
Link copied to clipboard
open fun animateInsetsAmount(toInsetsAmount: Float)
Animates the insets amount from the current value to the specified one.
Link copied to clipboard
@FloatRange(from = 0.0, to = 1.0)
open fun getAlpha(): Float
Gets the opacity of the protection.
Link copied to clipboard
open fun getInsetAmount(): Float
Gets the depth of the protection.
Link copied to clipboard
open fun getSide(): Int
Gets the side of this protection.
Link copied to clipboard
open fun setAlpha(@FloatRange(from = 0.0, to = 1.0) alpha: Float)
Sets the opacity of the protection to a value from 0 to 1, where 0 means the protection is completely transparent and 1 means the protection is completely opaque.
Link copied to clipboard
open fun setInsetAmount(@FloatRange(from = 0.0, to = 1.0) insetAmount: Float)
Sets the depth of the protection to a value from 0 to 1, where 0 means the protection is completely outside the window and 1 means the protection is completely inside the window.