• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download

<lambda>null1 package com.airbnb.lottie.samples
2 
3 import android.os.Bundle
4 import androidx.appcompat.app.AppCompatActivity
5 import com.airbnb.epoxy.EpoxyController
6 import com.airbnb.lottie.samples.views.WishListIconView
7 import com.airbnb.lottie.samples.views.listingCard
8 import com.airbnb.lottie.samples.views.marquee
9 import kotlinx.android.synthetic.main.activity_list.*
10 
11 class ListActivity : AppCompatActivity() {
12 
13     override fun onCreate(savedInstanceState: Bundle?) {
14         super.onCreate(savedInstanceState)
15         setContentView(R.layout.activity_list)
16 
17         setSupportActionBar(toolbar)
18         supportActionBar?.setDisplayShowTitleEnabled(false)
19         toolbar.setNavigationOnClickListener { finish() }
20 
21         recyclerView.buildModelsWith { it.buildModels() }
22     }
23 
24     private fun EpoxyController.buildModels() {
25         marquee {
26             id("marquee")
27             title("List")
28             subtitle("Loading the same animation many times in a list")
29         }
30 
31         repeat(100) {
32             listingCard {
33                 id(it)
34                 clickListener { view -> (view as WishListIconView).toggleWishlisted() }
35             }
36         }
37     }
38 }