Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add Mapbox logo and attribution button to Android #2074

Closed
ljbade opened this issue Aug 14, 2015 · 16 comments
Closed

Add Mapbox logo and attribution button to Android #2074

ljbade opened this issue Aug 14, 2015 · 16 comments
Labels
Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS

Comments

@ljbade
Copy link
Contributor

ljbade commented Aug 14, 2015

After the compass and location marker the only missing UI elements vs iOS is the Mapbox logo and attribution button.

@ljbade ljbade added the Android Mapbox Maps SDK for Android label Aug 14, 2015
@ljbade
Copy link
Contributor Author

ljbade commented Aug 14, 2015

@bleege Perhaps you can do this once you get location marker refactor finished?

@ljbade ljbade added the GL JS parity For feature parity with Mapbox GL JS label Aug 14, 2015
@tobrun
Copy link
Member

tobrun commented Aug 18, 2015

If you can provide a screenshot of the iOS version + MapBox logo. I will take this up.

@bleege bleege added this to the Android b1 milestone Aug 20, 2015
@friedbunny
Copy link
Contributor

The Mapbox logo that's bundled with iOS lives here: /platform/ios/resources

ios simulator screen shot aug 20 2015 11 37 18 am

The logo stays pinned to the bottom-left and the attribution control is at the bottom-right. Both must be movable/hide-able.

@tobrun
Copy link
Member

tobrun commented Aug 21, 2015

Logo is added but the sample app is currently using the bottom-right to display a fab for user location.

device-2015-08-21-091136

Are the actions behind the attribution control the same as the ones found in the navigation drawer?

device-2015-08-21-091504

@friedbunny
Copy link
Contributor

Are the actions behind the attribution control the same as the ones found in the navigation drawer?

No, that appears to correspond to the gears debug menu on iOS.

I'm not sure which direction @ljbade and @bleege want to take the attribution control on Android, but here are the strings and here are the links/actions on iOS. This contains:

@ljbade
Copy link
Contributor Author

ljbade commented Aug 21, 2015

I think the attribution control should be fairly easy to implement with some sort of popup dialog.

Only thing not settled yet is metrics stuff.

@tobrunvannuland - yeah every app might have different UI overlaid on the map. At a minimum we should allow configuring of which corner the logo is in, and possibly provide fine tuning of the margin.

@friedbunny
Copy link
Contributor

Oh, I should say: we've made the logo and attribution controls mildly configurable on iOS and they are hide-able/movable. See #1781.

@tobrun
Copy link
Member

tobrun commented Aug 31, 2015

I will implement a solution based on CompassView implementation:

  • expose method
  • expose attribute

Will use following method signatures:

LogoView:

  • setLogoVisible(boolean visible)
  • setLogoGravity(int gravity)
  • setLogoMargins(int left, int top, int right, int bottom)

AttributionControlView:

  • setAttributionControlVisible(boolean visible)
  • setAttributionControlGravitiy(int gravity)
  • setAttributionControlMargins(int left, int top, int right, int botton)

@ljbade

  • Shall I expose gravity + margins for CompassView as well?
  • Related to pop-up: there are 3 possible solutions
    • AlertDialog is not ideal due to problems found by Square, proposed only works for Android 4.3+. The basic idea can be ported to MapView activity lifecycle methods.
    • DialogFragment, not possible, don't make library depend on FragmentActivity/FragmentManager.
    • PopUpWindow, create custom dialog implementation

@bleege
Copy link
Contributor

bleege commented Aug 31, 2015

@tobrunvannuland This all looks great! Just a few pieces of feedback:

Logo and Attribution should always appear on the MapView, so there's no need to implement setXYZ ![screen shot 2015-08-31 at 2 15 42 pm](https://cloud.githubusercontent.com/assets/989928/9588008/4d995fba-4feb-11e5-9517-d5830d5ddf3d.png) Visible() methods for either of them. The other two methods for each look 👍 .

Here's what and how iOS provides for Attribution links. The top 3 all open Web pages in the native Web browser which is the same functionality that we can use in Android. No need to implement Adjust Privacy Setting yet, as the SDK does not have Metrics in it like iOS does (see #1033) so there's nothing to adjust yet. :-) It will in the future though as will the need to build the Adjust Privacy Setting option.

As for the UI pattern to display / hold this, please feel free to use what you think works best.

screen shot 2015-08-31 at 2 15 42 pm

@tobrun
Copy link
Member

tobrun commented Sep 1, 2015

@bleege
Currently for opening webpages I'm using the standard ACTION_VIEW intent. (shown left in GIF)
With minor adjustments we can use Chrome custom tabs.

webpage

Let me know what you prefer.

@ljbade
Copy link
Contributor Author

ljbade commented Sep 3, 2015

@tobrunvannuland Hmm I think a WebView would interfere less with the hosting Activity/app of the MapView? We need to be careful we don't break any UI flow of the hosting app.

@bleege
Copy link
Contributor

bleege commented Sep 3, 2015

@tobrunvannuland I'm intrigued by the Chrome custom tabs, but I think @ljbade is correct about firing an Intent to kick the germane Web site out to a WebVeiw interfering less with an app's UX. Since we're building an SDK, we can't assume any access to non MapView UI components.

@ljbade
Copy link
Contributor Author

ljbade commented Sep 3, 2015

@bleege True, I mean what happens if a user does not have a web browser or Chrome installed on their phone?

We should remember we want our Android SDK to work on all variations of Android if possible, not just Google blessed ones.

It is entirely possible Chineese Android based phones come with a completely different browser.

@ljbade
Copy link
Contributor Author

ljbade commented Sep 8, 2015

@bleege @incanus Do we need to include an option in the attribution screen that links or displays some of the licence notices as required by a number of the open source components used.

See https://github.com/mapbox/mapbox-gl-native/blob/8f37502c719feb151e01cb31d89c2effaf1b91ad/LICENSE.md

@bleege
Copy link
Contributor

bleege commented Sep 8, 2015

@ljbade I didn't see examples of license's requiring display inside of apps in the list. Did I miss something? If not, I think just having them in the LICENSE.md file as we do should be fine.

@incanus
Copy link
Contributor

incanus commented Sep 9, 2015

Fixed in #2292.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

No branches or pull requests

5 participants