-
Notifications
You must be signed in to change notification settings - Fork 307
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
WIP - Fix #871 - Fix Logo Padding in left hand mode #872
Conversation
@m-yang Regarding the failing CLA check - could you please see cla-assistant/cla-assistant#186, and try following the steps outlined there to see if that fixes it? |
@barbeau Incidentally, the CLA issue seems to have been fixed as well. Before the rebase, there were commits from my old username which may have caused problems with the CLA. |
Thanks for taking a shot at this! Nice CLA is fixed too. The left margin will need to be set based on screen width which varies per device. For example, here's how it looks on a Samsung Galaxy S8+: Note that this margin also affects the compass position at the top of the screen when you rotate the map: I think this is ok for left hand mode as long as it has the correct margin based on device screen width too. |
@@ -121,6 +121,13 @@ | |||
StopOverlay.OnFocusChangedListener, OnMapReadyCallback, | |||
VehicleOverlay.Controller, LayersSpeedDialAdapter.LayerActivationListener { | |||
|
|||
|
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.
Extra new line here - please remove
I think a less complex solution that avoids additional interfaces and callbacks is to check the left hand preference when instantiating the BaseMapFragment, and if true pass the left map margin into the BaseMapFragment via an Intent when it's instantiated. You can then read this Bundle via See the use of Also, the |
Thanks for your response.
Just want to clarify an issue about Bundles in the BaseMapFragment. In BaseMapFragment's I am reading the left padding passed in from HomeActivity through However, I'm getting a null reference error when calling If I do a null on What are some suggestions as to debugging this issue? |
@m-yang Sorry for the delay getting back to you, I've been swamped lately and got buried in some other tasks. Hopefully I'll have a chance to look at this soon. |
@m-yang Thinking more and looking at
...and if the padding is saved you'd set the padding value there in the
That's similar to how we're handling if the map center has been initialized by checking if values have been set for the
Let me know if you have any questions about this. Also please push any code you have so far if you have more questions (even if it doesn't work) - it's easier for me to comment that way and if needed pull it in myself and run. |
Fixed issue (#871) by adjusting logo padding when left hand mode is enabled.
The fix required that HomeActivity implement a callback to listen for the the
onMapReady
call in the BaseMapFragment since thecheckLeftHandMode
in HomeActivity executed before the map was ready, leading to some issues where padding wasn't set properly when app is first opened.Let me know what you think.