I'm using in my app the Conductor framework.
The app in general is fixed in portrait state, but I have 2 Controllers
that use ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
and respond to device orientation changes
Controller
A - shows a summary of images takenController
B - is the camera interactionso when A is launched, it immediately launches B and shows the summary after images are taken.
A holds a RecyclerView
that uses FlexboxLayoutManager
(when I tried replacing the layout manager w/ a simple LinearLayoutManager
nothing changed)
I have 3 flows that work fine:
However this scenario fails:
The device in held in Portrait -> A is launched -> B is launched -> device orientation changes to Landscape -> images are taken -> B is closed -> the images are NOT shown in A
In all the flows I see that the adapter
is aware of the new items, and getItemViewType
, onCreateViewHolder
and onBindViewHolder
are called with the correct positions
The flow that fails is actually that one that seems most natural to me as a user :(
UPDATE:
android:layout_height="wrap_content"
android:layout_height="match_parent"
while working with LinearLayoutManager
works (looks ugly)FlexboxLayoutManager
fails all the flows that worked beforeSo I'm taking a look now at FlexboxLayoutManager
to see if I can fix this easily - I don't think that a recycler view is actually needed in my flow
It seems that the solution was just changing the RecyclerView
from android:layout_height="wrap_content"
to android:layout_height="match_parent"
.
In the update above I said that it still doesn't work with FlexboxLayoutManager
, but the problem was on my end (too commenting out and in of code).
The original code wasn't written by me, so I'm not sure why wrap_content
was used