android-maps-utils icon indicating copy to clipboard operation
android-maps-utils copied to clipboard

cluster text not visible on 0.4.4

Open mengoni opened this issue 10 years ago • 4 comments

Summary:

Upgrading to 0.4.4 the text on clusters is not visible (the number of items in cluster).

Steps to reproduce:

In previous version I used this code: mIconClusterGenerator.setTextAppearance(com.google.maps.android.R.style.ClusterIcon_TextAppearance); but on 0.4.4 the resource is not available. I tried to use instead: mIconClusterGenerator.setTextAppearance(com.google.maps.android.R.style.amu_ClusterIcon_TextAppearance);

Expected behavior:

On map should be visible the number of items within the clusters.

Observed behavior:

In the logs I can correctly see the number of items, but on map the cluster text is not visible.

Device and Android version:

I tried on Nexus 5 and Nexus 6P with latest play services.

Screenshots:

screenshot_20160912-165800

mengoni avatar Sep 12 '16 15:09 mengoni

Same for me

dawidhyzy avatar Sep 27 '16 11:09 dawidhyzy

Same issue here

BxSMobility avatar Sep 27 '16 14:09 BxSMobility

I tried to implement a custom style like

<style name="AppTheme.ClusterIcon.TextAppearance" parent="AppTheme"> <item name="android:fontFamily">sans-serif</item> <item name="android:textStyle">bold</item> <item name="android:textSize">16sp</item> <item name="android:textColor">@color/simple_white</item> </style>

then use it mIconClusterGenerator.setTextAppearance(context, android.R.style.AppTheme_ClusterIcon_TextAppearance);

But the result is the same: transparent text on cluster items.

EDIT: After few digging the commit I noticed that also makeSquareTextView method changed. from squareTextView.setId(R.id.text); to squareTextView.setId(R.id.amu_text);

this make the style change be able to show text label

from mIconGenerator.setTextAppearance(R.style.ClusterIcon_TextAppearance); to mIconGenerator.setTextAppearance(R.style.amu_ClusterIcon_TextAppearance);

references: https://github.com/googlemaps/android-maps-utils/commit/29490ad2cbc6bf2fb13fb7ac60eb8769c408bd51 http://stackoverflow.com/questions/39205798/textview-in-settextappearance-android-maps-utils-0-4-4-always-transparent

bishop87 avatar Sep 27 '16 14:09 bishop87

Thanks @bishop87 your fix works for me!

mengoni avatar Oct 13 '16 16:10 mengoni