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

SearchView not on top of toolbar in one activity. Fine in the other #153

Closed
bignadad opened this issue Aug 20, 2018 · 5 comments
Closed

Comments

@bignadad
Copy link

I have 2 activities using the same theme but the searchview is offset on the child activity.
In my main activity it works fine. But in my child activity that is launched from my main its offset.

I do have a tab layout in the parent activity.

Any ideas what to look for to fix this?

screenshot_20180819-232521_memoria
screenshot_20180819-232458_memoria

@AllanWang
Copy link
Owner

Can you elaborate on what you mean by "child activity"? How are the styles different between the two activities? My guess is that in one of them you've set it to fit the system window, as the offset looks to be the same as the status bar height. There's a way to override the offset when it draws if you'd like to look into that.

I won't be able to look into it myself until after my internship.

@bignadad
Copy link
Author

child activity meaning the activity that is working is starting it. the styles are the same and not using any systemfitwindows.

I tried this 'searchView?.menuY = -resources.getStatusBarHeight()' right after the bind searchview but didnt do anything. Am I calling it correctly?

@bignadad
Copy link
Author

sorry i realize now you say in comments to call in the open listener. I will see if that works

@bignadad
Copy link
Author

That fixed it. Thank you.

@AllanWang
Copy link
Owner

Great! I recommend you make it relative, as in using "-=" rather than "=". This probably works now because menuY is 0, but in the event your toolbar is not at the top, you'll have a problem again.

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

2 participants