<commit_before>package kesshou.android.daanx.views.main;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.firebase.analytics.FirebaseAnalytics;

import java.util.ArrayList;

import kesshou.android.daanx.R;
import kesshou.android.daanx.util.ActivityUtils;
import kesshou.android.daanx.util.Adapter.MenuTableAdapter;
import kesshou.android.daanx.util.Adapter.TableDecoration;
import kesshou.android.daanx.util.Adapter.holder.Menu;
import kesshou.android.daanx.util.BeautifulColor;
import kesshou.android.daanx.util.ChromeTabHelper;
import kesshou.android.daanx.views.MainActivity;
import kesshou.android.daanx.views.news.CalcActivity;
import kesshou.android.daanx.views.news.NewsActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class NewsFragment extends Fragment {

	private View rootView;

	public NewsFragment() {
		// Required empty public constructor
	}


	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
	                         Bundle savedInstanceState) {
		// Inflate the layout for this fragment
		if(rootView == null) {
			rootView = inflater.inflate(R.layout.fragment_news, container, false);

			ArrayList<Menu> menus = new ArrayList<>();
			Menu calc = new Menu(R.drawable.ic_calc, BeautifulColor.getColor(1), getString(R.string.main_news_calc), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "Calc");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "Calc");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					Intent intent = new Intent();
					intent.setClass(getActivity(), CalcActivity.class);
					startActivity(intent);
				}
			});
			menus.add(calc);
			Menu news = new Menu(R.drawable.ic_news,BeautifulColor.getColor(2), getString(R.string.main_news_news), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "News");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "News");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					Intent intent = new Intent();
					intent.setClass(getActivity(), NewsActivity.class);
					startActivity(intent);
				}
			});
			menus.add(news);
			Menu map = new Menu(R.drawable.ic_map,BeautifulColor.getColor(3), getString(R.string.main_news_map), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School map");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "School map");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					ChromeTabHelper.openTabs(getActivity(),"http://www.taivs.tp.edu.tw/images/img-building.jpg");
				}
			});
			menus.add(map);
			Menu seatState = new Menu(R.drawable.ic_event_seat,BeautifulColor.getColor(4), getString(R.string.main_news_seatstate), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School map");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "School map");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					ChromeTabHelper.openTabs(getActivity(),"https://dev.dacsc.club/v1/seatstate");
				}
			});
			menus.add(seatState);
			Menu rule = new Menu(R.drawable.ic_book,BeautifulColor.getColor(5), getString(R.string.main_news_rule), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School rules");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "School rules");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					ChromeTabHelper.openTabs(getActivity(),"http://military.taivs.tp.edu.tw/node/51");
				}
			});
			menus.add(rule);
			Menu qAndA = new Menu(R.drawable.ic_question_answer,BeautifulColor.getColor(6), getString(R.string.main_news_qanda), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School Q&A");<commit_msg>Update wrong SeatState and Map URL<commit_after>package kesshou.android.daanx.views.main;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.firebase.analytics.FirebaseAnalytics;

import java.util.ArrayList;

import kesshou.android.daanx.R;
import kesshou.android.daanx.util.ActivityUtils;
import kesshou.android.daanx.util.Adapter.MenuTableAdapter;
import kesshou.android.daanx.util.Adapter.TableDecoration;
import kesshou.android.daanx.util.Adapter.holder.Menu;
import kesshou.android.daanx.util.BeautifulColor;
import kesshou.android.daanx.util.ChromeTabHelper;
import kesshou.android.daanx.views.MainActivity;
import kesshou.android.daanx.views.news.CalcActivity;
import kesshou.android.daanx.views.news.NewsActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class NewsFragment extends Fragment {

	private View rootView;

	public NewsFragment() {
		// Required empty public constructor
	}


	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
	                         Bundle savedInstanceState) {
		// Inflate the layout for this fragment
		if(rootView == null) {
			rootView = inflater.inflate(R.layout.fragment_news, container, false);

			ArrayList<Menu> menus = new ArrayList<>();
			Menu calc = new Menu(R.drawable.ic_calc, BeautifulColor.getColor(1), getString(R.string.main_news_calc), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "Calc");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "Calc");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					Intent intent = new Intent();
					intent.setClass(getActivity(), CalcActivity.class);
					startActivity(intent);
				}
			});
			menus.add(calc);
			Menu news = new Menu(R.drawable.ic_news,BeautifulColor.getColor(2), getString(R.string.main_news_news), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "News");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "News");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					Intent intent = new Intent();
					intent.setClass(getActivity(), NewsActivity.class);
					startActivity(intent);
				}
			});
			menus.add(news);
			Menu map = new Menu(R.drawable.ic_map,BeautifulColor.getColor(3), getString(R.string.main_news_map), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School map");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "School map");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					ChromeTabHelper.openTabs(getActivity(),"http://docs.google.com/gview?embedded=true&url=www.taivs.tp.edu.tw/tw/doc/daan-buildings.pdf");
				}
			});
			menus.add(map);
			Menu seatState = new Menu(R.drawable.ic_event_seat,BeautifulColor.getColor(4), getString(R.string.main_news_seatstate), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School map");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "School map");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					ChromeTabHelper.openTabs(getActivity(),"https://kesshou.dacsc.club/v1/seatstate");
				}
			});
			menus.add(seatState);
			Menu rule = new Menu(R.drawable.ic_book,BeautifulColor.getColor(5), getString(R.string.main_news_rule), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School rules");
					bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "School rules");
					bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "fn");
					((MainActivity)getActivity()).mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM, bundle);
					ChromeTabHelper.openTabs(getActivity(),"http://military.taivs.tp.edu.tw/node/51");
				}
			});
			menus.add(rule);
			Menu qAndA = new Menu(R.drawable.ic_question_answer,BeautifulColor.getColor(6), getString(R.string.main_news_qanda), "", new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					Bundle bundle = new Bundle();
					bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "School Q&A");
{'fraction_non_alphanumeric': 0.12780035920219301, 'fraction_numerical': 0.0026467530012288494, 'mean_word_length': 4.851769911504425, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5904869', 'n_tokens_mistral': 3884, 'n_tokens_neox': 3296, 'n_words': 520}