/* Ċ Ġ* ĠCopyright Ġ 2 0 1 9 ĠSquare ĠInc . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . squareup . sample . recyclerview Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . Button Ċ import Ġcom . squareup . sample . recyclerview . App Workflow . Base Screen Ċ import Ġcom . squareup . sample . recyclerview . editable list workflow . List Diff Mode Ċ import Ġcom . squareup . sample . recyclerview . editable list workflow . List Diff Mode . As ynchronous Ċ import Ġcom . squareup . sample . recyclerview . editable list workflow . List Diff Mode . S ynchronous Ċ import Ġcom . squareup . workflow . ui . Layout Runner Ċ import Ġcom . squareup . workflow . ui . Layout Runner . Companion . bind Ċ import Ġcom . squareup . workflow . ui . View Factory Ċ import Ġcom . squareup . workflow . ui . View Environment Ċ import Ġcom . squareup . workflow . ui . Workflow View Stub Ċ Ċ /** Ċ Ġ* ĠR enders Ġa Ġ[ Base Screen ] Ġfrom Ġthe Ġ[ App Workflow ] Ġby Ġshowing Ġthe Ġlist Ġin Ġthree Ġseparate Ċ Ġ* Ġ` RecyclerView ` s Ġat Ġonce , Ġall Ġbound Ġto Ġthe Ġsame Ġrendering . Ċ Ġ* Ċ Ġ* ĠEach Ġof Ġthe Ġ` RecyclerView ` s Ġuses Ġa Ġdifferent Ġ[ List Diff Mode ] Ġfor Ġupdating Ġits Ġadapter . Ċ Ġ*/ Ċ class ĠBase Screen Layout Runner ( view : ĠView ) Ġ: ĠLayout Runner < Base Screen > Ġ{ ĊĊĠ Ġprivate Ġval Ġno Diff List Stub Ġ= Ġview . findViewById < Workflow View Stub >( R . id . list _ stub ) ĊĠ Ġprivate Ġval Ġsync List Stub Ġ= Ġview . findViewById < Workflow View Stub >( R . id . sync _ list _ stub ) ĊĠ Ġprivate Ġval Ġasync List Stub Ġ= Ġview . findViewById < Workflow View Stub >( R . id . async _ list _ stub ) ĊĠ Ġprivate Ġval Ġadd Row Button Ġ= Ġview . findViewById < Button >( R . id . add _ new _ row _ button ) ĊĊĠ Ġoverride Ġfun Ġshow Rendering ( ĊĠĠĠ Ġrendering : ĠBase Screen , ĊĠĠĠ Ġview Environment : ĠView Environment ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġval Ġsync Hints Ġ= Ġview Environment Ġ+ Ġ( List Diff Mode Ġto ĠS ynchronous ) ĊĠĠĠ Ġval Ġasync Hints Ġ= Ġview Environment Ġ+ Ġ( List Diff Mode Ġto ĠAs ynchronous ) ĊĠĠĠ Ġno Diff List Stub . update ( rendering . list Rendering , Ġview Environment ) ĊĠĠĠ Ġsync List Stub . update ( rendering . list Rendering , Ġsync Hints ) ĊĠĠĠ Ġasync List Stub . update ( rendering . list Rendering , Ġasync Hints ) ĊĠĠĠ Ġadd Row Button . setOnClickListener Ġ{ Ġrendering . on Add Row T apped () Ġ} ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ: ĠView Factory < Base Screen > Ġby Ġbind ( ĊĠĠĠĠĠ ĠR . layout . base _ screen _ layout , Ġ:: Base Screen Layout Runner ĊĠ Ġ) Ċ } Ċ