<commit_before>package com.xinyu.mwp.activity;

import android.os.Handler;
import android.support.v4.widget.DrawerLayout;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.xinyu.mwp.R;
import com.xinyu.mwp.activity.base.BaseMultiFragmentActivity;
import com.xinyu.mwp.application.MyApplication;
import com.xinyu.mwp.fragment.DealFragment;
import com.xinyu.mwp.fragment.IndexFragment;
import com.xinyu.mwp.fragment.LeftFragment;
import com.xinyu.mwp.fragment.ShareOrderFragment;
import com.xinyu.mwp.user.OnUserUpdateListener;
import com.xinyu.mwp.user.UserManager;
import com.xinyu.mwp.util.LogUtil;
import com.xinyu.mwp.util.ToastUtils;

import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * @author : Created by Benjamin
 * @email : <EMAIL>
 */
public class MainFragmentActivity extends BaseMultiFragmentActivity implements OnUserUpdateListener {
    private static final String[] TITLES = {"首页", "交易", "晒单"};

    @ViewInject(R.id.drawer)
    protected DrawerLayout drawer;
    @ViewInject(R.id.bottomLayout)
    private LinearLayout bottombar;
    @ViewInject(R.id.title)
    private TextView title;
    protected LeftFragment leftFragment;
    private long exitNow;
    private long first = 0;

    @Override
    public int getFragmentContainerId() {
        return R.id.contentContainer;
    }

    @Override
    protected int getLayoutID() {
        return R.layout.activity_mainfragment;
    }

    @Override
    public void createFragmentsToBackStack() {

        fragments.add(new IndexFragment());
        fragments.add(new DealFragment());
        fragments.add(new ShareOrderFragment());

        leftFragment = new LeftFragment();
        pushFragmentToContainer(R.id.leftContainer, leftFragment);
        pushFragmentToBackStack(0);

    }

    @Override
    public void pushFragmentToBackStack(int selectIndex) {
        super.pushFragmentToBackStack(selectIndex);
        bottombar.getChildAt(selectIndex).setSelected(true);
        toggleTitleBar();
    }

    @Override
    protected void initView() {
        super.initView();
        UserManager.getInstance().registerUserUpdateListener(this);
        setSwipeBackEnable(false);
    }

    @Event(value = {R.id.icon, R.id.login, R.id.register
            , R.id.myAttention, R.id.myPushOrder, R.id.myShareOrder, R.id.dealDetail
            , R.id.feedback, R.id.score, R.id.about})
    @Override
    protected void initListener() {
        super.initListener();

        leftFragment.setLeftClickListener(new LeftFragment.LeftClickListener() {
            @Override
            public void click(View v, int action, Object obj) {
                toggleDrawer(false);
                ToastUtils.show(context, action + "");
                switch (action) {
                    case R.id.icon:
                        break;
                    case R.id.login:
                        break;
                    case R.id.register:
                        break;
                    case R.id.myAttention:
                        next(MyAttentionActivity.class);
                        break;
                    case R.id.myPushOrder:
                        next(MyPushOrderActivity.class);
                        break;
                    case R.id.myShareOrder:
                        break;
                    case R.id.dealDetail:
                        break;
                    case R.id.feedback:
                        break;
                    case R.id.score:
                        break;
                    case R.id.about:
                        break;
                }
            }
        });

        drawer.setDrawerListener(new DrawerLayout.DrawerListener() {
            @Override
            public void onDrawerSlide(View drawerView, float slideOffset) {
            }

            @Override
            public void onDrawerOpened(View drawerView) {
                drawerView.setClickable(true);
            }<commit_msg>M*S： 登录页面排版<commit_after>package com.xinyu.mwp.activity;

import android.os.Handler;
import android.support.v4.widget.DrawerLayout;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.xinyu.mwp.R;
import com.xinyu.mwp.activity.base.BaseMultiFragmentActivity;
import com.xinyu.mwp.application.MyApplication;
import com.xinyu.mwp.fragment.DealFragment;
import com.xinyu.mwp.fragment.IndexFragment;
import com.xinyu.mwp.fragment.LeftFragment;
import com.xinyu.mwp.fragment.ShareOrderFragment;
import com.xinyu.mwp.user.OnUserUpdateListener;
import com.xinyu.mwp.user.UserManager;
import com.xinyu.mwp.util.ActivityUtil;
import com.xinyu.mwp.util.LogUtil;
import com.xinyu.mwp.util.ToastUtils;

import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * @author : Created by Benjamin
 * @email : <EMAIL>
 */
public class MainFragmentActivity extends BaseMultiFragmentActivity implements OnUserUpdateListener {
    private static final String[] TITLES = {"首页", "交易", "晒单"};

    @ViewInject(R.id.drawer)
    protected DrawerLayout drawer;
    @ViewInject(R.id.bottomLayout)
    private LinearLayout bottombar;
    @ViewInject(R.id.title)
    private TextView title;
    protected LeftFragment leftFragment;
    private long exitNow;
    private long first = 0;

    @Override
    public int getFragmentContainerId() {
        return R.id.contentContainer;
    }

    @Override
    protected int getLayoutID() {
        return R.layout.activity_mainfragment;
    }

    @Override
    public void createFragmentsToBackStack() {

        fragments.add(new IndexFragment());
        fragments.add(new DealFragment());
        fragments.add(new ShareOrderFragment());

        leftFragment = new LeftFragment();
        pushFragmentToContainer(R.id.leftContainer, leftFragment);
        pushFragmentToBackStack(0);

    }

    @Override
    public void pushFragmentToBackStack(int selectIndex) {
        super.pushFragmentToBackStack(selectIndex);
        bottombar.getChildAt(selectIndex).setSelected(true);
        toggleTitleBar();
    }

    @Override
    protected void initView() {
        super.initView();
        UserManager.getInstance().registerUserUpdateListener(this);
        setSwipeBackEnable(false);
    }

    @Event(value = {R.id.icon, R.id.login, R.id.register
            , R.id.myAttention, R.id.myPushOrder, R.id.myShareOrder, R.id.dealDetail
            , R.id.feedback, R.id.score, R.id.about})
    @Override
    protected void initListener() {
        super.initListener();

        leftFragment.setLeftClickListener(new LeftFragment.LeftClickListener() {
            @Override
            public void click(View v, int action, Object obj) {
                toggleDrawer(false);
                ToastUtils.show(context, action + "");
                switch (action) {
                    case R.id.icon:
                        break;
                    case R.id.login:
                        ActivityUtil.nextLogin(context);
                        break;
                    case R.id.register:
                        ActivityUtil.nextRegister(context);
                        break;
                    case R.id.myAttention:
                        next(MyAttentionActivity.class);
                        break;
                    case R.id.myPushOrder:
                        next(MyPushOrderActivity.class);
                        break;
                    case R.id.myShareOrder:
                        break;
                    case R.id.dealDetail:
                        break;
                    case R.id.feedback:
                        break;
                    case R.id.score:
                        break;
                    case R.id.about:
                        break;
                }
            }
        });

        drawer.setDrawerListener(new DrawerLayout.DrawerListener() {
            @Override
            public void onDrawerSlide(View drawerView, float slideOffset) {
            }

            @Override
            public void onDrawerOpened(View drawerView) {
                drawerView.setClickable(true);
            }
{'fraction_non_alphanumeric': 0.09268758201121317, 'fraction_numerical': 0.0007157342240248121, 'mean_word_length': 2.002865329512894, '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': '5711819', 'n_tokens_mistral': 2363, 'n_tokens_neox': 2292, 'n_words': 423}