File tree Expand file tree Collapse file tree 2 files changed +23
-32
lines changed
ReactAndroid/src/main/java/com/facebook/react/devsupport Expand file tree Collapse file tree 2 files changed +23
-32
lines changed Original file line number Diff line number Diff line change 22
22
import com .facebook .react .R ;
23
23
import com .facebook .react .bridge .UiThreadUtil ;
24
24
import com .facebook .react .common .ReactConstants ;
25
- import java .net .MalformedURLException ;
26
- import java .net .URL ;
27
25
import java .util .Locale ;
28
26
29
27
/** Controller to display loading messages on top of the screen. All methods are thread safe. */
@@ -55,34 +53,6 @@ public void run() {
55
53
});
56
54
}
57
55
58
- public void showForUrl (String url ) {
59
- Context context = getContext ();
60
- if (context == null ) {
61
- return ;
62
- }
63
-
64
- URL parsedURL ;
65
- try {
66
- parsedURL = new URL (url );
67
- } catch (MalformedURLException e ) {
68
- FLog .e (ReactConstants .TAG , "Bundle url format is invalid. \n \n " + e .toString ());
69
- return ;
70
- }
71
-
72
- int port = parsedURL .getPort () != -1 ? parsedURL .getPort () : parsedURL .getDefaultPort ();
73
- showMessage (
74
- context .getString (R .string .catalyst_loading_from_url , parsedURL .getHost () + ":" + port ));
75
- }
76
-
77
- public void showForRemoteJSEnabled () {
78
- Context context = getContext ();
79
- if (context == null ) {
80
- return ;
81
- }
82
-
83
- showMessage (context .getString (R .string .catalyst_debug_connecting ));
84
- }
85
-
86
56
public void updateProgress (
87
57
final @ Nullable String status , final @ Nullable Integer done , final @ Nullable Integer total ) {
88
58
if (!sEnabled ) {
Original file line number Diff line number Diff line change @@ -752,13 +752,34 @@ protected ReactInstanceDevHelper getReactInstanceDevHelper() {
752
752
753
753
@ UiThread
754
754
private void showDevLoadingViewForUrl (String bundleUrl ) {
755
- mDevLoadingViewController .showForUrl (bundleUrl );
755
+ if (mApplicationContext == null ) {
756
+ return ;
757
+ }
758
+
759
+ URL parsedURL ;
760
+
761
+ try {
762
+ parsedURL = new URL (bundleUrl );
763
+ } catch (MalformedURLException e ) {
764
+ FLog .e (ReactConstants .TAG , "Bundle url format is invalid. \n \n " + e .toString ());
765
+ return ;
766
+ }
767
+
768
+ int port = parsedURL .getPort () != -1 ? parsedURL .getPort () : parsedURL .getDefaultPort ();
769
+ mDevLoadingViewController .showMessage (
770
+ mApplicationContext .getString (
771
+ R .string .catalyst_loading_from_url , parsedURL .getHost () + ":" + port ));
756
772
mDevLoadingViewVisible = true ;
757
773
}
758
774
759
775
@ UiThread
760
776
protected void showDevLoadingViewForRemoteJSEnabled () {
761
- mDevLoadingViewController .showForRemoteJSEnabled ();
777
+ if (mApplicationContext == null ) {
778
+ return ;
779
+ }
780
+
781
+ mDevLoadingViewController .showMessage (
782
+ mApplicationContext .getString (R .string .catalyst_debug_connecting ));
762
783
mDevLoadingViewVisible = true ;
763
784
}
764
785
You can’t perform that action at this time.
0 commit comments