Commit Graph

503 Commits

Author SHA1 Message Date
Pascal Hartig
847f4d0151 Delete redundant gradle code (once more)
Reviewed By: fabiomassimo

Differential Revision: D26751726

fbshipit-source-id: 03b8601cdb0910f2ec7508d9bb1c09bcd6bcd301
2021-03-02 08:46:13 -08:00
Harold Martin
4d8be35d1a Add plugin for LeakCanary 2 (#1959)
Summary:
Add plugin for LeakCanary 2 as requested various times: https://github.com/facebook/flipper/issues/1379 https://github.com/facebook/flipper/issues/832  https://github.com/square/leakcanary/issues/1777

## Changelog

* Adds a leakcanary2 plugin for Android
* Adds support for leakcanary2 to existing desktop plugin

Pull Request resolved: https://github.com/facebook/flipper/pull/1959

Test Plan:
* Docs updated to show new implementation
* Should old leakcanary plugin in sample be replaced?

Reviewed By: mweststrate

Differential Revision: D26691637

Pulled By: passy

fbshipit-source-id: 5e236fa6cc124f0720a6b21b5ee7c117ccf96fbf
2021-03-01 09:11:37 -08:00
Pascal Hartig
3d2a0e3eb2 Enable prefab for fbjni integration (#1941)
Summary:
I'm in the progress of releasing a prefab-enabled FBJNI release. This dramatically reduces the hackery around integrating with separately released native libraries.

This will fail until the release is actually out.

Pull Request resolved: https://github.com/facebook/flipper/pull/1941

Test Plan:
`./gradlew :sample:installDebug` works as before.
Once the release is out, we need to check if this creates any problems with RN but because we advice to exclude the dependency, I expect it not to cause any trouble.

Reviewed By: mweststrate

Differential Revision: D26545104

Pulled By: passy

fbshipit-source-id: 1e21fa1816f28e2fcb52da68863fabc8bc625136
2021-02-24 06:20:12 -08:00
Pascal Hartig
3f16da4db0 Upgrade gradle plugin (#1936)
Summary:
Upgraded to the latest Android Studio and this popped up.

Pull Request resolved: https://github.com/facebook/flipper/pull/1936

Test Plan:
Built the sample app.

Repro'd the previous build failure. Weirdly enough, this only occurred on Linux, not on my Mac. Now it's passing.

Reviewed By: mweststrate

Differential Revision: D26483694

Pulled By: passy

fbshipit-source-id: 9c27eb6d28a0f390154899d67469a504d68c2ad4
2021-02-19 03:29:50 -08:00
Pascal Hartig
b25de27b8a Move bolts dependencies to Fresco plugin (#1937)
Summary:
Fixes https://github.com/facebook/flipper/issues/1919

Somehow the diff author put the dependencies in the root `build.gradle`, which is unnecessary as this is only used by Fresco.

Pull Request resolved: https://github.com/facebook/flipper/pull/1937

Test Plan:
Built the sample app, checked that the Fresco stuff continues to work.
![Screenshot_1613565381](https://user-images.githubusercontent.com/9906/108205459-0366ef80-711d-11eb-8b3b-f804f02622af.png)

Reviewed By: mweststrate

Differential Revision: D26483701

Pulled By: passy

fbshipit-source-id: 88f056ed0897f2c00844e02721eb45d5b85c6908
2021-02-18 09:31:04 -08:00
Pascal Hartig
87d7bcf274 Remove JCenter specifics (#1914)
Summary:
This removes Bintray/JCenter specific code and replaces it with a new plugin recommended by [Chris Banes](https://chris.banes.dev/publishing-to-maven-central/).

Pull Request resolved: https://github.com/facebook/flipper/pull/1914

Test Plan:
Manually uploaded as snapshot and full release, but with this setup still requires all sorts of manual setup, including GPG. Next PR will include automation for this.

CI here should also verify that I didn't split this diff up incorrectly.

Reviewed By: jknoxville

Differential Revision: D26367350

Pulled By: passy

fbshipit-source-id: faa6b488d6c95bc643d2f9328362e29fb4b05ded
2021-02-10 07:16:32 -08:00
Joshua Selbo
340a29c1d5 Add inspector descriptor for ImageView
Summary:
- Made `EnumMapping` support generic value type -  `ImageView.ScaleType` is a Java enum; the scaleType api uses this instead of int types.
- Introduce descriptor for `ImageView` and allow getting/setting scaleType.

Reviewed By: mweststrate

Differential Revision: D26092725

fbshipit-source-id: ea3a4ee036b2b808f14277387d360318b7d25824
2021-02-01 10:21:26 -08:00
Ian Childs
c85942b6b1 Move sonar robolectric tests to use binary resources
Summary: Legacy resources are deprecated, this is what we should be using

Reviewed By: jselbo

Differential Revision: D25903962

fbshipit-source-id: ffa91a3aee8956591b7daab523bda2e59fec9932
2021-01-13 14:32:56 -08:00
Andres Suarez
731e39445f Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861849

fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
2021-01-10 10:07:30 -08:00
bizzguy
f806ee41d7 Network plugin - fix issue with responses with empty body (#1776)
Summary:
The Network Plugin does not properly handle network requests that return an empty body (because of the body actually being empty or because the network call returns something like a 404 status).

Also, the creation of mocks using the "Copy Highlighted" command when the original response returns an empty body is not handled properly.

## Fix

The Android plugin now returns a response when the body length is 0.

The client plugin creates a body containing an empty string instead of null when the body is empty.

## Changelog

Fix problem in Network Plugin when original call or mock has an empty body in the response.

Pull Request resolved: https://github.com/facebook/flipper/pull/1776

Test Plan:
The following screen output for the Network Plugin shows that the call is now being handled correctly.  The fields for "status", "size" and "duration" are now populated.

Also, the mock calls are properly defined and shown in yellow.

![image](https://user-images.githubusercontent.com/337874/102738969-5edd5280-4311-11eb-9b46-33a57a50e334.png)

Reviewed By: mweststrate

Differential Revision: D25804212

Pulled By: passy

fbshipit-source-id: b31cc87619c604b4df76e05bca5c86554a1cabff
2021-01-07 04:15:18 -08:00
Amir Katz
eb475e7550 creating a flag to explicitly load flipper
Summary: This change will allow loading flipper not only internal build but also in builds that explicitly turn on LOAD_FLIPPER_EXPLICIT in build config

Reviewed By: timur-valiev

Differential Revision: D25369245

fbshipit-source-id: 9f8e5c7033aa4ded6ce7bc8cc5b5c252ba65692b
2020-12-15 03:21:08 -08:00
Pascal Hartig
484a555428 Fix tutorial Android app build (#1676)
Summary:
This was not updated with the recent Litho editor changes.

Pull Request resolved: https://github.com/facebook/flipper/pull/1676

Test Plan:
`./gradlew :tutorial:installDebug`

<img width="1381" alt="Screenshot 2020-11-13 at 16 31 16" src="https://user-images.githubusercontent.com/9906/99096159-e1197f00-25cd-11eb-9a80-9697fc7e4e3b.png">

Reviewed By: mweststrate

Differential Revision: D24981566

Pulled By: passy

fbshipit-source-id: 8315fe67f80c36b570c0c8fa110f810ad31bd9f2
2020-11-16 11:00:20 -08:00
Paco Estevez Garcia
e9dc645423 Add Android support for Timeline detail view
Summary:
This diff adds the Java classes that serialize to the data expected by the new timeline widget. See D23865369 for the JS counterpart.

Currently the Flipper plugin uses `toString` to get the wire values. I'm not feeling like using a json library or dealing with JSONObject's nonsense, so these are rolled manually for now.

Reviewed By: astreet

Differential Revision: D24254377

fbshipit-source-id: b2fc00400c40b47ac29c9b83c0b66621c3677974
2020-10-19 06:01:14 -07:00
Paco Estevez Garcia
51293406d6 Move Litho Flipper Plugin to Litho
Summary:
The current ownership and release model prevents cleanly releasing new versions of the plugin while the code is split between two repos.

This diff moves the flipper-litho plugin to the Litho repository. You'll find new releases as `litho-editor-flipper` that'll be reexported via gradle's `api` to the old artifact.

Reviewed By: colriot

Differential Revision: D23962234

fbshipit-source-id: 7884423342904219ae9b41632c6df90cda870798
2020-10-07 15:44:33 -07:00
Joshua Selbo
0b2e5f6454 Upgrade Robolectric from 4.3.1 -> 4.4
Summary: Changelog: [Internal]

Reviewed By: jiawei-lyu

Differential Revision: D23718455

fbshipit-source-id: 39c684722db1269e2179cf9680cb728be1171afb
2020-09-29 18:41:20 -07:00
Paco Estevez Garcia
7acdfc196f Depend on litho-editor-flipper
Summary: FlipperEditor has migrated to `litho-editor-flipper`, so this diff fixes the dependency tree and deletes the file.

Reviewed By: muraziz

Differential Revision: D23380023

fbshipit-source-id: 75f5f037dc392194212fc156499f090c381999bd
2020-09-22 11:34:32 -07:00
Pascal Hartig
ddc9c3e243 Back out "Back out "[flipper][PR] Use interface SupportSQLiteDatabase in Android Databases Plugin""
Summary: jknoxville helped me debug this. The underlying problem was that we didn't include a dependency which is transitive in gradle land. We swallowed the exception and just returned an empty list. I left an error log in there to make future debugging easier. For reference, this was the error:

Reviewed By: cekkaewnumchai

Differential Revision: D23759727

fbshipit-source-id: 244510d2765913bf4c89458e336889c3c6838fc4
2020-09-17 10:30:16 -07:00
Paco Estevez Garcia
0d7cac3952 Add Playground link in Yoga layouts
Summary:
Adds a link to the Yoga playground atop all properties of Yoga-based views.

We could make the playground match the properties below if I figure out the hashing mechanism the website uses. This is a start.

Reviewed By: muraziz

Differential Revision: D23758538

fbshipit-source-id: 6a3f206914aa9962e55852df548f8026783506e9
2020-09-17 09:44:27 -07:00
Pascal Hartig
bb176577e9 Back out "Use interface SupportSQLiteDatabase in Android Databases Plugin"
Summary: This broke DB opening in FB apps. Will try to fix and reland this, but need to unblock people first.

Reviewed By: cekkaewnumchai

Differential Revision: D23705962

fbshipit-source-id: 3c9ff3a74e5a6d34e6cb2c75e7e2cec749b5a60e
2020-09-15 17:05:24 -07:00
Pascal Hartig
bb807243ae Revert "fbjni 0.0.4 (#1428)" (#1524)
Summary:
This reverts commit 97adea5423.

This is to address https://github.com/facebook/flipper/issues/1514.

Waiting for RN to upgrade fbjni on their end before un-reverting.

Pull Request resolved: https://github.com/facebook/flipper/pull/1524

Reviewed By: mweststrate

Differential Revision: D23678287

Pulled By: passy

fbshipit-source-id: a89f3f625690fc8f97d7e05f5cfdea729d1fe03d
2020-09-14 08:03:12 -07:00
a.artikov
7a7a88bfde Use interface SupportSQLiteDatabase in Android Databases Plugin (#1196)
Summary:
This change will allow to use various SQLiteDatabase implementations: standard Android implementation, [requery/sqlite-android](https://github.com/requery/sqlite-android) and so on. See issue https://github.com/facebook/flipper/issues/1183

## Changelog
Android Databases Plugin: `SqliteDatabaseConnectionProvider` returns `SupportSQLiteDatabase` instead of `SQLiteDatabase`.

Pull Request resolved: https://github.com/facebook/flipper/pull/1196

Test Plan: Check that Databases Plugin shows correct data on the sample Android application.

Reviewed By: mweststrate

Differential Revision: D23294272

Pulled By: passy

fbshipit-source-id: c07ebeb869ab01d41281f75541cbb3411f0ebae0
2020-09-09 04:26:07 -07:00
Paco Estevez Garcia
d4d2937c80 Fix setting layoutParams fromLayout Editor
Summary:
The function `setLayoutParams` expects the values to be set to be at array position 0+, and they were on position 1+ instead.

This effectively prevented users from setting LayoutParameters.

Reviewed By: muraziz

Differential Revision: D23538531

fbshipit-source-id: cc828363ee8d7408d1df29d98c37b09893826bb1
2020-09-06 12:58:24 -07:00
Paco Estevez Garcia
842fe6df5c Add picker for ViewDescriptor
Summary: This diff uses the new picker defined in EnumMapping for regular Android View properties.

Reviewed By: muraziz

Differential Revision: D23538532

fbshipit-source-id: be5b776453e7322fb13a5f9e6a66a1f8d1243e79
2020-09-06 12:58:24 -07:00
Paco Estevez Garcia
c78bac3d90 Add picker support for EnumMapping
Summary: This diff makes EnumMapping compatible with the new Layout widget "picker"

Reviewed By: muraziz

Differential Revision: D23538548

fbshipit-source-id: 7bdb01648c1ad5e2d0d7594c98df5ed89d893702
2020-09-06 12:58:24 -07:00
Dominik Wielgórski
5b4403b400 Splitting the 'OpenInIDE' API to 'resolvePath' and 'open' APIs
Summary: Detect if resolved path is properly computed and accordingly display a success or error notification within InAppErrorReporter.

Reviewed By: arpitratan

Differential Revision: D23425001

fbshipit-source-id: 4ca903a8b9e83dc0e11bb823537f56678dd85b76
2020-09-04 08:34:04 -07:00
Paco Estevez Garcia
a49ceff441 Remove implicit dependency on Androidx
Summary: This change removes the dependency of FlipperEditor from AndroidX, which prevents it from moving to the Litho repository

Reviewed By: Andrey-Mishanin

Differential Revision: D23475867

fbshipit-source-id: a330c676859ed9ce9a0ab186dd206310d2eccca5
2020-09-03 07:42:18 -07:00
Michel Weststrate
2d7c464f3e Increase OkhttpInterceptor default body size
Summary:
The default max body size for the OkHttpInterceptor that is reported to Flipper seems unreasonably small, as most images, graphql responses etc are bigger. Increased it to 1MB

Since the network plugin doesn't do any work if it is not explicitly enabled in Flipper, this should not lead to further performance regression / starvation.

Reviewed By: jknoxville

Differential Revision: D23375720

fbshipit-source-id: e901105209aec7108d61fc20295a149c5582f22d
2020-09-02 05:13:07 -07:00
Michel Weststrate
2f7a84115c Fix image rendering
Summary:
Images in the network plugin are rarely displayed in the network plugin, as it tries to use the public url to preview it. However, that won't if the endpoint is behind authentication, idempotent, etc. This diff changes the behavior to instead send the network body to flipper and use that to preview.

Changelog: [Network] Fixed image preview

Reviewed By: jknoxville, passy

Differential Revision: D23370743

fbshipit-source-id: 0070e9e38c10a5761b9f7190467e26f01a7b2471
2020-09-02 05:13:06 -07:00
Paco Estevez Garcia
ff3584e2e0 Add support for tagged messages on the Layout Inspector
Summary:
Related diff [CK]: D23243009

This diff adds support for a protocol for layout messages where the type is recursively encoded as:

```
{
 kind: "type",
 data: ???
}
```

The meat of the diff is on FlipperEditor.java, SetDataOperations.java and InspectorFlipperPlugin.java. The others are there just for a change on an interface.

We check if the message adheres to the new encoding, otherwise we fall back to the old behavior. If it's the new encoding, the message is traversed recursively flattening the types to EditorValue using the type hints provided.

Reviewed By: muraziz

Differential Revision: D23243009

fbshipit-source-id: 0f313455885930f3beaaadb66f3bf394f109ea23
2020-08-28 08:56:21 -07:00
Paco Estevez Garcia
19b5b65081 Add picker types for Yoga Layout values
Summary: This diff converts several flexbox properties to picker values

Reviewed By: colriot

Differential Revision: D23396217

fbshipit-source-id: 581a609a5e6da85c40d4a20c81f020e1832f2f4c
2020-08-28 07:45:41 -07:00
Paco Estevez Garcia
ee809fe112 Add support for the Picker widget in Android
Summary: Adds support in Flipper for the picker widget. The way it reaches Flipper is a bit nasty, using `toString` to produce a JSON value.

Reviewed By: passy

Differential Revision: D23294091

fbshipit-source-id: e3398e6fb474e46bdaac1960aeaf57e201946413
2020-08-28 07:45:41 -07:00
Pascal Hartig
97adea5423 fbjni 0.0.4 (#1428)
Summary:
Just released a new version.

Pull Request resolved: https://github.com/facebook/flipper/pull/1428

Test Plan:
`./gradlew :android:installDebug`

However, I'm tethering right now and this is taking ages so I haven't
been able to complete this.

Reviewed By: mweststrate

Differential Revision: D23295098

Pulled By: passy

fbshipit-source-id: aa53fa1c47f0b02d2c8b9f12d66b1c600a37075b
2020-08-27 03:45:40 -07:00
Michel Weststrate
7f9d4c35a0 Allow for larger ascii responses
Summary: See linked task, data larger than 5KB would always be reported as blob. Increased this limit to 100KB, since if the user is looking at this data, it is proactively requested so it is fine if it is larger

Reviewed By: jknoxville

Differential Revision: D23317197

fbshipit-source-id: f563a980fa9567ac7e2f950b83c1888a7b295d77
2020-08-25 08:49:24 -07:00
Paco Estevez Garcia
b109fc4d3e FQN Cleanup
Summary: Fixing a silly missing import

Reviewed By: muraziz

Differential Revision: D23265033

fbshipit-source-id: 0e78d19314df853d2c512535650d3294bf3099e0
2020-08-25 04:28:51 -07:00
Dominik Wielgórski
939ed27aad Detect if given Component is LithoComponent
Summary: Useful for next diffs: enables to detect whether we have LithoComponent or CKComponent

Reviewed By: adityasharat

Differential Revision: D23128972

fbshipit-source-id: b9aef358c1426df4f05213c42e43402e8cae984f
2020-08-17 10:20:53 -07:00
John Knox
9efcbdceaf Send large responses in chunks
Summary:
It's common for responses to be completely missing in the network inspector. This is because they are larger than can be serialized in one go on some devices, so we drop all messages larger than 1MB.

This changes the android client to send large responses in individually serialized batches. This way we avoid running out of memory and can still send arbitrarily large payloads.

Changelog: Android network inspector can now handle responses large than 1MB.

Reviewed By: passy

Differential Revision: D22999905

fbshipit-source-id: ff4eb8fa72a7e42ea90d12ffe0f20c6d1e58b7e5
2020-08-10 08:47:32 -07:00
James Harmon
6989fa608d Add HTTP Status Code to mock response for Route (#1441)
Summary:
Mock requests can currently only return an HTTP Status Code of 200.  This is not sufficient to take full advantage of the mocking feature.  It would be more useful to specify a status code for the response.  Then not only can the original request be tested, but failure of the call could be tested as well.

This is described in Issue https://github.com/facebook/flipper/issues/1423 [https://github.com/facebook/flipper/issues/1423]

Changelog: Allow user to change response code for a mock request

Pull Request resolved: https://github.com/facebook/flipper/pull/1441

Test Plan:
Here is a video demonstrating the change
[Uploading response-status-code.mp4.zip…]

Here is a screenshot showing where the new HTTP status code is entered for the mock request:
![image](https://user-images.githubusercontent.com/337874/89370139-a1c1c500-d6a5-11ea-9a55-e5e99ba37af5.png)

This screenshot shows a mock response with an alternate return code:
![image](https://user-images.githubusercontent.com/337874/89370265-ecdbd800-d6a5-11ea-82e7-10afbd5dd939.png)

Reviewed By: jknoxville

Differential Revision: D22977811

Pulled By: passy

fbshipit-source-id: c1662dd02abeb4546c80a416ed87f8e0dadbf96a
2020-08-07 09:30:10 -07:00
Dominik Wielgórski
3a628019f7 Detect classes which are Litho Sections
Summary:
Populate class name for Litho Sections.
See D22922106 (86cafb9e80) for reference

Reviewed By: adityasharat

Differential Revision: D22949896

fbshipit-source-id: d804971708cf8c8466dd74eda3e750957dc95fc9
2020-08-06 13:11:27 -07:00
Dominik Wielgórski
86cafb9e80 Detect classes which are Litho Components
Summary: Populate class name for Litho Components.

Reviewed By: adityasharat

Differential Revision: D22922106

fbshipit-source-id: e18b748e0e0bd6f511558124a28b4b58d217ded7
2020-08-05 01:49:13 -07:00
Dominik Wielgórski
4c4097f0f8 Implemented menu to select ide
Summary:
Added IDE menu functionalities.
Changed minor UX detail - for classes that cannot be opened user will always see 'Can't open' prompt.

Design: https://www.figma.com/file/M0l6qhQqzllIcefVE4tQvG/Error-Reporter-IDE-Selector?node-id=82%3A0

Reviewed By: arpitratan, adityasharat

Differential Revision: D22790328

fbshipit-source-id: 8dfbcf7408c53947909bcf3fa700dee7ae47e14a
2020-07-30 04:30:06 -07:00
Mathias Fleig Mortensen
e466bc4aed Make disk cache inspection toggleable
Summary: Adds a toggle switch to show/hide disk cache images defaulting to inactive. The image data is only sent on the adb connection when the toggle is activated.

Reviewed By: defHLT

Differential Revision: D20002059

fbshipit-source-id: 05c9e515ffe09441e5cfb6f66eb14559ac4a322c
2020-07-27 09:44:52 -07:00
Paco Estevez Garcia
10f9a48540 Wire Editor to Flipper
Summary:
This diff implements the integration between a Litho Editor and Flipper. It does so by converting the Editor format to FlipperObject, and then converting it back from FlipperDynamic.

This conversion works for both `State` and `Prop`. We already provide default implementations for primitive + wrapped types and String, so the functionality should match the existing one.

Reviewed By: passy, Katalune

Differential Revision: D22455220

fbshipit-source-id: f7f633765f3d997ce6de09d2c1277019e72c0802
2020-07-27 05:09:16 -07:00
Dominik Wielgórski
1784eb78d9 Added buttons +notifications for opening in IDE functionality
Summary: Created buttons which enable opening in IDE for classes which are valid.

Reviewed By: adityasharat

Differential Revision: D22724496

fbshipit-source-id: 3532213ab7730aae5e61877ccfecd0558b329d57
2020-07-27 05:07:02 -07:00
Dominik Wielgórski
6561bc8f16 Added connection between InAppErrorReporter and Flipper Desktop App via Layout Plugin
Summary:
Created functionality which allows user to open clicked file from inAppErrorReporter.
Created "iface" interface for openInIDE API and created default implementation which indicates that openInIDE is not supported.
Created "impl" implementation specifically for fb4a.

Reviewed By: arpitratan

Differential Revision: D22642497

fbshipit-source-id: 7b3011c128a479e556b869fcc8c4147e153caf71
2020-07-23 13:47:09 -07:00
Dominik Wielgórski
cf6df492ee Created openInIDE API inside Layout Plugin
Summary: Created a communication between Layout Plugin and Flipper Desktop. The API allows users to open given file in a selected IDE. The openInIDE function returns true if the connection with Flipper is established, otherwise returns false.

Reviewed By: adityasharat

Differential Revision: D22625829

fbshipit-source-id: feaf186c107d62b1a75dfc6bbe2c1d66ffd7fd78
2020-07-21 09:27:53 -07:00
Pascal Hartig
51e7ce3566 Fragment sample test (#1328)
Summary:
Wanted to have a way to test fragment support in open source for https://github.com/facebook/flipper/issues/1209.

Stacked on https://github.com/facebook/flipper/issues/1327.
Pull Request resolved: https://github.com/facebook/flipper/pull/1328

Test Plan: ![Screenshot 2020-07-02 12 10 17](https://user-images.githubusercontent.com/9906/86352544-dc2ae300-bc5d-11ea-91f8-f6b06437f7bc.png)

Reviewed By: jknoxville

Differential Revision: D22356283

Pulled By: passy

fbshipit-source-id: 2ad84df0aae85634c8245e71f18b803ce8dd6ca0
2020-07-03 04:02:31 -07:00
Richard Zadorozny
91cccbe436 Sonar tag for skipping empty view groups in layout target mode
Summary:
I think it's somewhat common to have large containers that can hold future views, especially fragments. The problem is the presence of these containers can block the layout inspector's "target" mode.

I found out from cekkaewnumchai that Flipper does in fact return multiple results from the pick, but I think it could still be helpful to have this new tag since it is more convenient than having to do the secondary drill down each time.

Reviewed By: jknoxville

Differential Revision: D22284972

fbshipit-source-id: 1a2826ec746e4f31690db33ed72815ae168bffab
2020-07-02 08:39:35 -07:00
Paco Estevez Garcia
d871ce0a04 Extract TouchOverlayView to new class
Summary:
Before this diff, `TouchOverlayView` would be an inner non-static class,so it'd be difficult to track memory ownership for it.

It also made `InspectorFlipperPlugin` longer and harder to read.

Reviewed By: cekkaewnumchai

Differential Revision: D22285744

fbshipit-source-id: 6fdd8c33a07be6ab900ebb28a8c3ebf3761fb598
2020-07-01 11:05:46 -07:00
Paco Estevez Garcia
c1d9527406 Fix potential nullable accesss
Summary:
While ramping up to Flipper I found this potential NPE caused by ordering issues.

There are only 3 uses downstream that don't use a constant that's part of the default initializer.
```
λ festevezga-mbp xplat → buck build sonar/android/src/main/java/com/facebook/flipper/plugins/inspector/... 2>&1 | rg ' = descriptorForClass' | awk '{$1=$1};1' | sort | uniq -c
   5 NodeDescriptor descriptor = descriptorForClass(Object.class);
   3 NodeDescriptor descriptor = descriptorForClass(View.class);
   1 NodeDescriptor descriptor = descriptorForClass(node.getClass());
   2 final NodeDescriptor descriptor = descriptorForClass(Dialog.class);
  12 final NodeDescriptor descriptor = descriptorForClass(Fragment.class);
   5 final NodeDescriptor descriptor = descriptorForClass(Object.class);
  26 final NodeDescriptor descriptor = descriptorForClass(View.class);
   2 final NodeDescriptor descriptor = descriptorForClass(Window.class);
   1 final NodeDescriptor descriptor = descriptorForClass(node.getClass());
   1 final NodeDescriptor descriptor = descriptorForClass(topChild.getClass());
   2 final NodeDescriptor objectDescriptor = descriptorForClass(Object.class);
```

Reviewed By: muraziz

Differential Revision: D22284669

fbshipit-source-id: b41c8d78c70c5b5acdc08aa6f0e7afa681f4242d
2020-07-01 11:05:46 -07:00
pyricau@users.noreply.github.com
cfd8662c12 Fix ApplicationWrapper activity weakRef leak (#1301)
Summary:
Fix for https://github.com/facebook/flipper/issues/1300

The weak refs were not being cleared in two cases:

- On config changes, isFinishing() would be false in onPause()
- When calling finish() from Activity.onCreate(), onPause() isn't guaranteed to be called.

## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/1301

Reviewed By: mweststrate

Differential Revision: D22286182

Pulled By: passy

fbshipit-source-id: 948d1d9b2145b6526c0030cf537330409ff7f8c4
2020-06-30 09:46:00 -07:00