Questions tagged [litho]

A declarative, high-performance Android UI library by Facebook inspired by the React component model. Litho uses the Yoga layout library (an implementation of Flexbox) and is optimized for creating fast RecyclerView based interfaces.

Litho is a declarative, high-performance Android UI library by Facebook inspired by the React component model. Litho uses the Yoga layout library (an implementation of Flexbox) and is optimized for creating fast RecyclerView-based interfaces.

Links

  • Get Started: Integrate Litho into your Android app
  • Tutorial: Your first Litho components
  • Sections: An advanced API for heterogenous Recycler collections
  • API: JavaDoc

Community Resources

38 questions
1
vote
1 answer

How to make a child fill all usable screen real estate in Facebook's Litho?

I am trying to use mapview with Facebook's Litho and i cannot figure out how to make the mapview fill all usable screen real estate. Is there some method im overlooking? If you figure it out please tell me how also so i can learn how to gather more…
kjell vos
  • 13
  • 3
1
vote
0 answers

Change Text value after click on Parent component in Litho

Consider I am creating a column with two text children and setting a click handler on the column view. I want to change the value of the first text after I click the column. How can I do that?
Bardya Momeni
  • 337
  • 4
  • 13
1
vote
1 answer

How to handle pressed enter with Litho.Edittext

in my current android project I have to use Litho framework. Problem what I facing now is how to handle enter key with Litho EditText widget.(Invoke request when enter key on soft keyboard is pressed) I tried setOnKeyListener on LithoView which…
Tommy
  • 96
  • 5
1
vote
0 answers

Google Maps view integrated with FBLitho

I am trying to integrate a Google Maps View with Litho, and I have created a MountSpec for this. I have two issues with this. Firstly, I need to run some background thread code in the OnPrepare Method, but as a result, I cannot assign the result of…
1
vote
1 answer

What does Litho's @FromPrepare annotation do?

I have been reading Litho's documentation and I found this code example @LayoutSpec(events = { ColorChangedEvent.class }) class ColorComponentSpec { ... @OnCreateLayout static ComponentLayout onCreateLayout( Context c, @Prop…
Salim Mahboubi
  • 561
  • 7
  • 25
0
votes
0 answers

Creating a dynamic UI based on server response efficiently

I have an app where the UI elements are decided in the backend. Whenever the app opens it makes a call to server and server returns a json containing the settings and data based on which the UI will be updated. The current approach we are following…
0
votes
1 answer

Can I use Litho from Scala?

This may be a wrong understanding, since I don't have very much experience with these things. I suppose the Litho Java API cannot be used from Scala since it requires code generation that is done on the Java compiler side using Litho macros. Is that…
fiatjaf
  • 11,479
  • 5
  • 56
  • 72
0
votes
2 answers

FbLitho repeats views in RecyclerCollectionComponent even when new section is loaded

FbLitho framework repeats views from the old section i.e Groupsection in RecyclerCollectionComponent even when a new section is loaded.
Pravin Desai
  • 527
  • 5
  • 18
0
votes
1 answer

java.lang.LinkageError: com.facebook.litho.sections.widget.RecyclerCollectionComponent

java.lang.LinkageError: com.facebook.litho.sections.widget.RecyclerCollectionComponent When using litho RecyclerCollectionComponent RecyclerCollectionComponent component = RecyclerCollectionComponent.create(c).section( section …
Pravin Desai
  • 527
  • 5
  • 18
0
votes
1 answer

Recycle a list of litho components using a custom adapter

I am working on a project where I need recyling a list of litho components using a custom recyclerview adapter. The only issue is that I can't use RecyclerComponent which comes as part of the litho library. Is there a way to do this? Specifically,…
omerjerk
  • 4,090
  • 5
  • 40
  • 57
0
votes
1 answer

Litho Column border radius

Currently investigating Litho and I tried to add a border to a Column. It seems to work fine until I add a background to the Column. The Column doesn't appear to be clipped to the borders See attached image for better description Code (In…
MRainzo
  • 3,800
  • 2
  • 16
  • 25
0
votes
1 answer

Litho Radio Group container

I followed the checkbox example on Litho guide and built a similar implementation for a radio button: @LayoutSpec object CRadioSpec { @OnCreateLayout fun onCreateLayout( c: ComponentContext, @Prop value: String, …
User3
  • 2,465
  • 8
  • 41
  • 84
0
votes
1 answer

App crashing on start when using facebooks litho library

I wanted to try the litho library from facebook for recycler view. Read the official docs and few other articles, and i started implementing using a basic example of hello world. But the app shows a white screen and crashes without displaying…
a909
  • 79
  • 9
0
votes
1 answer

Does Litho Support Data Binding?

I've been reviewing the documents and I can't find anything talking about whether or not Litho supports data binding. There is one comment I've found here that says, "It supports one-directional data binding..." but there isn't anything in the docs…
BlackHatSamurai
  • 23,275
  • 22
  • 95
  • 156
0
votes
1 answer

How to run a Litho animation automatically?

What's the proper way to start a Litho animation when an Activity is first displayed. All of the Litho animation examples are initiated by a user action, but I want to run one automatically. I tried to extend a Litho animation example…
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113