<commit_before>package io.agora.contract.fragment;

import android.content.Intent;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.tuyenmonkey.mkloader.MKLoader;

import java.util.ArrayList;
import java.util.List;

import io.agora.contract.activity.CreateRoomActivity;
import io.agora.contract.adapter.ContentAdapter;
import io.agora.model.LiveVideos;
import io.agora.openlive.R;
import io.agora.presenter.IContentFragmentPresenter;
import io.agora.presenter.IContentFragmentPresenterImpl;

/**
 * File Name:
 * Author:      ruan
 * Write Dates: 2017/7/6
 * Description:
 */

public class ContentFragment extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener,IContentFragment {


    private ContentAdapter mAdapter;
    private List<LiveVideos> videos = new ArrayList<>();
    private int pageIndex = 0;
    SwipeRefreshLayout mRefreshLayout;

    RecyclerView mRecyclerView;
    IContentFragmentPresenter iContentFragmentPresenter;
    FloatingActionButton floatBtn;
    MKLoader loading;
    TextView tv_noData_tips;
    FrameLayout fl_content;

    @Override
    public View initView() {
        View view = View.inflate(context, R.layout.fragment_content,null);
        mRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refreshLayout);
        mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
        floatBtn = (FloatingActionButton) view.findViewById(R.id.floatBtn);
        loading = (MKLoader) view.findViewById(R.id.loading);
        tv_noData_tips = (TextView) view.findViewById(R.id.tv_noData_tips);
        fl_content = (FrameLayout) view.findViewById(R.id.fl_content);
        return view;
    }

    /**
     * 数据初始化
     */
    @Override
    public void initData() {

        Log.e("Com","ContentFragment------->InitData()");

        loading.setVisibility(View.VISIBLE);
        tv_noData_tips.setVisibility(View.GONE);
        iContentFragmentPresenter = new IContentFragmentPresenterImpl(this);
        iContentFragmentPresenter.getData();
        mRefreshLayout.setColorSchemeResources(R.color.colorPrimary, android.R.color.holo_red_light, android.R.color.holo_orange_light, android.R.color.holo_green_light);
        mRefreshLayout.setOnRefreshListener(this);
        GridLayoutManager manager = new GridLayoutManager(getActivity(), 2);
        mRecyclerView.setLayoutManager(manager);
        mRecyclerView.setHasFixedSize(true);
        mRecyclerView.setItemAnimator(new DefaultItemAnimator());

        floatBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, CreateRoomActivity.class);
                startActivity(intent);
            }
        });

       tv_noData_tips.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
                loading.setVisibility(View.VISIBLE);
               tv_noData_tips.setVisibility(View.GONE);
               iContentFragmentPresenter.getData();
           }
       });
        iContentFragmentPresenter.RealTimeCallBack();
<commit_msg>完成部分的直播给送礼物与点赞<commit_after>package io.agora.contract.fragment;

import android.content.Intent;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.tuyenmonkey.mkloader.MKLoader;

import java.util.ArrayList;
import java.util.List;

import io.agora.contract.activity.CreateRoomActivity;
import io.agora.contract.adapter.ContentAdapter;
import io.agora.model.LiveVideos;
import io.agora.openlive.R;
import io.agora.presenter.IContentFragmentPresenter;
import io.agora.presenter.IContentFragmentPresenterImpl;

/**
 * File Name:
 * Author:      ruan
 * Write Dates: 2017/7/6
 * Description:
 */

public class ContentFragment extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener,IContentFragment {


    private ContentAdapter mAdapter;
    private List<LiveVideos> videos = new ArrayList<>();
    private int pageIndex = 0;
    SwipeRefreshLayout mRefreshLayout;

    RecyclerView mRecyclerView;
    IContentFragmentPresenter iContentFragmentPresenter;
    FloatingActionButton floatBtn;
    MKLoader loading;
    TextView tv_noData_tips;
    FrameLayout fl_content;

    @Override
    public View initView() {
        View view = View.inflate(context, R.layout.fragment_content,null);
        mRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refreshLayout);
        mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
        floatBtn = (FloatingActionButton) view.findViewById(R.id.floatBtn);
        loading = (MKLoader) view.findViewById(R.id.loading);
        tv_noData_tips = (TextView) view.findViewById(R.id.tv_noData_tips);
        fl_content = (FrameLayout) view.findViewById(R.id.fl_content);
        return view;
    }

    /**
     * 数据初始化
     */
    @Override
    public void initData() {

        Log.e("Com","ContentFragment------->InitData()");

        loading.setVisibility(View.VISIBLE);
        tv_noData_tips.setVisibility(View.GONE);
        mAdapter = new ContentAdapter(context,videos);
        iContentFragmentPresenter = new IContentFragmentPresenterImpl(this);
        iContentFragmentPresenter.getData();
        mRefreshLayout.setColorSchemeResources(R.color.colorPrimary, android.R.color.holo_red_light, android.R.color.holo_orange_light, android.R.color.holo_green_light);
        mRefreshLayout.setOnRefreshListener(this);
        GridLayoutManager manager = new GridLayoutManager(getActivity(), 2);
        mRecyclerView.setLayoutManager(manager);
        mRecyclerView.setHasFixedSize(true);
        mRecyclerView.setItemAnimator(new DefaultItemAnimator());

        floatBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, CreateRoomActivity.class);
                startActivity(intent);
            }
        });

       tv_noData_tips.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
                loading.setVisibility(View.VISIBLE);
               tv_noData_tips.setVisibility(View.GONE);
               iContentFragmentPresenter.getData();
           }
       });
        iContentFragmentPresenter.RealTimeCallBack();

{'fraction_non_alphanumeric': 0.09603196472857536, 'fraction_numerical': 0.003306696059520529, 'mean_word_length': 3.662170841361593, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '7659899', 'n_tokens_mistral': 2147, 'n_tokens_neox': 2074, 'n_words': 333}