Fixed
Status Update
Comments
st...@gmail.com <st...@gmail.com> #2
Another alternative may be to add a MergeAdapter.Config.Builder
constructor that accepts a seed configuration as a parameter, so that one could write
mAdapter = MergeAdapter(
MergeAdapter.Config.Builder(MergeAdapter.Config.DEFAULT)
.setStableIdMode(ISOLATED_STABLE_IDS)
.build(),
adapter1,
adapter2
)
etc.
sh...@google.com <sh...@google.com> #3
Sorry for the delay.
I think this is a very good point. Forwarding onto a colleague to see what they think.
yb...@google.com <yb...@google.com> #4
this makes sense but a bit risky because it will be a behavior change and we usually don't do those in beta. on the other hand, if not now, it will be never so might be better to just make the change instead.
yb...@google.com <yb...@google.com> #5
in fact, the docs say isolateViewTypes
defaults to true which it does not :).
I'll try to fix this before rc
st...@gmail.com <st...@gmail.com> #7
Thanks for the fix, folks! :)
Description
androidx.recyclerview:recyclerview:1.2.0-alpha03
First of all, thank you for the new
MergeAdapter
! This is my first time using and benefiting from it.When I create a merge adapter configuration via
MergeAdapter.Config.Builder().build()
, I receive a configuration withConfig::isolateViewTypes
set tofalse
. The value of this same field inMergeAdapter.Config::DEFAULT
istrue
.This violated the principle of least surprise for me. I was evolving code that initially used "no" (= the default) configuration:
I wanted to update this code to change the stable ID mode. I tried to achieve that by building and passing in a custom configuration:
but this temporarily broke my code because view type isolation changed compared to the initial code. I instead needed to explicitly write
to retain default view type isolation behavior.
Please evaluate whether it would be less surprising to initialize
in
MergeAdapter.Config::Builder
instead!