Android-maps-utils: cluster text not visible on 0.4.4

Created on 12 Sep 2016  路  4Comments  路  Source: googlemaps/android-maps-utils

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

Most helpful comment

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

All 4 comments

Same for me

Same issue here

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

Thanks @bishop87 your fix works for me!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bedzinsa picture bedzinsa  路  7Comments

kujaomega picture kujaomega  路  4Comments

TatyanaRTB picture TatyanaRTB  路  3Comments

DanielCFreitas picture DanielCFreitas  路  6Comments

SeijiIto picture SeijiIto  路  7Comments