-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FpsListener to React Scroll Views
Summary: We want to give people the ability to log scroll performance (including Fb). This adds an interface that can be enabled and disabled from the react scroll views. This is a prerequisite to implementing the actual framerate logger that will log dropped frames while scrolling in prod. Reviewed By: astreet Differential Revision: D3283588 fbshipit-source-id: ed9736cb9ed3f441511647f36b1460092bd91e56
- Loading branch information
Nathan Spaun
authored and
Facebook Github Bot 5
committed
May 13, 2016
1 parent
fd37666
commit b67d4a2
Showing
6 changed files
with
158 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ReactAndroid/src/main/java/com/facebook/react/views/scroll/FpsListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
package com.facebook.react.views.scroll; | ||
|
||
public interface FpsListener { | ||
|
||
/** | ||
* Clients should call this method when they want the listener to begin recording data. | ||
* | ||
* @param tag | ||
*/ | ||
void enable(String tag); | ||
|
||
/** | ||
* Clients should call this method when they want the listener to stop recording data. | ||
* The listener will then report the data it collected. | ||
* | ||
* Calling disable on a listener that has already been disabled is a no-op. | ||
* | ||
* @param tag | ||
*/ | ||
void disable(String tag); | ||
|
||
/** | ||
* Reports whether this listener is recording data. | ||
*/ | ||
boolean isEnabled(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters