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

How to clear selection of tabs ? #3

Closed
deshario opened this issue Oct 22, 2017 · 7 comments
Closed

How to clear selection of tabs ? #3

deshario opened this issue Oct 22, 2017 · 7 comments

Comments

@deshario
Copy link

deshario commented Oct 22, 2017

How to clear the selection of tabs when i click the others tabs that have sub-items.
if we click the tabs that have sub-items ... the selection of tabs before is not removed. how can i remove it.
*** If there are not TabListItem ... everythings gonna perfect but we addTabListItem into tabs .. there will be this problem... ***
Thankyou
screenshot_1508671276

@samita121
Copy link

I wonder to know it too.

@ashazar
Copy link
Owner

ashazar commented Oct 23, 2017

When you click on another tab with sub-items, you actually don't select it yet.
That's why the actual (previous selected) tab is still kind-of active. (inactiveSelected)
So i planned to give it a darker color of selected background color as inactiveSelected color

The arguments for the setTabBackgroundColors() and setBackgroundColors() are as follows:
(DEFAULT_COLOR, SELECTED_COLOR, INACTIVE_SELECTED_COLOR)

You can make its inactiveSelected color as the default (unselected) color.

For all Tabs:

TabDrawerData
    .setTabBackgroundColors(DEFAULT_COLOR, SELECTED_COLOR, DEFAULT_COLOR);

For a specific Tab:

Tab
    .setBackgroundColors(DEFAULT_COLOR, SELECTED_COLOR, DEFAULT_COLOR);

@deshario
Copy link
Author

Ok Thankx. It works.

@deshario
Copy link
Author

When we popBackStackImmediate() all fragments its will be returned to first page... but tab is still selected to previous one. can we implement with onBackPressed() to select first tab.
backpressed

@ashazar
Copy link
Owner

ashazar commented Oct 24, 2017

Good catch! Thanks.

I will add a method to select a tab manually, in the coming release.

@deshario
Copy link
Author

Oh I'm waiting for your new release... because i need to submit my app very soon 😉😉😉

@ashazar
Copy link
Owner

ashazar commented Oct 25, 2017

You need to change TabDrawer's version to 1.2.0 in your build.gradle file.
Then you can use tabDrawer.setSelectedTab(tabPosition, itemPosition, false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants