GeekNews icon indicating copy to clipboard operation
GeekNews copied to clipboard

同页面多presenter问题

Open luckyjmcc opened this issue 7 years ago • 2 comments

想请教一下,如果同个activity或fragment有多个presenter,这种情况要怎么封装代码?

luckyjmcc avatar Jul 12 '17 01:07 luckyjmcc

我也想知道怎么封装,一个的时候就好弄,多个的情况怎么封装?

tengye avatar Sep 22 '17 07:09 tengye

我个人的做法是用组合来解决这个 建立一个汇总Presenter继承各个接口,构造方法里面创建出多个需要的Presenter,分别调用子presenter对应的方法,在汇总presenter的attach和detach方法里面绑定和解绑各个presenter与View的关联 仅供参考

zhdhr0000 avatar Sep 25 '17 08:09 zhdhr0000