// Path: app/src/main/java/com/nilhcem/droidconde/ui/BaseActivity.java
// public abstract class BaseActivity<P extends BaseActivityPresenter> extends AppCompatActivity {
// 
//     protected P presenter;
// 
//     protected abstract P newPresenter();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         presenter = newPresenter();
//     }
// 
//     @Override
//     protected void onPostCreate(@Nullable Bundle savedInstanceState) {
//         super.onPostCreate(savedInstanceState);
//         presenter.onPostCreate(savedInstanceState);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         presenter.onResume();
//     }
// 
//     @Override
//     protected void onSaveInstanceState(Bundle outState) {
//         super.onSaveInstanceState(outState);
//         presenter.onSaveInstanceState(outState);
//     }
// 
//     @Override
//     protected void onRestoreInstanceState(Bundle savedInstanceState) {
//         super.onRestoreInstanceState(savedInstanceState);
//         presenter.onRestoreInstanceState(savedInstanceState);
//     }
// 
//     @Override
//     public void setContentView(@LayoutRes int layoutResID) {
//         super.setContentView(layoutResID);
//         ButterKnife.bind(this);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         if (item.getItemId() == android.R.id.home) {
//             onBackPressed();
//             return true;
//         }
//         return super.onOptionsItemSelected(item);
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (presenter.onBackPressed()) {
//             return;
//         }
//         super.onBackPressed();
//     }
// 
//     @Override
//     protected void onDestroy() {
//         presenter = null;
//         super.onDestroy();
//     }
// }


import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.StringRes;
import android.support.design.widget.NavigationView;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.nilhcem.droidconde.R;
import com.nilhcem.droidconde.ui.BaseActivity;
import butterknife.BindView;
        navigationView.setNavigationItemSelectedListener(item -> {
            presenter.onNavigationItemSelected(item.getItemId());
            return true;
        });
    }

    @Override
    protected void onDestroy() {
        drawer.removeDrawerListener(actionBarDrawerToggle);
        super.onDestroy();
    }

    @Override
    public void updateToolbarTitle(@StringRes int resId) {
        getSupportActionBar().setTitle(resId);
    }

    @Override
    public boolean isNavigationDrawerOpen() {
        return drawer.isDrawerOpen(GravityCompat.START);
    }

    @Override
    public void closeNavigationDrawer() {
        drawer.closeDrawer(GravityCompat.START);
    }

    @Override
    public void showFragment(Fragment fragment) {
        getSupportFragmentManager().beginTransaction()
// Path: app/src/main/java/com/nilhcem/droidconde/ui/BaseActivity.java
// public abstract class BaseActivity<P extends BaseActivityPresenter> extends AppCompatActivity {
// 
//     protected P presenter;
// 
//     protected abstract P newPresenter();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         presenter = newPresenter();
//     }
// 
//     @Override
//     protected void onPostCreate(@Nullable Bundle savedInstanceState) {
//         super.onPostCreate(savedInstanceState);
//         presenter.onPostCreate(savedInstanceState);
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         presenter.onResume();
//     }
// 
//     @Override
//     protected void onSaveInstanceState(Bundle outState) {
//         super.onSaveInstanceState(outState);
//         presenter.onSaveInstanceState(outState);
//     }
// 
//     @Override
//     protected void onRestoreInstanceState(Bundle savedInstanceState) {
//         super.onRestoreInstanceState(savedInstanceState);
//         presenter.onRestoreInstanceState(savedInstanceState);
//     }
// 
//     @Override
//     public void setContentView(@LayoutRes int layoutResID) {
//         super.setContentView(layoutResID);
//         ButterKnife.bind(this);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         if (item.getItemId() == android.R.id.home) {
//             onBackPressed();
//             return true;
//         }
//         return super.onOptionsItemSelected(item);
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (presenter.onBackPressed()) {
//             return;
//         }
//         super.onBackPressed();
//     }
// 
//     @Override
//     protected void onDestroy() {
//         presenter = null;
//         super.onDestroy();
//     }
// }


// Path: app/src/main/java/com/nilhcem/droidconde/ui/drawer/DrawerActivity.java
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.StringRes;
import android.support.design.widget.NavigationView;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.nilhcem.droidconde.R;
import com.nilhcem.droidconde.ui.BaseActivity;
import butterknife.BindView;

        navigationView.setNavigationItemSelectedListener(item -> {
            presenter.onNavigationItemSelected(item.getItemId());
            return true;
        });
    }

    @Override
    protected void onDestroy() {
        drawer.removeDrawerListener(actionBarDrawerToggle);
        super.onDestroy();
    }

    @Override
    public void updateToolbarTitle(@StringRes int resId) {
        getSupportActionBar().setTitle(resId);
    }

    @Override
    public boolean isNavigationDrawerOpen() {
        return drawer.isDrawerOpen(GravityCompat.START);
    }

    @Override
    public void closeNavigationDrawer() {
        drawer.closeDrawer(GravityCompat.START);
    }

    @Override
    public void showFragment(Fragment fragment) {
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.drawer_fragments_container, fragment)