Navigation back event fixes for landscape orientation #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #393.
When a live stream activity is created in landscape mode, I would expect that a back navigation would cause the live stream itself to be closed and not to be put in portrait mode (as it did in v2.10.3). In v2.10.4 as part of the StreamFragment refactor, the isFullscreen boolean was previously used to determine whether to toggle fullscreen or not when a back navigation event occurred. In version v2.10.3 the isFullscreen flag would only ever change if the user was to manually switch to fullscreen. As part of the v2.10.4 refactor, this now relies on dynamically evaluating the current orientation without considering the users initial orientation. I've introduced StreamFragment#getInitialOrientation which exposes the initial orientation at the point of which a StreamFragment was created. This is then used in StreamActivity#onBackPressed to determine whether we should be toggling full screen or not given the current orientation is landscape.
Visual Representation:
I've also reduced the minimum chat size threshold to better cater for larger tablets.
FYI: I don't often write OOP and have only ever worked on personal android apps.