-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Tabs without titles #717
Conversation
There was a problem hiding this 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="http://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" /> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…eless tab icons from the center & isn't needed anyway since it's set dynamically.
@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. |
@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 :) |
I added some simple zoom animation for shifting titleless tabs, which looks at least better than the first alternative. |
@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. |
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. |
@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 :) |
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:
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. |
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 if there way to describe tab behaviour for every tab instead of for whole tab bar layout? |
@dimorinny maybe this will be available, i need to talk with @roughike |
I don't see reason why not. I'll make it available, since it's a minor change. |
@roughike thanks a lot. When are your planned to release this changes? |
I'd say we could make a release pretty soon, as we already have a lot of stuff lined up. |
* 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
How do in bar only icons(without title)? |
@Defaault please look at the readme in the main page, is the titleless feature |
Must i write something in class? |
Or exist some function |
@yombunker Thanks! I had seen |
@yombunker There's no such feature in the README... |
* 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
* 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.
* 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
No description provided.