-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify UI layout #371
Comments
…BarController (#371) this is a rather large commit that consists of the following changes: - UITypePhone now uses UITabBarController. - as a consequence UITypePhone no longer uses a main menu button (the "main menu" is a replacement for the navigation provided by UITabBarController). the changes are in RightPaneViewController. since none of the UI types is using a main menu any more, removal of the code that provides main menu support will be considered. - in landscape orientation, UITypePhone now displays the status view at the top of the screen, because it doesn't look good to have it sitting just above the tab bar. the changes are in LeftPaneViewController. - PlayRootViewNavigationController now has a bit of additional logic when not to show the navigation bar. - extended layout is now fully supported on UIAreaPlay. this means that bars at the top and bottom of the screen are now properly translucent, at the top the navigation bar extends behind the status bar, and the root view controller of the UITabBarController sets the proper background color to provide a backdrop showing through the translucent bars. - MainTabBarController is now the application window's root view controller, because extended layout support at the screen top didn't work correctly when a different view controller was used as the application window's root view controller (no specifics are available anymore, but it had to do something with the navigation bar at the top of the screen). - WindowRootViewController is removed since it is no longer used. its responsibilities (provide interface orientation change support and owner of the magnifying class) are moved to MainTabBarController. - StatusViewController now uses a container view to allow for simpler Auto Layout constraints.
…371) change details: - in landscape orientation, no longer use BoardPositionToolbarController at the top of the screen in the left pane. - in both portrait and landscape orientation, no longer use NavigationBarController with its three navigation bars faking a single bar. - in portrait orientation, instead use the single navigation bar provided by PlayRootViewNavigationController and populate its left/right bar button items, as well as integrate the status view as the navigation bar's title view. - in landscape orientation, instead display a button box with the game actions and the status view at the top of the screen in the left pane. - extended layout support: PlayRootViewControllerPad now defines a background color to be shown behind the translucent bars at the top and bottom of the screen. - LeftPaneViewController and RightPaneViewController are radically simplified because they now have to support only a single layout.
…tion bar (#371) change details - no longer use NavigationBarController with its three navigation bars faking a single bar. instead use the single navigation bar provided by PlayRootViewNavigationController and populate its left/right bar button items, as well as integrate the status view as the navigation bar's title view. - extended layout support: PlayRootViewControllerPortraitOnly now defines a background color to be shown behind the translucent bars at the top and bottom of the screen.
… navigate board positions (#371) change details: - together with the previous commit this commit fully aligns the layout of UITypePhonePortraitOnly with the portrait layouts of UITypePhone and UITypePad - no longer use BoardPositionToolbarController with its custom toolbar that alternates between buttons and a collection view. instead use the (by now) standard ButtonBoxController for the navigation buttons in combination with collection view. - the collection view cells are no longer of type BoardPositionView, instead they are of type BoardPositionCollectionViewCell - additional Auto Layout constraints are necessary to properly center the board view in vertical direction
…extended layout (#371) other improvements - show a background for iOS versions 12.x and older - show a grey-ish table view background color, which is aesthetically more pleasing than the white-ish system background color - layout the text view with margins around it; for the manually created NSLayoutConstraint objects this means that they now relate to the system-provided layout margins guide instead of to the superview bottom edge - handle multiple consecutive keyboard show/hide notifications of the same type; especially multiple show notifications now no longer lead to the text view bottom edge being incorrectly aligned
- BoardPositionView: was used on UITypePhonePortraitOnly. is replaced by BoardPositionCollectionViewCell. - CurrentBoardPositionViewController: was used on UITypePhonePortraitOnly. no replacement. - BoardPositionToolbarController: was used on UITypePad and UITypePhonePortraitOnly. no direct replacement. navigation occurs now via ButtonBoxController. - BoardPositionListViewController: was used on UITypePhonePortraitOnly. is replaced by BoardPositionCollectionViewController. - NavigationBarControllerPhonePortraitOnly / NavigationBarController: was used on UITypePad and UITypePhonePortraitOnly. no direct replacement. instead of faking a single navigation bar with three consecutive navigation bars the navigation bar displayed by PlayRootViewNavigationController is now used to display buttons and the status view. - one of the most recent things investigated to support extended layout was to set the controller as the delegate of its 3 navigation bars and override the UINavigationBarDelegate method positionForBar: to return UIBarPositionTopAttached. the goal: let the bars extend upwards behind the status bar. this research was abandoned when the UI layout unification direction was decided upon. - NavigationBarControllerPhone: was used on UITypePhone. no direct replacement. the navigation bar displayed by PlayRootViewNavigationController is now used to display buttons and the status view. - MainNavigationController: was used on UITypePhone. replaced by MainTabBarController. - MainTableViewController: was used on UITypePhone. no replacement. - MainMenuPresenter: was used on UITypePhone. no replacement. - main menu icon resource: was used on UITypePhone. no replacement.
A consequence of the unification effort is that in Portrait orientation the vertical space available for the board view is now slightly reduced. For most iPhone devices this is not a problem, because for them the vertical space available is still larger than the screen width, so the screen width remains the limiting dimension for the square board view. However, for the smallest iPhone devices that the app still supports - the iPhone 5S and the iPhone SE (640 points vertical screen size) - the reduction means that the vertical space available is now less than the screen width, so the vertical space available now becomes the limiting dimension. In practice on the affected iPhone devices for some board sizes coordinate labels and/or move numbers and label markup will no longer show up without zooming in. |
…e and UILayoutPad (#371) as a result of the UI layout unification, both the .h and .m files of PlayRootViewControllerPhone and PlayRootViewControllerPad were 99% identical, line for line, so merging the two classes into one is inevitable, although version control history of the original files is lost by this action. the 3 differences that existed are now encoded in the switch-statement in the initializer of the new class PlayRootViewControllerPhoneAndPad.
Ready for next release, closing this issue. |
The app currently has very different UI layouts for the three UI types.
UITypePhonePortraitOnly
)UITypePhone
)UITypePad
)A decision has been reached to unify the layouts of the three UI types as much as possible. These were the main decision drivers:
UICollectionView
andBoardPositionCollectionViewCell
. This means changingUITypePad
(get rid of the table view based approach) andUITypePhonePortraitOnly
(get rid of the alternativeUICollectionView
implementation that usesBoardPositionView
as the cell type).UITypePad
andUITypePhonePortraitOnly
currently have hacks that mangleUIToolBar
into submission, so if possible these should start to use the customButtonBoxController
view controller instead of aUIToolbar
.UITypePhone
looks quite neat in my opinion, but the pain and workarounds it took to implement are pretty horrible, and not everything works 100% the way it should. Plus every time I upgrade to a new iOS version there is a new set of smaller or bigger issues that need to be fixed. Again, I am no longer willing to spend the time to support this, so I am going to switch to anUITabBarController
based layout onUITypePhone
. The drawback for the user is that in landscape orientation the board will have less vertical space and will therefore become smaller.UITypePhone
layout to useUITabBarController
, it should be very similar to theUITypePad
layout. There is a huge promise that the two layouts can be merged, with only minimal differences between them.edgesForExtendedLayout
toUIRectEdgeNone
andautomaticallyAdjustsScrollViewInsets
to NO.The text was updated successfully, but these errors were encountered: