<commit_before>package pl.temomuko.autostoprace.ui.teamslocationsmap;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.maps.android.clustering.ClusterManager;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

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

import javax.inject.Inject;

import butterknife.Bind;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import pl.temomuko.autostoprace.Constants;
import pl.temomuko.autostoprace.R;
import pl.temomuko.autostoprace.data.Event;
import pl.temomuko.autostoprace.data.model.LocationRecord;
import pl.temomuko.autostoprace.data.model.Team;
import pl.temomuko.autostoprace.ui.base.drawer.DrawerActivity;
import pl.temomuko.autostoprace.ui.main.MainActivity;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map.LocationRecordClusterItem;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map.LocationRecordClusterRenderer;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map.TeamLocationInfoWindowAdapter;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.searchteamview.SearchTeamView;
import pl.temomuko.autostoprace.util.IntentUtil;
import pl.temomuko.autostoprace.util.LogUtil;
import pl.temomuko.autostoprace.util.rx.RxCacheHelper;
import pl.temomuko.autostoprace.util.rx.RxUtil;
import rx.Observable;
import rx.Subscription;

/**
 * Created by <NAME> on 2016-02-05.
 */
public class TeamsLocationsMapActivity extends DrawerActivity
        implements TeamsLocationsMapMvpView {

    private static final String TAG = TeamsLocationsMapActivity.class.getSimpleName();
    private static final String BUNDLE_CURRENT_TEAM_LOCATIONS = "bundle_current_team_locations";
    private static final String BUNDLE_SEARCH_TEAM_VIEW = "bundle_team_list_hints";
    private static final float DEFAULT_MAP_ZOOM = 5.5f;
    private final static String RX_CACHE_ALL_TEAMS_TAG = "rx_cache_all_teams_tag";
    public static final String RX_CACHE_TEAM_LOCATIONS_TAG = "rx_cache_team_locations_tag";

    @Inject TeamsLocationsMapPresenter mTeamsLocationsMapPresenter;
    @Inject TeamLocationInfoWindowAdapter mTeamsLocationInfoWindowAdapter;

    @Bind(R.id.horizontal_progress_bar) MaterialProgressBar mMaterialProgressBar;
    @Bind(R.id.search_team_view) SearchTeamView mSearchTeamView;
    @Bind(R.id.rv_team_hints) RecyclerView mTeamHintsRecyclerView;
    @Bind(R.id.card_team_hints) CardView mTeamHintsLinearLayout;

    private boolean mAllTeamsProgressState = false;
    private boolean mTeamProgressState = false;
    private boolean mAnimateTeamLocationsUpdate = true;
    private GoogleMap mMap;
    private Subscription mSetHintsSubscription;
    private Subscription mSetLocationsSubscription;
    private ClusterManager<LocationRecordClusterItem> mClusterManager;
    private List<LocationRecord> mCurrentTeamLocations;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_teams_locations_map);
        getActivityComponent().inject(this);
        setupPresenter();
        setupSearchTeamView();
        setupIntent(getIntent());
        setupMapFragment();
    }

    @Override
    protected void onStart() {
        super.onStart();
        EventBus.getDefault().register(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mTeamsLocationsMapPresenter.loadAllTeams();
    }

    @Override
    protected void onStop() {
        super.onStop();
        EventBus.getDefault().unregister(this);
    }

    @Override
    protected void onDestroy() {
        mTeamsLocationsMapPresenter.detachView();
        if (mSetHintsSubscription != null) mSetHintsSubscription.unsubscribe();<commit_msg>Fixed intent setup in map activity<commit_after>package pl.temomuko.autostoprace.ui.teamslocationsmap;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.maps.android.clustering.ClusterManager;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

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

import javax.inject.Inject;

import butterknife.Bind;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import pl.temomuko.autostoprace.Constants;
import pl.temomuko.autostoprace.R;
import pl.temomuko.autostoprace.data.Event;
import pl.temomuko.autostoprace.data.model.LocationRecord;
import pl.temomuko.autostoprace.data.model.Team;
import pl.temomuko.autostoprace.ui.base.drawer.DrawerActivity;
import pl.temomuko.autostoprace.ui.main.MainActivity;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map.LocationRecordClusterItem;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map.LocationRecordClusterRenderer;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.map.TeamLocationInfoWindowAdapter;
import pl.temomuko.autostoprace.ui.teamslocationsmap.adapter.searchteamview.SearchTeamView;
import pl.temomuko.autostoprace.util.IntentUtil;
import pl.temomuko.autostoprace.util.LogUtil;
import pl.temomuko.autostoprace.util.rx.RxCacheHelper;
import pl.temomuko.autostoprace.util.rx.RxUtil;
import rx.Observable;
import rx.Subscription;

/**
 * Created by <NAME> on 2016-02-05.
 */
public class TeamsLocationsMapActivity extends DrawerActivity
        implements TeamsLocationsMapMvpView {

    private static final String TAG = TeamsLocationsMapActivity.class.getSimpleName();
    private static final String BUNDLE_CURRENT_TEAM_LOCATIONS = "bundle_current_team_locations";
    private static final String BUNDLE_SEARCH_TEAM_VIEW = "bundle_team_list_hints";
    private static final float DEFAULT_MAP_ZOOM = 5.5f;
    private final static String RX_CACHE_ALL_TEAMS_TAG = "rx_cache_all_teams_tag";
    public static final String RX_CACHE_TEAM_LOCATIONS_TAG = "rx_cache_team_locations_tag";

    @Inject TeamsLocationsMapPresenter mTeamsLocationsMapPresenter;
    @Inject TeamLocationInfoWindowAdapter mTeamsLocationInfoWindowAdapter;

    @Bind(R.id.horizontal_progress_bar) MaterialProgressBar mMaterialProgressBar;
    @Bind(R.id.search_team_view) SearchTeamView mSearchTeamView;
    @Bind(R.id.rv_team_hints) RecyclerView mTeamHintsRecyclerView;
    @Bind(R.id.card_team_hints) CardView mTeamHintsLinearLayout;

    private boolean mAllTeamsProgressState = false;
    private boolean mTeamProgressState = false;
    private boolean mAnimateTeamLocationsUpdate = true;
    private GoogleMap mMap;
    private Subscription mSetHintsSubscription;
    private Subscription mSetLocationsSubscription;
    private ClusterManager<LocationRecordClusterItem> mClusterManager;
    private List<LocationRecord> mCurrentTeamLocations;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_teams_locations_map);
        getActivityComponent().inject(this);
        setupPresenter();
        setupSearchTeamView();
        setupIntent(getIntent());
        getIntent().removeExtra(MainActivity.EXTRA_TEAM_NUMBER);
        setupMapFragment();
    }

    @Override
    protected void onStart() {
        super.onStart();
        EventBus.getDefault().register(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mTeamsLocationsMapPresenter.loadAllTeams();
    }

    @Override
    protected void onStop() {
        super.onStop();
        EventBus.getDefault().unregister(this);
    }

    @Override
    protected void onDestroy() {
        mTeamsLocationsMapPresenter.detachView();
        if (mSetHintsSubscription != null) mSetHintsSubscription.unsubscribe();
{'fraction_non_alphanumeric': 0.08573059360730594, 'fraction_numerical': 0.0027397260273972603, 'mean_word_length': 5.165376495425757, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2898083', 'n_tokens_mistral': 2785, 'n_tokens_neox': 2692, 'n_words': 437}