google / agera

Reactive Programming for Android
Apache License 2.0
7.2k stars 639 forks source link

Added layout presenter #149

Closed ghost closed 7 years ago

codecov-io commented 7 years ago

Codecov Report

Merging #149 into master will increase coverage by 0.41%. The diff coverage is 95.74%.

@@             Coverage Diff              @@
##             master     #149      +/-   ##
============================================
+ Coverage      97.2%   97.61%   +0.41%     
- Complexity      619      627       +8     
============================================
  Files            41       44       +3     
  Lines          1679     1763      +84     
  Branches        198      203       +5     
============================================
+ Hits           1632     1721      +89     
+ Misses           14        7       -7     
- Partials         33       35       +2
Impacted Files Coverage Δ Complexity Δ
...ogle/android/agera/rvadapter/LayoutPresenters.java 100% <100%> (ø) 3 <3> (?)
...oogle/android/agera/rvadapter/LayoutPresenter.java 100% <100%> (ø) 2 <2> (?)
...gle/android/agera/rvadapter/RepositoryAdapter.java 93.28% <91.89%> (+6.4%) 22 <0> (+1) :white_check_mark:
...era/rvdatabinding/DataBindingLayoutPresenters.java 96.66% <96.66%> (ø) 2 <2> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f14356c...d94ac50. Read the comment docs.

ghost commented 7 years ago

been giving this some thought, and think it's worth the extra 30 method count to rvadapter for the added ease of use. (I think the follow up collection change will possibly lead to a slight reduce too? I'll look into it.)

maxtroy commented 7 years ago

Per offline discussion, I still think the static layout presenters should use -1 for stable IDs. In this way, you don't need to maintain the dynamic presenter array, and you don't accidentally offset the user-provided stable IDs beyond Long.MAX_VALUE. Let any special need be handled by actual (special) RepositoryPresenter implementations.

ghost commented 7 years ago

Good point, beyond max value is def. an issue. How about an ID map, count up for each added item, adding the static at the start, and only have the map if there's static views? Best of both worlds? (or least worse?)

maxtroy commented 7 years ago

That's too much to handle :)

ghost commented 7 years ago

not too hard to do, and has no impact unless you use static items? why too much?