Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
471 changes: 453 additions & 18 deletions Libraries/Animated/src/AnimatedImplementation.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,17 @@ dependencies {
compile 'com.squareup.okhttp:okhttp-ws:2.5.0'
compile 'com.squareup.okio:okio:1.6.0'
compile 'org.webkit:android-jsc:r174650'
compile 'com.facebook.rebound:rebound:0.3.8'

testCompile "junit:junit:${JUNIT_VERSION}"
/*testCompile "junit:junit:${JUNIT_VERSION}"
testCompile "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"
testCompile "org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}"
testCompile "org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}"
testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
testCompile "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}"
testCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"

androidTestCompile "com.android.support.test:testing-support-lib:0.1"
androidTestCompile "com.android.support.test:testing-support-lib:0.1"*/
}

apply from: 'release.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package com.facebook.react.bridge;

import javax.annotation.Nullable;
import javax.annotation.OverridingMethodsMustInvokeSuper;

import java.io.IOException;
import java.io.StringWriter;
Expand Down Expand Up @@ -450,6 +451,15 @@ public void onBatchComplete() {

decrementPendingJSCalls();
}

@Override
public void onBatchStarted() {
mCatalystQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();

if (!mDestroyed) {
mJavaRegistry.onBatchStarted();
}
}
}

private class NativeExceptionHandler implements QueueThreadExceptionHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
/**
* Interface for a module that will be notified when a batch of JS->Java calls has finished.
*/
public interface OnBatchCompleteListener {
public interface JSBatchListener {

void onBatchComplete();
void onBatchStarted();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ public class NativeModuleRegistry {

private final List<ModuleDefinition> mModuleTable;
private final Map<Class<? extends NativeModule>, NativeModule> mModuleInstances;
private final ArrayList<OnBatchCompleteListener> mBatchCompleteListenerModules;
private final ArrayList<JSBatchListener> mJSBatchCompleteListeners;

private NativeModuleRegistry(
List<ModuleDefinition> moduleTable,
Map<Class<? extends NativeModule>, NativeModule> moduleInstances) {
mModuleTable = moduleTable;
mModuleInstances = moduleInstances;

mBatchCompleteListenerModules = new ArrayList<OnBatchCompleteListener>(mModuleTable.size());
mJSBatchCompleteListeners = new ArrayList<>(mModuleTable.size());
for (int i = 0; i < mModuleTable.size(); i++) {
ModuleDefinition definition = mModuleTable.get(i);
if (definition.target instanceof OnBatchCompleteListener) {
mBatchCompleteListenerModules.add((OnBatchCompleteListener) definition.target);
if (definition.target instanceof JSBatchListener) {
mJSBatchCompleteListeners.add((JSBatchListener) definition.target);
}
}
}
Expand Down Expand Up @@ -115,8 +115,14 @@ private NativeModuleRegistry(
}

public void onBatchComplete() {
for (int i = 0; i < mBatchCompleteListenerModules.size(); i++) {
mBatchCompleteListenerModules.get(i).onBatchComplete();
for (int i = 0; i < mJSBatchCompleteListeners.size(); i++) {
mJSBatchCompleteListeners.get(i).onBatchComplete();
}
}

public void onBatchStarted() {
for (int i = 0; i < mJSBatchCompleteListeners.size(); i++) {
mJSBatchCompleteListeners.get(i).onBatchStarted();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ public interface ReactCallback {

@DoNotStrip
void onBatchComplete();

@DoNotStrip
void onBatchStarted();
}
Loading