Skip to content
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

Tabs without titles #717

Merged
merged 14 commits into from
Mar 29, 2017
Merged

Tabs without titles #717

merged 14 commits into from
Mar 29, 2017

Conversation

roughike
Copy link
Owner

No description provided.

@roughike roughike added this to the Next version milestone Mar 27, 2017
@roughike roughike self-assigned this Mar 27, 2017
@roughike roughike requested a review from yombunker March 27, 2017 21:58
@roughike roughike changed the title Feature/tabs without titles Tabs without titles Mar 27, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 66.569% when pulling 0e0c581 on feature/tabs-without-titles into dbad9bb on development.

Copy link
Collaborator

@yombunker yombunker left a comment

Choose a reason for hiding this comment

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

Small comments

```xml
<selector xmlns:android="https://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_myicon_selected" android:state_selected="true" />
<item android:drawable="@drawable/ic_myicon_default" android:state_selected="false" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

The false if not needed because the last thing is always the default

Copy link
Owner Author

Choose a reason for hiding this comment

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

Did not know that, nice.

@@ -141,6 +143,11 @@ private void populateAttributes(Context context, AttributeSet attrs) {
tabXmlResource = ta.getResourceId(R.styleable.BottomBar_bb_tabXmlResource, 0);
isTabletMode = ta.getBoolean(R.styleable.BottomBar_bb_tabletMode, false);
behaviors = ta.getInteger(R.styleable.BottomBar_bb_behavior, BEHAVIOR_NONE);

if (isIconsOnlyMode() && isShiftingMode()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this restriction? they might want to set it as icon only and shifting and set the text manually as you did on your example, or is not that how it works your example?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I just thought it looked a little weird, and would require a boolean, since a tab can have only one type because it's an enum. Also I think having a separate layout resource for the titleless tab was cleaner than reusing fixed / shifting tab layouts.

But yeah, I think this limitation could be removed, as there will probably be someone who would like have shifting tabs without titles.

@roughike roughike requested a review from yombunker March 28, 2017 17:12
@roughike
Copy link
Owner Author

@yombunker Check out the latest changes.

Now the shifting behavior on titleless tab is allowed, but I feel it needs something as it looks quirky. Maybe the active icon should be lifted up a little bit? I already tried that with the titles on shifting titleless items set to "invisible" instead of a "gone" visibility, but that looked even weirder. Maybe the optimal is somewhere in the middle.

Let me know if you have suggestions what the selected shifting & titleless items should look like.

@yombunker
Copy link
Collaborator

@roughike i'll try it in a few hours to see how it looks, but, if it looks weird then i guess will be better to disable it as you had it, cause, then we will get more issues open of people that want it and it looks weird :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.1%) to 65.296% when pulling 649cb8c on feature/tabs-without-titles into dbad9bb on development.

@roughike
Copy link
Owner Author

I added some simple zoom animation for shifting titleless tabs, which looks at least better than the first alternative.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.7%) to 64.739% when pulling d8d9c56 on feature/tabs-without-titles into dbad9bb on development.

@yombunker
Copy link
Collaborator

@roughike you are right, looks weird :P let's better prevent it. You made a right call by not allowing it in the first place.

@roughike
Copy link
Owner Author

I'm betting that if we disable shifting titleless tabs, people will probably complain more than just simply allowing it. But this is hard to decide.

@yombunker
Copy link
Collaborator

@roughike not saying remove shifting, but, don't allow shifting and icons only, kind of what you did in the first place. But, go to sleep :)

@roughike
Copy link
Owner Author

I was talking about the same thing 💩

Maybe we could track down all the open and closed issues about this, make a gif on the shifting + iconOnly tab behavior and have a vote:

  • Should we keep it as is?
  • Should we change it? How?
  • Should we just disable shifting + iconsOnly tabs alltogether

Then just @mention all those people that originally requested this feature or commented on those feature requests in this PR / a separate issue. #373 is a good starting point, but I bet there's a lot of these closed and open.

@roughike
Copy link
Owner Author

I think the current way of shifting & iconsOnly is just fine. Let's allow it, people will create issues if they want some other behavior.

@roughike roughike merged commit 19f8300 into development Mar 29, 2017
@roughike roughike deleted the feature/tabs-without-titles branch March 29, 2017 18:51
@dimorinny
Copy link

dimorinny commented Mar 31, 2017

@roughike if there way to describe tab behaviour for every tab instead of for whole tab bar layout?
For example I want to have one titless element in my bar.

@yombunker
Copy link
Collaborator

@dimorinny maybe this will be available, i need to talk with @roughike

@roughike
Copy link
Owner Author

roughike commented Apr 1, 2017

I don't see reason why not.

I'll make it available, since it's a minor change.

@dimorinny
Copy link

@roughike thanks a lot. When are your planned to release this changes?
If there is something I can do to help you, let me know.

@roughike
Copy link
Owner Author

roughike commented Apr 1, 2017

I'd say we could make a release pretty soon, as we already have a lot of stuff lined up.

roughike added a commit that referenced this pull request Apr 6, 2017
* Data binding fixes clean (#712)

* Fix Bottom Bar issues with Android Data Binding

* keep .idea

* travis changes

* Fix for shadow (#716)

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* SelectableItemBackground Ripple! (#713)

* Add selectableItemBackground programmatically which shows user touch response with either ripple or slight change of colour if below lollipop.

* Remove style in tablet mode which makes ripple go out of bounds. Without it ripple is contained within its view.

* Remove unnecessary local reference.

* Added getTypedValue and getDrawableRes methods in MiscUtils and changed to selectableItemBackgroundBorderless.

* Change color to resId.

* Fix for wrong size in tabs

- Setting the modified LayoutParams so that the views are changed (#719)

* Tabs without titles (#717)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Basic support for tabs that have no title, only icons.

* Reverted debug code.

* Made sure that icon-only tabs throw an exception if they don't have icons.

* There's no need to set visibility to the title, as it's already visible.

* Added a sample for the icons only mode.

* Made the titleless mode combined with shifting mode work.

* Removed the eight dp padding from XML layout, since that offsets titleless tab icons from the center & isn't needed anyway since it's set dynamically.

* Added some zoom to active tab icons that are both shifting and titleless.

* Cleared up the select & unselect methods.

* Modified the color changing tabs sample height, so it looks less crammed and more like the design specs.

* Show & Hide methods when on shy mode. (#722)

* Added methods for showing / hiding the BottomBar when on shy mode.

* Better naming.

* Refactored the hide / show methods to a separate ShySettings class, since they were only related for a shy BottomBar.

* Made getting shy settings not throw an exception when the bottombar isn't shy, but have a log warning instead.

* Made it possible to have individual titleless tabs. (#726)

* Feature/optional long press toasts (#714)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Made it possible to control whether or not the Toasts are shown when long pressing tabs.

* Updated changelog.

* v2.3.0 (#732)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Bumped up version number.

* Updated Changelog & Readme
@Defaault
Copy link

Defaault commented Apr 9, 2017

How do in bar only icons(without title)?

@yombunker
Copy link
Collaborator

@Defaault please look at the readme in the main page, is the titleless feature

@Defaault
Copy link

Defaault commented Apr 9, 2017

Must i write something in class?

@Defaault
Copy link

Defaault commented Apr 9, 2017

Or exist some function

@Defaault
Copy link

Defaault commented Apr 9, 2017

@yombunker Thanks! I had seen

@mradzinski
Copy link

@yombunker There's no such feature in the README...

roughike pushed a commit that referenced this pull request Apr 12, 2017
* Data binding fixes clean (#712)

* Fix Bottom Bar issues with Android Data Binding

* keep .idea

* travis changes

* Fix for shadow (#716)

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* SelectableItemBackground Ripple! (#713)

* Add selectableItemBackground programmatically which shows user touch response with either ripple or slight change of colour if below lollipop.

* Remove style in tablet mode which makes ripple go out of bounds. Without it ripple is contained within its view.

* Remove unnecessary local reference.

* Added getTypedValue and getDrawableRes methods in MiscUtils and changed to selectableItemBackgroundBorderless.

* Change color to resId.

* Fix for wrong size in tabs

- Setting the modified LayoutParams so that the views are changed (#719)

* Tabs without titles (#717)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Basic support for tabs that have no title, only icons.

* Reverted debug code.

* Made sure that icon-only tabs throw an exception if they don't have icons.

* There's no need to set visibility to the title, as it's already visible.

* Added a sample for the icons only mode.

* Made the titleless mode combined with shifting mode work.

* Removed the eight dp padding from XML layout, since that offsets titleless tab icons from the center & isn't needed anyway since it's set dynamically.

* Added some zoom to active tab icons that are both shifting and titleless.

* Cleared up the select & unselect methods.

* Modified the color changing tabs sample height, so it looks less crammed and more like the design specs.

* Show & Hide methods when on shy mode. (#722)

* Added methods for showing / hiding the BottomBar when on shy mode.

* Better naming.

* Refactored the hide / show methods to a separate ShySettings class, since they were only related for a shy BottomBar.

* Made getting shy settings not throw an exception when the bottombar isn't shy, but have a log warning instead.

* Made it possible to have individual titleless tabs. (#726)

* Feature/optional long press toasts (#714)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Made it possible to control whether or not the Toasts are shown when long pressing tabs.

* Updated changelog.

* - Fix for shadow not respecting flag
   - API 21+ was not using the flag at all
   - API 20- where not removing the margin when no shadow was displayed
   - API 20- set the default visibility of the shadow to GONE
yombunker pushed a commit that referenced this pull request Apr 13, 2017
* Bug fix/shadow not respecting flag (#749)

* Data binding fixes clean (#712)

* Fix Bottom Bar issues with Android Data Binding

* keep .idea

* travis changes

* Fix for shadow (#716)

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* SelectableItemBackground Ripple! (#713)

* Add selectableItemBackground programmatically which shows user touch response with either ripple or slight change of colour if below lollipop.

* Remove style in tablet mode which makes ripple go out of bounds. Without it ripple is contained within its view.

* Remove unnecessary local reference.

* Added getTypedValue and getDrawableRes methods in MiscUtils and changed to selectableItemBackgroundBorderless.

* Change color to resId.

* Fix for wrong size in tabs

- Setting the modified LayoutParams so that the views are changed (#719)

* Tabs without titles (#717)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Basic support for tabs that have no title, only icons.

* Reverted debug code.

* Made sure that icon-only tabs throw an exception if they don't have icons.

* There's no need to set visibility to the title, as it's already visible.

* Added a sample for the icons only mode.

* Made the titleless mode combined with shifting mode work.

* Removed the eight dp padding from XML layout, since that offsets titleless tab icons from the center & isn't needed anyway since it's set dynamically.

* Added some zoom to active tab icons that are both shifting and titleless.

* Cleared up the select & unselect methods.

* Modified the color changing tabs sample height, so it looks less crammed and more like the design specs.

* Show & Hide methods when on shy mode. (#722)

* Added methods for showing / hiding the BottomBar when on shy mode.

* Better naming.

* Refactored the hide / show methods to a separate ShySettings class, since they were only related for a shy BottomBar.

* Made getting shy settings not throw an exception when the bottombar isn't shy, but have a log warning instead.

* Made it possible to have individual titleless tabs. (#726)

* Feature/optional long press toasts (#714)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Made it possible to control whether or not the Toasts are shown when long pressing tabs.

* Updated changelog.

* - Fix for shadow not respecting flag
   - API 21+ was not using the flag at all
   - API 20- where not removing the margin when no shadow was displayed
   - API 20- set the default visibility of the shadow to GONE

* Bumped up version numbers & updated changelog for new release.
yombunker pushed a commit that referenced this pull request May 28, 2017
* v2.3.1 (#751)

* Bug fix/shadow not respecting flag (#749)

* Data binding fixes clean (#712)

* Fix Bottom Bar issues with Android Data Binding

* keep .idea

* travis changes

* Fix for shadow (#716)

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* - Removing the view for API 21
- Adding a negative margin for API 20 or less so that the content is overlapped with the shadow
- Fix the annotation for the MiscUtils

* SelectableItemBackground Ripple! (#713)

* Add selectableItemBackground programmatically which shows user touch response with either ripple or slight change of colour if below lollipop.

* Remove style in tablet mode which makes ripple go out of bounds. Without it ripple is contained within its view.

* Remove unnecessary local reference.

* Added getTypedValue and getDrawableRes methods in MiscUtils and changed to selectableItemBackgroundBorderless.

* Change color to resId.

* Fix for wrong size in tabs

- Setting the modified LayoutParams so that the views are changed (#719)

* Tabs without titles (#717)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Basic support for tabs that have no title, only icons.

* Reverted debug code.

* Made sure that icon-only tabs throw an exception if they don't have icons.

* There's no need to set visibility to the title, as it's already visible.

* Added a sample for the icons only mode.

* Made the titleless mode combined with shifting mode work.

* Removed the eight dp padding from XML layout, since that offsets titleless tab icons from the center & isn't needed anyway since it's set dynamically.

* Added some zoom to active tab icons that are both shifting and titleless.

* Cleared up the select & unselect methods.

* Modified the color changing tabs sample height, so it looks less crammed and more like the design specs.

* Show & Hide methods when on shy mode. (#722)

* Added methods for showing / hiding the BottomBar when on shy mode.

* Better naming.

* Refactored the hide / show methods to a separate ShySettings class, since they were only related for a shy BottomBar.

* Made getting shy settings not throw an exception when the bottombar isn't shy, but have a log warning instead.

* Made it possible to have individual titleless tabs. (#726)

* Feature/optional long press toasts (#714)

* Update CHANGELOG.md

* Update README.md

* Update README.md

* Made it possible to control whether or not the Toasts are shown when long pressing tabs.

* Updated changelog.

* - Fix for shadow not respecting flag
   - API 21+ was not using the flag at all
   - API 20- where not removing the margin when no shadow was displayed
   - API 20- set the default visibility of the shadow to GONE

* Bumped up version numbers & updated changelog for new release.

* Replaced faulty onAnimationEnd listener by postDelayed call (#708) (#774)

* Bumped Support Library to 25.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants