// Path: app/src/main/java/com/example/app/rxjava/AppApplication.java
// public class AppApplication extends Application {
// 
//     /*网络是否连接*/
//     public static boolean isNetConnect;/*网络连接状态监听*/
//     private ConnectionReceiver connectionReceiver = new ConnectionReceiver();
//     public static AppApplication APP_APPLICATION;
// 
//     //刷新广播监听
//     public static final String REFRESH_ACTION = "REFRESH_ACTION";
// 
//     public static AppApplication getInstance() {
//         return APP_APPLICATION;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         // Create global configuration and initialize ImageLoader with this config
//         APP_APPLICATION = this;
//         initImageLoader(getApplicationContext());
//         registerNetReceiver();
// 
//         FlowManager.init(this);
//     }
// 
//     public static void initImageLoader(Context context) {
//         // This configuration tuning is custom. You can tune every option, you may tune some of them,
//         // or you can create default configuration by
//         //  ImageLoaderConfiguration.createDefault(this);
//         // method.
//         ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
//         config.threadPriority(Thread.NORM_PRIORITY - 2);
//         config.denyCacheImageMultipleSizesInMemory();
//         config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
//         config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
//         config.tasksProcessingOrder(QueueProcessingType.LIFO);
//         config.writeDebugLogs(); // Remove for release app
// 
//         // Initialize ImageLoader with configuration.
//         ImageLoader.getInstance().init(config.build());
//     }
// 
//     /**
//      * 注册网络连接状态监听
//      */
//     public void registerNetReceiver() {
//         IntentFilter connectionIntentFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
//         registerReceiver(connectionReceiver, connectionIntentFilter);
//     }
// 
//     /**
//      * 注销网络连接状态监听
//      */
//     public void unregisterNetReceiver() {
//         if (connectionReceiver != null) {
//             unregisterReceiver(connectionReceiver);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/example/app/rxjava/base/BaseActivity.java
// public class BaseActivity extends AppCompatActivity implements BaseViewIA {
//     /**
//      * 进度条
//      */
//     private ProgressDialog mProgressDialog;
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mProgressDialog = new ProgressDialog(this);
//         mProgressDialog.setMessage("正在加载，请稍后..");
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//     }
// 
//     @Override
//     public void showProgressDialog() {
//         mProgressDialog.show();
//     }
//     @Override
//     public void hideProgressDialog() {
//         mProgressDialog.hide();
//     }
//     @Override
//     public void showError(String msg) {
//         Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
//     }
// }
// 
// Path: app/src/main/java/com/example/app/rxjava/receiver/ConnectionReceiver.java
// public class ConnectionReceiver extends BroadcastReceiver {
//     @Override
//     public void onReceive(Context context, Intent intent) {
//         if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
//             ConnectivityManager conn = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//             NetworkInfo info = conn.getActiveNetworkInfo();
//             if (info != null) {
//                 AppApplication.isNetConnect = info.isConnected();
//             } else {
//                 AppApplication.isNetConnect = false;
//             }
//         }
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.ShareActionProvider;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.example.app.rxjava.AppApplication;
import com.example.app.rxjava.R;
import com.example.app.rxjava.base.BaseActivity;
import com.example.app.rxjava.receiver.ConnectionReceiver;
package com.example.app.rxjava.module.main.view;



public class MainActivity extends BaseActivity {
    private Context context = this;
// Path: app/src/main/java/com/example/app/rxjava/AppApplication.java
// public class AppApplication extends Application {
// 
//     /*网络是否连接*/
//     public static boolean isNetConnect;/*网络连接状态监听*/
//     private ConnectionReceiver connectionReceiver = new ConnectionReceiver();
//     public static AppApplication APP_APPLICATION;
// 
//     //刷新广播监听
//     public static final String REFRESH_ACTION = "REFRESH_ACTION";
// 
//     public static AppApplication getInstance() {
//         return APP_APPLICATION;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         // Create global configuration and initialize ImageLoader with this config
//         APP_APPLICATION = this;
//         initImageLoader(getApplicationContext());
//         registerNetReceiver();
// 
//         FlowManager.init(this);
//     }
// 
//     public static void initImageLoader(Context context) {
//         // This configuration tuning is custom. You can tune every option, you may tune some of them,
//         // or you can create default configuration by
//         //  ImageLoaderConfiguration.createDefault(this);
//         // method.
//         ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
//         config.threadPriority(Thread.NORM_PRIORITY - 2);
//         config.denyCacheImageMultipleSizesInMemory();
//         config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
//         config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
//         config.tasksProcessingOrder(QueueProcessingType.LIFO);
//         config.writeDebugLogs(); // Remove for release app
// 
//         // Initialize ImageLoader with configuration.
//         ImageLoader.getInstance().init(config.build());
//     }
// 
//     /**
//      * 注册网络连接状态监听
//      */
//     public void registerNetReceiver() {
//         IntentFilter connectionIntentFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
//         registerReceiver(connectionReceiver, connectionIntentFilter);
//     }
// 
//     /**
//      * 注销网络连接状态监听
//      */
//     public void unregisterNetReceiver() {
//         if (connectionReceiver != null) {
//             unregisterReceiver(connectionReceiver);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/example/app/rxjava/base/BaseActivity.java
// public class BaseActivity extends AppCompatActivity implements BaseViewIA {
//     /**
//      * 进度条
//      */
//     private ProgressDialog mProgressDialog;
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mProgressDialog = new ProgressDialog(this);
//         mProgressDialog.setMessage("正在加载，请稍后..");
//     }
// 
//     @Override
//     protected void onDestroy() {
//         super.onDestroy();
//     }
// 
//     @Override
//     public void showProgressDialog() {
//         mProgressDialog.show();
//     }
//     @Override
//     public void hideProgressDialog() {
//         mProgressDialog.hide();
//     }
//     @Override
//     public void showError(String msg) {
//         Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
//     }
// }
// 
// Path: app/src/main/java/com/example/app/rxjava/receiver/ConnectionReceiver.java
// public class ConnectionReceiver extends BroadcastReceiver {
//     @Override
//     public void onReceive(Context context, Intent intent) {
//         if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
//             ConnectivityManager conn = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//             NetworkInfo info = conn.getActiveNetworkInfo();
//             if (info != null) {
//                 AppApplication.isNetConnect = info.isConnected();
//             } else {
//                 AppApplication.isNetConnect = false;
//             }
//         }
//     }
// }


// Path: app/src/main/java/com/example/app/rxjava/module/main/view/MainActivity.java
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.ShareActionProvider;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.example.app.rxjava.AppApplication;
import com.example.app.rxjava.R;
import com.example.app.rxjava.base.BaseActivity;
import com.example.app.rxjava.receiver.ConnectionReceiver;

package com.example.app.rxjava.module.main.view;



public class MainActivity extends BaseActivity {
    private Context context = this;
    private AppApplication application = null;