add debug overlay

Reviewed By: achen1

Differential Revision: D5659422

fbshipit-source-id: e95ed85884700b5e9bd084152e2cc89085fa66ad
This commit is contained in:
Aaron Chiu 2017-08-30 01:57:32 -07:00 committed by Facebook Github Bot
parent ccc11f2f30
commit e9d7711847
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,12 @@
include_defs("//ReactAndroid/DEFS")
android_library(
name = "debugoverlay",
srcs = glob(["*.java"]),
visibility = [
"PUBLIC",
],
deps = [
react_native_dep("third-party/java/jsr-305:jsr-305"),
],
)

View File

@ -0,0 +1,25 @@
// Copyright 2004-present Facebook. All Rights Reserved.
package com.facebook.debug.debugoverlay;
import javax.annotation.concurrent.Immutable;
/** Tag for a debug overlay log message. Name must be unique. */
@Immutable
public class DebugOverlayTag {
/** Name of tag. */
public final String name;
/** Description to display in settings. */
public final String description;
/** Color for tag display. */
public final int color;
public DebugOverlayTag(String name, String description, int color) {
this.name = name;
this.description = description;
this.color = color;
}
}

View File

@ -0,0 +1,13 @@
include_defs("//ReactAndroid/DEFS")
android_library(
name = "tags",
srcs = glob(["*.java"]),
visibility = [
"PUBLIC",
],
deps = [
react_native_dep("java/com/facebook/debug/debugoverlay:debugoverlay"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
],
)

View File

@ -0,0 +1,13 @@
// Copyright 2004-present Facebook. All Rights Reserved.
package com.facebook.debug.tags;
import android.graphics.Color;
import com.facebook.debug.debugoverlay.DebugOverlayTag;
/** Category for debug overlays. */
public class ReactDebugOverlayTags {
public static final DebugOverlayTag PERFORMANCE =
new DebugOverlayTag("Performance", "Markers for Performance", Color.GREEN);
}