// Path: app/src/main/java/me/yifeiyuan/climb/app/App.java
// public class App extends Application {
// 
//     private AppComponent mAppComponent;
// 
//     private static final String TAG = "Climb";
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// //        PackageManagerHook.hook(this);
//         Log.d(TAG, "onCreate: " + getPackageName());
// 
//         mAppComponent = DaggerAppComponent
//                 .builder()
//                 .appModule(new AppModule(this))
//                 .apiModule(new ApiModule())
//                 .build();
// 
//         if (BuildConfig.DEBUG) {
//             AndroidDevMetrics.initWith(this);
//         }
// 
//         AppStatusManager.getInstance().init(this);
// 
//     }
// 
//     public AppComponent getAppComponent() {
//         return mAppComponent;
//     }
// 
//     @Override
//     protected void attachBaseContext(Context base) {
//         PackageManagerHook.hook(base);
//         super.attachBaseContext(base);
//     }
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/di/components/AppComponent.java
// @Singleton
// @Component(modules = {AppModule.class, ApiModule.class})
// public interface AppComponent {
// 
//     App app();
// 
//     Api api();
// }
// 
// Path: swipeback/src/main/java/me/yifeiyuan/swipeback/SwipeBackActivity.java
// public class SwipeBackActivity extends AppCompatActivity implements SwipeBackActivityBase {
//     private SwipeBackActivityHelper mHelper;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mHelper = new SwipeBackActivityHelper(this);
//         mHelper.onActivityCreate();
//     }
// 
//     @Override
//     protected void onPostCreate(Bundle savedInstanceState) {
//         super.onPostCreate(savedInstanceState);
//         mHelper.onPostCreate();
//     }
// 
//     @Override
//     public View findViewById(int id) {
//         View v = super.findViewById(id);
//         if (v == null && mHelper != null)
//             return mHelper.findViewById(id);
//         return v;
//     }
// 
//     @Override
//     public SwipeBackLayout getSwipeBackLayout() {
//         return mHelper.getSwipeBackLayout();
//     }
// 
//     @Override
//     public void setSwipeBackEnable(boolean enable) {
//         getSwipeBackLayout().setEnableGesture(enable);
//     }
// 
//     @Override
//     public void scrollToFinishActivity() {
//         Utils.convertActivityToTranslucent(this);
//         getSwipeBackLayout().scrollToFinishActivity();
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import butterknife.Bind;
import butterknife.ButterKnife;
import me.yifeiyuan.climb.R;
import me.yifeiyuan.climb.app.App;
import me.yifeiyuan.climb.di.components.AppComponent;
import me.yifeiyuan.swipeback.SwipeBackActivity;
package me.yifeiyuan.climb.base;




/**
 * Created by 程序亦非猿 on 16/5/31.
 *
 * 统一:
 * 设置toolbar
 * 设置title
 * 处理左上返回按钮事件
 */
public abstract class BaseActivity extends SwipeBackActivity {

    protected Context mContext;

    @Nullable
    @Bind(R.id.collapsing_toolbar)
    protected CollapsingToolbarLayout mCollapsingToolbar;

    @Nullable
    @Bind(R.id.toolbar)
    protected Toolbar mToolbar;

    @Nullable
    @Bind(R.id.appbar)
// Path: app/src/main/java/me/yifeiyuan/climb/app/App.java
// public class App extends Application {
// 
//     private AppComponent mAppComponent;
// 
//     private static final String TAG = "Climb";
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// //        PackageManagerHook.hook(this);
//         Log.d(TAG, "onCreate: " + getPackageName());
// 
//         mAppComponent = DaggerAppComponent
//                 .builder()
//                 .appModule(new AppModule(this))
//                 .apiModule(new ApiModule())
//                 .build();
// 
//         if (BuildConfig.DEBUG) {
//             AndroidDevMetrics.initWith(this);
//         }
// 
//         AppStatusManager.getInstance().init(this);
// 
//     }
// 
//     public AppComponent getAppComponent() {
//         return mAppComponent;
//     }
// 
//     @Override
//     protected void attachBaseContext(Context base) {
//         PackageManagerHook.hook(base);
//         super.attachBaseContext(base);
//     }
// }
// 
// Path: app/src/main/java/me/yifeiyuan/climb/di/components/AppComponent.java
// @Singleton
// @Component(modules = {AppModule.class, ApiModule.class})
// public interface AppComponent {
// 
//     App app();
// 
//     Api api();
// }
// 
// Path: swipeback/src/main/java/me/yifeiyuan/swipeback/SwipeBackActivity.java
// public class SwipeBackActivity extends AppCompatActivity implements SwipeBackActivityBase {
//     private SwipeBackActivityHelper mHelper;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mHelper = new SwipeBackActivityHelper(this);
//         mHelper.onActivityCreate();
//     }
// 
//     @Override
//     protected void onPostCreate(Bundle savedInstanceState) {
//         super.onPostCreate(savedInstanceState);
//         mHelper.onPostCreate();
//     }
// 
//     @Override
//     public View findViewById(int id) {
//         View v = super.findViewById(id);
//         if (v == null && mHelper != null)
//             return mHelper.findViewById(id);
//         return v;
//     }
// 
//     @Override
//     public SwipeBackLayout getSwipeBackLayout() {
//         return mHelper.getSwipeBackLayout();
//     }
// 
//     @Override
//     public void setSwipeBackEnable(boolean enable) {
//         getSwipeBackLayout().setEnableGesture(enable);
//     }
// 
//     @Override
//     public void scrollToFinishActivity() {
//         Utils.convertActivityToTranslucent(this);
//         getSwipeBackLayout().scrollToFinishActivity();
//     }
// }


// Path: app/src/main/java/me/yifeiyuan/climb/base/BaseActivity.java
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import butterknife.Bind;
import butterknife.ButterKnife;
import me.yifeiyuan.climb.R;
import me.yifeiyuan.climb.app.App;
import me.yifeiyuan.climb.di.components.AppComponent;
import me.yifeiyuan.swipeback.SwipeBackActivity;

package me.yifeiyuan.climb.base;




/**
 * Created by 程序亦非猿 on 16/5/31.
 *
 * 统一:
 * 设置toolbar
 * 设置title
 * 处理左上返回按钮事件
 */
public abstract class BaseActivity extends SwipeBackActivity {

    protected Context mContext;

    @Nullable
    @Bind(R.id.collapsing_toolbar)
    protected CollapsingToolbarLayout mCollapsingToolbar;

    @Nullable
    @Bind(R.id.toolbar)
    protected Toolbar mToolbar;

    @Nullable
    @Bind(R.id.appbar)
    protected AppBarLayout mAppBar;