<commit_before>package com.malin.rengwuxianrxjava.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.jakewharton.scalpel.ScalpelFrameLayout;
import com.malin.rengwuxianrxjava.R;
import com.malin.rengwuxianrxjava.constant.Constant;
import com.malin.rengwuxianrxjava.data.Course;
import com.malin.rengwuxianrxjava.data.Student;
import com.malin.rengwuxianrxjava.factory.DataFactory;
import com.malin.rengwuxianrxjava.factory.ImageNameFactory;
import com.malin.rengwuxianrxjava.utils.DeviceInfo;
import com.malin.rengwuxianrxjava.utils.ImageUtils;
import com.malin.rengwuxianrxjava.utils.RecycleBitmap;
import com.malin.rengwuxianrxjava.view.AvoidRecoveredAppearErrorImageView;
import com.orhanobut.logger.LogLevel;
import com.orhanobut.logger.Logger;

import java.util.ArrayList;

import rx.Observable;
import rx.Observer;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action0;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.schedulers.Schedulers;


/**
 * 类描述:活动主页面
 * 创建人:<EMAIL>
 * 创建时间:15-11-10.
 * 备注:
 */
public class MainActivity extends Activity {
    private static final String TAG = "MainActivity";
    private static final String TAG_FOR_LOGGER = "MainActivity_I_LOVE_RXJAVA";
    private static final String JPG = ".jpg";
    private int mCounter;//循环的计数器
    private AvoidRecoveredAppearErrorImageView mImageView;
    private Bitmap mManyBitmapSuperposition = null;
    private Canvas mCanvas = null;
    private ProgressBar mProgressBar;
    private ScalpelFrameLayout mScalpelFrameLayout;
    private boolean mIsOpenScalpel=false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentViewLayout(true);
        initializeLogAndDeviceInfo();
        initView();
//        miZhiSuoJinAndNestedLoopAndCallbackHell();//演示谜之缩进--嵌套循环--回调地狱
//        rxJavaSolveMiZhiSuoJinAndNestedLoopAndCallbackHell();//使用RxJava解决问题
        testFuncation(14);//RxJava基础概念的练习
    }

    /**
     * 初始化Logger日志输出配置和获取手机尺寸信息
     */
    private void initializeLogAndDeviceInfo() {
        Logger.init(TAG_FOR_LOGGER).logLevel(LogLevel.FULL);//Use LogLevel.NONE for the release versions.
        DeviceInfo.getInstance().initializeScreenInfo(this);
    }

    /**
     * 给Activity设置布局
     *
     * @param isOpenScalpe:是否开启使用Scalpel查看三维模式的层次结构
     */
    private void setContentViewLayout(boolean isOpenScalpe) {
        getWindow().setBackgroundDrawable(null);
        View view = LayoutInflater.from(this).inflate(R.layout.activity_main, null);
        if (isOpenScalpe) {<commit_msg>change the default loading image<commit_after>package com.malin.rengwuxianrxjava.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.jakewharton.scalpel.ScalpelFrameLayout;
import com.malin.rengwuxianrxjava.R;
import com.malin.rengwuxianrxjava.constant.Constant;
import com.malin.rengwuxianrxjava.data.Course;
import com.malin.rengwuxianrxjava.data.Student;
import com.malin.rengwuxianrxjava.factory.DataFactory;
import com.malin.rengwuxianrxjava.factory.ImageNameFactory;
import com.malin.rengwuxianrxjava.utils.DeviceInfo;
import com.malin.rengwuxianrxjava.utils.ImageUtils;
import com.malin.rengwuxianrxjava.utils.RecycleBitmap;
import com.malin.rengwuxianrxjava.view.AvoidRecoveredAppearErrorImageView;
import com.orhanobut.logger.LogLevel;
import com.orhanobut.logger.Logger;

import java.util.ArrayList;

import rx.Observable;
import rx.Observer;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action0;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.schedulers.Schedulers;


/**
 * 类描述:活动主页面
 * 创建人:<EMAIL>
 * 创建时间:15-11-10.
 * 备注:
 */
public class MainActivity extends Activity {
    private static final String TAG = "MainActivity";
    private static final String TAG_FOR_LOGGER = "MainActivity_I_LOVE_RXJAVA";
    private static final String JPG = ".jpg";
    private int mCounter;//循环的计数器
    private AvoidRecoveredAppearErrorImageView mImageView;
    private Bitmap mManyBitmapSuperposition = null;
    private Canvas mCanvas = null;
    private ProgressBar mProgressBar;
    private ScalpelFrameLayout mScalpelFrameLayout;
    private boolean mIsOpenScalpel=false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentViewLayout(true);
        initializeLogAndDeviceInfo();
        initView();
//        miZhiSuoJinAndNestedLoopAndCallbackHell();//演示谜之缩进--嵌套循环--回调地狱
        rxJavaSolveMiZhiSuoJinAndNestedLoopAndCallbackHell();//使用RxJava解决问题
//        testFuncation(14);//RxJava基础概念的练习
    }

    /**
     * 初始化Logger日志输出配置和获取手机尺寸信息
     */
    private void initializeLogAndDeviceInfo() {
        Logger.init(TAG_FOR_LOGGER).logLevel(LogLevel.FULL);//Use LogLevel.NONE for the release versions.
        DeviceInfo.getInstance().initializeScreenInfo(this);
    }

    /**
     * 给Activity设置布局
     *
     * @param isOpenScalpe:是否开启使用Scalpel查看三维模式的层次结构
     */
    private void setContentViewLayout(boolean isOpenScalpe) {
        getWindow().setBackgroundDrawable(null);
        View view = LayoutInflater.from(this).inflate(R.layout.activity_main, null);
        if (isOpenScalpe) {
{'fraction_non_alphanumeric': 0.09280152550452885, 'fraction_numerical': 0.0034959478785952644, 'mean_word_length': 4.716621253405995, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '983419', 'n_tokens_mistral': 2129, 'n_tokens_neox': 2128, 'n_words': 338}