Working code: https://github.com/lukeallison/ViewPagerMasterDetail
Android Master/Detail Flow template: http://developer.android.com/tools/projects/templates.html#master-detail-activity
Description: Using the Master/Detail Flow template available in Android Studio, my application utilizes a ViewPager to manage three Parent fragments. The third fragment is a Master (list), which has a Child (detail) fragment.
Issues:
- When fragment_item_list is first inflated the App Bar pushes the last item of the list below the bounds of the screen. This issue is no longer present after rotating the device. Simply adding padding to the bottom of the screen will not fix the issue as it will leave an unwanted space at the bottom of the screen after rotating. Numerous SO threads have failed to address this issue. - Fixed
- Requires
android:configChanges="orientation|keyboardHidden|screenSize"
in order for the Child (detail) fragment to inflate the correct layout when rotated. I'd like to not have to enforce this. PLEASE help fix this bug. - Uses deprecated setOnPageChangeListener and onAttach(Activity)
- Upgrading the dependencies to 23.2.0 results in the ItemListFragment failing to inflate the correct Fragment when rotated so I can't update the libraries in the application
- The code is probably more cumbersome than necessary
Please help me fix these bugs so we have a template that myself and others can use.