More prep for ComponentContext not extending Context

Summary: Per title

Reviewed By: astreet

Differential Revision: D12839032

fbshipit-source-id: c69805fd68a6530d1e56edad3bb5edf4089ee98a
This commit is contained in:
Ian Childs
2018-10-31 07:25:45 -07:00
committed by Facebook Github Bot
parent 81ef493a23
commit f3833a6e5a
2 changed files with 11 additions and 6 deletions

View File

@@ -135,8 +135,8 @@ public class RootComponentSpec {
@OnEvent(ClickEvent.class) @OnEvent(ClickEvent.class)
static void openDiagnostics(final ComponentContext c) { static void openDiagnostics(final ComponentContext c) {
Intent intent = new Intent(c, FlipperDiagnosticActivity.class); Intent intent = new Intent(c.getBaseContext(), FlipperDiagnosticActivity.class);
c.startActivity(intent); c.getBaseContext().startActivity(intent);
} }
} }

View File

@@ -1,5 +1,10 @@
// Copyright 2004-present Facebook. All Rights Reserved. /*
* Copyright (c) 2004-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
package com.facebook.flipper.plugins.litho; package com.facebook.flipper.plugins.litho;
import static com.facebook.flipper.plugins.inspector.InspectorValue.Type.Color; import static com.facebook.flipper.plugins.inspector.InspectorValue.Type.Color;
@@ -617,9 +622,9 @@ public class DebugComponentDescriptor extends NodeDescriptor<DebugComponent> {
return fromDrawable(null); return fromDrawable(null);
} }
final T d = Reference.acquire(c, r); final T d = Reference.acquire(c.getBaseContext(), r);
final InspectorValue v = fromDrawable(d); final InspectorValue v = fromDrawable(d);
Reference.release(c, d, r); Reference.release(c.getBaseContext(), d, r);
return v; return v;
} }