GithubHelp home page GithubHelp logo

nl-momo / litho Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/litho

0.0 0.0 0.0 239.38 MB

A declarative framework for building efficient UIs on Android.

Home Page: http://fblitho.com

License: Other

Python 1.94% C++ 11.85% C 6.76% Java 79.35% CMake 0.02% IDL 0.02% Shell 0.07%

litho's Introduction

Litho CircleCI

Litho is a declarative framework for building efficient UIs on Android.

  • Declarative: Litho uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of immutable inputs and the framework takes care of the rest.
  • Asynchronous layout: Litho can measure and layout your UI ahead of time without blocking the UI thread.
  • View flattening: Litho uses Yoga for layout and automatically reduces the number of ViewGroups that your UI contains.
  • Fine-grained recycling: Any component such as a text or image can be recycled and reused anywhere in the UI.

To get started, check out these links:

Installation

Litho can be integrated either in Gradle or Buck projects. Read our Getting Started guide for installation instructions.

Quick start

1. Initialize SoLoader in your Application class.

public class SampleApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, false);
  }
}

2. Create and display a component in your Activity

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final ComponentContext context = new ComponentContext(this);

    final Component component = Text.create(context)
        .text("Hello World")
        .textSizeDip(50)
        .build();

    setContentView(LithoView.create(context, component));
}

Run sample

You can find more examples in our sample app.

To build and run (on an attached device/emulator) the sample app, execute

$ buck fetch sample
$ buck install -r sample

or, if you prefer Gradle,

$ ./gradlew :sample:installDebug

Contributing

For pull requests, please see our CONTRIBUTING guide.

See our issues page for ideas on how to contribute or to let us know of any problems.

Please also read our Coding Style and Code of Conduct before you contribute.

License

Litho is BSD-licensed. We also provide an additional patent grant.

litho's People

Contributors

pasqualeanatriello avatar marco-cova avatar lucasr avatar ianchilds avatar passy avatar mihaelao avatar muraziz avatar jaegs avatar strulovich avatar rratmansky avatar mhorowitz avatar usikder avatar astreet avatar jsendros avatar sriramramani avatar adamjernst avatar billynyh avatar lambdapioneer avatar bolinfest avatar weih9 avatar paveldudka avatar woehrl01 avatar dschafer avatar krschultz avatar orrsella avatar sblackshear avatar lexs avatar oprisnik avatar cjhopman avatar alsutton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.