diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java index 9697c4da7e8132..95fafd3c5e2b65 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevLoadingViewController.java @@ -22,10 +22,11 @@ import com.facebook.react.R; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.common.ReactConstants; +import com.facebook.react.devsupport.interfaces.DevLoadingViewManager; import java.util.Locale; /** Controller to display loading messages on top of the screen. All methods are thread safe. */ -public class DevLoadingViewController { +public class DevLoadingViewController implements DevLoadingViewManager { private static boolean sEnabled = true; private final ReactInstanceDevHelper mReactInstanceManagerHelper; private @Nullable TextView mDevLoadingView; @@ -39,6 +40,7 @@ public DevLoadingViewController(ReactInstanceDevHelper reactInstanceManagerHelpe mReactInstanceManagerHelper = reactInstanceManagerHelper; } + @Override public void showMessage(final String message) { if (!sEnabled) { return; @@ -53,6 +55,7 @@ public void run() { }); } + @Override public void updateProgress( final @Nullable String status, final @Nullable Integer done, final @Nullable Integer total) { if (!sEnabled) { @@ -77,6 +80,7 @@ public void run() { }); } + @Override public void hide() { if (!sEnabled) { return; diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevLoadingViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevLoadingViewManager.java new file mode 100644 index 00000000000000..5b51c4f89258a3 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevLoadingViewManager.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.devsupport.interfaces; + +import androidx.annotation.Nullable; + +/** Interface to display loading messages on top of the screen. */ +public interface DevLoadingViewManager { + + void showMessage(final String message); + + void updateProgress( + final @Nullable String status, final @Nullable Integer done, final @Nullable Integer total); + + void hide(); +}