// Path: app/src/main/java/io/github/scarletsky/bangumi/events/ClickNavigateIconEvent.java
// public class ClickNavigateIconEvent {
// 
//     private NavigateIconType iconType;
// 
//     public enum NavigateIconType {
//         BACK,
//         MENU
//     }
// 
//     public ClickNavigateIconEvent(NavigateIconType iconType) {
//         this.iconType = iconType;
//     }
// 
//     public NavigateIconType getIconType() {
//         return iconType;
//     }
// }
// 
// Path: app/src/main/java/io/github/scarletsky/bangumi/ui/activities/MainActivity.java
// public class MainActivity extends AppCompatActivity {
// 
//     private FragmentManager mFragmentManager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_main);
// 
//         DrawerFragment mDrawerFragment = new DrawerFragment();
//         mFragmentManager = getSupportFragmentManager();
//         mFragmentManager.beginTransaction().add(R.id.frame_main, mDrawerFragment).commit();
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (mFragmentManager.getBackStackEntryCount() != 1) {
//             super.onBackPressed();
//         } else {
//             finish();
//         }
//     }
// }
// 
// Path: app/src/main/java/io/github/scarletsky/bangumi/utils/BusProvider.java
// public class BusProvider {
//     private static Bus mBus;
// 
//     public static Bus getInstance() {
//         if (mBus == null) {
//             mBus = new Bus();
//         }
// 
//         return mBus;
//     }
// }


import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.View;
import io.github.scarletsky.bangumi.R;
import io.github.scarletsky.bangumi.events.ClickNavigateIconEvent;
import io.github.scarletsky.bangumi.ui.activities.MainActivity;
import io.github.scarletsky.bangumi.utils.BusProvider;
package io.github.scarletsky.bangumi.ui.fragments;



/**
 * Created by scarlex on 15-7-2.
 */
public abstract class BaseToolbarFragment extends Fragment {

    private static final String TAG = BaseToolbarFragment.class.getSimpleName();
    private MainActivity mActivity;
    private Toolbar mToolbar;

    @Override
    public void onResume() {
        super.onResume();
        BusProvider.getInstance().register(this);
    }

    @Override
    public void onPause() {
        super.onPause();
        BusProvider.getInstance().unregister(this);
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        this.mActivity = (MainActivity) activity;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mToolbar = (Toolbar) getView().findViewById(R.id.toolbar_wrapper).findViewById(R.id.toolbar);
// Path: app/src/main/java/io/github/scarletsky/bangumi/events/ClickNavigateIconEvent.java
// public class ClickNavigateIconEvent {
// 
//     private NavigateIconType iconType;
// 
//     public enum NavigateIconType {
//         BACK,
//         MENU
//     }
// 
//     public ClickNavigateIconEvent(NavigateIconType iconType) {
//         this.iconType = iconType;
//     }
// 
//     public NavigateIconType getIconType() {
//         return iconType;
//     }
// }
// 
// Path: app/src/main/java/io/github/scarletsky/bangumi/ui/activities/MainActivity.java
// public class MainActivity extends AppCompatActivity {
// 
//     private FragmentManager mFragmentManager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_main);
// 
//         DrawerFragment mDrawerFragment = new DrawerFragment();
//         mFragmentManager = getSupportFragmentManager();
//         mFragmentManager.beginTransaction().add(R.id.frame_main, mDrawerFragment).commit();
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (mFragmentManager.getBackStackEntryCount() != 1) {
//             super.onBackPressed();
//         } else {
//             finish();
//         }
//     }
// }
// 
// Path: app/src/main/java/io/github/scarletsky/bangumi/utils/BusProvider.java
// public class BusProvider {
//     private static Bus mBus;
// 
//     public static Bus getInstance() {
//         if (mBus == null) {
//             mBus = new Bus();
//         }
// 
//         return mBus;
//     }
// }


// Path: app/src/main/java/io/github/scarletsky/bangumi/ui/fragments/BaseToolbarFragment.java
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.View;
import io.github.scarletsky.bangumi.R;
import io.github.scarletsky.bangumi.events.ClickNavigateIconEvent;
import io.github.scarletsky.bangumi.ui.activities.MainActivity;
import io.github.scarletsky.bangumi.utils.BusProvider;

package io.github.scarletsky.bangumi.ui.fragments;



/**
 * Created by scarlex on 15-7-2.
 */
public abstract class BaseToolbarFragment extends Fragment {

    private static final String TAG = BaseToolbarFragment.class.getSimpleName();
    private MainActivity mActivity;
    private Toolbar mToolbar;

    @Override
    public void onResume() {
        super.onResume();
        BusProvider.getInstance().register(this);
    }

    @Override
    public void onPause() {
        super.onPause();
        BusProvider.getInstance().unregister(this);
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        this.mActivity = (MainActivity) activity;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mToolbar = (Toolbar) getView().findViewById(R.id.toolbar_wrapper).findViewById(R.id.toolbar);
        setToolbarTitle();