package com.garpr.android.activities;

import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.view.MenuItem;

import com.garpr.android.R;

import butterknife.BindView;

public abstract class BaseNavigationActivity extends BaseActivity implements
        BottomNavigationView.OnNavigationItemSelectedListener {

    @BindView(R.id.bottomNavigationView)
    protected BottomNavigationView mBottomNavigationView;


    @IdRes
    protected int getSelectedNavigationItem() {
        return 0;
    }

    @Override
    public boolean onNavigationItemSelected(@NonNull final MenuItem item) {
        if (item.isChecked()) {
            return false;
        }

        switch (item.getItemId()) {
            case R.id.actionPlayers:
                startActivity(PlayersActivity.getLaunchIntent(this));
                break;

            case R.id.actionRankings:
                startActivity(RankingsActivity.getLaunchIntent(this));
                break;

            case R.id.actionTournaments:
                startActivity(TournamentsActivity.getLaunchIntent(this));
                break;
        }

        return false;
    }

    @Override
    protected void onViewsBound() {
        super.onViewsBound();
        mBottomNavigationView.setOnNavigationItemSelectedListener(this);

        final int selectedNavigationItem = getSelectedNavigationItem();
        if (selectedNavigationItem != 0) {
            mBottomNavigationView.getMenu().findItem(selectedNavigationItem).setChecked(true);
        }
    }

}

@@ -32,16 +32,47 @@
 ities;%0A%0A
+import android.content.Intent;%0A
 import a
@@ -774,32 +774,63 @@
 lse;%0A        %7D%0A%0A
+        Intent intent = null;%0A%0A
         switch (
@@ -902,30 +902,25 @@
         
-startActivity(
+intent = 
 PlayersA
@@ -940,33 +940,32 @@
 unchIntent(this)
-)
 ;%0A              
@@ -1028,30 +1028,25 @@
         
-startActivity(
+intent = 
 Rankings
@@ -1067,33 +1067,32 @@
 unchIntent(this)
-)
 ;%0A              
@@ -1162,22 +1162,17 @@
     
-startActivity(
+intent = 
 Tour
@@ -1208,17 +1208,16 @@
 nt(this)
-)
 ;%0A      
@@ -1236,32 +1236,153 @@
 eak;%0A        %7D%0A%0A
+        if (intent != null) %7B%0A            startActivity(intent);%0A            overridePendingTransition(0, 0);%0A        %7D%0A%0A
         return f

clear transitions