1

In example of using yandexmapkit library called "yandexmapkit-sample" which I get from https://github.com/yandexmobile/yandexmapkit-android, when I started any example that have Balloon in it's code, text color and background color of Balloon are the same.

Can I change these colors somehow?

Overlay overlay = new Overlay(mMapController);
OverlayItem kremlin = new OverlayItem(new GeoPoint(55.752004 , 37.617017), res.getDrawable(R.drawable.kreml));
BalloonItem balloonKremlin = new BalloonItem(this,kremlin.getGeoPoint());
balloonKremlin.setText("Московский Кремль. Здесь можно ещё много о чём написать.");
balloonKremlin.setOnBalloonListener(this);
kremlin.setBalloonItem(balloonKremlin);
overlay.addOverlayItem(kremlin); 
mixel
  • 25,177
  • 13
  • 126
  • 165
Leonid
  • 4,953
  • 2
  • 10
  • 13

1 Answers1

0

Yes, it's possible: just create layout named ymk_balloon_default_layout.xml in your project and set color in there.

Something like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="horizontal"
              android:background="@drawable/ymk_balloon_black"
        >
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:id="@+id/ymk_balloon_text_view"
              android:gravity="fill_horizontal"
              android:ellipsize="end"
              android:singleLine="false"
              android:textSize="18dip"
              android:text="    "
              android:textColor="@color/your_color_here"
            />
</LinearLayout>

See MapKit sources.

Mikalai Daronin
  • 8,590
  • 2
  • 35
  • 47
  • Thanks a lot, it works. I understand that even when I was testing example I've changed it Gradle file in dependences instead of importing module that was with example I used to import 'ru.yandex:yandexmapkit:2.4.0@aar' . Thankyou one more time) – Leonid Mar 16 '16 at 06:26