Skip to content
A delicious framework for building modularized Android user interfaces, by Yelp.
Branch: master
Clone or download
dwaxemberg Merge pull request #3 from victorslkim/victorslkim/2/improve-listcomp…

Improve ListComponent item visibility
Latest commit 7ae1309 May 20, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea/codeStyles Created a carousel component Mar 13, 2019
bento-sample-app Groupe visibilityListener removal in a single method for tidyness May 2, 2019
bento-testing Fixed residual merge conflicts Apr 17, 2019
bento Improve ListComponent item visibility May 16, 2019
buildSrc Improve ListComponent item visibility May 16, 2019
documentation Added less high res logo May 1, 2019
gradle/wrapper Instantiate a bento-testing library as a bento companion. Oct 16, 2018
jetifier Migrating to AndroidX Mar 12, 2019
.gitignore [bento] Added Nullable and NonNull annotations to all the java object… Apr 8, 2019
.pre-commit-config.yaml Added detect-secrets and pre-commit-config Oct 12, 2018
.secrets.baseline Added detect-secrets and pre-commit-config Oct 12, 2018
.travis.yml Add a May 3, 2019
Jenkinsfile Added Jekinsfile for bento-checks. Jun 25, 2018
LICENSE [bento] Added a LICENSE file Mar 12, 2019
Makefile [bento] Prepared repo for GitHub Apr 17, 2019
OWNERS Added an OWNERS file to get this pushed Apr 17, 2019 Make Bento Logo in Readme be fluid May 3, 2019
build.gradle Fixed residual merge conflicts Apr 17, 2019 [bento] Prepared repo for GitHub Apr 17, 2019
gradlew Instantiate a bento-testing library as a bento companion. Oct 16, 2018
gradlew.bat Instantiate a bento-testing library as a bento companion. Oct 16, 2018
publishing.gradle Fixed residual merge conflicts Apr 17, 2019 COREAND-2824: Add files for Master-Merge pipeline of bento Aug 21, 2018
settings.gradle Instantiate a bento-testing library as a bento companion. Oct 16, 2018

A delicious framework for building modularized Android user interfaces, by Yelp.

Maven Central Build Status Twitter License

Bento is a framework inspired by Epoxy for building complex, modularized Android user interfaces. By leveraging the mechanics and best practices behind RecyclerViews on Android, Bento makes it easy to compose various resusable visual components into a single screen. At Yelp, we've been using Bento for our most critical and complex screens in both our consumer and business owner Android applications.

How does it work?

Most Android apps that have a list-based user interface use a RecyclerView to display their views. At a basic level, the RecyclerView works by referencing an ordered list of data and creating a view on screen for each item of data in that list. That works really well if your list consists of homogenous data types, but can quickly become unruly when you need to manage an unbounded number of data and view types to be rendered in a list. It also becomes an issue if you need to use the same view type in a different type of user interface other than a RecyclerView, such as a ViewPager or a ListView.

Bento aims to fix these issues by providing a framework to manage the the complexity of handling different view types and the dynamic position of each view in the list. Bento can also be used to manage views in other parent view types such as ViewPagers and ListViews all while keeping the benefits of RecyclerView best practices like view holders and view recycling.

Bento groups different view types and the logic associated with displaying and interacting with those view types into "Components". A Component can be anything from a simple text view to a horizontal carousel comprised of other components.

At its core, a Component is a self-contained element that generates a data item. An associated ComponentViewHolder class will inflate a view and bind the data item provided to the inflated view. The view holder will also typically bind the Component to the view to handle any user interactions.

We can also create groupings of different components using a ComponentGroup, which is also a Component itself, to keep logical groupings of components together in the list.

The order of a Component in its parent view relative to other components is determined by the ComponentController. This interface is the magic soy sauce that allows us to add, remove and insert components dynamically into the ordering as if we were manipulating values in a simple list data structure. It provides an abstraction we can use to apply this functionality to different view types such as RecyclerView, ListView and ViewPager. For example the RecyclerViewComponentController handles the complex coreography of communicating with the RecyclerView class on determining spans and positions and makes it very simple to manage diverse sets of components in a list.

The Bento framework makes it easy to break down complex interfaces into a set of easy to understand, modular, dynamic and testable components.


  • Modular - Independent sections of a screen should be, well, independent. Bento components are self-contained.
  • Testable - The separation of concerns between a component's parts makes it easy to write unit tests for presenter logic and espresso tests for view binding logic, enabling complete test coverage.
  • Reusable - Bento components can be shared across screens in your app, making code sharing simple.
  • Progressive - No need to rewrite your app from scratch. Bento components can be integrated progressively into your existing application. It even works with ListViews.
  • Scalable - Perfect for large screens with a long list of heterogeneous views. View recycling also helps maximize performance.
  • Low build overhead - No annotation processing means fast build times.


We're compiling a list of examples of how to use Bento. Here's what we have currently and some of the examples we plan to add in the future:


Bento can be setup with Gradle:

// Top level build.gradle
allprojects {
	repositories {

// Module level build.gradle
dependencies {
    implementation "<version-number>"
    androidTestImplementation "<version-number>"


We highly encourage contributions from the community, even if you've never contributed to an open source project before! If you see an issue but don't have time to fix it, open an issue in this repository.

Steps for Contributing

0. Requirements

There are a few requirements to compile Bento.

  • Python is needed for the pre-commit hooks to run
  • Java and Kotlin are needed to actually compile the project
  • Android Studio (we recommend >= 3.3.2)

1. Get the code

Fork the this repository, and then clone the code to your local machine.

2. Prepare the git hooks

Once you have the repo on your machine, run the following command from the root of the project.

$ make install-hooks

These git hooks will make sure you're not committing private keys to the repository. In the future we might add more functionality.

3. Create a new branch

We usually like branches to be named:

  • username/issue-number/what-it-do
  • targo/24/fix-item-range

4. Build, change, test, commit

Repeat as necessary. The project should build from within Android Studio and if it doesn't, see the help section below. You should also be able to compile and run the bento-sample-app to test your changes.

You can also run ./gradlew publishToMavenLocal to publish the package to your local maven repo on your machine. From there you can add mavenLocal() before other maven repositories. That way your project can load in the version of Bento you're working on.

We follow semver so the version number in GlobalDependencies.kt should be updated to reflect the changes.

5. Push your changes and open a pull request

Push your branch with the new commits to your cloned repo, then open a pull request through GitHub. Once Travis CI gives it a green light along with a member of our team, it will be merged and the new version will be deployed to Maven Central.


  • Open a GitHub issue and tag it with the Question tag
  • Ask a question on StackOverflow and tag it with bento and android


Apache 2.0 - Please read the LICENSE file.

You can’t perform that action at this time.