SettingSDKModeActivity

public final class SettingSDKModeActivity extends AppCompatActivity

SettingSDKModeActivity is responsible for managing the SDK mode. It allows the user to switch between Online and Offline modes, displays relevant UI elements, and ensures the SDK is initialized accordingly.

Constructors

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
private <Error class: unknown class> binding
Link copied to clipboard

Functions

Link copied to clipboard
private final <Error class: unknown class> getBinding()
Link copied to clipboard
private final Unit initSDK()

Initializes the SDK in a background thread and shows a loading dialog. This ensures the SDK is set up correctly after switching modes.

Link copied to clipboard
protected Unit onCreate(Bundle savedInstanceState)

Called when the activity is created. Initializes the UI, sets up the touch handling and listeners.

Link copied to clipboard
protected Unit onResume()

Called when the activity is resumed. Validates the current SDK mode and updates the UI accordingly.

Link copied to clipboard
private final Unit setBinding(<Error class: unknown class> binding)
Link copied to clipboard
private final Unit setButtonState(SdkMode mode)

Sets the button state for Online and Offline buttons based on the current SDK mode.

Link copied to clipboard
private final Unit setupListeners()

Sets up the listeners for UI elements like buttons and icons.

Link copied to clipboard
private final Unit setupUI()

Initializes the UI based on the current SDK mode.

Link copied to clipboard
private final Unit showPrivacyDialog(String heading, String description)

Displays the privacy policy information in a BottomSheetDialog.

Link copied to clipboard
private final Unit switchToOfflineMode()

Switches the SDK mode to Offline and reinitializes the SDK if the model file exists. If the model file doesn't exist, it starts the DownloadProgressActivity.

Link copied to clipboard
private final Unit switchToOnlineMode()

Switches the SDK mode to Online and reinitializes the SDK if needed.

Link copied to clipboard
private final Unit validateSDKMode()

Validates the current SDK mode and ensures that if the mode is Offline, the necessary model file exists. If not, it switches the mode to Online.