Skip to content

Commit

Permalink
Add completion for @OnCalculateCachedValue
Browse files Browse the repository at this point in the history
Summary:
Why?
- OnCalculateCachedValue is used for both LayoutSpec and MountSpec and part of the documentation (https://fblitho.com/docs/cached-values) so users would expect auto-completion

What?
- Added OnCalculateCachedValue to increase coverage of MountSpec and LayoutSpec method completion which is used ~150 times across the Android code base

Reviewed By: colriot

Differential Revision: D24139359

fbshipit-source-id: 65d66a4b3be7a26e07b7334bf21d620450b9e4d2
  • Loading branch information
Martin Troiber authored and facebook-github-bot committed Oct 7, 2020
1 parent 0927d1a commit 7f972b4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
<OnMeasure method="/* TODO: https://fblitho.com/docs/mount-specs#measurement */@com.facebook.litho.annotations.OnMeasure static void onMeasure(com.facebook.litho.ComponentContext c, com.facebook.litho.ComponentLayout layout, int widthSpec, int heightSpec, com.facebook.litho.Size size) {}"/>
<OnMount method="/* TODO: https://fblitho.com/docs/mount-specs#mounting */@androidx.annotation.UiThread @com.facebook.litho.annotations.OnMount static void onMount(com.facebook.litho.ComponentContext c, android.graphics.drawable.ColorDrawable colorDrawable) {}"/>
<ShouldUpdate method="/* https://fblitho.com/docs/mount-specs#shouldupdate */@com.facebook.litho.annotations.ShouldUpdate static boolean shouldUpdate() {return false;}"/>
<OnCalculateCachedValue method="/* TODO: https://fblitho.com/docs/cached-values */@com.facebook.litho.annotations.OnCalculateCachedValue(name = &quot;expensiveValue&quot;) static int onCalculateCachedValue() {return 0;}"/>
</templateSet>

0 comments on commit 7f972b4

Please sign in to comment.