<commit_before>
package com.uwetrottmann.shopr.ui;

import android.os.Bundle;

import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.MarkerOptions;
import com.uwetrottmann.shopr.model.Shop;
import com.uwetrottmann.shopr.utils.ShopUtils;

import java.util.List;

public class ShopMapFragment extends SupportMapFragment {

    public static final String TAG = "Shops Map";

    public static ShopMapFragment newInstance() {
        return new ShopMapFragment();
    }

    private List<Shop> mShops;

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        // enable my location feature
        getMap().setMyLocationEnabled(true);

        mShops = ShopUtils.getShopsSamples();

        onDisplayShops();

    }

    private void onDisplayShops() {
        for (Shop shop : mShops) {
            getMap().addMarker(new MarkerOptions().position(shop.location()).title(shop.name()));
        }
    }

}<commit_msg>Center map on user location upon launch.<commit_after>
package com.uwetrottmann.shopr.ui;

import android.location.Location;
import android.os.Bundle;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.uwetrottmann.shopr.model.Shop;
import com.uwetrottmann.shopr.utils.ShopUtils;

import java.util.List;

public class ShopMapFragment extends SupportMapFragment {

    private static final int ZOOM_LEVEL_INITIAL = 14;
    public static final String TAG = "Shops Map";

    public static ShopMapFragment newInstance() {
        return new ShopMapFragment();
    }

    private List<Shop> mShops;
    private Location mLocation;
    private boolean mIsInitialized;

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        mIsInitialized = false;

        // enable my location feature
        getMap().setMyLocationEnabled(true);

        mShops = ShopUtils.getShopsSamples();

    }

    @Override
    public void onStart() {
        super.onStart();

        onInitializeMap();

        onDisplayShops();
    }

    private void onInitializeMap() {
        if (!mIsInitialized) {
            mLocation = ((MainActivity) getActivity()).getLocation();
            if (mLocation == null) {
                return;
            }

            // move camera to current position
            getMap().moveCamera(
                    CameraUpdateFactory.newLatLngZoom(
                            new LatLng(mLocation.getLatitude(), mLocation.getLongitude()), ZOOM_LEVEL_INITIAL));

            mIsInitialized = true;
        }
    }

    private void onDisplayShops() {
        for (Shop shop : mShops) {
            getMap().addMarker(new MarkerOptions().position(shop.location()).title(shop.name()));
        }
    }

}
{'fraction_non_alphanumeric': 0.09867109634551495, 'fraction_numerical': 0.000664451827242525, 'mean_word_length': 2.8701799485861184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '984358', 'n_tokens_mistral': 866, 'n_tokens_neox': 840, 'n_words': 177}