Skip to content

Conversation

@hyochan
Copy link

@hyochan hyochan commented Oct 11, 2018

Support the feature request for #22882.

BottomNavigationBar to have no titles.

@Hixie
Copy link
Contributor

Hixie commented Oct 12, 2018

We still need the text for the titles, because otherwise we can't provide anything to the accessibility layer.

But maybe we can have a new BottomNavigationBarType that hides the labels from view?

@willlarche
Copy link
Contributor

Thank you so much, @dooboolab , for writing this!

Make the following changes when you have a moment:

  • Keep the title strings mandatory for the Semantics system to read.
  • Make titles something that's shown by default but hideable.
    • When hidden, the layout responds as if they are not there at all (as opposed to now where you pass "" and still have room for titles.)

@hyochan
Copy link
Author

hyochan commented Oct 16, 2018

@willlarche Thank you for the review. I've updated the codes applying to your review. I've created showLabel parameter in BottomNavigationBarItem that judges the rendering for the label. Would this be ok?

Copy link
Contributor

@willlarche willlarche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That actually doesn't put the label in the Semantic tree. Here's with your change:
screen shot 2018-11-02 at 12 59 17 pm

And here's before your change:
screen shot 2018-11-02 at 12 59 12 pm

You can see "Alarm Tab 1 of 5" is the correct label for the 1st one. See if you can make it behave the same.

@hyochan
Copy link
Author

hyochan commented Nov 13, 2018

@willlarche Hi. Sorry for the late comeback. I was busy preparing for the Y-Combinator interview.
I don't quite understand your review because the purpose of this update is to provide ability to support bottomNavigationBarItem without label.

Below is expected feature.
bottomnavigationbartext
BottomNavigationBarItem with labels.

bottomnavigationbar
BottomNavigationBarItem without labels.

I supported this providing showLabel attribute. Is there something I've not understood?

@willlarche
Copy link
Contributor

Yes, sorry. The accessibility experience needs to be the same with and without titles. Accessibility in Flutter is done thru the Semantics APIs. https://www.didierboelens.com/2018/07/semantics/

I've posted an image of what the semantics tree looks like with the titles (like before) and then what the tree looks like without the titles (new version.) We need them to be identical no matter what the front end looks like. So, even without seeing the titles, a blind user would be able to hear them.

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Nov 28, 2018
@willlarche
Copy link
Contributor

@hyochan are you ready for re-review on this?

@ohenley
Copy link

ohenley commented Jan 12, 2019

Did patch my flutter using this commit. Eg. win my case bottom_navigation_bar builds fixed label. I declare:

BottomNavigationBarItem(
icon: Icon(Icons.search),
title: Text("search"),
label: "search",
showLabel: false),

I still have "ghost" space for the text and therefore my icons are not centered on the main axis.
Am I using it wrong or it is the intended behavior?
Thx.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@hyochan hyochan force-pushed the bottom_navigation_bar branch from 03ce144 to 4ce9d68 Compare January 12, 2019 14:35
@googlebot
Copy link

CLAs look good, thanks!

@hyochan
Copy link
Author

hyochan commented Jan 12, 2019

@willlarche I've just updated my code. Sorry for the delay, I needed to think the way to support semanticLabel since the title widget could be any widget including, Container. I tried to get text value out of Text widget. I've also done the rebase. Lastly, I've tried to expose heightFactor in last commit to support flexible design (Don't know why the last commit fails the build tough). Please review my update!

@ohenley My code wasn't ready since I was applying to support semanticLabel. Could you try current update?

Copy link
Contributor

@willlarche willlarche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, @hyochan . Thank you. I'll do a proper review Tuesday but I wanted to let you know that I'm still seeing the height change when there's showLabel: false. Here's from my simulator. The clock icon should not rise, right?
simulator screen shot - iphone xs max - 2019-01-12 at 15 21 41

@hyochan
Copy link
Author

hyochan commented Jan 13, 2019

@willlarche Well, I thought that was expected when bottomNavigationBar is built with

type: BottomNavigationBarType.shifting

which is the default type. If you don't want your icon to rise, I think we should use below.

type: BottomNavigationBarType.fixed

P.S. I've just pushed another commit since I found unnecessary margin in fixedLabel.

@ohenley
Copy link

ohenley commented Jan 13, 2019

@hyochan:
can not try today, will do tomorrow.

@willlarche and @hyochan :
regarding the clock icon rising, just to add to the comment by hyochan, from what I recall of the implementation, type: BottomNavigationBarType.shifting (icon rising behaviour) is selected automatically in code when you have more than 3 navigation_bar_item in the nav_bar.

@willlarche
Copy link
Contributor

You're right! Thanks for your patience.

So, this looks almost there. I'll put in a couple notes at the request of @jonahwilliams who will take over review as I'll be unavailable for 3 weeks.

@hyochan
Copy link
Author

hyochan commented Jan 18, 2019

@jonahwilliams I've made the fix. Thanks.

@hyochan hyochan force-pushed the bottom_navigation_bar branch from 6bda283 to a7dc74c Compare February 12, 2019 13:49
@googlebot
Copy link

CLAs look good, thanks!

@hyochan
Copy link
Author

hyochan commented Feb 12, 2019

@jonahwilliams Thanks. I was able to do the job with your grateful help 🍻.
image

P.S I've tested this locally and checked it is passing. I don't get why CI build is failing.

@jonahwilliams
Copy link
Contributor

Several files have trailing whitespace:

⏩ RUNNING: cd .; grep --line-number --extended-regexp [[:blank:]]$ packages/flutter/lib/src/material/bottom_navigation_bar.dart packages/flutter/test/material/bottom_navigation_bar_test.dart
packages/flutter/test/material/bottom_navigation_bar_test.dart:882:    
packages/flutter/test/material/bottom_navigation_bar_test.dart:885: 
packages/flutter/test/material/bottom_navigation_bar_test.dart:927:    
🕐 ELAPSED TIME: 0:00:00.022591 for grep --line-number --extended-regexp [[:blank:]]$ packages/flutter/lib/src/material/bottom_navigation_bar.dart packages/flutter/test/material/bottom_navigation_bar_test.dart in .: 
Whitespace detected at the end of source code lines.
Please remove:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ERROR: Last command exited with 0 (expected: 1).
Command: grep --line-number --extended-regexp [[:blank:]]$ packages/flutter/lib/src/material/bottom_navigation_bar.dart packages/flutter/test/material/bottom_navigation_bar_test.dart
Relative working directory: .

@willlarche
Copy link
Contributor

@jonahwilliams 's approval and passing tests all that's needed now.

@johnsonmh
Copy link
Contributor

Hi Hyo, thanks so much for opening this PR and working on this feature since it is highly requested! I’m making a number of unrelated changes to the BottomNavigationBar component in: #27698. My changes update the motion logic of the BottomNavigationBar and will remove some of the code you've been working in here. Would it be OK if I incorporate some of the work you did in your PR into my current PR? I will close your PR and add you as a co-author on the new PR.

Fixed filtering down the predicate when testing Opacity of showLabel=false [BottomNavigationBar].
@hyochan
Copy link
Author

hyochan commented Feb 13, 2019

@willlarche @jonahwilliams I think I made it now. Sorry that it took me times to recognize the process of contribution to flutter since this was my first time. I can do better next time. Please review once more.

@johnsonmh Hi. Thank you for the great offer, but I'd like to make this PR as one complete one since I've been taking quite a time working on it. Also, I am thinking of another work based on this which is #22685. I am planning to close that one when I start working on that. I hope you could rebase if possible.

johnsonmh added a commit to johnsonmh/flutter that referenced this pull request Feb 14, 2019
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

will land when tree is unfrozen

@willlarche willlarche changed the title [FR] BottomNavigationBar fixed with no titles. [WIP] [FR] BottomNavigationBar fixed with no titles. Feb 14, 2019
@willlarche
Copy link
Contributor

Put a temporary flag on it so I can merge it simultaneously with #27698 next week.

@willlarche
Copy link
Contributor

@hyochan , You've worked super hard on this and we want to land it. Since @johnsonmh 's PR would have a slight breaking change to yours, we're going to merge them together next week so there's no Flutter release between their merges. Just means holding for a few days! You're all set.

@hyochan
Copy link
Author

hyochan commented Feb 15, 2019

Thank you so much. I am very honored to contribute to this awesome Google project. I will do more and better next time.

@willlarche
Copy link
Contributor

willlarche commented Feb 15, 2019 via email

@HansMuller
Copy link
Contributor

Similar versions of the changes and new tests included in this PR were also included in what is now #28159

I'm going to close this PR in favor of #28159. I have listed you as a co-contributor on #28159, please let me know if that's OK.

@HansMuller HansMuller closed this Feb 19, 2019
@hyochan
Copy link
Author

hyochan commented Feb 19, 2019

@HansMuller I thought I've already answered above that I wish this PR could be merged as one complete one. I wished myself to list up my PR's and being motivated to contribute to flutter further. Why couldn't this be merged and rebase separately? I've also done quite a work rebasing because I had to wait for the reviews even though I was on the recent branch.

@HansMuller
Copy link
Contributor

@hyochan Right, but unfortunately the work you did here was independently duplicated in another PR that had broader scope (#28159). It wouldn't make sense to land this PR only to effectively remove it with #28159.

I wanted to give you credit for the work you did, which is why I added you as a co-contributor to #28519.

@hyochan hyochan deleted the bottom_navigation_bar branch February 19, 2019 23:45
@hyochan hyochan changed the title [WIP] [FR] BottomNavigationBar fixed with no titles. [FR] BottomNavigationBar fixed with no titles. Nov 22, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants