Search code examples
androidandroid-mapviewandroid-maps-utils

TextView in setTextAppearance() android-maps-utils 0.4.4 always transparent


After bump from 0.4.3 to 0.4.4 in android-maps-utils I cannot set TextView style in IconGenerator for cluster icons. TextView stays transparent no matter what style I use (from lib or from my styles.xml).

public class MapRenderCustom extends DefaultClusterRenderer<T> {
public MapRenderCustom(Context context, GoogleMap map, ClusterManager<T> clusterManager) {
    super(context, map, clusterManager);
new IconGenerator(contex).setTextAppearance(com.google.maps.android.R.style.ClusterIcon_TextAppearance);
}
}

Above works fine with 0.4.3. But in 0.4.4 it doesn't work (even with changing to amu_ClusterIcon_TextAppearance).

Code that can be blamed for this: https://github.com/googlemaps/android-maps-utils/commit/29490ad2cbc6bf2fb13fb7ac60eb8769c408bd51 but I don't see how it break visibility of TextView.


Solution

  • I solved as described here: https://github.com/googlemaps/android-maps-utils/issues/315

    copy/paste of my answer here: 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 as desired

    from

    mIconGenerator.setTextAppearance(R.style.ClusterIcon_TextAppearance);

    to

    mIconGenerator.setTextAppearance(R.style.amu_ClusterIcon_TextAppearance);