Fix some warning.
This commit is contained in:
1 parent
48ff81eb41
commit
08aae655b2
2 files changed
+76
-163
No files matched your search
+23
-38
@@ -10,24 +10,23 @@ import com.github.lzyzsd.randomcolor.RandomColor;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Course {
|
||||
public String week;
|
||||
public int day;
|
||||
public int starthour;
|
||||
public int startmin;
|
||||
public int endhour;
|
||||
public int endmin;
|
||||
class Course {
|
||||
String week;
|
||||
int day;
|
||||
int starthour;
|
||||
int startmin;
|
||||
int endhour;
|
||||
int endmin;
|
||||
public String name;
|
||||
public String room;
|
||||
public String teacher;
|
||||
String room;
|
||||
private String teacher;
|
||||
public int color;
|
||||
public int priority;//0:normal 1:course 2:alert
|
||||
public final int PRIORITY_ACTIVITY = 2;
|
||||
public final int PRIORITY_COURSE = 1;
|
||||
public final int PRIORITY_NORMAL = 0;
|
||||
private static final String DATABASE_NAME = "Schedule_Fragment_data.db";
|
||||
int priority;//0:normal 1:course 2:alert
|
||||
// public final int PRIORITY_ACTIVITY = 2;
|
||||
// public final int PRIORITY_COURSE = 1;
|
||||
// public final int PRIORITY_NORMAL = 0;
|
||||
private static final String TAG = "Course";
|
||||
public Course(String week, int day, int starthour, int startmin, int endhour, int endmin, String name, String room, String teacher, int color, int priority) {
|
||||
Course(String week, int day, int starthour, int startmin, int endhour, int endmin, String name, String room, String teacher, int color, int priority) {
|
||||
this.week=week;
|
||||
this.day = day;
|
||||
this.starthour = starthour;
|
||||
@@ -40,7 +39,7 @@ public class Course {
|
||||
this.color = color;
|
||||
this.priority = priority;
|
||||
}
|
||||
public Course(Course copy){
|
||||
Course(Course copy){
|
||||
this.week=copy.week;
|
||||
this.day = copy.day;
|
||||
this.starthour = copy.starthour;
|
||||
@@ -53,7 +52,7 @@ public class Course {
|
||||
this.color = copy.color;
|
||||
this.priority = copy.priority;
|
||||
}
|
||||
public Course() {
|
||||
Course() {
|
||||
week=null;
|
||||
day = -1;
|
||||
starthour = -1;
|
||||
@@ -66,29 +65,14 @@ public class Course {
|
||||
color = (new RandomColor()).randomColor()-0x30000000;
|
||||
priority = 0;
|
||||
}
|
||||
public void recover() {
|
||||
week=null;
|
||||
day = -1;
|
||||
starthour = -1;
|
||||
startmin = -1;
|
||||
endhour = -1;
|
||||
endmin = -1;
|
||||
name = "未填写";
|
||||
room = "未填写";
|
||||
teacher = "未填写";
|
||||
color = -1;
|
||||
priority = 0;
|
||||
}
|
||||
public boolean empty() {
|
||||
return day < 0;
|
||||
}
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
public void addinfile(SharedPreferences sharedPreferences, SharedPreferences.Editor editor) {
|
||||
void addinfile(SharedPreferences sharedPreferences) {
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
int num;
|
||||
for (num = 0; ; num++)
|
||||
if (sharedPreferences.getString("week" + num, null) == null)
|
||||
break;
|
||||
this.removeinfile(sharedPreferences, editor);
|
||||
this.removeinfile(sharedPreferences);
|
||||
editor.putString("week" + num, week);
|
||||
editor.putInt("day" + num, day);
|
||||
editor.putInt("starthour" + num, starthour);
|
||||
@@ -100,10 +84,11 @@ public class Course {
|
||||
editor.putString("teacher" + num, teacher);
|
||||
editor.putInt("color" + num, color);
|
||||
editor.putInt("priority" + num, priority);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
public void removeinfile(SharedPreferences sharedPreferences, SharedPreferences.Editor editor) {
|
||||
void removeinfile(SharedPreferences sharedPreferences) {
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
Log.i(TAG, "removeinfile: REMOVE FILE START!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
int num;
|
||||
for (num = 0; ; num++)
|
||||
@@ -140,7 +125,7 @@ public class Course {
|
||||
editor.putString("teacher" + i ,sharedPreferences.getString( "teacher" + (num-1),null));
|
||||
editor.putInt("color" + i ,sharedPreferences.getInt( "color" + (num-1),-1));
|
||||
editor.putInt("priority" + i ,sharedPreferences.getInt( "priority" + (num-1),-1));
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
editor.remove("week" + (num-1));
|
||||
editor.remove("day" + (num-1));
|
||||
editor.remove("starthour" + (num-1));
|
||||
|
||||
+53
-125
@@ -1,5 +1,4 @@
|
||||
package wesayallright.timemanager.surface.scheduleFragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
@@ -34,29 +33,34 @@ import java.util.Calendar;
|
||||
import java.util.Objects;
|
||||
|
||||
import wesayallright.timemanager.R;
|
||||
|
||||
public class ScheduleFragment extends Fragment implements View.OnClickListener , AdapterView.OnItemSelectedListener , View.OnTouchListener , ToggleButton.OnCheckedChangeListener , NumberPicker.OnValueChangeListener {
|
||||
private RelativeLayout layout1, layout2, layout3, layout4, layout5, layout6, layout7;
|
||||
private ArrayList<ArrayList<TextView>> textarr = new ArrayList<>(); // textarr.get(day).get(xth in day)
|
||||
private ArrayList<ArrayList<ArrayList<Course>>> pcourse = new ArrayList<>();//pcourse.get(week).get(day).get(xth in day)
|
||||
private ArrayList<Course> course = new ArrayList<>();
|
||||
private ArrayList<RelativeLayout> layout = new ArrayList<>();
|
||||
private boolean[] week_togglebutton = new boolean[21];
|
||||
private static final String TAG = "ScheduleFragment";
|
||||
private View view;
|
||||
private int firstmonth = 2;
|
||||
private int firstday = 27;
|
||||
private ArrayList<ArrayList<ArrayList<Course>>> pcourse = new ArrayList<>();//pcourse.get(week).get(day).get(xth in day)
|
||||
private ArrayList<ArrayList<TextView>> textarr = new ArrayList<>(); // textarr.get(day).get(xth in day)
|
||||
private ArrayList<ToggleButton> togglearray = new ArrayList<>();
|
||||
private ArrayList<RelativeLayout> layout = new ArrayList<>();
|
||||
private ArrayList<Course> course = new ArrayList<>();
|
||||
private ArrayList<Integer> weeks = new ArrayList<>();
|
||||
private Calendar first = Calendar.getInstance();
|
||||
private Calendar today = Calendar.getInstance();
|
||||
private int firstweek;
|
||||
private int nowweek;
|
||||
private int realweek;
|
||||
private Course using;
|
||||
private ArrayList<ToggleButton> togglearray = new ArrayList<>();
|
||||
private EditText editname;
|
||||
private EditText editroom;
|
||||
private TextView textweek;
|
||||
private TextView texttime;
|
||||
private View RunnableView;
|
||||
private View view;
|
||||
private NumberPicker daypicker, starthhpicker, startmmpicker, endhhpicker, endmmpicker;
|
||||
private int dialog_day, dialog_starthh, dialog_startmm, dialog_endhh, dialog_endmm;
|
||||
private SharedPreferences sharedPreferences;
|
||||
private SharedPreferences.Editor editor;
|
||||
private Course using;
|
||||
private boolean running = false;
|
||||
private boolean stop = false;
|
||||
private int dialog_day, dialog_starthh, dialog_startmm, dialog_endhh, dialog_endmm;
|
||||
private int bereplacedx, bereplacedy, bereplacedz;
|
||||
private int firstmonth = 2;
|
||||
private int firstday = 27;
|
||||
private int firstweek;
|
||||
private int realweek;
|
||||
private int nowweek;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
@@ -69,7 +73,6 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
public void initializing() {
|
||||
sharedPreferences = getActivity().getSharedPreferences("Schedule_Fragment_data0", Context.MODE_PRIVATE);
|
||||
editor = sharedPreferences.edit();
|
||||
//pcourse
|
||||
for (int i = 0; i < 20; i++) {
|
||||
pcourse.add(new ArrayList<ArrayList<Course>>());
|
||||
@@ -84,13 +87,13 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
firstweek = first.get(Calendar.WEEK_OF_YEAR);
|
||||
nowweek = today.get(Calendar.WEEK_OF_YEAR);
|
||||
//layout
|
||||
layout.add(layout1 = (RelativeLayout) view.findViewById(R.id.SBrelative1));
|
||||
layout.add(layout2 = (RelativeLayout) view.findViewById(R.id.SBrelative2));
|
||||
layout.add(layout3 = (RelativeLayout) view.findViewById(R.id.SBrelative3));
|
||||
layout.add(layout4 = (RelativeLayout) view.findViewById(R.id.SBrelative4));
|
||||
layout.add(layout5 = (RelativeLayout) view.findViewById(R.id.SBrelative5));
|
||||
layout.add(layout6 = (RelativeLayout) view.findViewById(R.id.SBrelative6));
|
||||
layout.add(layout7 = (RelativeLayout) view.findViewById(R.id.SBrelative7));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative1));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative2));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative3));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative4));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative5));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative6));
|
||||
layout.add((RelativeLayout) view.findViewById(R.id.SBrelative7));
|
||||
for (int i = 0; i < 7; i++) {
|
||||
layout.get(i).setOnClickListener(this);
|
||||
}
|
||||
@@ -174,7 +177,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
}
|
||||
|
||||
private String weekproduce(ArrayList<Integer> week) {
|
||||
String string = new String();
|
||||
String string = "";
|
||||
for (int i = 0; i < week.size(); i++) {
|
||||
if (i != week.size() - 1)
|
||||
string += week.get(i) + " ";
|
||||
@@ -306,7 +309,6 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
Log.i(TAG, "readcourse: READ COURSE END!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
}
|
||||
|
||||
|
||||
private void redate(int position) {
|
||||
//更改SM日期
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@@ -348,15 +350,11 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
day[i].postInvalidate();
|
||||
}
|
||||
|
||||
|
||||
public static int dip2px(Context context, double dpValue) {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dpValue * scale + 0.5f);
|
||||
}
|
||||
|
||||
private ArrayList<Integer> weeks = new ArrayList<>();
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -391,7 +389,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
weeks.add(19);
|
||||
textweek.setText("");
|
||||
for (int i = 0; i < weeks.size(); i += 2)
|
||||
if (weeks.get(i) == weeks.get(i + 1))
|
||||
if (Objects.equals(weeks.get(i), weeks.get(i + 1)))
|
||||
textweek.setText(textweek.getText() + "" + (weeks.get(i) + 1) + "周 ");
|
||||
else
|
||||
textweek.setText(textweek.getText() + "" + (weeks.get(i) + 1) + "-" + (weeks.get(i + 1) + 1) + "周 ");
|
||||
@@ -411,6 +409,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
weekdialog.show();
|
||||
Window weekwindow = weekdialog.getWindow();
|
||||
togglearray.clear();
|
||||
assert weekwindow != null;
|
||||
togglearray.add((ToggleButton) weekwindow.findViewById(R.id.week_togglebutton1));
|
||||
togglearray.add((ToggleButton) weekwindow.findViewById(R.id.week_togglebutton2));
|
||||
togglearray.add((ToggleButton) weekwindow.findViewById(R.id.week_togglebutton3));
|
||||
@@ -496,6 +495,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
AlertDialog timedialog = timebuilder.create();
|
||||
timedialog.show();
|
||||
Window timewindow = timedialog.getWindow();
|
||||
assert timewindow != null;
|
||||
daypicker = (NumberPicker) timewindow.findViewById(R.id.daypicker);
|
||||
starthhpicker = (NumberPicker) timewindow.findViewById(R.id.starthhpicker);
|
||||
startmmpicker = (NumberPicker) timewindow.findViewById(R.id.startmmpicker);
|
||||
@@ -568,7 +568,6 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
break;
|
||||
default:
|
||||
boolean is = false;
|
||||
int Break = 0;
|
||||
for (int i = 0; i < 7; i++)
|
||||
if (view.equals(layout.get(i)))
|
||||
is = true;
|
||||
@@ -606,7 +605,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
using.startmin = dialog_startmm;
|
||||
using.endhour = dialog_endhh;
|
||||
using.endmin = dialog_endmm;
|
||||
using.addinfile(sharedPreferences, editor);
|
||||
using.addinfile(sharedPreferences);
|
||||
Log.i(TAG, "onClick: addinfile successed!");
|
||||
readcourse();
|
||||
addcourse(course, layout);
|
||||
@@ -623,71 +622,12 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
builder.setView(dialogview);
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
assert dialog.getWindow() != null;
|
||||
textweek = (TextView) dialog.getWindow().findViewById(R.id.dialogweek);
|
||||
texttime = (TextView) dialog.getWindow().findViewById(R.id.dialogtime);
|
||||
textweek.setOnClickListener(this);
|
||||
texttime.setOnClickListener(this);
|
||||
break;
|
||||
// using = new Course();
|
||||
// weeks.add(0);
|
||||
// weeks.add(19);
|
||||
// using.day = (today.get(Calendar.DAY_OF_WEEK) + 5) % 7;
|
||||
// LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||
// View dialogview = inflater.inflate(R.layout.schedule_course_dialog, null);
|
||||
// //先注册一些控件
|
||||
// final EditText editname, editroom;
|
||||
// final TextView Textweek, Texttime;
|
||||
// editname = (EditText) dialogview.findViewById(R.id.SCourseEditTextName);
|
||||
// editroom = (EditText) dialogview.findViewById(R.id.SCourseEditTextRoom);
|
||||
// Textweek = (TextView) dialogview.findViewById(R.id.dialogweek);
|
||||
// Texttime = (TextView) dialogview.findViewById(R.id.dialogtime);
|
||||
// editname.setSingleLine(false);
|
||||
// editroom.setSingleLine(false);
|
||||
// editname.setHorizontallyScrolling(false);
|
||||
// editroom.setHorizontallyScrolling(false);
|
||||
// editname.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||
// editroom.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||
// AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
// builder.setTitle("添加新课程");
|
||||
// builder.setPositiveButton("保存", new DialogInterface.OnClickListener() {
|
||||
// @RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialogInterface, int i) {
|
||||
// if (editname.getText().toString().trim() != "未填写" && editroom.getText().toString().trim() != "未填写" && Texttime.getText() != "未填写") {
|
||||
// using.name = editname.getText().toString().trim();
|
||||
// using.room = editroom.getText().toString().trim();
|
||||
// using.week = weekproduce(weeks);
|
||||
// Log.i(TAG, "onClick: the " + using.name + " is in the positive button!! And the weeks information is below:");
|
||||
// for (i = 0; i < weeks.size(); i++)
|
||||
// Log.i(TAG, "onClick: weeks[" + i + "]=" + weeks.get(i));
|
||||
// using.day = dialog_day;
|
||||
// using.starthour = dialog_starthh;
|
||||
// using.startmin = dialog_startmm;
|
||||
// using.endhour = dialog_endhh;
|
||||
// using.endmin = dialog_endmm;
|
||||
// using.addinfile(sharedPreferences, editor);
|
||||
// Log.i(TAG, "onClick: addinfile successed!");
|
||||
// readcourse();
|
||||
// addcourse(course, layout);
|
||||
// dialogInterface.dismiss();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialogInterface, int i) {
|
||||
// dialogInterface.dismiss();
|
||||
// }
|
||||
// });
|
||||
// builder.setView(dialogview);
|
||||
// AlertDialog dialog = builder.create();
|
||||
// dialog.show();
|
||||
// textweek = (TextView) dialog.getWindow().findViewById(R.id.dialogweek);
|
||||
// texttime = (TextView) dialog.getWindow().findViewById(R.id.dialogtime);
|
||||
// dialog.getWindow().findViewById(R.id.dialogweek).setOnClickListener(this);
|
||||
// dialog.getWindow().findViewById(R.id.dialogtime).setOnClickListener(this);
|
||||
// break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,30 +643,20 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
}
|
||||
|
||||
private EditText editname;
|
||||
private EditText editroom;
|
||||
private TextView textweek;
|
||||
private TextView texttime;
|
||||
private int bereplacedx, bereplacedy, bereplacedz;
|
||||
private android.os.Handler handler;
|
||||
private View RunnableView;
|
||||
private boolean stop = false;
|
||||
private boolean running = false;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public boolean onTouch(final View view, MotionEvent motionEvent) {
|
||||
Log.i(TAG, "onTouch: INTO ONTOUCH !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
Log.i(TAG, "onTouch: Y:"+motionEvent.getY());
|
||||
Log.i(TAG, "onTouch: Y:" + motionEvent.getY());
|
||||
RunnableView = view;
|
||||
int backgroundColor;
|
||||
int i, j, Break,day=-1;
|
||||
int i, j, Break;
|
||||
boolean is;
|
||||
switch (motionEvent.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
stop = false;
|
||||
handler = new android.os.Handler();
|
||||
android.os.Handler handler = new android.os.Handler();
|
||||
final Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -769,7 +699,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
running = false;
|
||||
using.removeinfile(sharedPreferences, editor);
|
||||
using.removeinfile(sharedPreferences);
|
||||
readcourse();
|
||||
addcourse(course, layout);
|
||||
}
|
||||
@@ -880,7 +810,6 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
editname.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||
editroom.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||
builder.setTitle(using.name);
|
||||
String[] dayname = {"周一", "周二", "周三", "周四", "周五", "周六", "周日"};
|
||||
editname.setText(using.name);
|
||||
editroom.setText(using.room);
|
||||
textweek.setText("");
|
||||
@@ -896,19 +825,21 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
dialog_startmm = using.startmin;
|
||||
dialog_endhh = using.endhour;
|
||||
dialog_endmm = using.endmin;
|
||||
texttime.setText(dayname[dialog_day] + " ");
|
||||
String texttime_settext = "";
|
||||
texttime_settext += " ";
|
||||
if (dialog_starthh < 10)
|
||||
texttime.setText(texttime.getText() + "0");
|
||||
texttime.setText(texttime.getText() + "" + dialog_starthh + ":");
|
||||
texttime_settext += "0";
|
||||
texttime_settext += "" + dialog_starthh + ":";
|
||||
if (dialog_startmm < 10)
|
||||
texttime.setText(texttime.getText() + "0");
|
||||
texttime.setText(texttime.getText() + "" + dialog_startmm + "-");
|
||||
texttime_settext += "0";
|
||||
texttime_settext += "" + dialog_startmm + "-";
|
||||
if (dialog_endhh < 10)
|
||||
texttime.setText(texttime.getText() + "0");
|
||||
texttime.setText(texttime.getText() + "" + dialog_endhh + ":");
|
||||
texttime_settext += "0";
|
||||
texttime_settext += "" + dialog_endhh + ":";
|
||||
if (dialog_endmm < 10)
|
||||
texttime.setText(texttime.getText() + "0");
|
||||
texttime.setText(texttime.getText() + "" + dialog_endmm);
|
||||
texttime_settext += "0";
|
||||
texttime_settext += "" + dialog_endmm;
|
||||
texttime.setText(texttime_settext);
|
||||
builder.setPositiveButton("保存", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
@@ -922,8 +853,8 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
using.endmin = dialog_endmm;
|
||||
Log.i(TAG, "onClick: now you release the " + using.name + " room:" + using.room + " day:" + using.day + " from" + using.starthour + ":" + using.startmin + " to " + using.endhour + ":" + using.endmin);
|
||||
Log.i(TAG, "onClick: now you release the " + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).name + " room:" + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).room + " day:" + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).day + " from" + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).starthour + ":" + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).startmin + " to " + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).endhour + ":" + pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).endmin);
|
||||
pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).removeinfile(sharedPreferences, editor);
|
||||
using.addinfile(sharedPreferences, editor);
|
||||
pcourse.get(bereplacedx).get(bereplacedy).get(bereplacedz).removeinfile(sharedPreferences);
|
||||
using.addinfile(sharedPreferences);
|
||||
readcourse();
|
||||
addcourse(course, layout);
|
||||
dialogInterface.dismiss();
|
||||
@@ -938,6 +869,7 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
builder.setView(dialogview);
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
assert dialog.getWindow() != null;
|
||||
textweek = (TextView) dialog.getWindow().findViewById(R.id.dialogweek);
|
||||
texttime = (TextView) dialog.getWindow().findViewById(R.id.dialogtime);
|
||||
textweek.setOnClickListener(this);
|
||||
@@ -1085,7 +1017,6 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
togglearray.get(i).postInvalidate();
|
||||
}
|
||||
|
||||
|
||||
public void check() {
|
||||
boolean line1, line2, line3, line4, dialine1, dialine2;
|
||||
line1 = true;
|
||||
@@ -1146,13 +1077,11 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
togglearray.get(26).setChecked(false);
|
||||
}
|
||||
|
||||
|
||||
public void save(boolean[] togglebuttonbool) {
|
||||
for (int i = 0; i < 20; i++)
|
||||
togglebuttonbool[i] = togglearray.get(i).isChecked();
|
||||
}
|
||||
|
||||
|
||||
public void recover(boolean[] togglebuttonbool) {
|
||||
for (int i = 0; i < 20; i++)
|
||||
togglearray.get(i).setChecked(togglebuttonbool[i]);
|
||||
@@ -1188,5 +1117,4 @@ public class ScheduleFragment extends Fragment implements View.OnClickListener ,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user