mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
add some RN Core markers
Reviewed By: achen1 Differential Revision: D5740438 fbshipit-source-id: eca6160e0ff9089e1f70ead0f2269ce152258c19
This commit is contained in:
committed by
Facebook Github Bot
parent
7fab093fc8
commit
6c2c2ecd8c
+1
-1
@@ -1,7 +1,7 @@
|
||||
include_defs("//ReactAndroid/DEFS")
|
||||
|
||||
android_library(
|
||||
name = "debugoverlay",
|
||||
name = "model",
|
||||
srcs = glob(["*.java"]),
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
package com.facebook.debug.debugoverlay;
|
||||
package com.facebook.debug.debugoverlay.model;
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
include_defs("//ReactAndroid/DEFS")
|
||||
|
||||
android_library(
|
||||
name = "holder",
|
||||
srcs = glob(["*.java"]),
|
||||
exported_deps = [
|
||||
react_native_dep("java/com/facebook/debug/debugoverlay/model:model"),
|
||||
],
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
react_native_dep("third-party/java/jsr-305:jsr-305"),
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
package com.facebook.debug.holder;
|
||||
|
||||
import com.facebook.debug.debugoverlay.model.DebugOverlayTag;
|
||||
|
||||
/** No-op implementation of {@link Printer}. */
|
||||
public class NoopPrinter implements Printer {
|
||||
|
||||
public static final NoopPrinter INSTANCE = new NoopPrinter();
|
||||
|
||||
private NoopPrinter() {}
|
||||
|
||||
@Override
|
||||
public void logMessage(DebugOverlayTag tag, String message, Object... args) {}
|
||||
|
||||
@Override
|
||||
public void logMessage(DebugOverlayTag tag, String message) {}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
package com.facebook.debug.holder;
|
||||
|
||||
import com.facebook.debug.debugoverlay.model.DebugOverlayTag;
|
||||
|
||||
/** Interface to pass data to debugging tools. */
|
||||
public interface Printer {
|
||||
|
||||
void logMessage(final DebugOverlayTag tag, final String message, Object... args);
|
||||
|
||||
void logMessage(final DebugOverlayTag tag, final String message);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
package com.facebook.debug.holder;
|
||||
|
||||
/** Holder for debugging tool instance. */
|
||||
public class PrinterHolder {
|
||||
|
||||
private static Printer sPrinter = NoopPrinter.INSTANCE;
|
||||
|
||||
public static void setPrinter(Printer printer) {
|
||||
if (printer == null) {
|
||||
sPrinter = NoopPrinter.INSTANCE;
|
||||
} else {
|
||||
sPrinter = printer;
|
||||
}
|
||||
}
|
||||
|
||||
public static Printer getPrinter() {
|
||||
return sPrinter;
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,13 @@ include_defs("//ReactAndroid/DEFS")
|
||||
android_library(
|
||||
name = "tags",
|
||||
srcs = glob(["*.java"]),
|
||||
exported_deps = [
|
||||
react_native_dep("java/com/facebook/debug/debugoverlay/model:model"),
|
||||
],
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
react_native_dep("java/com/facebook/debug/debugoverlay:debugoverlay"),
|
||||
react_native_dep("third-party/java/jsr-305:jsr-305"),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
package com.facebook.debug.tags;
|
||||
|
||||
import android.graphics.Color;
|
||||
import com.facebook.debug.debugoverlay.DebugOverlayTag;
|
||||
import com.facebook.debug.debugoverlay.model.DebugOverlayTag;
|
||||
|
||||
/** Category for debug overlays. */
|
||||
public class ReactDebugOverlayTags {
|
||||
@@ -12,4 +12,6 @@ public class ReactDebugOverlayTags {
|
||||
new DebugOverlayTag("Performance", "Markers for Performance", Color.GREEN);
|
||||
public static final DebugOverlayTag NAVIGATION =
|
||||
new DebugOverlayTag("Navigation", "Tag for navigation", Color.rgb(0x9C, 0x27, 0xB0));
|
||||
public static final DebugOverlayTag RN_CORE =
|
||||
new DebugOverlayTag("RN Core", "Tag for React Native Core", Color.BLACK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user