<commit_before>package com.kuxhausen.huemore.editmood;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;

import com.actionbarsherlock.app.SherlockFragment;
import com.google.gson.Gson;
import com.kuxhausen.huemore.NetworkManagedSherlockFragmentActivity;
import com.kuxhausen.huemore.R;
import com.kuxhausen.huemore.editmood.EditMoodPagerDialogFragment.OnCreateMoodListener;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions.InternalArguments;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions.MoodColumns;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions.PreferenceKeys;
import com.kuxhausen.huemore.persistence.HueUrlEncoder;
import com.kuxhausen.huemore.persistence.Utils;
import com.kuxhausen.huemore.state.Event;
import com.kuxhausen.huemore.state.Mood;
import com.kuxhausen.huemore.state.api.BulbState;

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.drawable.ColorDrawable;
import android.view.ContextMenu;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.support.v7.widget.GridLayout;

public class EditAdvancedMoodFragment extends SherlockFragment implements OnClickListener, OnCreateMoodListener {

	Gson gson = new Gson();
	GridLayout grid;
	int contextSpot;
	
	public ArrayList<StateCell> dataRay = new ArrayList<StateCell>();
	ArrayList<TimeslotDuration> timeslotDuration = new ArrayList<TimeslotDuration>();
	private final static int defaultDuration = 10;
	
	Button addChannel, addTimeslot;
	
	static String priorName;
	static Mood priorMood;
	
	private int pageType;
	private boolean dailyMode;
	
	public EditMoodPagerDialogFragment pager;
	
	public void setTimedMode(EditMoodPagerDialogFragment p){
		pageType = EditMoodPagerDialogFragment.TIMED_PAGE;
		pager = p;
	}
	public void setDailyMode(EditMoodPagerDialogFragment p){
		pageType = EditMoodPagerDialogFragment.DAILY_PAGE;
		pager = p;
		dailyMode = true;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		View myView = inflater.inflate(R.layout.edit_advanced_mood, null);
		
		addTimeslot = (Button) myView.findViewById(R.id.addTimeslotButton);
		addTimeslot.setOnClickListener(this);
		
		addChannel = (Button) myView.findViewById(R.id.addChannelButton);
		//int h = addChannel.getHeight();
		//int w = addChannel.getWidth();
		//addChannel.setRotation(270);
		//addChannel.setHeight(w);
		//addChannel.setWidth(h);
		addChannel.setOnClickListener(this);
		
		grid = (GridLayout) myView.findViewById(R.id.advancedGridLayout);
		grid.removeAllViews();
		timeslotDuration.clear();
		dataRay.clear();
		grid.setColumnCount(initialCols+1);
		grid.setRowCount(initialRows);
		
		addRow(defaultDuration);
		addRow(defaultDuration);
		addCol();<commit_msg>switched to 1 channel default in advanced mood editor<commit_after>package com.kuxhausen.huemore.editmood;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;

import com.actionbarsherlock.app.SherlockFragment;
import com.google.gson.Gson;
import com.kuxhausen.huemore.NetworkManagedSherlockFragmentActivity;
import com.kuxhausen.huemore.R;
import com.kuxhausen.huemore.editmood.EditMoodPagerDialogFragment.OnCreateMoodListener;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions.InternalArguments;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions.MoodColumns;
import com.kuxhausen.huemore.persistence.DatabaseDefinitions.PreferenceKeys;
import com.kuxhausen.huemore.persistence.HueUrlEncoder;
import com.kuxhausen.huemore.persistence.Utils;
import com.kuxhausen.huemore.state.Event;
import com.kuxhausen.huemore.state.Mood;
import com.kuxhausen.huemore.state.api.BulbState;

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.drawable.ColorDrawable;
import android.view.ContextMenu;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.support.v7.widget.GridLayout;

public class EditAdvancedMoodFragment extends SherlockFragment implements OnClickListener, OnCreateMoodListener {

	Gson gson = new Gson();
	GridLayout grid;
	int contextSpot;
	
	public ArrayList<StateCell> dataRay = new ArrayList<StateCell>();
	ArrayList<TimeslotDuration> timeslotDuration = new ArrayList<TimeslotDuration>();
	private final static int defaultDuration = 10;
	
	Button addChannel, addTimeslot;
	
	static String priorName;
	static Mood priorMood;
	
	private int pageType;
	private boolean dailyMode;
	
	public EditMoodPagerDialogFragment pager;
	
	public void setTimedMode(EditMoodPagerDialogFragment p){
		pageType = EditMoodPagerDialogFragment.TIMED_PAGE;
		pager = p;
	}
	public void setDailyMode(EditMoodPagerDialogFragment p){
		pageType = EditMoodPagerDialogFragment.DAILY_PAGE;
		pager = p;
		dailyMode = true;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		View myView = inflater.inflate(R.layout.edit_advanced_mood, null);
		
		addTimeslot = (Button) myView.findViewById(R.id.addTimeslotButton);
		addTimeslot.setOnClickListener(this);
		
		addChannel = (Button) myView.findViewById(R.id.addChannelButton);
		//int h = addChannel.getHeight();
		//int w = addChannel.getWidth();
		//addChannel.setRotation(270);
		//addChannel.setHeight(w);
		//addChannel.setWidth(h);
		addChannel.setOnClickListener(this);
		
		grid = (GridLayout) myView.findViewById(R.id.advancedGridLayout);
		grid.removeAllViews();
		timeslotDuration.clear();
		dataRay.clear();
		grid.setColumnCount(initialCols+1);
		grid.setRowCount(initialRows);
		
		addRow(defaultDuration);
		addRow(defaultDuration);
{'fraction_non_alphanumeric': 0.09255172413793103, 'fraction_numerical': 0.0020689655172413794, 'mean_word_length': 6.584728033472803, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '139307', 'n_tokens_mistral': 2313, 'n_tokens_neox': 2180, 'n_words': 396}