<commit_before>package de.bitdroid.flooding.map;

import java.util.ArrayList;
import java.util.List;

import org.osmdroid.api.IMapView;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.util.ResourceProxyImpl;
import org.osmdroid.views.overlay.ItemizedOverlay;
import org.osmdroid.views.overlay.OverlayItem;

import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Point;

import de.bitdroid.flooding.R;


final class StationsOverlay extends ItemizedOverlay<OverlayItem> {
	
	public static final int LOADER_ID = 43;

	private final List<OverlayItem> overlayItems = new ArrayList<OverlayItem>();
	private final List<Station> stations = new ArrayList<Station>();
	private final Context context;

	public StationsOverlay(
			Context applicationContext,
			Context activityContext,
			List<Station> stations) {

		super(
				applicationContext.getResources().getDrawable(android.R.drawable.presence_online), 
				new ResourceProxyImpl(applicationContext));

		this.context = activityContext;
		this.stations.addAll(stations);

		for (Station station : stations) {
			String name = station.getName();
			GeoPoint point = new GeoPoint(station.getLat(), station.getLon());
			overlayItems.add(new OverlayItem(name, name, point));
		}

		populate();
	}


	@Override
	protected OverlayItem createItem(int idx) {
		return overlayItems.get(idx);
	}


	@Override
	public int size() {
		return overlayItems.size();
	}


	@Override
	public boolean onSnapToItem(int x, int y, Point snapPoint, IMapView mapView) {
		return false;
	}


	@Override
	protected boolean onTap(int index) {
		Station station = stations.get(index);
		new AlertDialog.Builder(context)
			.setTitle(R.string.map_dialog_station_info_title)
			.setMessage(context.getString(
						R.string.map_dialog_station_info,
						station.getName(),
						station.getKm(),
						station.getLat(),
						station.getLon()))
			.setPositiveButton(R.string.btn_ok, null)
			.show();

		return true;
	}

}<commit_msg>map: StationsOverlay shows dark dialog<commit_after>package de.bitdroid.flooding.map;

import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Point;
import android.view.ContextThemeWrapper;

import org.osmdroid.api.IMapView;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.util.ResourceProxyImpl;
import org.osmdroid.views.overlay.ItemizedOverlay;
import org.osmdroid.views.overlay.OverlayItem;

import java.util.ArrayList;
import java.util.List;

import de.bitdroid.flooding.R;


final class StationsOverlay extends ItemizedOverlay<OverlayItem> {
	
	public static final int LOADER_ID = 43;

	private final List<OverlayItem> overlayItems = new ArrayList<OverlayItem>();
	private final List<Station> stations = new ArrayList<Station>();
	private final Context context;

	public StationsOverlay(
			Context applicationContext,
			Context activityContext,
			List<Station> stations) {

		super(
				applicationContext.getResources().getDrawable(android.R.drawable.presence_online), 
				new ResourceProxyImpl(applicationContext));

		this.context = activityContext;
		this.stations.addAll(stations);

		for (Station station : stations) {
			String name = station.getName();
			GeoPoint point = new GeoPoint(station.getLat(), station.getLon());
			overlayItems.add(new OverlayItem(name, name, point));
		}

		populate();
	}


	@Override
	protected OverlayItem createItem(int idx) {
		return overlayItems.get(idx);
	}


	@Override
	public int size() {
		return overlayItems.size();
	}


	@Override
	public boolean onSnapToItem(int x, int y, Point snapPoint, IMapView mapView) {
		return false;
	}


	@Override
	protected boolean onTap(int index) {
		Station station = stations.get(index);
		new AlertDialog.Builder(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Dialog))
			.setTitle(R.string.map_dialog_station_info_title)
			.setMessage(context.getString(
					R.string.map_dialog_station_info,
					station.getName(),
					station.getKm(),
					station.getLat(),
					station.getLon()))
			.setPositiveButton(R.string.btn_ok, null)
			.show();

		return true;
	}

}
{'fraction_non_alphanumeric': 0.10654342009243493, 'fraction_numerical': 0.0009729992702505473, 'mean_word_length': 4.7834036568213785, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2013883', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1281, 'n_words': 270}