Interface Lock
class InterfaceLock(lifecycle: Lifecycle, group: InterfaceLock.Group = Group())
Content copied to clipboard
Locking for user interface operations.
Use an instance of this class to ensure user interactions are ignored while a user-initiated operation is already running.
Each instance of InterfaceLock is a member of a Group and if no group parameter is provided to the constructor a new group is created by default. Only a single operation can be running across all InterfaceLock instances in the same group. Additional operations are not run until the currently running one completes.
Since the runExclusively is not blocking or suspending, you can monitor the progress using the state and observeState properties.
Constructors
Link copied to clipboard
fun InterfaceLock(lifecycle: Lifecycle, group: InterfaceLock.Group = Group())
Content copied to clipboard
Types
Functions
Link copied to clipboard
Link copied to clipboard
While the supplied work is running, this lock is considered taken and all other invocations of this method will just return, doing nothing.