diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 222efc9886c2c70db30f335ddfa193f729a11b8b..7d5c0ac08e5288b7507fe43ad379c9d800693b13 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 299e36f44bb3f0111078cd201a6eec413fc9213a..ea256900e6bd82683342456cb14eac4ae6ae2440 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,16 +28,12 @@ </activity> <!--<receiver android:name=".NotifyService"/>--> <activity android:name=".FirstPageConsent" /> - <activity android:name=".SecondPage" /> - <activity android:name=".SecondPage2" /> - <activity android:name=".SecondPage3" /> - <activity android:name=".SecondPage4" /> <receiver android:name=".MainMenu$Broadcast1" /> <receiver android:name=".MainMenu$Broadcast2" /> <receiver android:name=".MainMenu$Broadcast3" /> <receiver android:name=".MainMenu$Broadcast4" /> - <activity android:name=".Seek" /> + <activity android:name=".MainMenu" android:label="@string/app_name" diff --git a/app/src/main/java/com/example/admin/sleepbetter/CalendarPage.java b/app/src/main/java/com/example/admin/sleepbetter/CalendarPage.java index 424a441f55d7c619b7000a5cada6af7f67934055..85c4e93ac3d203d0f07297742c930d07f8884a13 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/CalendarPage.java +++ b/app/src/main/java/com/example/admin/sleepbetter/CalendarPage.java @@ -1,12 +1,11 @@ package com.example.admin.sleepbetter; import android.app.Fragment; +import android.arch.persistence.room.Room; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.annotation.Nullable; -import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -20,20 +19,27 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; import java.util.GregorianCalendar; import java.util.List; +import static android.content.Context.MODE_PRIVATE; + public class CalendarPage extends Fragment { public GregorianCalendar cal_month, cal_month_copy; private HwAdapter hwAdapter; private TextView tv_month; View helpView; + private static final String DATABASE_NAME = "user_db"; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - helpView = inflater.inflate(R.layout.calendar, container, false); + helpView = inflater.inflate(R.layout.act_Calendar, container, false); /* HomeCollection.date_collection_arr = new ArrayList<HomeCollection>(); @@ -49,23 +55,67 @@ public class CalendarPage extends Fragment { HomeCollection.date_collection_arr.add(new HomeCollection("2018-02-09", "Christmas", "Holiday", "this is holiday")); */ + new Thread(new Runnable() { + @Override + public void run() { + + Date c = Calendar.getInstance().getTime(); + SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); + final String currentDate = df.format(c); + + String startingDate = getActivity().getApplicationContext().getSharedPreferences("date", MODE_PRIVATE).getString("startingDate", ""); + + Date date1 = null; + Date date2 = null; + + + //Setting dates + try { + date1 = df.parse(currentDate); + date2 = df.parse(startingDate); + } catch (ParseException e) { + e.printStackTrace(); + } - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); - Gson gson = new Gson(); - String json = sharedPrefs.getString("trial", ""); - Type type = new TypeToken<List<HomeCollection>>() {}.getType(); - List<HomeCollection> arrayList = gson.fromJson(json, type); + Calendar c1 = Calendar.getInstance(); + c1.setTime(date1); - HomeCollection.date_collection_arr = (ArrayList<HomeCollection>) arrayList; + Calendar c2 = Calendar.getInstance(); + c2.setTime(date2); - System.out.println(arrayList.size()); - System.out.println(arrayList.get(0).date); - // HomeCollection.date_collection_arr = new ArrayList<HomeCollection>(); - // HomeCollection.date_collection_arr.add(new HomeCollection("2018-07-08", "Diwali", "Holiday", "this is holiday")); + int shouldBe = c1.get(Calendar.DAY_OF_YEAR) - c2.get(Calendar.DAY_OF_YEAR); + HomeCollection.date_collection_arr = new ArrayList<HomeCollection>(); + UserDatabase uDatabase = Room.databaseBuilder(getActivity().getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); + ArrayList<Double> moods = (ArrayList<Double>) uDatabase.daoAccess().fetchMoods(); + String experiments = getActivity().getApplicationContext().getSharedPreferences("experiments", MODE_PRIVATE).getString("experiments", ""); + String[] experimentsArray = experiments.split("$^"); + + String diary_comments = getActivity().getApplicationContext().getSharedPreferences("diary", MODE_PRIVATE).getString("diary", ""); + String[] diaries = diary_comments.split("$^"); + + String dayForLoop = startingDate; + for (int i=0; i<shouldBe; i++) { + + HomeCollection.date_collection_arr.add(new HomeCollection(dayForLoop, experimentsArray[i], String.valueOf(moods.get(i)), diaries[i])); + + Calendar cal = Calendar.getInstance(); + try { + cal.setTime(df.parse(startingDate)); + } catch (ParseException e) { + e.printStackTrace(); + } + cal.add(Calendar.DATE, 1); // number of days to add, can also use Calendar.DAY_OF_MONTH in place of Calendar.DATE + SimpleDateFormat sdf1 = new SimpleDateFormat("dd-MMM-yyyy"); + dayForLoop = sdf1.format(cal.getTime()); + + } + } + //scoatem variabila days si verificam: daca se imparte la 5, si nu e locked, + }).start(); cal_month = (GregorianCalendar) GregorianCalendar.getInstance(); @@ -80,7 +130,7 @@ public class CalendarPage extends Fragment { previous.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (cal_month.get(GregorianCalendar.MONTH) == 4 && cal_month.get(GregorianCalendar.YEAR) == 2018) { + if (cal_month.get(GregorianCalendar.MONTH) == 4 && cal_month.get(GregorianCalendar.YEAR) == 2019) { //cal_month.set((cal_month.get(GregorianCalendar.YEAR) - 1), cal_month.getActualMaximum(GregorianCalendar.MONTH), 1); Toast.makeText(getActivity().getApplicationContext(), "Event Detail is available for current session only.", Toast.LENGTH_SHORT).show(); } else { @@ -95,7 +145,7 @@ public class CalendarPage extends Fragment { next.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (cal_month.get(GregorianCalendar.MONTH) == 10 && cal_month.get(GregorianCalendar.YEAR) == 2018) { + if (cal_month.get(GregorianCalendar.MONTH) == 10 && cal_month.get(GregorianCalendar.YEAR) == 2019) { //cal_month.set((cal_month.get(GregorianCalendar.YEAR) + 1), cal_month.getActualMinimum(GregorianCalendar.MONTH), 1); Toast.makeText(getActivity().getApplicationContext(), "Event Detail is available for current session only.", Toast.LENGTH_SHORT).show(); } else { diff --git a/app/src/main/java/com/example/admin/sleepbetter/DaoAccess.java b/app/src/main/java/com/example/admin/sleepbetter/DaoAccess.java index 7d6f9eb2d44e39c494ca08ca3088f21fe05e8d16..f5066258c5edae71a5ae793e1640419155198b47 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/DaoAccess.java +++ b/app/src/main/java/com/example/admin/sleepbetter/DaoAccess.java @@ -32,46 +32,34 @@ public interface DaoAccess { List<UserExperiment> fetchUserExperiments(); @Query("SELECT mood_all FROM UserQuestionnaire") - List<Integer> fetchMoods(); + List<Double> fetchMoods(); - @Query("SELECT timesPerNight FROM UserQuestionnaire") - List<Integer> fetchTimsPerNight(); + @Query("SELECT awake FROM UserQuestionnaire") + List<Integer> fetchAwake(); - @Query("SELECT nightTerrors FROM UserQuestionnaire") - List<Integer> fetchNightTerrors(); + @Query("SELECT earlier FROM UserQuestionnaire") + List<Integer> fetchEarlier(); - @Query("SELECT fallAsleep FROM UserQuestionnaire") - List<Integer> fetchFallAsleep(); + @Query("SELECT howLong FROM UserQuestionnaire") + List<Integer> fetchHowLong(); - @Query("SELECT wakeUp FROM UserQuestionnaire") - List<Integer> fetchWakeUp(); + @Query("SELECT nightsAWeek FROM UserQuestionnaire") + List<Integer> fetchNightsAWeek(); - @Query("SELECT fresh FROM UserQuestionnaire") - List<Integer> fetchFresh(); + @Query("SELECT quality FROM UserQuestionnaire") + List<Integer> fetchQuality(); - @Query("SELECT sad FROM UserQuestionnaire") - List<Integer> fetchSad(); + @Query("SELECT impactMood FROM UserQuestionnaire") + List<Integer> fetchImpactMood(); - @Query("SELECT sleepy FROM UserQuestionnaire") - List<Integer> fetchSleepy(); + @Query("SELECT impactActivities FROM UserQuestionnaire") + List<Integer> fetchImpactActivities(); - @Query("SELECT tired FROM UserQuestionnaire") - List<Integer> fetchTired(); + @Query("SELECT impactGeneral FROM UserQuestionnaire") + List<Integer> fetchImpactGeneral(); - @Query("SELECT stressed FROM UserQuestionnaire") - List<Integer> fetchStressed(); - - @Query("SELECT apetite FROM UserQuestionnaire") - List<Integer> fetchApetite(); - - @Query("SELECT concentrate FROM UserQuestionnaire") - List<Integer> ftchConcentrate(); - - @Query("SELECT coordinate FROM UserQuestionnaire") - List<Integer> fetchCoordinate(); - - @Query("SELECT irritable FROM UserQuestionnaire") - List<Integer> fetchIrritable(); + @Query("SELECT problem FROM UserQuestionnaire") + List<Integer> fetchProblem(); @Query("SELECT * FROM UserDiary") List<UserDiary> fetchDiary(); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Data.java b/app/src/main/java/com/example/admin/sleepbetter/Data.java index 90a88380ac2e46a06f2899e50d4ff6448243f272..8887a3c296c5e01346bb84ba6f73b20ac74fcab5 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Data.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Data.java @@ -13,26 +13,17 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; -import android.widget.EditText; import android.widget.ImageView; import android.widget.Spinner; import android.widget.TextView; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.jjoe64.graphview.GraphView; import com.jjoe64.graphview.series.DataPoint; import com.jjoe64.graphview.series.LineGraphSeries; -import java.lang.reflect.Type; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; - -import static android.content.Context.MODE_PRIVATE; public class Data extends Fragment implements AdapterView.OnItemSelectedListener { private UserDatabase userDatabase; @@ -42,7 +33,7 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - dataView = inflater.inflate(R.layout.data, container, false); + dataView = inflater.inflate(R.layout.act_Data, container, false); ImageView imageView1 = (ImageView) dataView.findViewById(R.id.imageView28); imageView1.setImageResource(R.drawable.you); @@ -54,19 +45,10 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener GraphView graph = (GraphView) dataView.findViewById(R.id.totalMood); userDatabase = Room.databaseBuilder(getActivity().getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); - ArrayList<Integer> numberOfGoodMoods = (ArrayList<Integer>) userDatabase.daoAccess().fetchMoods(); + ArrayList<Double> numberOfGoodMoods = (ArrayList<Double>) userDatabase.daoAccess().fetchMoods(); int sizeMoods = sizeOfMoods(numberOfGoodMoods); - - System.out.println("DATAAAAAAAAAAAAAAAAAAAAa"); - System.out.println(numberOfGoodMoods.size()); - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); - Gson gson = new Gson(); - String json = sharedPrefs.getString("trial", ""); - Type type = new TypeToken<List<HomeCollection>>() {}.getType(); - List<HomeCollection> arrayList = gson.fromJson(json, type); - System.out.println("SIZE IS " + arrayList.size()); int sizeToGraph = 0; @@ -153,7 +135,7 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener if ((numberOfGoodMoods.size() - 1) % 5 == 0){ while (it.hasNext() && k < 5) { it.next(); - Integer moodToSee = userDatabase.daoAccess().fetchMoods().get(((userDatabase.daoAccess().fetchMoods().size() - 1) / 5) * 5 - 5 + k + 1); + Double moodToSee = userDatabase.daoAccess().fetchMoods().get(((userDatabase.daoAccess().fetchMoods().size() - 1) / 5) * 5 - 5 + k + 1); if (moodToSee != -1) { dp2[i] = new DataPoint(k + 1, moodToSee); @@ -164,7 +146,7 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener } else { while (it.hasNext() && k < (numberOfGoodMoods.size() - 1) % 5) { it.next(); - Integer moodToSee = userDatabase.daoAccess().fetchMoods().get(((userDatabase.daoAccess().fetchMoods().size() - 1) / 5) * 5 + k + 1); + Double moodToSee = userDatabase.daoAccess().fetchMoods().get(((userDatabase.daoAccess().fetchMoods().size() - 1) / 5) * 5 + k + 1); if (moodToSee != -1) { @@ -234,7 +216,7 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener } - private int sizeOfMoods(ArrayList<Integer> integers) { + private int sizeOfMoods(ArrayList<Double> integers) { int size = 0; @@ -257,82 +239,46 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener TextView mood = (TextView) dataView.findViewById(R.id.overallMood); mood.setText("Overall mood: " + getActivity().getApplicationContext().getSharedPreferences("MOOD", Context.MODE_PRIVATE).getInt("mood", 0) + "/5"); - TextView times = (TextView) dataView.findViewById(R.id.timesWaking); - times.setText("Times waking up: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("timesPerNight", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("timesPerNight", 0) >= 3){ - change = change + "/ " + "times waking up"; - } - - TextView nightTerrors = (TextView) dataView.findViewById(R.id.nightTerrors); - nightTerrors.setText("Night terrors: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("nightTerrors", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("nightTerrors", 0) >= 3){ - change = change + "/ " + "night terrors"; - } - - TextView waking = (TextView) dataView.findViewById(R.id.wakingUp); - waking.setText("Falling asleep: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("wakeUp", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("wakeUp", 0) >= 3){ - change = change + "/ " + "waking up"; - } - - TextView fall = (TextView) dataView.findViewById(R.id.fallasleep); - fall.setText("Waking up: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("fallAsleep", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("fallAsleep", 0) >= 3){ - change = change + "/ " + "falling sleep"; - } - - TextView fresh = (TextView) dataView.findViewById(R.id.fresh); - fresh.setText("Fresh: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("fresh", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("fresh", 0) >= 3){ - change = change + "/ " + "freshness"; - } - - TextView sad = (TextView) dataView.findViewById(R.id.sad); - sad.setText("Sad: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("sad", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("sad", 0) >= 3){ - change = change + "/ " + "sadness"; - } - - TextView sleepy = (TextView) dataView.findViewById(R.id.sleepy); - sleepy.setText("Sleepy: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("sleepy", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("sleepy", 0) >= 3){ - change = change + "/ " + "sleepiness"; + TextView times = (TextView) dataView.findViewById(R.id.howLong); + times.setText("How log it takes to fall asleep: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("howLong", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("howLong", 0) >= 3){ + change = change + "/ " + "hard to fall asleep"; } - TextView tired = (TextView) dataView.findViewById(R.id.tired); - tired.setText("Tired: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("tired", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("tired", 0) >= 3){ - change = change + "/ " + "tiredness"; + TextView nightTerrors = (TextView) dataView.findViewById(R.id.awake); + nightTerrors.setText("How long you are awake during the night: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("awake", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("awake", 0) >= 3){ + change = change + "/ " + "awake during the nights"; } - TextView stressed = (TextView) dataView.findViewById(R.id.stressed); - stressed.setText("Stressed: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("stressed", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("stressed", 0) >= 3){ - change = change + "/ " + "stress"; + TextView waking = (TextView) dataView.findViewById(R.id.earlier); + waking.setText("How much earlier you wake up than your normal time: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("earlier", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("earlier", 0) >= 3){ + change = change + "/ " + "waking up too early"; } - TextView irritable = (TextView) dataView.findViewById(R.id.irritable); - irritable.setText("Irritable: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("irritable", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("irritable", 0) >= 3){ - change = change + "/ " + "irritability"; + TextView fall = (TextView) dataView.findViewById(R.id.quality); + fall.setText("Sleep Quality: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("quality", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("quality", 0) >= 3){ + change = change + "/ " + "sleep quality"; } - TextView concentrate = (TextView) dataView.findViewById(R.id.concentrate); - concentrate.setText("Concentration: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("concentrate", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("concentrate", 0) >= 3){ - change = change + "/ " + "concentration"; + TextView fresh = (TextView) dataView.findViewById(R.id.impactMood); + fresh.setText("Affecting mood, energy, or relationships: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("impactMood", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("impactMood", 0) >= 3){ + change = change + "/ " + "affecting mood, energy, relationships"; } - TextView coordinate = (TextView) dataView.findViewById(R.id.coordinate); - coordinate.setText("Coordination: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("coordinate", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("coordinate", 0) >= 3){ - change = change + "/ " + "coordination"; + TextView sad = (TextView) dataView.findViewById(R.id.impactActivities); + sad.setText("Affecting concentration, productivity, or ability to stay awake: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("impactActivities", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("impactActivities", 0) >= 3){ + change = change + "/ " + "affecting concentration, productivity"; } - TextView appetite = (TextView) dataView.findViewById(R.id.appetite); - appetite.setText("Appetite: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("apetite", 0) + "/5"); - if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("apetite", 0) >= 3){ - change = change + "/ " + "appetite"; + TextView sleepy = (TextView) dataView.findViewById(R.id.impactGeneral); + sleepy.setText("Affecting life in general: " + getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("impactGeneral", 0) + "/5"); + if (getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("impactLife", 0) >= 3){ + change = change + "/ " + "affecting life in general"; } if (change.equals("")){ @@ -350,7 +296,7 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener GraphView graph = (GraphView) dataView.findViewById(R.id.specificMood); - ArrayList<Integer> numberOfGoodMoods = (ArrayList<Integer>) userDatabase.daoAccess().fetchMoods(); + ArrayList<Double> numberOfGoodMoods = (ArrayList<Double>) userDatabase.daoAccess().fetchMoods(); int sizeMoods = sizeOfMoods(numberOfGoodMoods); @@ -413,32 +359,20 @@ public class Data extends Fragment implements AdapterView.OnItemSelectedListener private List<Integer> getListFromSpinner(String text) { - if (text.equals("Times waking up per night")){ - return userDatabase.daoAccess().fetchTimsPerNight(); - } else if (text.equals("Night terrors")){ - return userDatabase.daoAccess().fetchNightTerrors(); - } else if (text.equals("Falling asleep")){ - return userDatabase.daoAccess().fetchFallAsleep(); - } else if (text.equals("Waking up")){ - return userDatabase.daoAccess().fetchWakeUp(); - } else if (text.equals("Fresh")){ - return userDatabase.daoAccess().fetchFresh(); - } else if (text.equals("Sad")){ - return userDatabase.daoAccess().fetchSad(); - } else if (text.equals("Sleepy")){ - return userDatabase.daoAccess().fetchSleepy(); - } else if (text.equals("Tired")){ - return userDatabase.daoAccess().fetchTired(); - } else if (text.equals("Stressed")){ - return userDatabase.daoAccess().fetchStressed(); - } else if (text.equals("Irritable")){ - return userDatabase.daoAccess().fetchIrritable(); - } else if (text.equals("Concentrate")){ - return userDatabase.daoAccess().ftchConcentrate(); - } else if (text.equals("Coordinate")){ - return userDatabase.daoAccess().fetchCoordinate(); - } else if (text.equals("Appetite")){ - return userDatabase.daoAccess().fetchApetite(); + if (text.equals("Falling asleep")){ + return userDatabase.daoAccess().fetchHowLong(); + } else if (text.equals("Awake at night")){ + return userDatabase.daoAccess().fetchAwake(); + } else if (text.equals("Waking up earlier")){ + return userDatabase.daoAccess().fetchEarlier(); + } else if (text.equals("Sleep quality")){ + return userDatabase.daoAccess().fetchQuality(); + } else if (text.equals("Impacting feelings")){ + return userDatabase.daoAccess().fetchImpactMood(); + } else if (text.equals("Impacting activities")){ + return userDatabase.daoAccess().fetchImpactActivities(); + } else if (text.equals("Impacting life")){ + return userDatabase.daoAccess().fetchImpactGeneral(); } return null; diff --git a/app/src/main/java/com/example/admin/sleepbetter/DialogAdaptorStudent.java b/app/src/main/java/com/example/admin/sleepbetter/DialogAdaptorStudent.java index 40f26304edc0412ec4b7dfd9e3391367ec0f13e5..c259428f8865a2946995cfb7aafd4155b3ce8726 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/DialogAdaptorStudent.java +++ b/app/src/main/java/com/example/admin/sleepbetter/DialogAdaptorStudent.java @@ -45,7 +45,7 @@ class DialogAdaptorStudent extends BaseAdapter { @Override public View getView(final int position, View convertView, ViewGroup parent) { LayoutInflater inflater = context.getLayoutInflater(); - View listViewItem = inflater.inflate(R.layout.row_addapt, null, true); + View listViewItem = inflater.inflate(R.layout.extra_row_addapt, null, true); TextView tvExperiment=(TextView)listViewItem.findViewById(R.id.tv_experiment); TextView tvOverall=(TextView)listViewItem.findViewById(R.id.tv_overall); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Dialogpojo.java b/app/src/main/java/com/example/admin/sleepbetter/Dialogpojo.java index 5b3f0f5c5c76aa96277dfb96c23039ed98aebfcd..48261bfee159056222b4101ed58f2f6263fde71c 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Dialogpojo.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Dialogpojo.java @@ -27,8 +27,6 @@ public class Dialogpojo { this.duedates = duedates; } - public void setProofs(String proofs) { this.proofs = proofs; } - public void setComments(String comments) { this.comments = comments; } @@ -53,10 +51,6 @@ public class Dialogpojo { return duedates; } - public String getProofs() { - return proofs; - } - public String getComments() { return comments; } diff --git a/app/src/main/java/com/example/admin/sleepbetter/Factors.java b/app/src/main/java/com/example/admin/sleepbetter/Factors.java index 5c73417b4f9684648c859e5379104f6987509eb4..8a12eb2fa1c60564da7420844fba42e6d54288e7 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Factors.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Factors.java @@ -1,28 +1,27 @@ package com.example.admin.sleepbetter; -import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; -import android.app.FragmentManager; import android.app.Fragment; import android.app.FragmentTransaction; +import android.arch.persistence.room.Room; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.view.WindowManager; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.Date; import static android.content.Context.MODE_PRIVATE; @@ -33,42 +32,32 @@ public class Factors extends Fragment { private static RadioGroup radioGroup; private boolean shouldBlockTouches = false; + private static final String DATABASE_NAME = "user_db"; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - factorsView = inflater.inflate(R.layout.factors, container, false); + factorsView = inflater.inflate(R.layout.act_Experiments, container, false); Button button2 = (Button) factorsView.findViewById(R.id.submit); - button2.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - submitExperiment(); - } - }); String experiment = getActivity().getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("experiment", "nothing"); - int savedRadioIndex = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("KEY_SAVED_RADIO_BUTTON_INDEX", 0); radioGroup = (RadioGroup) factorsView.findViewById(R.id.experimentsGroup); if (!experiment.equals("nothing")){ - - System.out.println(experiment); - System.out.println(savedRadioIndex); RadioButton savedCheckedRadioButton = (RadioButton)radioGroup.getChildAt(savedRadioIndex); savedCheckedRadioButton.setChecked(true); } - - radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override @@ -111,94 +100,99 @@ public class Factors extends Fragment { } }); + new Thread(new Runnable() { + @Override + public void run() { - Button button = (Button) factorsView.findViewById(R.id.moreInfo); + Date c = Calendar.getInstance().getTime(); + SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); + final String currentDate = df.format(c); - button.setOnClickListener(new View.OnClickListener() { + String previousExperimentStartDate = getActivity().getSharedPreferences("date", MODE_PRIVATE).getString("startExperiment", ""); + String studyStartDate = getActivity().getSharedPreferences("date", MODE_PRIVATE).getString("startingDate", ""); - public void onClick(View v) { - goHelpPage(); + Calendar calendar1 = Calendar.getInstance(); + SimpleDateFormat formatter1 = new SimpleDateFormat("HH:mm"); + String currentHour = formatter1.format(calendar1.getTime()); - } + UserDatabase uDatabase = Room.databaseBuilder(getActivity().getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); + int loggedIn = uDatabase.daoAccess().fetchUserQuestionnaires().size(); - }); + Date date1 = null; + Date date2 = null; - boolean isLocked = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getBoolean("locked", false); - int fiveDays = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("days", 0); + SimpleDateFormat dates = new SimpleDateFormat("dd-MMM-yyyy"); - Calendar calendar1 = Calendar.getInstance(); - SimpleDateFormat formatter1 = new SimpleDateFormat("HH:mm"); - String currentDate = formatter1.format(calendar1.getTime()); + //Setting dates + try { + date1 = dates.parse(currentDate); + date2 = dates.parse(previousExperimentStartDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(fiveDays + " IS DAYS"); - System.out.println(isLocked + " IS LOCKED"); + Calendar c1 = Calendar.getInstance(); + c1.setTime(date1); - if (isLocked && fiveDays % 5 == 0 && currentDate.compareTo("18:59")>0){ - //daca e blocat si a venit momentul sa se schimbe experimentul - for (int i = 0; i < radioGroup.getChildCount(); i++) { - radioGroup.getChildAt(i).setEnabled(true); - } - //zice ca nu e blocat - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", false).apply(); + Calendar c2 = Calendar.getInstance(); + c2.setTime(date2); - //Amm schimbat in plus - } else if (isLocked && (fiveDays + 1) % 5 == 0 && currentDate.compareTo("18:59")<0){ - for (int i = 0; i < radioGroup.getChildCount(); i++) { - radioGroup.getChildAt(i).setEnabled(false); - } - Toast.makeText(getActivity().getApplicationContext(), "You will be able to change the experiment, after you complete today's questionnaire.", Toast.LENGTH_SHORT).show(); + int differenceBetweenOldExperimentAndCurrent = c1.get(Calendar.DAY_OF_YEAR) - c2.get(Calendar.DAY_OF_YEAR); - } else if (isLocked && (fiveDays + 1) % 5 == 0 && currentDate.compareTo("18:59")>0){ - for (int i = 0; i < radioGroup.getChildCount(); i++) { - radioGroup.getChildAt(i).setEnabled(false); - } - Toast.makeText(getActivity().getApplicationContext(), "You will be able to change the experiment, after you complete today's questionnaire.", Toast.LENGTH_SHORT).show(); + if (previousExperimentStartDate.equals(studyStartDate) && differenceBetweenOldExperimentAndCurrent == 5){ + if (Integer.valueOf(currentHour) < 19){ + for (int i = 0; i < radioGroup.getChildCount(); i++) { + radioGroup.getChildAt(i).setEnabled(false); + } + Toast.makeText(getActivity().getApplicationContext(), "You are not allowed to change your experiment yet. You can change it after 19:00 today.", Toast.LENGTH_LONG).show(); + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); - } else if (isLocked && fiveDays % 5 != 0){ - //daca e blocat si e na din zilele cand nu are voie sa schimbe - for (int i = 0; i < radioGroup.getChildCount(); i++) { - radioGroup.getChildAt(i).setEnabled(false); - } - Toast.makeText(getActivity().getApplicationContext(), "You cannot change the current experiment before the 5-day period ends.", Toast.LENGTH_SHORT).show(); - } else { - //daca nu e blocat - prima data cand intra - for (int i = 0; i < radioGroup.getChildCount(); i++) { - radioGroup.getChildAt(i).setEnabled(true); - } - } + } else if (loggedIn % 5 != 1){ + for (int i = 0; i < radioGroup.getChildCount(); i++) { + radioGroup.getChildAt(i).setEnabled(false); + } + Toast.makeText(getActivity().getApplicationContext(), "You are not allowed to change your experiment yet. You can change it after completing today's questionnaire.", Toast.LENGTH_LONG).show(); + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); - return factorsView; - } + } + } + if (!previousExperimentStartDate.equals(studyStartDate)){ + if (differenceBetweenOldExperimentAndCurrent < 5){ + for (int i = 0; i < radioGroup.getChildCount(); i++) { + radioGroup.getChildAt(i).setEnabled(false); + } + Toast.makeText(getActivity().getApplicationContext(), "You are not allowed to change your experiment yet as 5 days have not passed.", Toast.LENGTH_LONG).show(); + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); - private void SavePreferences(String key, int value){ - getActivity().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt(key, value).apply(); - } + } else { + if (Integer.valueOf(currentHour) < 19){ + for (int i = 0; i < radioGroup.getChildCount(); i++) { + radioGroup.getChildAt(i).setEnabled(false); + } + Toast.makeText(getActivity().getApplicationContext(), "You are not allowed to change your experiment yet. You can change it after 19:00 today.", Toast.LENGTH_LONG).show(); + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); - private void goHelpPage() { - FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); - fragmentTransaction.replace(R.id.content_frame, new Help()); + } else if (loggedIn % 5 != 1){ + for (int i = 0; i < radioGroup.getChildCount(); i++) { + radioGroup.getChildAt(i).setEnabled(false); + } + Toast.makeText(getActivity().getApplicationContext(), "You are not allowed to change your experiment yet. You can change it after completing today's questionnaire.", Toast.LENGTH_LONG).show(); + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); - fragmentTransaction.addToBackStack(null); - fragmentTransaction.commit(); - getFragmentManager().executePendingTransactions(); + } + } + } + } + }).start(); + return factorsView; } - /* - public void openFactor(String factor){ - - FragmentManager fragmentManager = getFragmentManager(); - - if (factor.equals("light")) { - fragmentManager.beginTransaction().replace(R.id.content_frame, new FactorSSLight()).commit(); - } else if (factor.equals("caffeine")) { - fragmentManager.beginTransaction().replace(R.id.content_frame, new FactorDECaffeine()).commit(); - } else if (factor.equals("schedule")) { - fragmentManager.beginTransaction().replace(R.id.content_frame, new FactorCRSleepSchedule()).commit(); - } - }*/ + private void SavePreferences(String key, int value){ + getActivity().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt(key, value).apply(); + } private void submitExperiment(){ @@ -252,25 +246,41 @@ public class Factors extends Fragment { builder.setPositiveButton("Submit", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { - // FIRE ZE MISSILES! boolean isLocked = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getBoolean("locked", false); if (isLocked){ - Toast.makeText(getActivity().getApplicationContext(), "You cannot change the current experiment before the 5-day period ends.", Toast.LENGTH_SHORT).show(); + Toast.makeText(getActivity().getApplicationContext(), "You cannot change the current experiment before the 5-day period ends.", Toast.LENGTH_LONG).show(); } else { //daca nu e blocat, atunci se updateaza experimentul, se blocheaza accesul si se incrementeaza nr de zile for (int i = 0; i < radioGroup.getChildCount(); i++) { radioGroup.getChildAt(i).setEnabled(false); } - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); + Intent intent = new Intent(getActivity().getApplicationContext(), MainMenu.class); - int days = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("days", 0); - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", days + 1).apply(); + //update starting date + Date c = Calendar.getInstance().getTime(); + SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); + final String currentDate = df.format(c); - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("afterExperiment", true).apply(); + getActivity().getSharedPreferences("date", MODE_PRIVATE).getString("startExperiment", ""); + getActivity().getSharedPreferences("date", MODE_PRIVATE).edit().putString("startExperiment", currentDate).apply(); + // + String experiments = getActivity().getSharedPreferences("experiments", MODE_PRIVATE).getString("experiments", ""); + + String currentExperiment = getActivity().getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("experiment", "nothing"); + + + String[] experimentsArray = experiments.split("$^"); + experimentsArray[experimentsArray.length] = currentExperiment + "."; + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < experimentsArray.length; i++) { + sb.append(experimentsArray[i]).append("$^"); + } + sb.setLength(sb.length() - 2); + getActivity().getApplicationContext().getSharedPreferences("experiments", MODE_PRIVATE).edit().putString("experiments", sb.toString()).apply(); - Intent intent = new Intent(getActivity().getApplicationContext(), MainMenu.class); startActivity(intent); } } diff --git a/app/src/main/java/com/example/admin/sleepbetter/FirstPage.java b/app/src/main/java/com/example/admin/sleepbetter/FirstPage.java index d5ab854907445f69eafff3c081c7b84d24c1845b..8d03cb1b0a86a104ca5825430d0f82b3d3b8bf64 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/FirstPage.java +++ b/app/src/main/java/com/example/admin/sleepbetter/FirstPage.java @@ -1,11 +1,6 @@ package com.example.admin.sleepbetter; -import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.preference.PreferenceManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; @@ -15,10 +10,6 @@ import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; -import com.google.gson.Gson; - -import java.util.ArrayList; - public class FirstPage extends AppCompatActivity { private EditText nameBox = null; @@ -27,7 +18,7 @@ public class FirstPage extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_first_page); + setContentView(R.layout.act_Welcome); nameBox = (EditText) findViewById(R.id.yourName); System.out.println("INPUT IS :" + nameBox.getText().toString()); @@ -51,11 +42,6 @@ public class FirstPage extends AppCompatActivity { String completed = getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing"); - int completedBitmoji = getSharedPreferences("bmhappy", MODE_PRIVATE).getInt("slectedbitmoji", -1); - getSharedPreferences("bmok", MODE_PRIVATE).getInt("slectedbitmoji", 0); - getSharedPreferences("bmnotok", MODE_PRIVATE).getInt("slectedbitmoji", 0); - getSharedPreferences("bmbad", MODE_PRIVATE).getInt("slectedbitmoji", 0); - if (completed.equals("Yes") || completed.equals("No")){ consent.setChecked(true); @@ -140,7 +126,7 @@ public class FirstPage extends AppCompatActivity { Toast.makeText(getApplicationContext(), "Please input your participant ID number", Toast.LENGTH_SHORT).show(); } else { - Intent intent = new Intent(this, SecondPage.class); + Intent intent = new Intent(this, Notice.class); String name = nameBox.getText().toString(); String participant = participantID.getText().toString(); diff --git a/app/src/main/java/com/example/admin/sleepbetter/FirstPageConsent.java b/app/src/main/java/com/example/admin/sleepbetter/FirstPageConsent.java index ffd1f627aa98e47f578bff7a19f3d56b9c580a94..a8a2759563940d0f12670ce22bea585f19445f8b 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/FirstPageConsent.java +++ b/app/src/main/java/com/example/admin/sleepbetter/FirstPageConsent.java @@ -2,12 +2,10 @@ package com.example.admin.sleepbetter; import android.content.Intent; import android.os.Bundle; -import android.provider.MediaStore; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.CheckBox; -import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; @@ -17,7 +15,7 @@ public class FirstPageConsent extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_first_page_consent); + setContentView(R.layout.act_Consent); Button button = (Button) findViewById(R.id.submit); diff --git a/app/src/main/java/com/example/admin/sleepbetter/GoalDiary.java b/app/src/main/java/com/example/admin/sleepbetter/GoalDiary.java index 9d06c6ff8cf277f6a828bed1487ed1c2d2d2c0ef..8de8d0fe6c8495bb8f59f95445e73d14d19cadb5 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/GoalDiary.java +++ b/app/src/main/java/com/example/admin/sleepbetter/GoalDiary.java @@ -2,7 +2,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.arch.persistence.room.Room; -import android.content.Context; import android.content.SharedPreferences; import android.graphics.Color; import android.os.Bundle; @@ -22,6 +21,7 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import java.lang.reflect.Type; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -40,7 +40,7 @@ public class GoalDiary extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - goalDiaryView = inflater.inflate(R.layout.goal_diary, container, false); + goalDiaryView = inflater.inflate(R.layout.act_Diary, container, false); ImageView imageView = (ImageView) goalDiaryView.findViewById(R.id.imageView29); imageView.setImageResource(R.drawable.diary); Button button = (Button) goalDiaryView.findViewById(R.id.button); @@ -68,28 +68,30 @@ public class GoalDiary extends Fragment { List<UserDiary> diaries = userDatabase.daoAccess().fetchDiary(); final TableLayout tableLayout = (TableLayout) goalDiaryView.findViewById(R.id.table); + + Date c = Calendar.getInstance().getTime(); + SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); + final String currentDate = df.format(c); + int colorBlack = Color.BLACK; for (int i = 0; i < diaries.size(); i++) { - // Creation row - final TableRow tableRow = new TableRow(getActivity().getApplicationContext()); - tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT, 2)); - tableRow.setWeightSum(2); - // Creation textView - final TextView text = new TextView(getActivity().getApplicationContext()); - text.setText(diaries.get(i).getDate()); - text.setTextColor(colorBlack); - text.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1)); - - // Creation textView - final TextView text2 = new TextView(getActivity().getApplicationContext()); - text2.setText(diaries.get(i).getComment()); - text2.setTextColor(colorBlack); - text2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1)); - - tableRow.addView(text); - tableRow.addView(text2); - - tableLayout.addView(tableRow); + + if (diaries.get(i).getDate().equals(currentDate)) { + // Creation row + final TableRow tableRow = new TableRow(getActivity().getApplicationContext()); + tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT, 1)); + tableRow.setWeightSum(1); + + // Creation textView + final TextView text2 = new TextView(getActivity().getApplicationContext()); + text2.setText(diaries.get(i).getComment()); + text2.setTextColor(colorBlack); + text2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1)); + + tableRow.addView(text2); + + tableLayout.addView(tableRow); + } } } @@ -101,7 +103,7 @@ public class GoalDiary extends Fragment { Date c = Calendar.getInstance().getTime(); SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); - final String formattedDate = df.format(c); + final String currentDate = df.format(c); final String note = notee; @@ -110,13 +112,8 @@ public class GoalDiary extends Fragment { int colorBlack = Color.BLACK; // Creation row final TableRow tableRow = new TableRow(getActivity().getApplicationContext()); - tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT, 2)); - tableRow.setWeightSum(2); - // Creation textView - final TextView text = new TextView(getActivity().getApplicationContext()); - text.setText(formattedDate); - text.setTextColor(colorBlack); - text.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1)); + tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT, 1)); + tableRow.setWeightSum(1); // Creation textView final TextView text2 = new TextView(getActivity().getApplicationContext()); @@ -124,67 +121,41 @@ public class GoalDiary extends Fragment { text2.setTextColor(colorBlack); text2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1)); - tableRow.addView(text); tableRow.addView(text2); tableLayout.addView(tableRow); - String experiment = getActivity().getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("experiment", " "); - - SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); - final String formattedDate2 = df2.format(c); - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); - String json = sharedPrefs.getString("trial", ""); - Gson gson = new Gson(); - - Type type = new TypeToken<List<HomeCollection>>() { - }.getType(); - List<HomeCollection> arrayList = gson.fromJson(json, type); - - HomeCollection.date_collection_arr = (ArrayList<HomeCollection>) arrayList; - HomeCollection coll = HomeCollection.date_collection_arr.get(HomeCollection.date_collection_arr.size() - 1); - String date = coll.date; - - - String proof = getActivity().getApplicationContext().getSharedPreferences("proof", MODE_PRIVATE).getString("proof", "No proof logged in yet."); - - if (date.equals(formattedDate2)) { - String comment = coll.comment; - comment = comment + " / " + note; - - String lastExp = coll.experiment; - String lastProof = coll.proof; - - HomeCollection.date_collection_arr.remove(HomeCollection.date_collection_arr.size() - 1); - if (lastExp.equals(experiment)) { - - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, experiment, String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), proof, comment)); - } else { - if (lastExp.contains("yesterday")){ - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, lastExp, "(yesterday) " + String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), "(yesterday) " + lastProof, comment)); - } else { - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, lastExp, String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), proof, comment)); - } - } - - SharedPreferences.Editor editor = sharedPrefs.edit(); - - json = gson.toJson(HomeCollection.date_collection_arr); - - editor.putString("trial", json); - editor.commit(); + //Update array of comments + + String startingDate= getActivity().getApplicationContext().getSharedPreferences("date", MODE_PRIVATE).getString("startingDate", ""); + Date date1 = null; + Date date2 = null; + SimpleDateFormat dates = new SimpleDateFormat("dd-MMM-yyyy"); + //Setting dates + try { + date1 = dates.parse(currentDate); + date2 = dates.parse(startingDate); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar c1 = Calendar.getInstance(); + c1.setTime(date1); + Calendar c2 = Calendar.getInstance(); + c2.setTime(date2); - } else { - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, "(yesterday) " + experiment, "(yesterday) " + String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), "(yesterday) " + proof, note)); + int differenceOfDates = c1.get(Calendar.DAY_OF_YEAR) - c2.get(Calendar.DAY_OF_YEAR); - SharedPreferences.Editor editor = sharedPrefs.edit(); + String diary_comments = getActivity().getApplicationContext().getSharedPreferences("diary", MODE_PRIVATE).getString("diary", ""); - json = gson.toJson(HomeCollection.date_collection_arr); + String[] diaries = diary_comments.split("$^"); + diaries[differenceOfDates] = diaries[differenceOfDates] + note + "."; - editor.putString("trial", json); - editor.commit(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < diaries.length; i++) { + sb.append(diaries[i]).append("$^"); } + sb.setLength(sb.length() - 2); + getActivity().getApplicationContext().getSharedPreferences("diary", MODE_PRIVATE).edit().putString("diary", sb.toString()).apply(); new Thread(new Runnable() { @Override @@ -196,7 +167,7 @@ public class GoalDiary extends Fragment { UserDiary userDiary = new UserDiary(); userDiary.setUsername(username); - userDiary.setDate(formattedDate); + userDiary.setDate(currentDate); userDiary.setComment(note); userDatabase.daoAccess().insertSingleUserDiary(userDiary); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Help.java b/app/src/main/java/com/example/admin/sleepbetter/Help.java deleted file mode 100644 index 5605589a76dd60b7a160cee8aa7f333c60cff1d1..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/Help.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.example.admin.sleepbetter; - - -import android.app.Fragment; -import android.graphics.Color; -import android.graphics.PorterDuff; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.text.Html; -import android.util.Log; -import android.view.KeyEvent; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.inputmethod.EditorInfo; -import android.widget.EditText; -import android.widget.TextView; - -import com.github.kittinunf.fuel.Fuel; -import com.github.kittinunf.fuel.core.FuelError; -import com.github.kittinunf.fuel.core.Handler; -import com.github.kittinunf.fuel.core.Request; -import com.github.kittinunf.fuel.core.Response; -import com.ibm.watson.developer_cloud.conversation.v1.ConversationService; -import com.ibm.watson.developer_cloud.conversation.v1.model.MessageRequest; -import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse; -import com.ibm.watson.developer_cloud.http.ServiceCallback; - -import java.util.HashMap; -import java.util.Map; - -public class Help extends Fragment { - - private static final String TAG = "Help"; - private ConversationService myConversationService = null; - private TextView chatDisplayTV; - private EditText userStatementET; - private final String IBM_USERNAME = "528a69dc-8537-4a01-8598-bf08be28a75a"; - private final String IBM_PASSWORD = "PqXreJu3IwoQ"; - private final String IBM_WORKSPACE_ID = "724cbe7d-c790-4298-a591-79833ac9aff9"; - - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - View view = inflater.inflate(R.layout.testbot, container, false); - //setContentView(R.layout.testbot); - chatDisplayTV = view.findViewById(R.id.tv_chat_display); - userStatementET = view.findViewById(R.id.et_user_statement); - - //instantiating IBM Watson Conversation Service - myConversationService = - new ConversationService( - "2017-12-06", - IBM_USERNAME, - IBM_PASSWORD - ); - - userStatementET.setOnEditorActionListener(new TextView.OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView tv, int action, KeyEvent keyEvent) { - if (action == EditorInfo.IME_ACTION_DONE) { - //show the user statement - final String userStatement = userStatementET.getText().toString(); - chatDisplayTV.append( - Html.fromHtml("<p><b>YOU:</b> " + userStatement + "</p>") - ); - userStatementET.setText(""); - - MessageRequest request = new MessageRequest.Builder() - .inputText(userStatement) - .build(); - // initiate chat conversation - myConversationService - .message(IBM_WORKSPACE_ID, request) - .enqueue(new ServiceCallback<MessageResponse>() { - @Override - public void onResponse(MessageResponse response) { - String botstatement = ""; - for(String string : response.getText()){ - botstatement += string; - } - // final String botStatement = response.getText().get(0); - final String botStatement = botstatement; - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - chatDisplayTV.append( - Html.fromHtml("<p><b>ALEX:</b> " + - botStatement + "</p>") - ); - } - }); - - // if the intent is joke then we access the third party - // service to get a random joke and respond to user - if (response.getIntents().get(0).getIntent().endsWith("RequestQuote")) { - final Map<String, String> params = new HashMap<String, String>() {{ - put("Accept", "text/plain"); - }}; - Fuel.get("https://icanhazdadjoke.com/").header(params) - .responseString(new Handler<String>() { - @Override - public void success(Request request, Response response, String body) { - Log.d(TAG, "" + response + " ; " + body); - chatDisplayTV.append( - Html.fromHtml("<p><b>BOT:</b> " + - body + "</p>") - ); - } - - @Override - public void failure(Request request, Response response, FuelError fuelError) { - } - }); - } - } - - @Override - public void onFailure(Exception e) { - Log.d(TAG, e.getMessage()); - } - }); - } - return false; - } - }); - - - return view; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/admin/sleepbetter/HomeCollection.java b/app/src/main/java/com/example/admin/sleepbetter/HomeCollection.java index b9d2c8bc3371c2e443570de18cb4310b9c150f3f..fcad6dfb981b8fe8307493f40dfbd12e625aefcd 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/HomeCollection.java +++ b/app/src/main/java/com/example/admin/sleepbetter/HomeCollection.java @@ -6,17 +6,15 @@ class HomeCollection { public String date=""; public String experiment=""; public String overall=""; - public String proof=""; public String comment=""; public static ArrayList<HomeCollection> date_collection_arr; - public HomeCollection(String date, String experiment, String overall, String proof, String comment){ + public HomeCollection(String date, String experiment, String overall, String comment){ this.date=date; this.experiment=experiment; this.overall=overall; - this.proof= proof; this.comment = comment; } diff --git a/app/src/main/java/com/example/admin/sleepbetter/HwAdapter.java b/app/src/main/java/com/example/admin/sleepbetter/HwAdapter.java index 50b67a64fcffa29211231ae01c12b94b15046e15..278e894a07d9afc9b245d834342c3f28d87a469b 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/HwAdapter.java +++ b/app/src/main/java/com/example/admin/sleepbetter/HwAdapter.java @@ -30,7 +30,7 @@ class HwAdapter extends BaseAdapter { private java.util.Calendar month; public GregorianCalendar pmonth; /** - * calendar instance for previous month for getting complete view + * act_Calendar instance for previous month for getting complete view */ public GregorianCalendar pmonthmaxset; private GregorianCalendar selectedDate; @@ -84,7 +84,7 @@ class HwAdapter extends BaseAdapter { if (convertView == null) { // if it's not recycled, initialize some // attributes LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - v = vi.inflate(R.layout.cal_item, null); + v = vi.inflate(R.layout.extra_cal_Item, null); } @@ -147,7 +147,7 @@ class HwAdapter extends BaseAdapter { // allocating maximum row number for the gridview. mnthlength = maxWeeknumber * 7; maxP = getMaxP(); // previous month maximum day 31,30.... - calMaxP = maxP - (firstDay - 1);// calendar offday starting 24,25 ... + calMaxP = maxP - (firstDay - 1);// act_Calendar offday starting 24,25 ... pmonthmaxset = (GregorianCalendar) pmonth.clone(); pmonthmaxset.set(GregorianCalendar.DAY_OF_MONTH, calMaxP + 1); @@ -196,7 +196,7 @@ class HwAdapter extends BaseAdapter { } else { v.setBackgroundColor(Color.parseColor("#343434")); - if (cal_obj.overall.equals("1")){ + /* if (cal_obj.overall.equals("1")){ v.setBackgroundResource(R.drawable.rounded_calender_one); } else if (cal_obj.overall.equals("2")){ v.setBackgroundResource(R.drawable.rounded_calender_two); @@ -210,8 +210,8 @@ class HwAdapter extends BaseAdapter { } else if (cal_obj.overall.contains("yesterday")){ v.setBackgroundResource(R.drawable.rounded_calender_one); } - - txt.setTextColor(Color.parseColor("#696969")); +*/ + txt.setTextColor(Color.parseColor("#180A63")); } } @@ -227,7 +227,6 @@ class HwAdapter extends BaseAdapter { HashMap<String, String> maplist = new HashMap<String, String>(); maplist.put("hexperiment",HomeCollection.date_collection_arr.get(j).experiment); maplist.put("hoverall",HomeCollection.date_collection_arr.get(j).overall); - maplist.put("hproof",HomeCollection.date_collection_arr.get(j).proof); maplist.put("hcomment",HomeCollection.date_collection_arr.get(j).comment); JSONObject json1 = new JSONObject(maplist); jbarrays.put(json1); @@ -235,7 +234,7 @@ class HwAdapter extends BaseAdapter { } if (jbarrays.length()!=0) { final Dialog dialogs = new Dialog(context); - dialogs.setContentView(R.layout.dialog_inform); + dialogs.setContentView(R.layout.extra_dialog_inform); listTeachers = (ListView) dialogs.findViewById(R.id.list_teachers); ImageView imgCross = (ImageView) dialogs.findViewById(R.id.img_cross); listTeachers.setAdapter(new DialogAdaptorStudent(context, getMatchList(jbarrays + ""))); @@ -263,7 +262,6 @@ class HwAdapter extends BaseAdapter { pojo.setExperiments(jsonObject.optString("hexperiment")); pojo.setOveralls(jsonObject.optString("hoverall")); - pojo.setProofs(jsonObject.optString("hproof")); pojo.setComments(jsonObject.optString("hcomment")); alCustom.add(pojo); diff --git a/app/src/main/java/com/example/admin/sleepbetter/MainMenu.java b/app/src/main/java/com/example/admin/sleepbetter/MainMenu.java index 4964c6295be86aa54d645515d7f3267db932a8d0..5bd766c815d53e234a61a48fc39a68b7fde54b60 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/MainMenu.java +++ b/app/src/main/java/com/example/admin/sleepbetter/MainMenu.java @@ -11,14 +11,9 @@ import android.arch.persistence.room.Room; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.content.SharedPreferences; -import android.media.RingtoneManager; -import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.os.SystemClock; import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; @@ -26,20 +21,14 @@ import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.view.Menu; import android.view.MenuItem; -import android.widget.AdapterView; import android.widget.Button; -import android.widget.GridView; -import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; -import android.widget.Toast; +import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Date; -import java.util.GregorianCalendar; import java.util.Calendar; public class MainMenu extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @@ -50,73 +39,115 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_menu); + setContentView(R.layout.act_Menu); + + System.out.println("RECEIVDDDD"); -/* new Thread(new Runnable() { @Override public void run() { Date c = Calendar.getInstance().getTime(); SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); - final String formattedDate = df.format(c); + final String currentDate = df.format(c); - UserDatabase uDatabase = Room.databaseBuilder(getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); - uDatabase.daoAccess().deleteUserQuestonnaire(uDatabase.daoAccess().fetchUserQuestionnaires().get(3)); - - UserQuestionnaire user = new UserQuestionnaire(); - String username = getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); user.setUsername(username); - user.setUsername(username); - user.setDate(formattedDate); - user.setTimesPerNight(-1); - user.setNightTerrors(-1); - user.setFallAsleep(-1); - user.setWakeUp(-1); - user.setFresh(-1); - user.setSad(-1); - user.setSleepy(-1); - user.setTired(-1); - user.setStressed(-1); - user.setApetite(-1); - user.setConcentrate(-1); - user.setCoordinate(-1); - user.setIrritable(-1); - user.setMood(-1); - - //setting mood value to -1 in shared preferences - - uDatabase.daoAccess().insertSingleUserQuestionnaire(user); - - Report rep = new Report(uDatabase, getApplicationContext()); - rep.save(username, false, getApplicationContext().getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); + String startingDate = getSharedPreferences("date", MODE_PRIVATE).getString("startingDate", ""); - } + Date date1 = null; + Date date2 = null; - //scoatem variabila days si verificam: daca se imparte la 5, si nu e locked, - }).start(); + SimpleDateFormat dates = new SimpleDateFormat("dd-MMM-yyyy"); - getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putBoolean("completed", false).apply(); + //Setting dates + try { + date1 = dates.parse(currentDate); + date2 = dates.parse(startingDate); + } catch (ParseException e) { + e.printStackTrace(); + } - getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); -// + Calendar c1 = Calendar.getInstance(); + c1.setTime(date1); - new Thread(new Runnable() { - @Override - public void run() { + Calendar c2 = Calendar.getInstance(); + c2.setTime(date2); + + int shouldBe = c1.get(Calendar.DAY_OF_YEAR) - c2.get(Calendar.DAY_OF_YEAR); UserDatabase uDatabase = Room.databaseBuilder(getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); + int loggedIn = uDatabase.daoAccess().fetchUserQuestionnaires().size(); + + int misses = shouldBe -loggedIn; + + if (misses >=1){ + + for (int i=1; i<misses; i++){ + // adaugam -1 in tabel + + UserQuestionnaire user = new UserQuestionnaire(); + String username = getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); user.setUsername(username); + user.setDate(currentDate); + user.setUsername(username); + user.setHowLong(-1); + user.setAwake(-1); + user.setEarlier(-1); + user.setNightsAWeek(-1); + user.setQuality(-1); + user.setImpactMood(-1); + user.setImpactActivities(-1); + user.setImpactGeneral(-1); + user.setProblem(-1); + user.setMood(-1); + + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("howLong", -1).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("awake", -1).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("earlier", -1).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("quality", -1).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactMood", -1).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactActivities", -1).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactGeneral", -1).apply(); + getSharedPreferences("MOOD", MODE_PRIVATE).edit().putFloat("mood", (float) -1).apply(); + + //setting mood value to -1 in shared preferences + + uDatabase.daoAccess().insertSingleUserQuestionnaire(user); + + Report rep = new Report(uDatabase, getApplicationContext()); + rep.save(username, false, getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); + } + } + + //update experiments + + //including day 0 + shouldBe++; + + String experiments = getSharedPreferences("experiments", MODE_PRIVATE).getString("experiments", ""); - int totalQuestionnaires = uDatabase.daoAccess().fetchUserQuestionnaires().size(); + String[] experimentsArray = experiments.split("$^"); - int fiveDays = getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("days", 0); - int numberOfDays = getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("numberDays", 0); + if (shouldBe > experimentsArray.length){ + String currentExperiment = getSharedPreferences("name", MODE_PRIVATE).getString("experiment", "nothing"); - System.out.println("questionnairs: " + totalQuestionnaires); - System.out.println("fivedays: " + fiveDays); + experimentsArray[experimentsArray.length] = currentExperiment + "."; - System.out.println("nrofdayss: " + numberOfDays); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < experimentsArray.length; i++) { + sb.append(experimentsArray[i]).append("$^"); + } + sb.setLength(sb.length() - 2); + getSharedPreferences("experiments", MODE_PRIVATE).edit().putString("experiments", sb.toString()).apply(); + + } + //updating day } - }).start(); -*/ + + //scoatem variabila days si verificam: daca se imparte la 5, si nu e locked, + }).start(); + + //context.getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putBoolean("completed", false).apply(); + //context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); + + //scoatem variabila days si verificam: daca se imparte la 5, si nu e locked, ImageView imageView = findViewById(R.id.imageView2); imageView.setImageResource(R.drawable.sleep); @@ -139,15 +170,11 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi String name = getSharedPreferences("name", MODE_PRIVATE).getString("username", "nothing"); navUsername.setText(name); -// Adding the right bitmoji - ImageView imageView2 = (ImageView) headerView.findViewById(R.id.imageView); - imageView2.setImageResource(R.drawable.stickman); //NOTIFICATION DEMO this.createNotificationChannel(); this.setNotifications(); this.setFirstSpecialNotification(); - this.setSecondSpecialNotification(); ///END NOTIFICATIONs Button button1 = (Button) findViewById(R.id.whatSleep); @@ -162,18 +189,6 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi }); - Button button2 = (Button) findViewById(R.id.WhatChabot); - - button2.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToWhatIsChatbot(); - - } - - }); - Button button3 = (Button) findViewById(R.id.WhatExperiments); button3.setOnClickListener(new View.OnClickListener() { @@ -195,13 +210,6 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi } - private void goToWhatIsChatbot() { - Intent intent = new Intent(this, WhatChatbot.class); - - startActivity(intent); - - } - private void goToWhatExperiments() { Intent intent = new Intent(this, WhatExperiments.class); @@ -285,8 +293,6 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi } else if (id == R.id.nav_calendar) { fragmentTransaction.replace(R.id.content_frame, new CalendarPage()); - } else if (id == R.id.nav_bot) { - fragmentTransaction.replace(R.id.content_frame, new Help()); } fragmentTransaction.addToBackStack(null); @@ -335,25 +341,7 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi am.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent); } - private void setSpecialAlarmManager(int hour, int minute, final String title, final String message) { - - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.HOUR_OF_DAY, hour); - calendar.set(Calendar.MINUTE, minute); - calendar.set(Calendar.SECOND, 0); - - if (Calendar.getInstance().after(calendar)) { - calendar.add(Calendar.DAY_OF_MONTH, 1); - } - - Intent intent1 = new Intent(MainMenu.this, Broadcast4.class); - PendingIntent pendingIntent = PendingIntent.getBroadcast(MainMenu.this, 0, intent1, 0); - AlarmManager am = (AlarmManager) MainMenu.this.getSystemService(MainMenu.this.ALARM_SERVICE); - am.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent); - - } private void setFirstSpecialNotification() { - System.out.println("SPECIALK"); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 19); calendar.set(Calendar.MINUTE, 0); @@ -369,25 +357,6 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi } - private void setSecondSpecialNotification() { - System.out.println("SPECIALK"); - Calendar calendar = Calendar.getInstance(); - - calendar.set(Calendar.HOUR_OF_DAY, 15); - calendar.set(Calendar.MINUTE, 35); - calendar.set(Calendar.SECOND, 0); - - if (Calendar.getInstance().after(calendar)) { - calendar.add(Calendar.DAY_OF_MONTH, 1); - } - Intent intent2 = new Intent(MainMenu.this, Broadcast3.class); - PendingIntent pendingIntent2 = PendingIntent.getBroadcast(MainMenu.this, 0, intent2, 0); - AlarmManager am2 = (AlarmManager) MainMenu.this.getSystemService(MainMenu.this.ALARM_SERVICE); - am2.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent2); - - } - - //produce the required notifications private void setNotifications() { int experiment = getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("KEY_SAVED_RADIO_BUTTON_INDEX", 0); @@ -426,7 +395,6 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi break; } - setSpecialAlarmManager(0, 1, "Oups:", "Checking questionnaire"); } public static class Broadcast1 extends BroadcastReceiver { @@ -546,112 +514,4 @@ public class MainMenu extends AppCompatActivity implements NavigationView.OnNavi } } - public static class Broadcast3 extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - - long when = System.currentTimeMillis(); - NotificationManager notificationManager = (NotificationManager) context - .getSystemService(Context.NOTIFICATION_SERVICE); - - Intent notificationIntent = new Intent(context, Help.class); - notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - - PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, - notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); - - - // Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); - - NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(context, "13") - .setSmallIcon(R.drawable.pill) - .setContentTitle("Do you have any question?") - .setContentText("Pam: Ask me something if you are curious!") - .setAutoCancel(true).setWhen(when) - .setContentIntent(pendingIntent); - notificationManager.notify(21, mNotifyBuilder.build()); -// - } - } - - public static class Broadcast4 extends BroadcastReceiver { - @Override - public void onReceive(final Context context, Intent intent) { - - System.out.println("RECEIVDDDD"); - - //updating day - int numberOfDays = context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("numberDays", 0); - numberOfDays++; - context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("numberDays", numberOfDays).apply(); - new Thread(new Runnable() { - @Override - public void run() { - System.out.println("RECEIVDDDD222"); - Date c = Calendar.getInstance().getTime(); - SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); - final String formattedDate = df.format(c); - - - UserDatabase uDatabase = Room.databaseBuilder(context, UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); - - int totalQuestionnaires = uDatabase.daoAccess().fetchUserQuestionnaires().size(); - - int fiveDays = context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("days", 0); - int numberOfDays = context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("numberDays", 0); - - Boolean wasRightAfterChangeOfExperiment = context.getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getBoolean("afterExperiment", true);; - - System.out.println("here is fiveDays: " + fiveDays); - if (numberOfDays > totalQuestionnaires) { - - //daca nu a facut chestionarul - //1 updatam ce se intampla in questionnaire 4 - if (fiveDays % 5 == 1 && wasRightAfterChangeOfExperiment) { - context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", fiveDays).apply(); - context.getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("afterExperiment", false).apply(); - - } else { - context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", fiveDays + 1).apply(); - } - //2 adaugam -1 in tabel - - UserQuestionnaire user = new UserQuestionnaire(); - String username = context.getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); user.setUsername(username); - user.setDate(formattedDate); - user.setTimesPerNight(-1); - user.setNightTerrors(-1); - user.setFallAsleep(-1); - user.setWakeUp(-1); - user.setFresh(-1); - user.setSad(-1); - user.setSleepy(-1); - user.setTired(-1); - user.setStressed(-1); - user.setApetite(-1); - user.setConcentrate(-1); - user.setCoordinate(-1); - user.setIrritable(-1); - user.setMood(-1); - - //setting mood value to -1 in shared preferences - - uDatabase.daoAccess().insertSingleUserQuestionnaire(user); - - Report rep = new Report(uDatabase, context); - rep.save(username, false, context.getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); - - } - } - - //scoatem variabila days si verificam: daca se imparte la 5, si nu e locked, - }).start(); - - context.getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putBoolean("completed", false).apply(); - - context.getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("locked", true).apply(); -// - } - } - } \ No newline at end of file diff --git a/app/src/main/java/com/example/admin/sleepbetter/Notice.java b/app/src/main/java/com/example/admin/sleepbetter/Notice.java new file mode 100644 index 0000000000000000000000000000000000000000..482a55048a03e9c618d3f31ca251652ffbe61fe4 --- /dev/null +++ b/app/src/main/java/com/example/admin/sleepbetter/Notice.java @@ -0,0 +1,31 @@ +package com.example.admin.sleepbetter; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.Button; + +public class Notice extends AppCompatActivity { + + protected void onCreate(Bundle savedInstanceState) { + + + super.onCreate(savedInstanceState); + setContentView(R.layout.act_Notice); + + + Button button = (Button) findViewById(R.id.submitButton); + button.setOnClickListener(new View.OnClickListener() { + + public void onClick(View v) { + + Intent intent = new Intent(getApplicationContext(), QInitial.class); + + startActivity(intent); + } + + }); + + } +} diff --git a/app/src/main/java/com/example/admin/sleepbetter/QFinal.java b/app/src/main/java/com/example/admin/sleepbetter/QFinal.java new file mode 100644 index 0000000000000000000000000000000000000000..e6e4f89239afaf8aef4b6ecea70c1833fa4247fe --- /dev/null +++ b/app/src/main/java/com/example/admin/sleepbetter/QFinal.java @@ -0,0 +1,256 @@ +package com.example.admin.sleepbetter; + +import android.app.Fragment; +import android.arch.persistence.room.Room; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.support.annotation.Nullable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.RadioGroup; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import static android.content.Context.MODE_PRIVATE; + +public class QFinal extends Fragment { + + private static final String DATABASE_NAME = "user_db"; + private UserDatabase userDatabase; + + View questionnaireView; + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { + questionnaireView = inflater.inflate(R.layout.act_QuesIFinal, container, false); + + + Button button = (Button) questionnaireView.findViewById(R.id.submitButton); + + button.setOnClickListener(new View.OnClickListener() { + + public void onClick(View v) { + + loopForSending(); + + } + + }); + + return questionnaireView; + } + + private void loopForSending(){ + // System.out.println("IS NETWORK : " + isConnected()); + if (isConnected()){ + goToMenu(); + } else { + QInitial.InternetDialog dial = new QInitial.InternetDialog(); + dial.show(getFragmentManager(), "dialog"); + } + } + + + public void goToMenu(){ + + double mood =0; + + RadioGroup qGroup = questionnaireView.findViewById(R.id.q1Group); + int qID = qGroup.getCheckedRadioButtonId(); + View radioButton = qGroup.findViewById(qID); + final int howLong = qGroup.indexOfChild(radioButton) +1; + mood += howLong; + + //RadioButton r = (RadioButton) q1Group.getChildAt(idx); + // final String howLong = r.getText().toString(); + + qGroup = questionnaireView.findViewById(R.id.q2Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int awake = qGroup.indexOfChild(radioButton) +1; + mood += awake; + + qGroup = questionnaireView.findViewById(R.id.q3Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int earlier = qGroup.indexOfChild(radioButton) +1; + mood += earlier; + + qGroup = questionnaireView.findViewById(R.id.q4Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int nightsAWeek = qGroup.indexOfChild(radioButton) +1; + mood += nightsAWeek; + + qGroup = questionnaireView.findViewById(R.id.q5Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int quality = qGroup.indexOfChild(radioButton) +1; + mood += quality; + + qGroup = questionnaireView.findViewById(R.id.q6Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int impactMood = qGroup.indexOfChild(radioButton) +1; + mood += impactMood; + + qGroup = questionnaireView.findViewById(R.id.q7Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int impactActivities = qGroup.indexOfChild(radioButton) +1; + mood += impactActivities; + + qGroup = questionnaireView.findViewById(R.id.q8Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int impactGeneral = qGroup.indexOfChild(radioButton) +1; + mood += impactGeneral; + + qGroup = questionnaireView.findViewById(R.id.q9Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int problem = qGroup.indexOfChild(radioButton) +1; + mood += problem; + + mood = mood/9; + + Intent intent = new Intent(getActivity().getApplicationContext(), MainMenu.class); + + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("apetite", 0); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("apetite", 1).apply(); + + + Date c = Calendar.getInstance().getTime(); + SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); + final String quesDate = df.format(c); + + getActivity().getApplicationContext().getSharedPreferences("date", MODE_PRIVATE).getString("currentDate", ""); + getActivity().getApplicationContext().getSharedPreferences("date", MODE_PRIVATE).edit().putString("currentDate", quesDate).apply(); + + + startActivity(intent); + + final double finalMood = mood; + + new Thread(new Runnable() { + @Override + public void run() { + + userDatabase = Room.databaseBuilder(getActivity().getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); + + UserQuestionnaire user = new UserQuestionnaire(); + String username = getActivity().getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); + user.setUsername(username); + user.setDate(quesDate); + user.setHowLong(howLong); + user.setAwake(awake); + user.setEarlier(earlier); + user.setNightsAWeek(nightsAWeek); + user.setQuality(quality); + user.setImpactMood(impactMood); + user.setImpactActivities(impactActivities); + user.setImpactGeneral(impactGeneral); + user.setProblem(problem); + user.setMood(finalMood); + + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("howLong", howLong).apply(); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("awake", awake).apply(); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("earlier", earlier).apply(); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("quality", quality).apply(); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactMood", impactMood).apply(); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactActivities", impactActivities).apply(); + getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactGeneral", impactGeneral).apply(); + getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).edit().putFloat("mood", (float) finalMood).apply(); + + userDatabase.daoAccess().insertSingleUserQuestionnaire(user); + + Report rep = new Report(userDatabase, getActivity().getApplicationContext()); + rep.save(username, false, getActivity().getApplicationContext().getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); + } + }).start(); + + String experiment = getActivity().getApplicationContext().getSharedPreferences("name", Context.MODE_PRIVATE).getString("experiment", " "); + + SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); + final String formattedDate2 = df2.format(c); + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); + String json = sharedPrefs.getString("trial", ""); + Gson gson = new Gson(); + + Type type = new TypeToken<List<HomeCollection>>() {}.getType(); + List<HomeCollection> arrayList = gson.fromJson(json, type); + + HomeCollection.date_collection_arr = (ArrayList<HomeCollection>) arrayList; + HomeCollection coll = HomeCollection.date_collection_arr.get(HomeCollection.date_collection_arr.size()-1); + String date = coll.date; + + if (date.equals(formattedDate2)){ + String commentt = coll.comment; + commentt = commentt + " / " + ""; + + HomeCollection.date_collection_arr.remove(HomeCollection.date_collection_arr.size()-1); + + String proof = getActivity().getApplicationContext().getSharedPreferences("proof", MODE_PRIVATE).getString("proof", "No proof logged in yet."); + + HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, experiment, String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), proof, commentt)); + + SharedPreferences.Editor editor = sharedPrefs.edit(); + + json = gson.toJson(HomeCollection.date_collection_arr); + + editor.putString("trial", json); + editor.commit(); + } else { + String proof = getActivity().getApplicationContext().getSharedPreferences("proof", MODE_PRIVATE).getString("proof", "No proof logged in yet."); + + HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, experiment, String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), proof, "")); + + SharedPreferences.Editor editor = sharedPrefs.edit(); + + json = gson.toJson(HomeCollection.date_collection_arr); + + editor.putString("trial", json); + editor.commit(); + } + + int days = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("days", 0); + Boolean wasRightAfterChangeOfExperiment = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getBoolean("afterExperiment", true);; + + if (days % 5 == 1 && wasRightAfterChangeOfExperiment){ + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", days).apply(); + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("afterExperiment", false).apply(); + + } else { + getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", days + 1).apply(); + } + + + } + + public boolean isConnected() { + ConnectivityManager + cm = (ConnectivityManager) getActivity().getApplicationContext() + .getSystemService(Context.CONNECTIVITY_SERVICE); + NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); + return activeNetwork != null + && activeNetwork.isConnectedOrConnecting(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/admin/sleepbetter/QInitial.java b/app/src/main/java/com/example/admin/sleepbetter/QInitial.java new file mode 100644 index 0000000000000000000000000000000000000000..c02199d32b4e49a964e3e0874f467f6bca7864ee --- /dev/null +++ b/app/src/main/java/com/example/admin/sleepbetter/QInitial.java @@ -0,0 +1,255 @@ +package com.example.admin.sleepbetter; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.arch.persistence.room.Room; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.RadioButton; +import android.widget.RadioGroup; +import android.widget.Toast; + +import com.google.gson.Gson; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +public class QInitial extends AppCompatActivity { + + + private static final String DATABASE_NAME = "user_db"; + private UserDatabase userDatabase; + + @Override + protected void onCreate(Bundle savedInstanceState) { + + + super.onCreate(savedInstanceState); + + setContentView(R.layout.act_QuesInitial); + + Button button = (Button) findViewById(R.id.submitButton); + + button.setOnClickListener(new View.OnClickListener() { + + public void onClick(View v) { + + loopForSending(); + + + + } + + }); + + } + + private void loopForSending(){ + // System.out.println("IS NETWORK : " + isConnected()); + if (isConnected()){ + goToMenu(); + } else { + InternetDialog dial = new InternetDialog(); + dial.show(getFragmentManager(), "dialog"); + } + } + + public boolean isConnected() { + ConnectivityManager + cm = (ConnectivityManager) getApplicationContext() + .getSystemService(Context.CONNECTIVITY_SERVICE); + NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); + return activeNetwork != null + && activeNetwork.isConnectedOrConnecting(); + } + + public static class InternetDialog extends DialogFragment { + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + // Use the Builder class for convenient dialog construction + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + + builder.setMessage("You need to have internet connection to proceed."); + builder.setPositiveButton("Close", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + // FIRE ZE MISSILES! + dialog.dismiss(); + + + } + }); + // Create the AlertDialog object and return it + return builder.create(); + } + } + + private void goToMenu() { + + double mood =0; + + RadioGroup qGroup = this.findViewById(R.id.q1Group); + int qID = qGroup.getCheckedRadioButtonId(); + View radioButton = qGroup.findViewById(qID); + final int howLong = qGroup.indexOfChild(radioButton) +1; + mood += howLong; + + //RadioButton r = (RadioButton) q1Group.getChildAt(idx); + // final String howLong = r.getText().toString(); + + qGroup = this.findViewById(R.id.q2Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int awake = qGroup.indexOfChild(radioButton) +1; + mood += awake; + + qGroup = this.findViewById(R.id.q3Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int earlier = qGroup.indexOfChild(radioButton) +1; + mood += earlier; + + qGroup = this.findViewById(R.id.q4Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int nightsAWeek = qGroup.indexOfChild(radioButton) +1; + mood += nightsAWeek; + + qGroup = this.findViewById(R.id.q5Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int quality = qGroup.indexOfChild(radioButton) +1; + mood += quality; + + qGroup = this.findViewById(R.id.q6Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int impactMood = qGroup.indexOfChild(radioButton) +1; + mood += impactMood; + + qGroup = this.findViewById(R.id.q7Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int impactActivities = qGroup.indexOfChild(radioButton) +1; + mood += impactActivities; + + qGroup = this.findViewById(R.id.q8Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int impactGeneral = qGroup.indexOfChild(radioButton) +1; + mood += impactGeneral; + + qGroup = this.findViewById(R.id.q9Group); + qID = qGroup.getCheckedRadioButtonId(); + radioButton = qGroup.findViewById(qID); + final int problem = qGroup.indexOfChild(radioButton) +1; + mood += problem; + + mood = mood/9; + Intent intent = new Intent(this, MainMenu.class); + + // getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("apetite", 0); + // getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("apetite", 1).apply(); + + + Date c = Calendar.getInstance().getTime(); + SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); + final String currentDate = df.format(c); + + getSharedPreferences("date", MODE_PRIVATE).getString("startingDate", ""); + getSharedPreferences("date", MODE_PRIVATE).edit().putString("startingDate", currentDate).apply(); + + + startActivity(intent); + + final double finalMood = mood; + new Thread(new Runnable() { + @Override + public void run() { + + userDatabase = Room.databaseBuilder(getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); + userDatabase.daoAccess().deleteUserExperimentTable(); + userDatabase.daoAccess().deleteUserQuesionnaireTable(); + userDatabase.daoAccess().deleteUserDiaryTable(); + + UserQuestionnaire user = new UserQuestionnaire(); + String username = getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); + user.setUsername(username); + user.setDate(currentDate); + user.setHowLong(howLong); + user.setAwake(awake); + user.setEarlier(earlier); + user.setNightsAWeek(nightsAWeek); + user.setQuality(quality); + user.setImpactMood(impactMood); + user.setImpactActivities(impactActivities); + user.setImpactGeneral(impactGeneral); + user.setProblem(problem); + user.setMood(finalMood); + + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("howLong", howLong).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("awake", awake).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("earlier", earlier).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("quality", quality).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactMood", impactMood).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactActivities", impactActivities).apply(); + getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("impactGeneral", impactGeneral).apply(); + getSharedPreferences("MOOD", MODE_PRIVATE).edit().putFloat("mood", (float) finalMood).apply(); + userDatabase.daoAccess().insertSingleUserQuestionnaire(user); + + + Report rep = new Report(userDatabase, getApplicationContext()); + rep.save(username, true, getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); + + // ArrayList<String> diary_comments = new ArrayList<String>(); + // diary_comments.add(""); + String diary_comments = "$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^"; + getSharedPreferences("diary", MODE_PRIVATE).edit().putString("diary", diary_comments).apply(); + String experiments = "No experiment for the initial day."; + getSharedPreferences("experiments", MODE_PRIVATE).edit().putString("experiments", experiments).apply(); + } + }).start(); + + + String experiment = getSharedPreferences("name", Context.MODE_PRIVATE).getString("experiment", " "); + + SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); + final String formattedDate2 = df2.format(c); + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + SharedPreferences.Editor editor = sharedPrefs.edit(); + Gson gson = new Gson(); + + HomeCollection.date_collection_arr = new ArrayList<HomeCollection>(); + HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, "No experiment started yet", String.valueOf(getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), "")); + String json = gson.toJson(HomeCollection.date_collection_arr); + + editor.putString("trial", json); + editor.commit(); + + } + +/* + public void onBackPressed() { + Intent intent = new Intent(this, MainMenu.class); + startActivity(intent); + finish(); + }*/ +} + diff --git a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire.java b/app/src/main/java/com/example/admin/sleepbetter/Questionnaire.java deleted file mode 100644 index daf68e287bc0a8d0d69dd7fbbc3fa6d77d02e979..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.app.Fragment; -import android.app.FragmentManager; -import android.arch.persistence.room.Room; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.TextView; -import android.widget.ImageView; -import android.widget.Toast; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import static android.content.Context.MODE_PRIVATE; - -public class Questionnaire extends Fragment { - - private SeekBarWithIntervals timesPerNightBar = null; - private SeekBarWithIntervals nightTerrorsBar = null; - - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - View questionnaireView; - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - questionnaireView = inflater.inflate(R.layout.questionnaire, container, false); - - ImageView imageView = questionnaireView.findViewById(R.id.imageView6); - imageView.setImageResource(R.drawable.night_emoticon); - Button button = (Button) questionnaireView.findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToThirdActivity(); - - } - - }); - - List<String> seekbarIntervals = getIntervals("upToFour", "times"); - getSeekbarWithIntervals("times").setIntervals(seekbarIntervals); - - List<String> seekbarIntervals2 = getIntervals("upToFour", "terrors"); - getSeekbarWithIntervals("nightTerrors").setIntervals(seekbarIntervals2); - - - - - return questionnaireView; - } - - private List<String> getIntervals(String command, final String question) { - - final int previousTimes = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("timesPerNight", 0); - final int previousTerrors = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("nightTerrors", 0); - - if (command.equals("upToFour")) { - - return new ArrayList<String>() {{ - add("0"); - add("1"); - add("2"); - add("3"); - add("4/4+"); - if(question.equals("times")){ - if (previousTimes == 1){ - add("0"); - } else if (previousTimes == 2){ - add("1"); - } else if (previousTimes == 3){ - add("2"); - } else if (previousTimes == 4){ - add("3"); - } else if (previousTimes == 5){ - add("4/4+"); - } - } else { - if (previousTerrors == 1){ - add("0"); - } else if (previousTerrors == 2){ - add("1"); - } else if (previousTerrors == 3){ - add("2"); - } else if (previousTerrors == 4){ - add("3"); - } else if (previousTerrors == 5){ - add("4/4+"); - } - } - - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("times")) { - if (timesPerNightBar == null) { - timesPerNightBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.timesPerNightBar); - } - - return timesPerNightBar; - } else if (name.equals("nightTerrors")) { - if (nightTerrorsBar == null) { - nightTerrorsBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.nightTerrorsBar); - } - - return nightTerrorsBar; - } - return null; - } - - - public void goToThirdActivity(){ - - - final int timesPerNight = timesPerNightBar.getProgress(); - final int nightTerrors = nightTerrorsBar.getProgress(); - - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("timesPerNight", timesPerNight + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("nightTerrors", nightTerrors + 1).apply(); - - - FragmentManager fragmentManager = getFragmentManager(); - - fragmentManager.beginTransaction().replace(R.id.content_frame, new Questionnaire2()).commit(); - } - - public void onBackPressed() { - // super.onBackPressed(); commented this line in order to disable back press - //Write your code here - Toast.makeText(getActivity().getApplicationContext(), "Cannot go back to the experiment proof. Please finish the short questionnaire!", Toast.LENGTH_SHORT).show(); - } - - -} diff --git a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire2.java b/app/src/main/java/com/example/admin/sleepbetter/Questionnaire2.java deleted file mode 100644 index c768f1d26c9b84f98e84168480674e256da2c644..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire2.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.app.Fragment; -import android.app.FragmentManager; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.ImageView; - -import java.util.ArrayList; -import java.util.List; - -import static android.content.Context.MODE_PRIVATE; - -public class Questionnaire2 extends Fragment { - - private SeekBarWithIntervals fallAsleepBar = null; - private SeekBarWithIntervals wakeUpBar = null; - private SeekBarWithIntervals freshBar = null; - - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - View questionnaireView; - - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - questionnaireView = inflater.inflate(R.layout.questionnaire_two, container, false); - - ImageView imageView = questionnaireView.findViewById(R.id.imageView7); - imageView.setImageResource(R.drawable.day_and_night); - - Button button = (Button) questionnaireView.findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToThirdActivity(); - - } - - }); - - - List<String> listOne = getIntervals("upToFive", "fall"); - - getSeekbarWithIntervals("fallAsleep").setIntervals(listOne); - - List<String> listOne2 = getIntervals("upToFive", "wake"); - - getSeekbarWithIntervals("wakeUp").setIntervals(listOne2); - - List<String> listOne3 = getIntervals("upToFive", "fresh"); - - getSeekbarWithIntervals("fresh").setIntervals(listOne3); - - - return questionnaireView; - } - - private List<String> getIntervals(String command, final String question) { - - final int previousWake = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("wakeUp", 0); - final int previousFall = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("fallAsleep", 0); - final int previousFresh = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("fresh", 0); - - if (command.equals("upToFive")) { - return new ArrayList<String>() {{ - add("1"); - add("2"); - add("3"); - add("4"); - add("5"); - if(question.equals("fall")){ - add(String.valueOf(previousFall)); - } else if(question.equals("wake")){ - add(String.valueOf(previousWake)); - } else if(question.equals("fresh")){ - add(String.valueOf(previousFresh)); - } - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("fallAsleep")) { - if (fallAsleepBar == null) { - fallAsleepBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.fallAsleepBar); - } - - return fallAsleepBar; - } else if (name.equals("wakeUp")) { - if (wakeUpBar == null) { - wakeUpBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.easyWakeUpBar); - } - - return wakeUpBar; - } else if (name.equals("fresh")) { - if (freshBar == null) { - freshBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.freshBar); - } - - return freshBar; - } - return null; - } - - - public void goToThirdActivity() { - - - final int fallAsleep = fallAsleepBar.getProgress(); - final int wakeUp = wakeUpBar.getProgress(); - final int fresh = freshBar.getProgress(); - - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("fallAsleep", fallAsleep + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("wakeUp", wakeUp + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("fresh", fresh + 1).apply(); - - - FragmentManager fragmentManager = getFragmentManager(); - - fragmentManager.beginTransaction().replace(R.id.content_frame, new Questionnaire3()).commit(); - } - - -} diff --git a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire3.java b/app/src/main/java/com/example/admin/sleepbetter/Questionnaire3.java deleted file mode 100644 index f87385f28566af676c031256c7dbabfa27c486f9..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire3.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.app.Fragment; -import android.app.FragmentManager; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.ImageView; - -import java.util.ArrayList; -import java.util.List; - -import static android.content.Context.MODE_PRIVATE; - -public class Questionnaire3 extends Fragment { - - private SeekBarWithIntervals sadBar = null; - private SeekBarWithIntervals sleepyBar = null; - private SeekBarWithIntervals tiredBar = null; - private SeekBarWithIntervals stressedBar = null; - private SeekBarWithIntervals irritableBar = null; - - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - View questionnaireView; - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - questionnaireView = inflater.inflate(R.layout.questionnaire_three, container, false); - - ImageView imageView = questionnaireView.findViewById(R.id.imageView8); - imageView.setImageResource(R.drawable.mood_dice); - - - - Button button = (Button) questionnaireView.findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToThirdActivity(); - - } - - }); - - - List<String> listOne = getIntervals("upToFive", "sad"); - - getSeekbarWithIntervals("sad").setIntervals(listOne); - - List<String> listOne2 = getIntervals("upToFive", "sleepy"); - - getSeekbarWithIntervals("sleepy").setIntervals(listOne2); - - List<String> listOne3 = getIntervals("upToFive", "tired"); - - getSeekbarWithIntervals("tired").setIntervals(listOne3); - - - List<String> listOne4 = getIntervals("upToFive", "stressed"); - - getSeekbarWithIntervals("stressed").setIntervals(listOne4); - - - List<String> listOne5 = getIntervals("upToFive", "irritable"); - - getSeekbarWithIntervals("irritable").setIntervals(listOne5); - - - - - - return questionnaireView; - } - - private List<String> getIntervals(String command, final String question) { - final int prebiousSad = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("sad", 0); - final int previousSleeppy = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("sleepy", 0); - final int previousTired = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("tired", 0); - final int previousStressed = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("stressed", 0); - final int previousIrritable = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("irritable", 0); - - - if (command.equals("upToFive")) { - return new ArrayList<String>() {{ - add("1"); - add("2"); - add("3"); - add("4"); - add("5"); - if(question.equals("sad")){ - add(String.valueOf(prebiousSad)); - } else if(question.equals("sleepy")){ - add(String.valueOf(previousSleeppy)); - } else if(question.equals("tired")){ - add(String.valueOf(previousTired)); - } else if(question.equals("stressed")){ - add(String.valueOf(previousStressed)); - } else if(question.equals("irritable")){ - add(String.valueOf(previousIrritable)); - } - - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("sad")) { - if (sadBar == null) { - sadBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.sadBar); - } - - return sadBar; - } else if (name.equals("sleepy")) { - if (sleepyBar == null) { - sleepyBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.sleepyBar); - } - - return sleepyBar; - } else if (name.equals("tired")) { - if (tiredBar == null) { - tiredBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.tiredBar); - } - - return tiredBar; - } else if (name.equals("stressed")) { - if (stressedBar == null) { - stressedBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.stressedBar); - } - - return stressedBar; - } else if (name.equals("irritable")) { - if (irritableBar == null) { - irritableBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.irritableBar); - } - - return irritableBar; - } - return null; - } - - - public void goToThirdActivity(){ - - - final int sad = sadBar.getProgress(); - final int sleepy = sleepyBar.getProgress(); - final int tired = tiredBar.getProgress(); - final int stressed = stressedBar.getProgress(); - final int irritable = irritableBar.getProgress(); - - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("sad", sad + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("sleepy", sleepy + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("tired", tired + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("stressed", stressed + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("irritable", irritable + 1).apply(); - - - FragmentManager fragmentManager = getFragmentManager(); - - fragmentManager.beginTransaction().replace(R.id.content_frame, new Questionnaire4()).commit(); - } - - -} diff --git a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire4.java b/app/src/main/java/com/example/admin/sleepbetter/Questionnaire4.java deleted file mode 100644 index f73def92e10ffc6a2b400b62538aea14d49cb8b6..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/Questionnaire4.java +++ /dev/null @@ -1,326 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.app.Fragment; -import android.arch.persistence.room.Room; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import static android.content.Context.MODE_PRIVATE; - -public class Questionnaire4 extends Fragment { - - private SeekBarWithIntervals apetiteBar = null; - private SeekBarWithIntervals concentrateBar = null; - private SeekBarWithIntervals coordinateBar = null; - - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - View questionnaireView; - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - questionnaireView = inflater.inflate(R.layout.questionnaire_four, container, false); - - ImageView imageView = questionnaireView.findViewById(R.id.imageView9); - imageView.setImageResource(R.drawable.actions); - - Button button = (Button) questionnaireView.findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - loopForSending(); - - } - - }); - - List<String> listOne = getIntervals("upToFive", "concentrate"); - - getSeekbarWithIntervals("concentrate").setIntervals(listOne); - - List<String> listOne2 = getIntervals("upToFive", "coordinate"); - - getSeekbarWithIntervals("coordinate").setIntervals(listOne2); - - List<String> listOne3 = getIntervals("upToFive", "apetite"); - - getSeekbarWithIntervals("apetite").setIntervals(listOne3); - - return questionnaireView; - } - - private void loopForSending(){ - // System.out.println("IS NETWORK : " + isConnected()); - if (isConnected()){ - goToThirdActivity(); - } else { - SecondPage4.InternetDialog dial = new SecondPage4.InternetDialog(); - dial.show(getFragmentManager(), "dialog"); - } - } - - private List<String> getIntervals(String command, final String question) { - - final int previousConcentrate = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("concentrate", 0); - final int previousCoordinate = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("coordinate", 0); - final int previousAppetite = getActivity().getApplicationContext().getSharedPreferences("questionnaire", Context.MODE_PRIVATE).getInt("apetite", 0); - - - if (command.equals("upToFive")) { - return new ArrayList<String>() {{ - add("1"); - add("2"); - add("3"); - add("4"); - add("5"); - if(question.equals("concentrate")){ - add(String.valueOf(previousConcentrate)); - } else if(question.equals("coordinate")){ - add(String.valueOf(previousCoordinate)); - } else if(question.equals("apetite")){ - add(String.valueOf(previousAppetite)); - } - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("concentrate")) { - if (concentrateBar == null) { - concentrateBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.concentrateBar); - } - - return concentrateBar; - } else if (name.equals("coordinate")) { - if (coordinateBar == null) { - coordinateBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.coordinateBar); - } - - return coordinateBar; - } else if (name.equals("apetite")) { - if (apetiteBar == null) { - apetiteBar = (SeekBarWithIntervals) questionnaireView.findViewById(R.id.apetiteBar); - } - - return apetiteBar; - } - return null; - } - - - public void goToThirdActivity(){ - - System.out.println("test"); - Intent intent = new Intent(getActivity().getApplicationContext(), MainMenu.class); - - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getBoolean("completed", false); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putBoolean("completed", true).apply(); - - final int timesPerNight = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("timesPerNight", 0); - final int nightTerrors = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("nightTerrors", 0); - - final int fallAsleep = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("fallAsleep", 0); - final int wakeUp = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("wakeUp", 0); - final int fresh = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("fresh", 0); - - final int sad = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("sad", 0); - final int sleepy = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("sleepy", 0); - final int tired = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("tired", 0); - final int stressed = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("stressed", 0); - final int irritable = getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("irritable", 0); - - final int apetite = apetiteBar.getProgress(); - final int concentrate = concentrateBar.getProgress(); - final int coordinate = coordinateBar.getProgress(); - - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("apetite", apetite + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("concentrate", concentrate + 1).apply(); - getActivity().getApplicationContext().getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("coordinate", coordinate + 1).apply(); - - Date c = Calendar.getInstance().getTime(); - SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); - final String formattedDate = df.format(c); - - getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).edit().putInt("mood", moodCalculator(timesPerNight, nightTerrors, sad, sleepy, tired, stressed, irritable, concentrate+1, coordinate+1)).apply(); - - int mood = moodCalculator(timesPerNight, nightTerrors, sad, sleepy, tired, stressed, irritable, concentrate + 1, coordinate + 1); - System.out.println("UPPER MOOD is " + mood); - this.doMood(mood); - - - - EditText commentBox = (EditText) questionnaireView.findViewById(R.id.yourName2); - final String comment = commentBox.getText().toString(); - - startActivity(intent); - - new Thread(new Runnable() { - @Override - public void run() { - - System.out.println("entered thread"); - userDatabase = Room.databaseBuilder(getActivity().getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); - - UserQuestionnaire user = new UserQuestionnaire(); - String username = getActivity().getApplicationContext().getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); - user.setUsername(username); - user.setDate(formattedDate); - user.setTimesPerNight(timesPerNight); - user.setNightTerrors(nightTerrors); - user.setFallAsleep(fallAsleep); - user.setWakeUp(wakeUp); - user.setFresh(fresh); - user.setSad(sad); - user.setSleepy(sleepy); - user.setTired(tired); - user.setStressed(stressed); - user.setApetite(apetite+1); - user.setConcentrate(concentrate+1); - user.setCoordinate(coordinate+1); - user.setIrritable(irritable); - user.setMood(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)); - - userDatabase.daoAccess().insertSingleUserQuestionnaire(user); - - System.out.println("mood id " + getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)); - System.out.println(userDatabase.daoAccess().fetchUserQuestionnaires().size() + " questionnaires"); - if (!comment.equals("")) { - - - UserDiary userDiary = new UserDiary(); - userDiary.setUsername(username); - userDiary.setDate(formattedDate); - userDiary.setComment(comment); - - userDatabase.daoAccess().insertSingleUserDiary(userDiary); - } - - - Report rep = new Report(userDatabase, getActivity().getApplicationContext()); - rep.save(username, false, getActivity().getApplicationContext().getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); - } - }).start(); - - String experiment = getActivity().getApplicationContext().getSharedPreferences("name", Context.MODE_PRIVATE).getString("experiment", " "); - - SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); - final String formattedDate2 = df2.format(c); - - System.out.println("passed thread"); - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext()); - String json = sharedPrefs.getString("trial", ""); - Gson gson = new Gson(); - - Type type = new TypeToken<List<HomeCollection>>() {}.getType(); - List<HomeCollection> arrayList = gson.fromJson(json, type); - - HomeCollection.date_collection_arr = (ArrayList<HomeCollection>) arrayList; - HomeCollection coll = HomeCollection.date_collection_arr.get(HomeCollection.date_collection_arr.size()-1); - String date = coll.date; - - if (date.equals(formattedDate2)){ - String commentt = coll.comment; - commentt = commentt + " / " + comment; - - HomeCollection.date_collection_arr.remove(HomeCollection.date_collection_arr.size()-1); - - String proof = getActivity().getApplicationContext().getSharedPreferences("proof", MODE_PRIVATE).getString("proof", "No proof logged in yet."); - - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, experiment, String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), proof, commentt)); - - SharedPreferences.Editor editor = sharedPrefs.edit(); - - json = gson.toJson(HomeCollection.date_collection_arr); - - editor.putString("trial", json); - editor.commit(); - } else { - String proof = getActivity().getApplicationContext().getSharedPreferences("proof", MODE_PRIVATE).getString("proof", "No proof logged in yet."); - - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, experiment, String.valueOf(getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), proof, comment)); - - SharedPreferences.Editor editor = sharedPrefs.edit(); - - json = gson.toJson(HomeCollection.date_collection_arr); - - editor.putString("trial", json); - editor.commit(); - } - - int days = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("days", 0); - Boolean wasRightAfterChangeOfExperiment = getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getBoolean("afterExperiment", true);; - - if (days % 5 == 1 && wasRightAfterChangeOfExperiment){ - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", days).apply(); - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putBoolean("afterExperiment", false).apply(); - - } else { - getActivity().getApplicationContext().getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("days", days + 1).apply(); - } - - - } - - public boolean isConnected() { - ConnectivityManager - cm = (ConnectivityManager) getActivity().getApplicationContext() - .getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); - return activeNetwork != null - && activeNetwork.isConnectedOrConnecting(); - } - - private int moodCalculator(int timesNight, int nightmares, int sad, int sleepy, int tired, int stressed, int irritable, int concentrate, int coordinate) { - System.out.println( timesNight + " " + nightmares + " " + sad + " " + sleepy + " " + tired + " " + stressed + " " + irritable + " " + concentrate + " " + coordinate); - int avgMood = (sad + sleepy + tired + stressed + irritable) / 5; - int avgNight = (timesNight + nightmares) / 2; - int avgAction = (concentrate + coordinate) / 2; - int result = (avgMood * 3 + avgNight + avgAction) / 5; - return result; - } - - private void doMood(int mood) { - System.out.println("MOOD is " + mood); - int happy = getActivity().getApplicationContext().getSharedPreferences("bmhappy", MODE_PRIVATE).getInt("slectedbitmoji", 0); - int ok = getActivity().getApplicationContext().getSharedPreferences("bmok", MODE_PRIVATE).getInt("slectedbitmoji", 0); - int notok = getActivity().getApplicationContext().getSharedPreferences("bmnotok", MODE_PRIVATE).getInt("slectedbitmoji", 0); - int bad = getActivity().getApplicationContext().getSharedPreferences("bmbad", MODE_PRIVATE).getInt("slectedbitmoji", 0); - - SharedPreferences preferences = getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE); - if (mood == 1 || mood == 0) preferences.edit().putInt("moodbitmoji", happy).apply(); - if (mood == 2) preferences.edit().putInt("moodbitmoji", ok).apply(); - if (mood == 3) preferences.edit().putInt("moodbitmoji", notok).apply(); - if (mood == 4 || mood == 5) preferences.edit().putInt("moodbitmoji", bad).apply(); - - getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0); - getActivity().getApplicationContext().getSharedPreferences("MOOD", MODE_PRIVATE).edit().putInt("mood", mood).apply(); - - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/admin/sleepbetter/SecondPage.java b/app/src/main/java/com/example/admin/sleepbetter/SecondPage.java deleted file mode 100644 index 4930a67c63aa46b8d319d3b8eea258c609f2d425..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/SecondPage.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.arch.persistence.room.Room; -import android.content.Intent; -import android.content.SharedPreferences; -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; -import android.view.View; -import android.widget.Button; -import android.widget.ImageView; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -public class SecondPage extends AppCompatActivity { - - private SeekBarWithIntervals timesPerNightBar = null; - private SeekBarWithIntervals nightTerrorsBar = null; - - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - @Override - protected void onCreate(Bundle savedInstanceState) { - - - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_second_page); - - - getSharedPreferences("PREFERENCE", MODE_PRIVATE).edit() - .putBoolean("isFirstRun", false).apply(); - - - ImageView imageView = findViewById(R.id.imageView6); - imageView.setImageResource(R.drawable.night_emoticon); - - Button button = (Button) findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToThirdActivity(); - - } - - }); - - List<String> seekbarIntervals = getIntervals("upToFour"); - getSeekbarWithIntervals("times").setIntervals(seekbarIntervals); - - getSeekbarWithIntervals("nightTerrors").setIntervals(seekbarIntervals); - - - } - - private void goToThirdActivity() { - - - Intent intent = new Intent(this, SecondPage2.class); - - final int timesPerNight = timesPerNightBar.getProgress(); - final int nightTerrors = nightTerrorsBar.getProgress(); - - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("timesPerNight", timesPerNight + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("timesPerNight", timesPerNight + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("nightTerrors", nightTerrors + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("nightTerrors", nightTerrors + 1).apply(); - - - getSharedPreferences("name", MODE_PRIVATE).getString("experiment", " "); - getSharedPreferences("name", MODE_PRIVATE).edit().putString("experiment", "Increase bright light exposure during the day").apply(); - getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).getInt("KEY_SAVED_RADIO_BUTTON_INDEX", 0); - getSharedPreferences("MY_SHARED_PREF", MODE_PRIVATE).edit().putInt("KEY_SAVED_RADIO_BUTTON_INDEX", 1).apply(); - startActivity(intent); - - - } - - private List<String> getIntervals(String command) { - - if (command.equals("upToFour")) { - return new ArrayList<String>() {{ - add("0"); - add("1"); - add("2"); - add("3"); - add("4/4+"); - add("-1"); - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("times")) { - if (timesPerNightBar == null) { - timesPerNightBar = (SeekBarWithIntervals) findViewById(R.id.timesPerNightBar); - } - - return timesPerNightBar; - } else if (name.equals("nightTerrors")) { - if (nightTerrorsBar == null) { - nightTerrorsBar = (SeekBarWithIntervals) findViewById(R.id.nightTerrorsBar); - } - - return nightTerrorsBar; - } - return null; - } -/* - public void onBackPressed() { - Intent intent = new Intent(this, MainMenu.class); - startActivity(intent); - finish(); - }*/ -} - diff --git a/app/src/main/java/com/example/admin/sleepbetter/SecondPage2.java b/app/src/main/java/com/example/admin/sleepbetter/SecondPage2.java deleted file mode 100644 index 1f9db640042e1fe53d21e69827d875ca0b7e6cc4..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/SecondPage2.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.arch.persistence.room.Room; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.Button; -import android.widget.ImageView; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -public class SecondPage2 extends AppCompatActivity { - - private SeekBarWithIntervals fallAsleepBar = null; - private SeekBarWithIntervals wakeUpBar = null; - private SeekBarWithIntervals freshBar = null; - - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - @Override - protected void onCreate(Bundle savedInstanceState) { - - - - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_second_page_two); - - ImageView imageView = findViewById(R.id.imageView7); - imageView.setImageResource(R.drawable.day_and_night); - - Button button = (Button) findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToThirdActivity(); - - } - - }); - - - List<String> listOne = getIntervals("upToFive"); - - getSeekbarWithIntervals("fallAsleep").setIntervals(listOne); - - getSeekbarWithIntervals("wakeUp").setIntervals(listOne); - - getSeekbarWithIntervals("fresh").setIntervals(listOne); - - - - - - } - - private void goToThirdActivity() { - - - Intent intent = new Intent(this, SecondPage3.class); - - - final int fallAsleep = fallAsleepBar.getProgress(); - final int wakeUp = wakeUpBar.getProgress(); - final int fresh = freshBar.getProgress(); - - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("fallAsleep", fallAsleep + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("fallAsleep", fallAsleep + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("wakeUp", wakeUp + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("wakeUp", wakeUp + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("fresh", fresh + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("fresh", fresh + 1).apply(); - - - startActivity(intent); - - - - - } - - - private List<String> getIntervals(String command) { - - if (command.equals("upToFive")) { - return new ArrayList<String>() {{ - add("1"); - add("2"); - add("3"); - add("4"); - add("5"); - add("-1"); - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("fallAsleep")) { - if (fallAsleepBar == null) { - fallAsleepBar = (SeekBarWithIntervals) findViewById(R.id.fallAsleepBar); - } - - return fallAsleepBar; - } else if (name.equals("wakeUp")) { - if (wakeUpBar == null) { - wakeUpBar = (SeekBarWithIntervals) findViewById(R.id.easyWakeUpBar); - } - - return wakeUpBar; - } else if (name.equals("fresh")) { - if (freshBar == null) { - freshBar = (SeekBarWithIntervals) findViewById(R.id.freshBar); - } - - return freshBar; - } - return null; - } -/* - public void onBackPressed() { - Intent intent = new Intent(this, MainMenu.class); - startActivity(intent); - finish(); - }*/ -} - diff --git a/app/src/main/java/com/example/admin/sleepbetter/SecondPage3.java b/app/src/main/java/com/example/admin/sleepbetter/SecondPage3.java deleted file mode 100644 index 5560960c46ca8a95d45d1591c7b5ef8c97f62f27..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/SecondPage3.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.arch.persistence.room.Room; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.Button; -import android.widget.ImageView; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -public class SecondPage3 extends AppCompatActivity { - - - private SeekBarWithIntervals sadBar = null; - private SeekBarWithIntervals sleepyBar = null; - private SeekBarWithIntervals tiredBar = null; - private SeekBarWithIntervals stressedBar = null; - private SeekBarWithIntervals irritableBar = null; - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - @Override - protected void onCreate(Bundle savedInstanceState) { - - - - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_second_page_three); - - ImageView imageView = findViewById(R.id.imageView8); - imageView.setImageResource(R.drawable.mood_dice); - - Button button = (Button) findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - goToThirdActivity(); - - } - - }); - - - List<String> listOne = getIntervals("upToFive"); - - getSeekbarWithIntervals("sad").setIntervals(listOne); - - getSeekbarWithIntervals("sleepy").setIntervals(listOne); - - getSeekbarWithIntervals("tired").setIntervals(listOne); - - getSeekbarWithIntervals("stressed").setIntervals(listOne); - - getSeekbarWithIntervals("irritable").setIntervals(listOne); - - - - - - } - - private void goToThirdActivity() { - - - Intent intent = new Intent(this, SecondPage4.class); - - final int sad = sadBar.getProgress(); - final int sleepy = sleepyBar.getProgress(); - final int tired = tiredBar.getProgress(); - final int stressed = stressedBar.getProgress(); - final int irritable = irritableBar.getProgress(); - - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("sad", sad + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("sad", sad + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("sleepy", sleepy + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("sleepy", sleepy + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("tired", tired + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("tired", tired + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("stressed", stressed + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("stressed", stressed + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("irritable", irritable + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("irritable", irritable + 1).apply(); - - startActivity(intent); - } - - - - private List<String> getIntervals(String command) { - - if (command.equals("upToFour")) { - return new ArrayList<String>() {{ - add("0"); - add("1"); - add("2"); - add("3"); - add("4/4+"); - add("-1"); - }}; - } else if (command.equals("upToFive")) { - return new ArrayList<String>() {{ - add("1"); - add("2"); - add("3"); - add("4"); - add("5"); - add("-1"); - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("sad")) { - if (sadBar == null) { - sadBar = (SeekBarWithIntervals) findViewById(R.id.sadBar); - } - - return sadBar; - } else if (name.equals("sleepy")) { - if (sleepyBar == null) { - sleepyBar = (SeekBarWithIntervals) findViewById(R.id.sleepyBar); - } - - return sleepyBar; - } else if (name.equals("tired")) { - if (tiredBar == null) { - tiredBar = (SeekBarWithIntervals) findViewById(R.id.tiredBar); - } - - return tiredBar; - } else if (name.equals("stressed")) { - if (stressedBar == null) { - stressedBar = (SeekBarWithIntervals) findViewById(R.id.stressedBar); - } - - return stressedBar; - } else if (name.equals("irritable")) { - if (irritableBar == null) { - irritableBar = (SeekBarWithIntervals) findViewById(R.id.irritableBar); - } - - return irritableBar; - } - return null; - } -/* - public void onBackPressed() { - Intent intent = new Intent(this, MainMenu.class); - startActivity(intent); - finish(); - }*/ -} - diff --git a/app/src/main/java/com/example/admin/sleepbetter/SecondPage4.java b/app/src/main/java/com/example/admin/sleepbetter/SecondPage4.java deleted file mode 100644 index 0603218934dbabb1327ed71c4e835a756946b0d1..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/SecondPage4.java +++ /dev/null @@ -1,306 +0,0 @@ -package com.example.admin.sleepbetter; - -import android.app.AlertDialog; -import android.app.Dialog; -import android.app.DialogFragment; -import android.arch.persistence.room.Room; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.SharedPreferences; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.Toast; - -import com.google.gson.Gson; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -public class SecondPage4 extends AppCompatActivity { - - - private SeekBarWithIntervals apetiteBar = null; - private SeekBarWithIntervals concentrateBar = null; - private SeekBarWithIntervals coordinateBar = null; - private static final String DATABASE_NAME = "user_db"; - private UserDatabase userDatabase; - - @Override - protected void onCreate(Bundle savedInstanceState) { - - - super.onCreate(savedInstanceState); - - setContentView(R.layout.activity_second_page_four); - - ImageView imageView = findViewById(R.id.imageView9); - imageView.setImageResource(R.drawable.actions); - - Button button = (Button) findViewById(R.id.submitButton); - - button.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - - loopForSending(); - - - - } - - }); - - List<String> listOne = getIntervals("upToFive"); - - getSeekbarWithIntervals("concentrate").setIntervals(listOne); - - getSeekbarWithIntervals("coordinate").setIntervals(listOne); - - getSeekbarWithIntervals("apetite").setIntervals(listOne); - - - } - - private void loopForSending(){ - // System.out.println("IS NETWORK : " + isConnected()); - if (isConnected()){ - goToThirdActivity(); - } else { - InternetDialog dial = new InternetDialog(); - dial.show(getFragmentManager(), "dialog"); - } - } - - public boolean isConnected() { - ConnectivityManager - cm = (ConnectivityManager) getApplicationContext() - .getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); - return activeNetwork != null - && activeNetwork.isConnectedOrConnecting(); - } - - public static class InternetDialog extends DialogFragment { - - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - // Use the Builder class for convenient dialog construction - AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - - builder.setMessage("You need to have internet connection to proceed."); - builder.setPositiveButton("Close", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - // FIRE ZE MISSILES! - dialog.dismiss(); - - - } - }); - // Create the AlertDialog object and return it - return builder.create(); - } - } - - private void goToThirdActivity() { - - - Intent intent = new Intent(this, MainMenu.class); - - final int timesPerNight = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("timesPerNight", 0); - final int nightTerrors = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("nightTerrors", 0); - - final int fallAsleep = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("fallAsleep", 0); - final int wakeUp = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("wakeUp", 0); - final int fresh = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("fresh", 0); - - final int sad = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("sad", 0); - final int sleepy = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("sleepy", 0); - final int tired = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("tired", 0); - final int stressed = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("stressed", 0); - final int irritable = getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("irritable", 0); - - final int apetite = apetiteBar.getProgress(); - final int concentrate = concentrateBar.getProgress(); - final int coordinate = coordinateBar.getProgress(); - - - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("apetite", apetite + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("apetite", apetite + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("concentrate", concentrate + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("concentrate", concentrate + 1).apply(); - getSharedPreferences("questionnaire", MODE_PRIVATE).getInt("coordinate", coordinate + 1); - getSharedPreferences("questionnaire", MODE_PRIVATE).edit().putInt("coordinate", coordinate + 1).apply(); - - Date c = Calendar.getInstance().getTime(); - SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); - final String formattedDate = df.format(c); - - //CALCULATE THE MOOOD - int mood = moodCalculator(timesPerNight, nightTerrors, sad, sleepy, tired, stressed, irritable, concentrate + 1, coordinate + 1); - System.out.println("UPPER MOOD is " + mood); - this.doMood(mood); - - - startActivity(intent); - - EditText commentBox = (EditText) findViewById(R.id.yourName2); - final String comment = commentBox.getText().toString(); - - new Thread(new Runnable() { - @Override - public void run() { - - userDatabase = Room.databaseBuilder(getApplicationContext(), UserDatabase.class, DATABASE_NAME).fallbackToDestructiveMigration().build(); - userDatabase.daoAccess().deleteUserExperimentTable(); - userDatabase.daoAccess().deleteUserQuesionnaireTable(); - userDatabase.daoAccess().deleteUserDiaryTable(); - - UserQuestionnaire user = new UserQuestionnaire(); - String username = getSharedPreferences("name", MODE_PRIVATE).getString("participantID", "nothing"); - user.setUsername(username); - user.setDate(formattedDate); - user.setTimesPerNight(timesPerNight); - user.setNightTerrors(nightTerrors); - user.setFallAsleep(fallAsleep); - user.setWakeUp(wakeUp); - user.setFresh(fresh); - user.setSad(sad); - user.setSleepy(sleepy); - user.setTired(tired); - user.setStressed(stressed); - user.setApetite(apetite + 1); - user.setConcentrate(concentrate + 1); - user.setCoordinate(coordinate + 1); - user.setIrritable(irritable); - user.setMood(getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)); - - userDatabase.daoAccess().insertSingleUserQuestionnaire(user); - - - if (!comment.equals("")) { - - - UserDiary userDiary = new UserDiary(); - userDiary.setUsername(username); - userDiary.setDate(formattedDate); - userDiary.setComment(comment); - - userDatabase.daoAccess().insertSingleUserDiary(userDiary); - } - Report rep = new Report(userDatabase, getApplicationContext()); - rep.save(username, true, getSharedPreferences("consent", MODE_PRIVATE).getString("consent", "nothing")); - } - }).start(); - - - String experiment = getSharedPreferences("name", Context.MODE_PRIVATE).getString("experiment", " "); - - SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); - final String formattedDate2 = df2.format(c); - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - SharedPreferences.Editor editor = sharedPrefs.edit(); - Gson gson = new Gson(); - - HomeCollection.date_collection_arr = new ArrayList<HomeCollection>(); - HomeCollection.date_collection_arr.add(new HomeCollection(formattedDate2, "No experiment started yet", String.valueOf(getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0)), "No experiment started yet", comment)); - String json = gson.toJson(HomeCollection.date_collection_arr); - - editor.putString("trial", json); - editor.commit(); - - } - - private int moodCalculator(int timesNight, int nightmares, int sad, int sleepy, int tired, int stressed, int irritable, int concentrate, int coordinate) { - int avgMood = (sad + sleepy + tired + stressed + irritable) / 5; - int avgNight = (timesNight + nightmares) / 2; - int avgAction = (concentrate + coordinate) / 2; - int result = (avgMood * 3 + avgNight + avgAction) / 5; - return result; - } - - private List<String> getIntervals(String command) { - - if (command.equals("upToFour")) { - return new ArrayList<String>() {{ - add("0"); - add("1"); - add("2"); - add("3"); - add("4/4+"); - add("-1"); - }}; - } else if (command.equals("upToFive")) { - return new ArrayList<String>() {{ - add("1"); - add("2"); - add("3"); - add("4"); - add("5"); - add("-1"); - }}; - } - return null; - } - - private SeekBarWithIntervals getSeekbarWithIntervals(String name) { - - if (name.equals("concentrate")) { - if (concentrateBar == null) { - concentrateBar = (SeekBarWithIntervals) findViewById(R.id.concentrateBar); - } - - return concentrateBar; - } else if (name.equals("coordinate")) { - if (coordinateBar == null) { - coordinateBar = (SeekBarWithIntervals) findViewById(R.id.coordinateBar); - } - - return coordinateBar; - } else if (name.equals("apetite")) { - if (apetiteBar == null) { - apetiteBar = (SeekBarWithIntervals) findViewById(R.id.apetiteBar); - } - - return apetiteBar; - } - return null; - } - - private void doMood(int mood) { - System.out.println("MOOD is " + mood); - int happy = getSharedPreferences("bmhappy", MODE_PRIVATE).getInt("slectedbitmoji", 0); - int ok = getSharedPreferences("bmok", MODE_PRIVATE).getInt("slectedbitmoji", 0); - int notok = getSharedPreferences("bmnotok", MODE_PRIVATE).getInt("slectedbitmoji", 0); - int bad = getSharedPreferences("bmbad", MODE_PRIVATE).getInt("slectedbitmoji", 0); - - SharedPreferences preferences = getSharedPreferences("MOOD", MODE_PRIVATE); - if (mood == 1 || mood == 0) preferences.edit().putInt("moodbitmoji", happy).apply(); - if (mood == 2) preferences.edit().putInt("moodbitmoji", ok).apply(); - if (mood == 3) preferences.edit().putInt("moodbitmoji", notok).apply(); - if (mood == 4 || mood == 5) preferences.edit().putInt("moodbitmoji", bad).apply(); - - getSharedPreferences("MOOD", MODE_PRIVATE).getInt("mood", 0); - getSharedPreferences("MOOD", MODE_PRIVATE).edit().putInt("mood", mood).apply(); - - } -/* - public void onBackPressed() { - Intent intent = new Intent(this, MainMenu.class); - startActivity(intent); - finish(); - }*/ -} - diff --git a/app/src/main/java/com/example/admin/sleepbetter/Seek.java b/app/src/main/java/com/example/admin/sleepbetter/Seek.java deleted file mode 100644 index 0744272ded4fcb194af51346d518f38cfce5e355..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/Seek.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.example.admin.sleepbetter; - - -import java.util.ArrayList; -import java.util.List; - -import android.os.Bundle; -import android.app.Activity; - -public class Seek extends Activity { - private SeekBarWithIntervals SeekbarWithIntervals = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.seekbar); - - List<String> seekbarIntervals = getIntervals(); - getSeekbarWithIntervals().setIntervals(seekbarIntervals); - } - - private List<String> getIntervals() { - return new ArrayList<String>() {{ - add("1"); - add("aaa"); - add("3"); - add("bbb"); - add("5"); - add("ccc"); - add("7"); - add("ddd"); - add("9"); - }}; - } - - private SeekBarWithIntervals getSeekbarWithIntervals() { - if (SeekbarWithIntervals == null) { - SeekbarWithIntervals = (SeekBarWithIntervals) findViewById(R.id.seekbarWithIntervals); - } - - return SeekbarWithIntervals; - } -} diff --git a/app/src/main/java/com/example/admin/sleepbetter/SeekBarWithIntervals.java b/app/src/main/java/com/example/admin/sleepbetter/SeekBarWithIntervals.java deleted file mode 100644 index 2c00b641b71f796a7baa0e1fb7430d444d752a89..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/example/admin/sleepbetter/SeekBarWithIntervals.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.example.admin.sleepbetter; - - -import android.app.Activity; -import android.content.Context; -import android.graphics.Color; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.LinearLayout; -import android.widget.RelativeLayout; -import android.widget.SeekBar; -import android.widget.TextView; - -import java.util.List; - -public class SeekBarWithIntervals extends LinearLayout { - private RelativeLayout relativeLayout = null; - private SeekBar seekbar = null; - - private int widthMeasureSpec = 0; - private int heightMeasureSpec = 0; - - public SeekBarWithIntervals(Context context) { - super(context); - init(); - } - - public SeekBarWithIntervals(Context context, AttributeSet attrs) { - super(context, attrs); - init(); - } - - public SeekBarWithIntervals(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - init(); - } - - - private void init() { - this.setOrientation(VERTICAL); - - } - - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - - getActivity().getLayoutInflater() - .inflate(R.layout.seekbar_with_intervals, this); - } - - private Activity getActivity() { - return (Activity) getContext(); - } - - @Override - protected void onLayout(boolean changed, int l, int t, int r, int b) { - super.onLayout(changed, l, t, r, b); - - if (changed) { - alignIntervals(); - - // We've changed the intervals layout, we need to refresh. - relativeLayout.measure(widthMeasureSpec, heightMeasureSpec); - relativeLayout.layout(relativeLayout.getLeft(), relativeLayout.getTop(), relativeLayout.getRight(), relativeLayout.getBottom()); - } - } - - private void alignIntervals() { - int widthOfSeekbarThumb = getSeekbarThumbWidth(); - int thumbOffset = widthOfSeekbarThumb / 2; - - int widthOfSeekbar = getSeekbar().getWidth(); - int firstIntervalWidth = getRelativeLayout().getChildAt(0).getWidth(); - int remainingPaddableWidth = widthOfSeekbar - firstIntervalWidth - widthOfSeekbarThumb; - - int numberOfIntervals = getSeekbar().getMax(); - int maximumWidthOfEachInterval = remainingPaddableWidth / numberOfIntervals; - - alignFirstInterval(thumbOffset); - alignIntervalsInBetween(maximumWidthOfEachInterval); - alignLastInterval(thumbOffset, maximumWidthOfEachInterval); - } - - private int getSeekbarThumbWidth() { - return getResources().getDimensionPixelOffset(R.dimen.seekbar_thumb_width); - } - - private void alignFirstInterval(int offset) { - TextView firstInterval = (TextView) getRelativeLayout().getChildAt(0); - firstInterval.setPadding(offset, 0, 0, 0); - } - - private void alignIntervalsInBetween(int maximumWidthOfEachInterval) { - int widthOfPreviousIntervalsText = 0; - - // Don't align the first or last interval. - for (int index = 1; index < (getRelativeLayout().getChildCount() - 1); index++) { - TextView textViewInterval = (TextView) getRelativeLayout().getChildAt(index); - int widthOfText = textViewInterval.getWidth(); - - // This works out how much left padding is needed to center the current interval. - int leftPadding = Math.round(maximumWidthOfEachInterval - (widthOfText / 2) - (widthOfPreviousIntervalsText / 2)); - textViewInterval.setPadding(leftPadding, 0, 0, 0); - - widthOfPreviousIntervalsText = widthOfText; - } - } - - private void alignLastInterval(int offset, int maximumWidthOfEachInterval) { - int lastIndex = getRelativeLayout().getChildCount() - 1; - - TextView lastInterval = (TextView) getRelativeLayout().getChildAt(lastIndex); - int widthOfText = lastInterval.getWidth(); - - int leftPadding = Math.round(maximumWidthOfEachInterval - widthOfText - offset); - lastInterval.setPadding(leftPadding, 0, 0, 0); - } - - protected synchronized void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) { - this.widthMeasureSpec = widthMeasureSpec; - this.heightMeasureSpec = heightMeasureSpec; - - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - } - - public int getProgress() { - return getSeekbar().getProgress(); - } - - public void setProgress(int progress) { - getSeekbar().setProgress(progress); - } - - public void setIntervals(List<String> intervals) { - displayIntervals(intervals); - getSeekbar().setMax(intervals.size() - 2); - } - - private void displayIntervals(List<String> intervals) { - int idOfPreviousInterval = 0; - - if (getRelativeLayout().getChildCount() == 0) { - for (int i=0; i<intervals.size() - 1; i++) { - TextView textViewInterval = createInterval(intervals.get(i)); - alignTextViewToRightOfPreviousInterval(textViewInterval, idOfPreviousInterval); - - idOfPreviousInterval = textViewInterval.getId(); - - if (intervals.get(i).equals(intervals.get(intervals.size() - 1))){ - textViewInterval.setTextColor(Color.BLUE); - } - getRelativeLayout().addView(textViewInterval); - } - } - } - - private TextView createInterval(String interval) { - View textBoxView = (View) LayoutInflater.from(getContext()) - .inflate(R.layout.seekbar_with_intervals_label, null); - - TextView textView = (TextView) textBoxView - .findViewById(R.id.textViewInterval); - - textView.setId(View.generateViewId()); - textView.setText(interval); - - return textView; - } - - private void alignTextViewToRightOfPreviousInterval(TextView textView, int idOfPreviousInterval) { - RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); - - if (idOfPreviousInterval > 0) { - params.addRule(RelativeLayout.RIGHT_OF, idOfPreviousInterval); - } - - textView.setLayoutParams(params); - } - - public void setOnSeekBarChangeListener(SeekBar.OnSeekBarChangeListener onSeekBarChangeListener) { - getSeekbar().setOnSeekBarChangeListener(onSeekBarChangeListener); - } - - private RelativeLayout getRelativeLayout() { - if (relativeLayout == null) { - relativeLayout = (RelativeLayout) findViewById(R.id.intervals); - } - - return relativeLayout; - } - - public void setSeekbarProgress(int progress) { - seekbar.setProgress(progress); - } - - private SeekBar getSeekbar() { - if (seekbar == null) { - seekbar = (SeekBar) findViewById(R.id.seekbar); - seekbar.setProgress(3); - } - - return seekbar; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update.java b/app/src/main/java/com/example/admin/sleepbetter/Update.java index c39130730e8c75a6487179d01cdd7df3690bc2f7..5b594744b84d31717677f3669e399a6882bb4494 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update.java @@ -13,7 +13,7 @@ public class Update extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - helpView = inflater.inflate(R.layout.update, container, false); + helpView = inflater.inflate(R.layout.act_update, container, false); return helpView; } diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_6hours.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_6hours.java index fc401111313929c0210bc5af347decc73c55eb50..bdf677f1dcb4500c2054503ebb7ced358ff09809 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_6hours.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_6hours.java @@ -10,7 +10,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; -import android.widget.FrameLayout; import android.widget.TimePicker; import android.widget.Toast; @@ -31,7 +30,7 @@ public class Update_Caffeine_6hours extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_caffeine_six, container, false); + updateView = inflater.inflate(R.layout.act_update_caffeine_six, container, false); List<String> listOne = getIntervals("dayReview"); getSeekbarWithIntervals("dayReviewBar").setIntervals(listOne); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_Empty.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_Empty.java index 3656074ebea9f02ab0bfa6cda492e86e08e9e1e8..c15b46288939130a7c96381e8e626bfba52f33ea 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_Empty.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_Empty.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -14,7 +13,6 @@ import android.widget.Button; import android.widget.ImageView; import android.widget.RadioButton; import android.widget.RadioGroup; -import android.widget.TimePicker; import android.widget.Toast; import java.text.SimpleDateFormat; @@ -34,7 +32,7 @@ public class Update_Caffeine_Empty extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_caffeine_empty, container, false); + updateView = inflater.inflate(R.layout.act_update_caffeine_empty, container, false); ImageView imageView = updateView.findViewById(R.id.imageView22); imageView.setImageResource(R.drawable.stomach); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_limit.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_limit.java index 6464d4fab7f2802281b9f1dd6e088e44840d65c6..017ffe8dce07f05690b563f5ac168fb53bb5c8a5 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_limit.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Caffeine_limit.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -12,8 +11,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; -import android.widget.RadioButton; -import android.widget.RadioGroup; import android.widget.Toast; import java.text.SimpleDateFormat; @@ -37,7 +34,7 @@ public class Update_Caffeine_limit extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_caffeine_limit, container, false); + updateView = inflater.inflate(R.layout.act_update_caffeine_limit, container, false); ImageView imageView = updateView.findViewById(R.id.imageView13); imageView.setImageResource(R.drawable.caffeine); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Bright.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Bright.java index 22e4cfe980a7e9788c4c9b9575f820b845607ee0..28c0a8a2b68dc7d6ec45e07005c5400b23c2ceeb 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Bright.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Bright.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -34,7 +33,7 @@ public class Update_Light_Bright extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_light_bright, container, false); + updateView = inflater.inflate(R.layout.act_update_light_bright, container, false); ImageView imageView = updateView.findViewById(R.id.imageView15); imageView.setImageResource(R.drawable.sun); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Glasses.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Glasses.java index 500a0e0ebfc697a6f37fd8170f5bbab9dc5f1891..3633afb46c52d43277cfe85a0d08ec046fb00e1f 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Glasses.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Light_Glasses.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -33,7 +32,7 @@ public class Update_Light_Glasses extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_light_glasses, container, false); + updateView = inflater.inflate(R.layout.act_update_light_glasses, container, false); ImageView imageView = updateView.findViewById(R.id.imageView16); imageView.setImageResource(R.drawable.glasses); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Light_TurnOffBright.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Light_TurnOffBright.java index 3cd8ca193ad698f305314465398497f948f938fe..95854669f786b1459ec17056e23d4e46869699a8 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Light_TurnOffBright.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Light_TurnOffBright.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -33,7 +32,7 @@ public class Update_Light_TurnOffBright extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_light_turnoffs, container, false); + updateView = inflater.inflate(R.layout.act_update_light_turnoffs, container, false); ImageView imageView = updateView.findViewById(R.id.imageView17); imageView.setImageResource(R.drawable.screen); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_7hours.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_7hours.java index a134b30fee3de47ac37c88d675cf35f6a6108530..a96f48938949bc52d98d9ea5d6c97b91f9a63556 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_7hours.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_7hours.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -31,7 +30,7 @@ public class Update_Schedule_7hours extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_schedule_seven, container, false); + updateView = inflater.inflate(R.layout.act_update_schedule_seven, container, false); ImageView imageView = updateView.findViewById(R.id.imageView21); imageView.setImageResource(R.drawable.sleeep_clock); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Midnight.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Midnight.java index 4750fb005fbfd2cfcb9e8be36a493da52f91a02d..1eb4085a2dae7378f8c97d35da51f379961f7467 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Midnight.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Midnight.java @@ -29,7 +29,7 @@ public class Update_Schedule_Midnight extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_schedule_midnight, container, false); + updateView = inflater.inflate(R.layout.act_update_schedule_midnight, container, false); List<String> listOne = getIntervals("dayReview"); getSeekbarWithIntervals("dayReviewBar").setIntervals(listOne); Button button = (Button) updateView.findViewById(R.id.submitUpdate); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Relax.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Relax.java index bc860ccb5f0f068eaec8450ad14d2ce411b5b4a7..8023893ac76c1aebcd6fa03e653933c4328e5cba 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Relax.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_Relax.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -33,7 +32,7 @@ public class Update_Schedule_Relax extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_schedule_relax, container, false); + updateView = inflater.inflate(R.layout.act_update_schedule_relax, container, false); List<String> listOne = getIntervals("dayReview"); getSeekbarWithIntervals("dayReviewBar").setIntervals(listOne); ImageView imageView = updateView.findViewById(R.id.imageView19); diff --git a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_SameTime.java b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_SameTime.java index c141b68d5e49d4ba88126794e1d197eed51a7c30..aa5abc279b8d598be6dc7eb08e9beb1a6813c9b2 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_SameTime.java +++ b/app/src/main/java/com/example/admin/sleepbetter/Update_Schedule_SameTime.java @@ -3,7 +3,6 @@ package com.example.admin.sleepbetter; import android.app.Fragment; import android.app.FragmentManager; import android.arch.persistence.room.Room; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.constraint.ConstraintLayout; @@ -32,7 +31,7 @@ public class Update_Schedule_SameTime extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - updateView = inflater.inflate(R.layout.update_schedule_sametime, container, false); + updateView = inflater.inflate(R.layout.act_update_schedule_sametime, container, false); ImageView imageView = updateView.findViewById(R.id.imageView20); imageView.setImageResource(R.drawable.sleeep_clock); diff --git a/app/src/main/java/com/example/admin/sleepbetter/UserQuestionnaire.java b/app/src/main/java/com/example/admin/sleepbetter/UserQuestionnaire.java index b3478bc957d3cd0ebef9aec195b632d3a7004207..5548e96c4aebf69b1dabf8b3a9eada7562aec96a 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/UserQuestionnaire.java +++ b/app/src/main/java/com/example/admin/sleepbetter/UserQuestionnaire.java @@ -20,22 +20,18 @@ public class UserQuestionnaire { private String username; private String date; - private int timesPerNight; - private int nightTerrors; - private int fallAsleep; - private int wakeUp; - private int fresh; - private int sad; - private int sleepy; - private int tired; - private int stressed; - private int apetite; - private int concentrate; - private int coordinate; - private int irritable; + private int howLong; + private int awake; + private int earlier; + private int nightsAWeek; + private int quality; + private int impactMood; + private int impactActivities; + private int impactGeneral; + private int problem; @ColumnInfo(name="mood_all") - private int mood; + private double mood; public UserQuestionnaire() { } @@ -56,120 +52,83 @@ public class UserQuestionnaire { this.date = date; } - public int getTimesPerNight() { - return timesPerNight; + public int getAwake() { + return awake; } - public void setTimesPerNight(int timesPerNight) { - this.timesPerNight = timesPerNight; + public void setAwake(int awake) { + this.awake = awake; } - public int getNightTerrors() { - return nightTerrors; + public int getHowLong() { + return howLong; } - public void setNightTerrors(int nightTerrors) { - this.nightTerrors = nightTerrors; + public void setHowLong(int howLong) { + this.howLong = howLong; } - public int getFallAsleep() { - return fallAsleep; + public int getEarlier() { + return earlier; } - public void setFallAsleep(int fallAsleep) { - this.fallAsleep = fallAsleep; + public void setEarlier(int earlier) { + this.earlier = earlier; } - public int getWakeUp() { - return wakeUp; - } - - public void setWakeUp(int wakeUp) { - this.wakeUp = wakeUp; - } - - public int getFresh() { - return fresh; - } - - public void setFresh(int fresh) { - this.fresh = fresh; - } - - public int getSad() { - return sad; - } - - public void setSad(int sad) { - this.sad = sad; - } - - public int getSleepy() { - return sleepy; - } - - public void setSleepy(int sleepy) { - this.sleepy = sleepy; - } + public int getNightsAWeek() { return nightsAWeek; } - public int getTired() { - return tired; + public void setNightsAWeek(int nightsAWeek) { + this.nightsAWeek = nightsAWeek; } - public void setTired(int tired) { - this.tired = tired; + public int getQuality() { + return quality; } - public int getStressed() { - return stressed; + public void setQuality(int quality) { + this.quality = quality; } - public void setStressed(int stressed) { - this.stressed = stressed; + public int getImpactMood() { + return impactMood; } - public int getApetite() { - return apetite; + public void setImpactMood(int impactMood) { + this.impactMood = impactMood; } - public void setApetite(int apetite) { - this.apetite = apetite; + public int getImpactActivities() { + return impactActivities; } - - public int getConcentrate() { - return concentrate; + public void setImpactActivities(int impactActivities) { + this.impactActivities = impactActivities; } - public void setConcentrate(int concentrate) { - this.concentrate = concentrate; + public int getImpactGeneral() { + return impactGeneral; } - - public int getCoordinate() { - return coordinate; + public void setImpactGeneral(int impactGeneral) { + this.impactGeneral = impactGeneral; } - public void setCoordinate(int coordinate) { - this.coordinate = coordinate; - } - - - public int getIrritable() { - return irritable; + public int getProblem() { + return problem; } - public void setIrritable(int irritable) { - this.irritable = irritable; + public void setProblem(int problem) { + this.problem = problem; } - public int getMood() { + public double getMood() { return mood; } - public void setMood(int mood) { + public void setMood(double mood) { this.mood = mood; } diff --git a/app/src/main/java/com/example/admin/sleepbetter/WhatExperiments.java b/app/src/main/java/com/example/admin/sleepbetter/WhatExperiments.java index 406bbae2460a6aa5c9e8e9a5d951ba96bb140103..a7f77750d3bd612bb3f02364118f0be0b06cb884 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/WhatExperiments.java +++ b/app/src/main/java/com/example/admin/sleepbetter/WhatExperiments.java @@ -1,7 +1,6 @@ package com.example.admin.sleepbetter; import android.content.Intent; -import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; @@ -13,7 +12,7 @@ public class WhatExperiments extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.what_experiments); + setContentView(R.layout.act_what_experiments); ImageView imageView = findViewById(R.id.imageView23); imageView.setImageResource(R.drawable.phone); diff --git a/app/src/main/java/com/example/admin/sleepbetter/WhatIsSleep.java b/app/src/main/java/com/example/admin/sleepbetter/WhatIsSleep.java index 7fb35d1f370a0b128e6869e669c03bf8c25e8989..6fc7a40137e09adf3894d667eea34ac9bcd9188d 100644 --- a/app/src/main/java/com/example/admin/sleepbetter/WhatIsSleep.java +++ b/app/src/main/java/com/example/admin/sleepbetter/WhatIsSleep.java @@ -1,7 +1,6 @@ package com.example.admin.sleepbetter; import android.content.Intent; -import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; @@ -13,7 +12,7 @@ public class WhatIsSleep extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.what_is_sleep); + setContentView(R.layout.act_what_is_sleep); ImageView imageView = findViewById(R.id.imageView4); imageView.setImageResource(R.drawable.sleepmoon); diff --git a/app/src/main/res/layout/calendar.xml b/app/src/main/res/layout/act_Calendar.xml similarity index 100% rename from app/src/main/res/layout/calendar.xml rename to app/src/main/res/layout/act_Calendar.xml diff --git a/app/src/main/res/layout/activity_first_page_consent.xml b/app/src/main/res/layout/act_Consent.xml similarity index 100% rename from app/src/main/res/layout/activity_first_page_consent.xml rename to app/src/main/res/layout/act_Consent.xml diff --git a/app/src/main/res/layout/data.xml b/app/src/main/res/layout/act_Data.xml similarity index 71% rename from app/src/main/res/layout/data.xml rename to app/src/main/res/layout/act_Data.xml index 861a11851a2dad779d27aedf9982aeb60f39eff7..5b61d1fa4b202c24db85be0debb8e8c1c3edc620 100644 --- a/app/src/main/res/layout/data.xml +++ b/app/src/main/res/layout/act_Data.xml @@ -127,7 +127,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="24dp" + android:layout_marginTop="8dp" android:clickable="false" android:cursorVisible="false" android:ems="10" @@ -139,7 +139,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/appetite" /> + app:layout_constraintTop_toBottomOf="@+id/impactGeneral" /> <EditText android:id="@+id/timelines" @@ -287,192 +287,103 @@ app:layout_constraintTop_toBottomOf="@+id/experimentName" /> <TextView - android:id="@+id/timesWaking" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="28dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:text="@string/svdTimes" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintBottom_toTopOf="@+id/imageView28" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" /> - - <TextView - android:id="@+id/nightTerrors" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:id="@+id/howLong" + android:layout_width="81dp" + android:layout_height="52dp" android:layout_marginBottom="12dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:text="@string/svdnightTerrors" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintBottom_toTopOf="@+id/imageView28" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" /> - - <TextView - android:id="@+id/fallasleep" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="36dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:text="@string/svdfallAsleep" + android:text="@string/svdHowLong" android:textColor="@android:color/black" android:textSize="12sp" app:layout_constraintBottom_toTopOf="@+id/imageView28" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.965" + app:layout_constraintHorizontal_bias="0.117" app:layout_constraintStart_toStartOf="parent" /> <TextView - android:id="@+id/wakingUp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="16dp" + android:id="@+id/quality" + android:layout_width="67dp" + android:layout_height="47dp" + android:layout_marginBottom="12dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:text="@string/svdwakeUp" + android:text="@string/svdQuality" android:textColor="@android:color/black" android:textSize="12sp" app:layout_constraintBottom_toTopOf="@+id/imageView28" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.9" + app:layout_constraintHorizontal_bias="0.791" app:layout_constraintStart_toStartOf="parent" /> <TextView - android:id="@+id/fresh" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:id="@+id/impactMood" + android:layout_width="96dp" + android:layout_height="64dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:text="@string/svdFresh" + android:layout_marginTop="8dp" + android:text="@string/svdImpactMood" android:textColor="@android:color/black" android:textSize="12sp" - app:layout_constraintBottom_toTopOf="@+id/imageView28" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.812" - app:layout_constraintStart_toStartOf="parent" /> - - <TextView - android:id="@+id/sad" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="28dp" - android:text="@string/svdSad" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintEnd_toStartOf="@+id/imageView28" - app:layout_constraintHorizontal_bias="0.509" + app:layout_constraintHorizontal_bias="0.966" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/nightTerrors" /> + app:layout_constraintTop_toBottomOf="@+id/quality" /> <TextView - android:id="@+id/sleepy" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:id="@+id/awake" + android:layout_width="107dp" + android:layout_height="58dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="4dp" - android:text="@string/svdSleepy" + android:layout_marginTop="8dp" + android:text="@string/svdAwake" android:textColor="@android:color/black" android:textSize="12sp" app:layout_constraintEnd_toStartOf="@+id/imageView28" - app:layout_constraintHorizontal_bias="0.441" + app:layout_constraintHorizontal_bias="1.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sad" /> + app:layout_constraintTop_toBottomOf="@+id/howLong" /> <TextView - android:id="@+id/tired" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:id="@+id/earlier" + android:layout_width="109dp" + android:layout_height="60dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="4dp" - android:text="@string/svdTired" + android:layout_marginTop="16dp" + android:text="@string/svdEarlier" android:textColor="@android:color/black" android:textSize="12sp" app:layout_constraintEnd_toStartOf="@+id/imageView28" - app:layout_constraintHorizontal_bias="0.52" + app:layout_constraintHorizontal_bias="1.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sleepy" /> + app:layout_constraintTop_toBottomOf="@+id/awake" /> <TextView - android:id="@+id/stressed" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:id="@+id/impactActivities" + android:layout_width="111dp" + android:layout_height="76dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="28dp" - android:text="@string/svdStressed" + android:layout_marginTop="16dp" + android:text="@string/svdImpactActivities" android:textColor="@android:color/black" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.1" - app:layout_constraintStart_toEndOf="@+id/imageView28" - app:layout_constraintTop_toBottomOf="@+id/fresh" /> - - <TextView - android:id="@+id/irritable" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="4dp" - android:text="@string/svdIrritable" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.228" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toEndOf="@+id/imageView28" - app:layout_constraintTop_toBottomOf="@+id/stressed" /> - - <TextView - android:id="@+id/concentrate" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/svdConcenrate" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.034" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView28" /> + app:layout_constraintTop_toBottomOf="@+id/impactMood" /> <TextView - android:id="@+id/coordinate" + android:id="@+id/impactGeneral" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/svdCoordinate" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.887" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView28" /> - - <TextView - android:id="@+id/appetite" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="24dp" - android:text="@string/svdAppetite" + android:layout_marginTop="48dp" + android:text="@string/svdImpactGeneral" android:textColor="@android:color/black" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/goal_diary.xml b/app/src/main/res/layout/act_Diary.xml similarity index 93% rename from app/src/main/res/layout/goal_diary.xml rename to app/src/main/res/layout/act_Diary.xml index 1d0def20be7533a0741a4a41c659153214cb959a..efd047ef7a59f289809a05b5340373a20017450b 100644 --- a/app/src/main/res/layout/goal_diary.xml +++ b/app/src/main/res/layout/act_Diary.xml @@ -139,19 +139,9 @@ android:layout_height="match_parent" android:weightSum="2"> - <TextView - android:id="@+id/dateTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="DATE" - android:textAlignment="center" - android:textColor="@android:color/black" - android:textStyle="bold" /> - <TextView android:id="@+id/comment" - android:layout_width="wrap_content" + android:layout_width="358dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="COMMENT" diff --git a/app/src/main/res/layout/factors.xml b/app/src/main/res/layout/act_Experiments.xml similarity index 92% rename from app/src/main/res/layout/factors.xml rename to app/src/main/res/layout/act_Experiments.xml index c92ec88d78a027ccefcb06d971e471d47dc4e18f..ff8fa916181c9489fe17d6633bc85ed9fc8f55c3 100644 --- a/app/src/main/res/layout/factors.xml +++ b/app/src/main/res/layout/act_Experiments.xml @@ -104,19 +104,6 @@ tools:layout_editor_absoluteY="0dp"> - <Button - android:id="@+id/moreInfo" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="32dp" - android:text="@string/moreInfo" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.868" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/experimentsGroup" /> - <RadioGroup android:id="@+id/experimentsGroup" android:layout_width="match_parent" @@ -262,12 +249,10 @@ android:id="@+id/submit" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="40dp" - android:layout_marginStart="32dp" - android:layout_marginTop="32dp" + android:layout_marginEnd="120dp" + android:layout_marginStart="120dp" android:text="@string/submitUpdate" - app:layout_constraintEnd_toStartOf="@+id/moreInfo" - app:layout_constraintHorizontal_bias="1.0" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/experimentsGroup" /> diff --git a/app/src/main/res/layout/content_menu.xml b/app/src/main/res/layout/act_Main_Menu.xml similarity index 99% rename from app/src/main/res/layout/content_menu.xml rename to app/src/main/res/layout/act_Main_Menu.xml index 690f146cb0b7e7e6f23572095307a0abc48d8f90..4b9bcd9a019207be3012c45b5d375cc89ba70628 100644 --- a/app/src/main/res/layout/content_menu.xml +++ b/app/src/main/res/layout/act_Main_Menu.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context=".MainMenu" - tools:showIn="@layout/app_bar_menu"> + tools:showIn="@layout/extra_bar_Main"> <FrameLayout android:id="@+id/content_frame" diff --git a/app/src/main/res/layout/activity_menu.xml b/app/src/main/res/layout/act_Menu.xml similarity index 90% rename from app/src/main/res/layout/activity_menu.xml rename to app/src/main/res/layout/act_Menu.xml index 116123c156cbcd48e99c19435bedeed53acb746e..b77b876e055e05030f2779f15979d7b8cfaaab4f 100644 --- a/app/src/main/res/layout/activity_menu.xml +++ b/app/src/main/res/layout/act_Menu.xml @@ -11,7 +11,7 @@ tools:openDrawer="start"> <include - layout="@layout/app_bar_menu" + layout="@layout/extra_bar_Main" android:layout_width="match_parent" android:layout_height="match_parent" /> @@ -21,7 +21,7 @@ android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" - app:headerLayout="@layout/nav_header_menu" + app:headerLayout="@layout/extra_nav_header_menu" app:menu="@menu/activity_menu_drawer" /> </android.support.v4.widget.DrawerLayout> diff --git a/app/src/main/res/layout/activity_first_note.xml b/app/src/main/res/layout/act_Notice.xml similarity index 100% rename from app/src/main/res/layout/activity_first_note.xml rename to app/src/main/res/layout/act_Notice.xml diff --git a/app/src/main/res/layout/activity_second_page_two.xml b/app/src/main/res/layout/act_QuesIFinal.xml similarity index 50% rename from app/src/main/res/layout/activity_second_page_two.xml rename to app/src/main/res/layout/act_QuesIFinal.xml index f36237bdbf06b5802adc89cc59f95fbdc83d046d..b9c7715f187deac891c0db21435de3f1d393d3e7 100644 --- a/app/src/main/res/layout/activity_second_page_two.xml +++ b/app/src/main/res/layout/act_QuesIFinal.xml @@ -85,7 +85,7 @@ <android.support.constraint.ConstraintLayout android:layout_width="match_parent" - android:layout_height="1361dp" + android:layout_height="1484dp" tools:layout_editor_absoluteX="8dp" tools:layout_editor_absoluteY="0dp"> @@ -116,7 +116,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="304dp" + android:layout_marginTop="572dp" android:clickable="false" android:cursorVisible="false" android:ems="10" @@ -124,7 +124,7 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine" - android:text="@string/q1desc" + android:text="@string/q2desc" android:textSize="12sp" android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" @@ -138,7 +138,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="456dp" + android:layout_marginTop="792dp" android:clickable="false" android:cursorVisible="false" android:ems="10" @@ -154,28 +154,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - <EditText - android:id="@+id/fourthSet" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="676dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/q4desc" - android:textSize="12sp" - android:textStyle="bold" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - <Button android:id="@+id/submitButton" android:layout_width="102dp" @@ -185,7 +163,7 @@ android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - tools:layout_editor_absoluteY="1284dp" /> + app:layout_constraintTop_toBottomOf="@+id/q8Group" /> <EditText @@ -203,42 +181,20 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine|textUri" - android:text="@string/s1" + android:text="@string/s1.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.428" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/firstSet" /> - <EditText - android:id="@+id/s4" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="304dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine|textUri" - android:text="@string/s4" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/firstSet" /> - <EditText android:id="@+id/s5" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="364dp" + android:layout_marginTop="572dp" android:background="@android:color/transparent" android:clickable="false" android:cursorVisible="false" @@ -247,7 +203,7 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine|textUri" - android:text="@string/s5" + android:text="@string/s5.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -260,7 +216,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="480dp" + android:layout_marginTop="800dp" android:background="@android:color/transparent" android:clickable="false" android:cursorVisible="false" @@ -269,7 +225,7 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine|textUri" - android:text="@string/s6" + android:text="@string/s6.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -282,7 +238,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="528dp" + android:layout_marginTop="972dp" android:background="@android:color/transparent" android:clickable="false" android:cursorVisible="false" @@ -291,7 +247,7 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine|textUri" - android:text="@string/s7" + android:text="@string/s7.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -304,7 +260,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="580dp" + android:layout_marginTop="1148dp" android:background="@android:color/transparent" android:clickable="false" android:cursorVisible="false" @@ -313,7 +269,7 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine|textUri" - android:text="@string/s8" + android:text="@string/s8.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -321,12 +277,12 @@ app:layout_constraintTop_toBottomOf="@+id/firstSet" /> <EditText - android:id="@+id/s9" + android:id="@+id/wakeUpUsually" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="712dp" + android:layout_marginTop="8dp" android:background="@android:color/transparent" android:clickable="false" android:cursorVisible="false" @@ -334,20 +290,21 @@ android:focusable="false" android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine|textUri" - android:text="@string/s9" + android:inputType="textMultiLine" + android:text="@string/s2.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + app:layout_constraintTop_toBottomOf="@+id/q1Group" /> <EditText - android:id="@+id/wakeUpUsually" + android:id="@+id/freshUsually" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" + android:layout_marginTop="8dp" android:background="@android:color/transparent" android:clickable="false" android:cursorVisible="false" @@ -356,33 +313,339 @@ android:focusableInTouchMode="false" android:hint="@string/some_explanation_about_the_input" android:inputType="textMultiLine" - android:text="@string/s2" + android:text="@string/s3.1" android:textSize="12sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - tools:layout_editor_absoluteY="242dp" /> + app:layout_constraintTop_toBottomOf="@+id/q2Group" /> - <EditText - android:id="@+id/freshUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" + <RadioGroup + android:id="@+id/q1Group" + android:layout_width="327dp" + android:layout_height="128dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/s3" - android:textSize="12sp" + android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - tools:layout_editor_absoluteY="273dp" /> + app:layout_constraintTop_toBottomOf="@+id/fallAsleepUsually"> + + <RadioButton + android:id="@+id/radioButton2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1" /> + + <RadioButton + android:id="@+id/radioButton4" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2" /> + + <RadioButton + android:id="@+id/radioButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3" /> + + <RadioButton + android:id="@+id/radioButton3" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4" /> + + <RadioButton + android:id="@+id/radioButton5" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q2Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/wakeUpUsually"> + + <RadioButton + android:id="@+id/radioButton7" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1" /> + + <RadioButton + android:id="@+id/radioButton8" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2" /> + + <RadioButton + android:id="@+id/radioButton9" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3" /> + + <RadioButton + android:id="@+id/radioButton10" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4" /> + + <RadioButton + android:id="@+id/radioButton6" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q3Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/freshUsually"> + + <RadioButton + android:id="@+id/radioButton15" + android:layout_width="296dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.1" /> + + <RadioButton + android:id="@+id/radioButton13" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2" /> + + <RadioButton + android:id="@+id/radioButton11" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3" /> + + <RadioButton + android:id="@+id/radioButton12" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4" /> + + <RadioButton + android:id="@+id/radioButton14" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q5Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s5"> + + <RadioButton + android:id="@+id/radioButton21" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.3" /> + + <RadioButton + android:id="@+id/radioButton22" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.3" /> + + <RadioButton + android:id="@+id/radioButton23" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.3" /> + + <RadioButton + android:id="@+id/radioButton24" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.3" /> + + <RadioButton + android:id="@+id/radioButton25" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.3" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q6Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s6"> + + <RadioButton + android:id="@+id/radioButton26" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.4" /> + + <RadioButton + android:id="@+id/radioButton27" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.4" /> + + <RadioButton + android:id="@+id/radioButton28" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.4" /> + + <RadioButton + android:id="@+id/radioButton29" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.4" /> + + <RadioButton + android:id="@+id/radioButton30" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.4" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q7Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s7"> + + <RadioButton + android:id="@+id/radioButton35" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.4" /> + + <RadioButton + android:id="@+id/radioButton31" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.4" /> + + <RadioButton + android:id="@+id/radioButton32" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.4" /> + + <RadioButton + android:id="@+id/radioButton33" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.4" /> + + <RadioButton + android:id="@+id/radioButton34" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.4" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q8Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s8"> + + <RadioButton + android:id="@+id/radioButton36" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.4" /> + + <RadioButton + android:id="@+id/radioButton37" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.4" /> + + <RadioButton + android:id="@+id/radioButton38" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.4" /> + + <RadioButton + android:id="@+id/radioButton39" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.4" /> + + <RadioButton + android:id="@+id/radioButton40" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.4" /> + </RadioGroup> </android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout/act_QuesInitial.xml b/app/src/main/res/layout/act_QuesInitial.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0811d7eb7363398258502f338a96b294586cb80 --- /dev/null +++ b/app/src/main/res/layout/act_QuesInitial.xml @@ -0,0 +1,817 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".SecondPage"> + + <View + android:id="@+id/topView" + android:layout_width="match_parent" + android:layout_height="75dp" + android:background="@color/LightSteelBlue" + tools:ignore="MissingConstraints" + tools:layout_editor_absoluteX="16dp" + tools:layout_editor_absoluteY="0dp" /> + + <TextView + android:id="@+id/questionnaireTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:text="@string/questionnaireTitle" + android:textAllCaps="false" + android:textColor="@android:color/black" + android:textSize="30sp" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="@+id/topView" + app:layout_constraintEnd_toStartOf="@+id/logoPlace" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="@+id/topView" + app:layout_constraintTop_toTopOf="@+id/topView" + app:layout_constraintVertical_bias="0.444" + tools:ignore="RtlHardcoded" /> + + <ImageView + android:id="@+id/logoPlace" + android:layout_width="91dp" + android:layout_height="81dp" + android:layout_marginBottom="8dp" + android:layout_marginEnd="8dp" + android:layout_marginTop="8dp" + android:contentDescription="@string/desc" + app:layout_constraintBottom_toBottomOf="@+id/topView" + app:layout_constraintEnd_toEndOf="@+id/topView" + app:layout_constraintTop_toTopOf="@+id/topView" + app:srcCompat="@drawable/pill" + tools:ignore="RtlHardcoded" /> + + <ScrollView + android:id="@+id/ScrollViewQuestionnaire" + style="@android:style/Widget.Material.ScrollView" + android:layout_width="match_parent" + android:layout_height="458dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:fillViewport="true" + android:scrollbarStyle="insideOverlay" + android:visibility="visible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.454" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/topView" + tools:targetApi="lollipop"> + + <FrameLayout + android:id="@+id/FrameForScrollView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="8dp" + android:layout_marginEnd="8dp" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" + app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" + app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> + + <android.support.constraint.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="1895dp" + tools:layout_editor_absoluteX="8dp" + tools:layout_editor_absoluteY="0dp"> + + <EditText + android:id="@+id/firstSet" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine" + android:text="@string/q1desc" + android:textSize="12sp" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <EditText + android:id="@+id/secondSet" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="572dp" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine" + android:text="@string/q2desc" + android:textSize="12sp" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <EditText + android:id="@+id/thirdSet" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="956dp" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine" + android:text="@string/q3desc" + android:textSize="12sp" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <EditText + android:id="@+id/fourthSet" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="1544dp" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine" + android:text="@string/q4desc" + android:textSize="12sp" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <Button + android:id="@+id/submitButton" + android:layout_width="102dp" + android:layout_height="43dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="24dp" + android:text="@string/nextButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/q9Group" /> + + + <EditText + android:id="@+id/fallAsleepUsually" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s1" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.428" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/s4" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="572dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s4" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/s5" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="744dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s5" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/s6" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="964dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s6" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/s7" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="1144dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s7" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/s8" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="1328dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s8" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/s9" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="1552dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine|textUri" + android:text="@string/s9" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/firstSet" /> + + <EditText + android:id="@+id/wakeUpUsually" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine" + android:text="@string/s2" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/q1Group" /> + + <EditText + android:id="@+id/freshUsually" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:background="@android:color/transparent" + android:clickable="false" + android:cursorVisible="false" + android:ems="10" + android:focusable="false" + android:focusableInTouchMode="false" + android:hint="@string/some_explanation_about_the_input" + android:inputType="textMultiLine" + android:text="@string/s3" + android:textSize="12sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/q2Group" /> + + <RadioGroup + android:id="@+id/q1Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/fallAsleepUsually"> + + <RadioButton + android:id="@+id/radioButton2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1" /> + + <RadioButton + android:id="@+id/radioButton4" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2" /> + + <RadioButton + android:id="@+id/radioButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3" /> + + <RadioButton + android:id="@+id/radioButton3" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4" /> + + <RadioButton + android:id="@+id/radioButton5" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q2Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/wakeUpUsually"> + + <RadioButton + android:id="@+id/radioButton7" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1" /> + + <RadioButton + android:id="@+id/radioButton8" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2" /> + + <RadioButton + android:id="@+id/radioButton9" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3" /> + + <RadioButton + android:id="@+id/radioButton10" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4" /> + + <RadioButton + android:id="@+id/radioButton6" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q3Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/freshUsually"> + + <RadioButton + android:id="@+id/radioButton15" + android:layout_width="296dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.1" /> + + <RadioButton + android:id="@+id/radioButton13" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2" /> + + <RadioButton + android:id="@+id/radioButton11" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3" /> + + <RadioButton + android:id="@+id/radioButton12" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4" /> + + <RadioButton + android:id="@+id/radioButton14" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q4Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s4"> + + <RadioButton + android:id="@+id/radioButton19" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.2" /> + + <RadioButton + android:id="@+id/radioButton20" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.2" /> + + <RadioButton + android:id="@+id/radioButton16" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.2" /> + + <RadioButton + android:id="@+id/radioButton17" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.2" /> + + <RadioButton + android:id="@+id/radioButton18" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.2" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q5Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s5"> + + <RadioButton + android:id="@+id/radioButton21" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.3" /> + + <RadioButton + android:id="@+id/radioButton22" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.3" /> + + <RadioButton + android:id="@+id/radioButton23" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.3" /> + + <RadioButton + android:id="@+id/radioButton24" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.3" /> + + <RadioButton + android:id="@+id/radioButton25" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.3" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q6Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s6"> + + <RadioButton + android:id="@+id/radioButton26" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.4" /> + + <RadioButton + android:id="@+id/radioButton27" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.4" /> + + <RadioButton + android:id="@+id/radioButton28" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.4" /> + + <RadioButton + android:id="@+id/radioButton29" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.4" /> + + <RadioButton + android:id="@+id/radioButton30" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.4" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q7Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s7"> + + <RadioButton + android:id="@+id/radioButton35" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.4" /> + + <RadioButton + android:id="@+id/radioButton31" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.4" /> + + <RadioButton + android:id="@+id/radioButton32" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.4" /> + + <RadioButton + android:id="@+id/radioButton33" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.4" /> + + <RadioButton + android:id="@+id/radioButton34" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.4" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q8Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s8"> + + <RadioButton + android:id="@+id/radioButton36" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.4" /> + + <RadioButton + android:id="@+id/radioButton37" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.4" /> + + <RadioButton + android:id="@+id/radioButton38" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.4" /> + + <RadioButton + android:id="@+id/radioButton39" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.4" /> + + <RadioButton + android:id="@+id/radioButton40" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.4" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/q9Group" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/s9"> + + <RadioButton + android:id="@+id/radioButton42" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.5" /> + + <RadioButton + android:id="@+id/radioButton43" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.5" /> + + <RadioButton + android:id="@+id/radioButton45" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.5" /> + + <RadioButton + android:id="@+id/radioButton41" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.5" /> + + <RadioButton + android:id="@+id/radioButton44" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.5" /> + </RadioGroup> + + + </android.support.constraint.ConstraintLayout> + </FrameLayout> + </ScrollView> + + +</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_first_page.xml b/app/src/main/res/layout/act_Welcome.xml similarity index 100% rename from app/src/main/res/layout/activity_first_page.xml rename to app/src/main/res/layout/act_Welcome.xml diff --git a/app/src/main/res/layout/update.xml b/app/src/main/res/layout/act_update.xml similarity index 100% rename from app/src/main/res/layout/update.xml rename to app/src/main/res/layout/act_update.xml diff --git a/app/src/main/res/layout/update_caffeine_empty.xml b/app/src/main/res/layout/act_update_caffeine_empty.xml similarity index 87% rename from app/src/main/res/layout/update_caffeine_empty.xml rename to app/src/main/res/layout/act_update_caffeine_empty.xml index e40b79f84122a2dbdc284885043b3d6f2052e241..79e18f3532d3a75b60d31decfcf61862a0b24c98 100644 --- a/app/src/main/res/layout/update_caffeine_empty.xml +++ b/app/src/main/res/layout/act_update_caffeine_empty.xml @@ -182,8 +182,9 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup" /> <EditText android:id="@+id/dayReview" @@ -230,7 +231,7 @@ android:layout_height="0dp" android:layout_marginEnd="24dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" + android:layout_marginTop="4dp" android:background="@android:color/transparent" android:clickable="false" android:ems="10" @@ -245,24 +246,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <RadioGroup android:id="@+id/activityGroup" android:layout_width="match_parent" @@ -299,23 +282,57 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView22" /> + app:layout_constraintTop_toBottomOf="@+id/activityGroup" /> - <ImageView - android:id="@+id/imageView22" - android:layout_width="133dp" - android:layout_height="133dp" + <RadioGroup + android:id="@+id/radioGroup" + android:layout_width="327dp" + android:layout_height="128dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/activityGroup" - app:srcCompat="@drawable/stomach" /> + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton48" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton46" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton47" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton49" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton50" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> </android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout/update_caffeine_limit.xml b/app/src/main/res/layout/act_update_caffeine_limit.xml similarity index 82% rename from app/src/main/res/layout/update_caffeine_limit.xml rename to app/src/main/res/layout/act_update_caffeine_limit.xml index 544f8d17ee958ebc7a0bc2c5f438e3e72a9fd822..69583dfb015025646f0879cd5194a255c5944b3b 100644 --- a/app/src/main/res/layout/update_caffeine_limit.xml +++ b/app/src/main/res/layout/act_update_caffeine_limit.xml @@ -113,7 +113,7 @@ <android.support.constraint.ConstraintLayout android:id="@+id/fr" android:layout_width="match_parent" - android:layout_height="617dp" + android:layout_height="968dp" tools:layout_editor_absoluteX="8dp" tools:layout_editor_absoluteY="0dp"> @@ -135,9 +135,9 @@ android:text="@string/energydrinksQuestion" android:textColor="@android:color/black" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintHorizontal_bias="1.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout16" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup8" /> <TextView android:id="@+id/tvQuestion2" @@ -156,9 +156,9 @@ android:text="@string/cansQuestion" android:textColor="@android:color/black" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.111" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout15" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup7" /> <EditText android:id="@+id/loggngTitle" @@ -176,8 +176,9 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> <EditText android:id="@+id/dayReview" @@ -239,24 +240,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <Button android:id="@+id/submitUpdate" android:layout_width="wrap_content" @@ -267,74 +250,87 @@ android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView13" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup9" /> - <RelativeLayout - android:id="@+id/relativeLayout15" - android:layout_width="match_parent" - android:layout_height="35dp" + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="1.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/turnOffQuestion"> + app:layout_constraintTop_toBottomOf="@+id/questionDay"> - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/cupsBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> - <RelativeLayout - android:id="@+id/relativeLayout16" - android:layout_width="match_parent" - android:layout_height="35dp" + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> + + <RadioGroup + android:id="@+id/radioGroup7" + android:layout_width="327dp" + android:layout_height="128dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvQuestion2"> + app:layout_constraintTop_toBottomOf="@+id/turnOffQuestion" /> - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/cansBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout17" - android:layout_width="match_parent" - android:layout_height="35dp" + <RadioGroup + android:id="@+id/radioGroup8" + android:layout_width="327dp" + android:layout_height="128dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/appGroup"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/energyBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> + app:layout_constraintTop_toBottomOf="@+id/tvQuestion2" /> - <ImageView - android:id="@+id/imageView13" - android:layout_width="133dp" - android:layout_height="133dp" + <RadioGroup + android:id="@+id/radioGroup9" + android:layout_width="327dp" + android:layout_height="128dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout17" /> + app:layout_constraintTop_toBottomOf="@+id/appGroup" /> </android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout/update_caffeine_six.xml b/app/src/main/res/layout/act_update_caffeine_six.xml similarity index 86% rename from app/src/main/res/layout/update_caffeine_six.xml rename to app/src/main/res/layout/act_update_caffeine_six.xml index 0a28c27d6cfe8ce4d92be4e93afaef2cd2ca4fab..62402de30729bdfd3b37b712dddb6303cedca0f5 100644 --- a/app/src/main/res/layout/update_caffeine_six.xml +++ b/app/src/main/res/layout/act_update_caffeine_six.xml @@ -155,8 +155,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -217,25 +265,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <Button android:id="@+id/submitUpdate" android:layout_width="wrap_content" @@ -245,7 +274,7 @@ android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView14" /> + app:layout_constraintTop_toBottomOf="@+id/whenSleep" /> <TimePicker android:id="@+id/lastDrink" @@ -271,18 +300,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/appGroup" /> - <ImageView - android:id="@+id/imageView14" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/whenSleep" - app:srcCompat="@drawable/caffeine" /> - </android.support.constraint.ConstraintLayout> </FrameLayout> diff --git a/app/src/main/res/layout/update_light_bright.xml b/app/src/main/res/layout/act_update_light_bright.xml similarity index 89% rename from app/src/main/res/layout/update_light_bright.xml rename to app/src/main/res/layout/act_update_light_bright.xml index ed1fae741e02cb804e912aadf26f4a1c1a646974..b5de58b8e6ffbce9f5ab62ee8d61d66bafce90f3 100644 --- a/app/src/main/res/layout/update_light_bright.xml +++ b/app/src/main/res/layout/act_update_light_bright.xml @@ -184,7 +184,7 @@ android:layout_height="46dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="4dp" + android:layout_marginTop="8dp" android:clickable="false" android:cursorVisible="false" android:ems="10" @@ -194,8 +194,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -299,25 +347,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/glassesGroup" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <RadioGroup android:id="@+id/appGroup" android:layout_width="match_parent" @@ -354,21 +383,9 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView15" /> - - <ImageView - android:id="@+id/imageView15" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/sunlightGroup" /> diff --git a/app/src/main/res/layout/update_light_glasses.xml b/app/src/main/res/layout/act_update_light_glasses.xml similarity index 88% rename from app/src/main/res/layout/update_light_glasses.xml rename to app/src/main/res/layout/act_update_light_glasses.xml index 18922c484bce0316ef75b4a99270c2ae806695a0..c132578c5dc8dd0d80fb6f18ab38c9d2c276dad7 100644 --- a/app/src/main/res/layout/update_light_glasses.xml +++ b/app/src/main/res/layout/act_update_light_glasses.xml @@ -164,8 +164,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -248,24 +296,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/appGroup" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <RadioGroup android:id="@+id/appGroup" android:layout_width="match_parent" @@ -305,17 +335,6 @@ android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView16" /> - - <ImageView - android:id="@+id/imageView16" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/glassesGroup" /> diff --git a/app/src/main/res/layout/update_light_turnoffs.xml b/app/src/main/res/layout/act_update_light_turnoffs.xml similarity index 88% rename from app/src/main/res/layout/update_light_turnoffs.xml rename to app/src/main/res/layout/act_update_light_turnoffs.xml index c7a47b2b18e1ecf3e05fe306a05aff58c5f60087..c239c591f18eb133151d6af1918cced14aaa27e6 100644 --- a/app/src/main/res/layout/update_light_turnoffs.xml +++ b/app/src/main/res/layout/act_update_light_turnoffs.xml @@ -185,8 +185,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -248,24 +296,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <RadioGroup android:id="@+id/activityGroup" android:layout_width="match_parent" @@ -302,21 +332,9 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView17" /> - - <ImageView - android:id="@+id/imageView17" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/activityGroup" /> diff --git a/app/src/main/res/layout/update_schedule_midnight.xml b/app/src/main/res/layout/act_update_schedule_midnight.xml similarity index 84% rename from app/src/main/res/layout/update_schedule_midnight.xml rename to app/src/main/res/layout/act_update_schedule_midnight.xml index f0a1014568ad1d7809e5fe7862232fa10898ba40..9d32c4a8bdca1ded7083d96d4aeb4a9dd64ab172 100644 --- a/app/src/main/res/layout/update_schedule_midnight.xml +++ b/app/src/main/res/layout/act_update_schedule_midnight.xml @@ -121,7 +121,7 @@ <EditText android:id="@+id/loggngTitle" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="47dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" @@ -134,8 +134,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <TimePicker android:id="@+id/whenSleep" @@ -210,48 +258,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <Button android:id="@+id/submitUpdate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView18" /> - - <ImageView - android:id="@+id/imageView18" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/whenSleep" - app:srcCompat="@drawable/sleeep_clock" /> + app:layout_constraintTop_toBottomOf="@+id/whenSleep" /> </android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout/update_schedule_relax.xml b/app/src/main/res/layout/act_update_schedule_relax.xml similarity index 89% rename from app/src/main/res/layout/update_schedule_relax.xml rename to app/src/main/res/layout/act_update_schedule_relax.xml index d09a4f30cc19b53381fedc63b18fea0ac2ccc75e..b6d548d2d879e1deec1871d2bbce845f312d9423 100644 --- a/app/src/main/res/layout/update_schedule_relax.xml +++ b/app/src/main/res/layout/act_update_schedule_relax.xml @@ -175,7 +175,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="12dp" + android:layout_marginTop="8dp" android:clickable="false" android:cursorVisible="false" android:ems="10" @@ -185,8 +185,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -247,24 +295,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <RadioGroup android:id="@+id/activityGroup" android:layout_width="match_parent" @@ -328,21 +358,9 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView19" /> - - <ImageView - android:id="@+id/imageView19" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/activityGroup" /> diff --git a/app/src/main/res/layout/update_schedule_sametime.xml b/app/src/main/res/layout/act_update_schedule_sametime.xml similarity index 86% rename from app/src/main/res/layout/update_schedule_sametime.xml rename to app/src/main/res/layout/act_update_schedule_sametime.xml index 764aa6b2b1cfc66a5bddc8cd53c4884b9a707588..73db77aa080ea3dc6caf680e0bc8966b3f2daeaf 100644 --- a/app/src/main/res/layout/update_schedule_sametime.xml +++ b/app/src/main/res/layout/act_update_schedule_sametime.xml @@ -145,7 +145,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="4dp" + android:layout_marginTop="8dp" android:clickable="false" android:cursorVisible="false" android:ems="10" @@ -155,8 +155,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -217,36 +265,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <Button android:id="@+id/submitUpdate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView20" /> + app:layout_constraintTop_toBottomOf="@+id/whenSleep" /> <TimePicker android:id="@+id/lastDrink" @@ -272,17 +300,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/appGroup" /> - <ImageView - android:id="@+id/imageView20" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/whenSleep" /> - </android.support.constraint.ConstraintLayout> </FrameLayout> diff --git a/app/src/main/res/layout/update_schedule_seven.xml b/app/src/main/res/layout/act_update_schedule_seven.xml similarity index 86% rename from app/src/main/res/layout/update_schedule_seven.xml rename to app/src/main/res/layout/act_update_schedule_seven.xml index 3ba776332b971a6b1bab11e6f87d09fb96922f49..bc32c02ce860fa0fe24eddcdd4faf4530f3fcb00 100644 --- a/app/src/main/res/layout/update_schedule_seven.xml +++ b/app/src/main/res/layout/act_update_schedule_seven.xml @@ -155,8 +155,56 @@ android:inputType="textPersonName" android:text="@string/logging" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/radioGroup2" /> + + <RadioGroup + android:id="@+id/radioGroup2" + android:layout_width="327dp" + android:layout_height="128dp" + android:layout_marginEnd="8dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout9" /> + app:layout_constraintTop_toBottomOf="@+id/questionDay"> + + <RadioButton + android:id="@+id/radioButton52" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op1.6" /> + + <RadioButton + android:id="@+id/radioButton51" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op2.6" /> + + <RadioButton + android:id="@+id/radioButton53" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op3.6" /> + + <RadioButton + android:id="@+id/radioButton54" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op4.6" /> + + <RadioButton + android:id="@+id/radioButton55" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/op5.6" /> + </RadioGroup> <EditText android:id="@+id/dayReview" @@ -218,36 +266,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loggngTitle" /> - <RelativeLayout - android:id="@+id/relativeLayout9" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionDay"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/dayReviewBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - <Button android:id="@+id/submitUpdate" android:layout_width="wrap_content" android:layout_height="44dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/nextButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView21" /> + app:layout_constraintTop_toBottomOf="@+id/whenSleep" /> <TimePicker android:id="@+id/lastDrink" @@ -273,17 +301,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/appGroup" /> - <ImageView - android:id="@+id/imageView21" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/whenSleep" /> - </android.support.constraint.ConstraintLayout> </FrameLayout> diff --git a/app/src/main/res/layout/what_experiments.xml b/app/src/main/res/layout/act_what_experiments.xml similarity index 97% rename from app/src/main/res/layout/what_experiments.xml rename to app/src/main/res/layout/act_what_experiments.xml index 47c3d59d88c085db3bf9e113694ab2595d34de16..f8fd64a576acf818a72e8979069d4b2c06c726b9 100644 --- a/app/src/main/res/layout/what_experiments.xml +++ b/app/src/main/res/layout/act_what_experiments.xml @@ -132,16 +132,12 @@ android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="8dp" android:text="@string/backButton" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/textView5" - app:layout_constraintVertical_bias="0.457" /> + app:layout_constraintTop_toBottomOf="@+id/textView5" /> <TextView android:id="@+id/textView7" diff --git a/app/src/main/res/layout/what_is_sleep.xml b/app/src/main/res/layout/act_what_is_sleep.xml similarity index 99% rename from app/src/main/res/layout/what_is_sleep.xml rename to app/src/main/res/layout/act_what_is_sleep.xml index 49bbc20fffd3d9d802421e65b0cc753ac08d34d6..156d0822906786e67cf85f1bf3a25135dc773abf 100644 --- a/app/src/main/res/layout/what_is_sleep.xml +++ b/app/src/main/res/layout/act_what_is_sleep.xml @@ -196,7 +196,6 @@ android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" - android:layout_marginTop="28dp" android:text="@string/backButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/activity_second_page.xml b/app/src/main/res/layout/activity_second_page.xml deleted file mode 100644 index ba7158b85a63ce9c4b85906c53948595f4fc7508..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_second_page.xml +++ /dev/null @@ -1,241 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage"> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="401dp"> - - <RelativeLayout - android:id="@+id/nightTerrorsLay" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/nightTerrorsUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/nightTerrorsBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/wakeUpPerNightUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/timesPerNightBar" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - </RelativeLayout> - - <EditText - android:id="@+id/light" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/nocturnalTitle" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <EditText - android:id="@+id/wakeUpPerNightUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/timesWakingUp" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/light" /> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:text="@string/nextButton" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - - <EditText - android:id="@+id/nightTerrorsUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:singleLine="false" - android:text="@string/nightTerrorUsually" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout" /> - - <ImageView - android:id="@+id/imageView6" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.502" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/nightTerrorsLay" - app:srcCompat="@drawable/night_emoticon" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/questionnaireHelp" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_second_page_four.xml b/app/src/main/res/layout/activity_second_page_four.xml deleted file mode 100644 index f63e58cc489b637e673013dc7c19c90f8c4c314a..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_second_page_four.xml +++ /dev/null @@ -1,326 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage"> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="622dp" - tools:layout_editor_absoluteX="8dp" - tools:layout_editor_absoluteY="0dp"> - - <EditText - android:id="@+id/yourName2" - android:layout_width="284dp" - android:layout_height="59dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@drawable/text_input_border" - android:hint="@string/firstNoteHint" - android:inputType="" - android:textSize="12sp" - android:textStyle="italic" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/textView8" /> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="2dp" - android:text="@string/submitUpdate" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/yourName2" /> - - - <EditText - android:id="@+id/actions" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="940dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/actions" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/concentrateUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/concentrateUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/actions" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/cordinateUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/coordinateUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout13" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/apetiteUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/apetiteUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout14" - app:layout_constraintVertical_bias="0.0" /> - - <RelativeLayout - android:id="@+id/relativeLayout13" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/concentrateUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/concentrateBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout14" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/cordinateUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/coordinateBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout7" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/apetiteUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/apetiteBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <ImageView - android:id="@+id/imageView9" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout7" /> - - <TextView - android:id="@+id/textView8" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="12dp" - android:text="@string/comments" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView9" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/questionnaireHelp" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_second_page_three.xml b/app/src/main/res/layout/activity_second_page_three.xml deleted file mode 100644 index 6c31df16e02d78a60a1578957fbd129f53caf6bc..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_second_page_three.xml +++ /dev/null @@ -1,377 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage"> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="601dp"> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginBottom="28dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:text="@string/nextButton" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - - - <EditText - android:id="@+id/mood" - android:layout_width="match_parent" - android:layout_height="43dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/mood" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.538" - app:layout_constraintStart_toStartOf="parent" - tools:layout_editor_absoluteY="3dp" /> - - <EditText - android:id="@+id/sadUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="1008dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/sadUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/mood" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/sleepyUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="488dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/sleepyUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout6" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/tiredUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="332dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/tiredUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout8" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/stressUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="340dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/stressUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout10" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/irritableUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="328dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/irritableUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout11" - app:layout_constraintVertical_bias="0.0" /> - - <RelativeLayout - android:id="@+id/relativeLayout6" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sadUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/sadBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout8" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sleepyUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/sleepyBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout10" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tiredUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/tiredBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout11" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/stressUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/stressedBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout12" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/irritableUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/irritableBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <ImageView - android:id="@+id/imageView8" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout12" - app:srcCompat="@drawable/mood_dice" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/questionnaireHelp" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/app_bar_menu.xml b/app/src/main/res/layout/extra_bar_Main.xml similarity index 95% rename from app/src/main/res/layout/app_bar_menu.xml rename to app/src/main/res/layout/extra_bar_Main.xml index 3abba456a408f0e3b063bca122c12b99dd699faf..6d2240c0074adf20c3311c41cf856028475c30f8 100644 --- a/app/src/main/res/layout/app_bar_menu.xml +++ b/app/src/main/res/layout/extra_bar_Main.xml @@ -20,6 +20,6 @@ </android.support.design.widget.AppBarLayout> - <include layout="@layout/content_menu" /> + <include layout="@layout/act_Main_Menu" /> </android.support.design.widget.CoordinatorLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/cal_item.xml b/app/src/main/res/layout/extra_cal_Item.xml similarity index 100% rename from app/src/main/res/layout/cal_item.xml rename to app/src/main/res/layout/extra_cal_Item.xml diff --git a/app/src/main/res/layout/dialog_inform.xml b/app/src/main/res/layout/extra_dialog_inform.xml similarity index 100% rename from app/src/main/res/layout/dialog_inform.xml rename to app/src/main/res/layout/extra_dialog_inform.xml diff --git a/app/src/main/res/layout/nav_header_menu.xml b/app/src/main/res/layout/extra_nav_header_menu.xml similarity index 100% rename from app/src/main/res/layout/nav_header_menu.xml rename to app/src/main/res/layout/extra_nav_header_menu.xml diff --git a/app/src/main/res/layout/row_addapt.xml b/app/src/main/res/layout/extra_row_addapt.xml similarity index 100% rename from app/src/main/res/layout/row_addapt.xml rename to app/src/main/res/layout/extra_row_addapt.xml diff --git a/app/src/main/res/layout/questionnaire.xml b/app/src/main/res/layout/questionnaire.xml deleted file mode 100644 index f8387c0a6f6eecfdccf6af02bf0d03bd07b97f55..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/questionnaire.xml +++ /dev/null @@ -1,242 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage" - android:background="#FFF"> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="401dp"> - - <RelativeLayout - android:id="@+id/nightTerrorsLay" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/nightTerrorsUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/nightTerrorsBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/wakeUpPerNightUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/timesPerNightBar" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - </RelativeLayout> - - <EditText - android:id="@+id/light" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/nocturnalTitle" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <EditText - android:id="@+id/wakeUpPerNightUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offtimesWakingUp" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/light" /> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginBottom="16dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:text="@string/nextButton" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - - <EditText - android:id="@+id/nightTerrorsUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:singleLine="false" - android:inputType="textMultiLine" - android:text="@string/offnightTerrorUsually" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout" /> - - <ImageView - android:id="@+id/imageView6" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.502" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/nightTerrorsLay" - app:srcCompat="@drawable/night_emoticon" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/offquestionnaireHelp" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/questionnaire_four.xml b/app/src/main/res/layout/questionnaire_four.xml deleted file mode 100644 index 819bf0900e457ea108f72650715dbdef40043a5e..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/questionnaire_four.xml +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage" - android:background="#FFF"> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="592dp" - tools:layout_editor_absoluteX="8dp" - tools:layout_editor_absoluteY="0dp"> - - <EditText - android:id="@+id/yourName2" - android:layout_width="284dp" - android:layout_height="59dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@drawable/text_input_border" - android:hint="@string/yourNote" - android:inputType="" - android:textSize="12sp" - android:textStyle="italic" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/textView8" /> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginBottom="16dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="2dp" - android:text="@string/submitUpdate" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - - - <EditText - android:id="@+id/actions" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="940dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/actions" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/concentrateUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offconcentrateUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/actions" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/cordinateUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offcoordinateUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout13" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/apetiteUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offapetiteUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout14" - app:layout_constraintVertical_bias="0.0" /> - - <RelativeLayout - android:id="@+id/relativeLayout13" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/concentrateUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/concentrateBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout14" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/cordinateUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/coordinateBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout7" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/apetiteUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/apetiteBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <ImageView - android:id="@+id/imageView9" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout7" - app:srcCompat="@drawable/actions" /> - - <TextView - android:id="@+id/textView8" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="12dp" - android:text="@string/comments" - android:textColor="@android:color/black" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView9" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/offquestionnaireHelp" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/questionnaire_three.xml b/app/src/main/res/layout/questionnaire_three.xml deleted file mode 100644 index d768ea776ad4627bbecc49ca17fffc9d1bb7a01c..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/questionnaire_three.xml +++ /dev/null @@ -1,379 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage" - android:background="#FFF"> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="601dp"> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginBottom="16dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:text="@string/nextButton" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" /> - - - <EditText - android:id="@+id/mood" - android:layout_width="match_parent" - android:layout_height="43dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="3dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/mood" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.538" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <EditText - android:id="@+id/sadUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="1008dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offsadUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/mood" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/sleepyUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="488dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offsleepyUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout6" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/tiredUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="332dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offtiredUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout8" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/stressUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="340dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offstressUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout10" - app:layout_constraintVertical_bias="0.0" /> - - <EditText - android:id="@+id/irritableUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="328dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offirritableUsually" - android:textSize="12sp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout11" - app:layout_constraintVertical_bias="0.0" /> - - <RelativeLayout - android:id="@+id/relativeLayout6" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sadUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/sadBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout8" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/sleepyUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/sleepyBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout10" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tiredUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/tiredBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout11" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/stressUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/stressedBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout12" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/irritableUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/irritableBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <ImageView - android:id="@+id/imageView8" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout12" - app:srcCompat="@drawable/mood_dice" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/offquestionnaireHelp" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/questionnaire_two.xml b/app/src/main/res/layout/questionnaire_two.xml deleted file mode 100644 index 3045a02b8352f73b18be9d8a13fb29ebfb309119..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/questionnaire_two.xml +++ /dev/null @@ -1,285 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".SecondPage" - android:background="#FFF"> - - <View - android:id="@+id/topView" - android:layout_width="match_parent" - android:layout_height="75dp" - android:background="@color/LightSteelBlue" - tools:ignore="MissingConstraints" - tools:layout_editor_absoluteX="0dp" - tools:layout_editor_absoluteY="0dp" /> - - <TextView - android:id="@+id/questionnaireTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/questionnaireTitle" - android:textAllCaps="false" - android:textColor="@android:color/black" - android:textSize="30sp" - android:textStyle="bold" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toStartOf="@+id/logoPlace" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:layout_constraintVertical_bias="0.444" - tools:ignore="RtlHardcoded" /> - - <ImageView - android:id="@+id/logoPlace" - android:layout_width="91dp" - android:layout_height="81dp" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginTop="8dp" - android:contentDescription="@string/desc" - app:layout_constraintBottom_toBottomOf="@+id/topView" - app:layout_constraintEnd_toEndOf="@+id/topView" - app:layout_constraintTop_toTopOf="@+id/topView" - app:srcCompat="@drawable/pill" - tools:ignore="RtlHardcoded" /> - - <ScrollView - android:id="@+id/ScrollViewQuestionnaire" - style="@android:style/Widget.Material.ScrollView" - android:layout_width="match_parent" - android:layout_height="424dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:fillViewport="true" - android:scrollbarStyle="insideOverlay" - android:visibility="visible" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.454" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/questionnaireUsuallyIntro" - tools:targetApi="lollipop"> - - <FrameLayout - android:id="@+id/FrameForScrollView" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintStart_toStartOf="@+id/ScrollViewQuestionnaire" - app:layout_constraintTop_toTopOf="@+id/ScrollViewQuestionnaire"> - - <android.support.constraint.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="557dp" - tools:layout_editor_absoluteX="8dp" - tools:layout_editor_absoluteY="0dp"> - - <EditText - android:id="@+id/firstSet" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textPersonName" - android:text="@string/beforeAfter" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <Button - android:id="@+id/submitButton" - android:layout_width="102dp" - android:layout_height="43dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:text="@string/nextButton" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/imageView7" /> - - - <EditText - android:id="@+id/fallAsleepUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offfallAsleepUsually" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/firstSet" /> - - <EditText - android:id="@+id/wakeUpUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offwakeUpUsually" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout2" /> - - <EditText - android:id="@+id/freshUsually" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="textMultiLine" - android:text="@string/offfreshUsually" - android:textSize="12sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.428" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout3" /> - - <RelativeLayout - android:id="@+id/relativeLayout2" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/fallAsleepUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/fallAsleepBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentStart="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout3" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/wakeUpUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/easyWakeUpBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" /> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/relativeLayout4" - android:layout_width="match_parent" - android:layout_height="35dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/freshUsually"> - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/freshBar" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentStart="true" /> - </RelativeLayout> - - <ImageView - android:id="@+id/imageView7" - android:layout_width="133dp" - android:layout_height="133dp" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.502" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/relativeLayout4" - app:srcCompat="@drawable/day_and_night" /> - - - </android.support.constraint.ConstraintLayout> - </FrameLayout> - </ScrollView> - - <EditText - android:id="@+id/questionnaireUsuallyIntro" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:background="@android:color/transparent" - android:clickable="false" - android:cursorVisible="false" - android:ems="10" - android:focusable="false" - android:focusableInTouchMode="false" - android:hint="@string/some_explanation_about_the_input" - android:inputType="" - android:singleLine="false" - android:text="@string/questionnaireUsuallyHelpSecond" - android:textSize="14sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/topView" /> - - -</android.support.constraint.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/seekbar.xml b/app/src/main/res/layout/seekbar.xml deleted file mode 100644 index 766e8c5a995048d69acee4eb9169edb9dff3371c..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/seekbar.xml +++ /dev/null @@ -1,17 +0,0 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingBottom="@dimen/activity_vertical_margin" - android:paddingLeft="@dimen/activity_horizontal_margin" - android:paddingRight="@dimen/activity_horizontal_margin" - android:paddingTop="@dimen/activity_vertical_margin" - tools:context=".Seek" > - - <com.example.admin.sleepbetter.SeekBarWithIntervals - android:id="@+id/seekbarWithIntervals" - android:layout_width="match_parent" - android:layout_height="41dp" - android:layout_centerInParent="true"></com.example.admin.sleepbetter.SeekBarWithIntervals> - -</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/seekbar_with_intervals.xml b/app/src/main/res/layout/seekbar_with_intervals.xml deleted file mode 100644 index 423322e9e141c9473900d4afa66ea8a9e542ada5..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/seekbar_with_intervals.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="horizontal"> - - <RelativeLayout - android:id="@+id/intervals" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"/> - - <SeekBar - android:id="@+id/seekbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/intervals" /> -</RelativeLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/seekbar_with_intervals_label.xml b/app/src/main/res/layout/seekbar_with_intervals_label.xml deleted file mode 100644 index 1cda707c280567ec018c9fff0ab28c7e95a366c2..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/seekbar_with_intervals_label.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/textViewInterval" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 81effb246e3f214a22b9f597affcfa18241b83e4..80235d0486d0b26a585950298a9cb9f47f2501e3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -29,6 +29,44 @@ <string name="notice">The next set of questions you will receive aim to assess your sleeping experience before using the SleepBetter app, in order to be able to record your progress. There are 9 questions which should approximately take 1 or 2 minutes max.</string> + <string name="op1">0-15 min</string> + <string name="op1.1">I don\'t wake up too early/Up to 15 min</string> + <string name="op2">16-30 min</string> + <string name="op3">31-45 min</string> + <string name="op4">46-60 min</string> + <string name="op5">>60 min</string> + + <string name="op1.2">0-1</string> + <string name="op2.2">2</string> + <string name="op3.2">3</string> + <string name="op4.2">4</string> + <string name="op5.2">5/more</string> + + <string name="op1.3">Very good</string> + <string name="op2.3">Good</string> + <string name="op3.3">Average</string> + <string name="op4.3">Poor</string> + <string name="op5.3">Very poor</string> + + + <string name="op1.4">Not at all</string> + <string name="op2.4">A little</string> + <string name="op3.4">Somewhat</string> + <string name="op4.4">Much</string> + <string name="op5.4">Very much</string> + + <string name="op1.5">I don\'t have a problem/less than 1 month</string> + <string name="op2.5">1-2 months</string> + <string name="op3.5">3-6 months</string> + <string name="op4.5">7-12 months</string> + <string name="op5.5">>1 year</string> + + + <string name="op1.6">A lot worse</string> + <string name="op2.6">Worse</string> + <string name="op3.6">The same</string> + <string name="op4.6">Better</string> + <string name="op5.6">A lot better</string> <string name="questionnaireTitle">QUESTIONNAIRE</string> @@ -36,8 +74,8 @@ <string name="s1">How long does it usually take you to fall asleep?</string> <string name="s2">Usually if you wake up one or more times during the night, how long are you awake in total?</string> <string name="s3">If your final wake-up time occurs before you intend to wake up, how much earlier is this?</string> - <string name="q2desc">This set of questions efer to your sleep quality in general. Please choose the most appropriate answer.</string> - <string name="s4"> If your final wake-up time occurs before you intend to wake up, how much earlier is this?</string> + <string name="q2desc">This set of questions refer to your sleep quality in general. Please choose the most appropriate answer.</string> + <string name="s4">How many nights a week do you have a problem with your sleep?</string> <string name="s5">How would you rate your sleep quality?</string> <string name="q3desc">This set of questions refer to the impact your sleeping pattern usually has on your daily activities and your life in general. Please choose the most appropriate answer.</string> <string name="s6">How do you think sleep impacted your mood, energy, or relationships?</string> @@ -46,6 +84,14 @@ <string name="q4desc">This set of questions aim to asses the severity of your sleep problems (if any). Please choose the most appropriate answer.</string> <string name="s9">How long have you had a problem with your sleep?</string> + <string name="s1.1">How long did it take you to fall asleep last night?</string> + <string name="s2.1">If you woke up one or more times during last night, how long are you awake in total?</string> + <string name="s3.1">If your final wake-up time occurred before you intended to wake up, how much earlier was this?</string> + <string name="s5.1">How would you rate the quality of last night\'s sleep?</string> + <string name="s6.1">How do you think last night\'s sleep impacted your mood, energy, or relationships?</string> + <string name="s7.1">How do you think last night\'s sleep impacted your concentration, productivity, or ability to stay awake?</string> + <string name="s8.1">How do you think last night\'s sleep impacted your life in general?</string> + <string name="questionnaireHelp">First, how would you rate the following aspects of your sleep and daily experience? 1 represents the lowest and 5 the highest.</string> <string name="questionnaireHelpSecond">For the question \"How quickly do you usually fall asleep?\", please bare in mind that 1 means \"as soon as getting into bed\", 2 is \"within 20 minutes\", 3 is \"up to one hour\", 4 is \"1/1.30 hours\" and 5 is \"more than that\". Also, for the \"How easily do you usually wake up?\", notice that 1 means \"waking up with no alarm\", 2 is \"using the alarm only sometimes\", 3 is \"using the alarm but I get up easily\", 4 is \"using the snooze button once\", 5 is \"using the snooze button more than once\".</string> @@ -102,13 +148,13 @@ <string name="pleaseInputGoal">Please input either a goal, a wish, or any note. You can return to this section later.</string> <string name="goalInput">Goal Diary input...</string> <string-array name="targetGraph"> - <item>Times waking up per night</item> - <item>Night terrors</item> <item>Falling asleep</item> - <item>Waking up</item> - <item>Fresh</item> - <item>Sad</item> - <item>Sleepy</item> + <item>Awake at night</item> + <item>Waking up earlier</item> + <item>Sleep quality</item> + <item>Impacting feelings</item> + <item>Impacting activities</item> + <item>Impacting life</item> <item>Tired</item> <item>Stressed</item> <item>Irritable</item> @@ -118,23 +164,17 @@ </string-array> <string name="currentStatus">Current Status</string> <string name="goalStatus">Goal Status</string> - <string name="youNeedToWorkOn">You need to work on:</string> + <string name="youNeedToWorkOn">Fields that can be improved:</string> <string name="thingsToChange">Edit</string> <string name="svdyourOverall">Overall mood: edit</string> - <string name="svdTimes">Times waking up: edit</string> - <string name="svdnightTerrors">Night terrors: edit</string> - <string name="svdfallAsleep">Falling asleep: edit</string> - <string name="svdwakeUp">Waking up: edit</string> - <string name="svdFresh">Fresh: edit</string> - <string name="svdSad">Sad: edit</string> - <string name="svdSleepy">Sleepy: edit</string> - <string name="svdTired">Tired: edit</string> - <string name="svdStressed">Stressed: edit</string> - <string name="svdIrritable">Irritable: edit</string> - <string name="svdConcenrate">Concentration: edit</string> - <string name="svdCoordinate">Coordination: edit</string> - <string name="svdAppetite">Appetite: edit</string> + <string name="svdHowLong">How log it takes to fall asleep: edit</string> + <string name="svdAwake">How long you are awake during the night: edit</string> + <string name="svdEarlier">How much earlier you wake up than your normal time: edit</string> + <string name="svdQuality">Sleep Quality: edit</string> + <string name="svdImpactMood">Affecting mood, energy, or relationships: edit</string> + <string name="svdImpactActivities">Affecting concentration, productivity, or ability to stay awake: edit</string> + <string name="svdImpactGeneral">Affecting life in general: edit</string> <string name="svdExperiment">Experiment: edit</string> <string name="main">MAIN</string> @@ -223,13 +263,13 @@ <string name="goalDiaryIntro">Welcome to your Goal Diary! Here you will able to note any particular changes you want to reflect on/any goals you wish to accomplice and any other observations. You can also see previous notes.</string> - <string name="previousGoals">Previous notes</string> + <string name="previousGoals">Today\'s notes</string> <string name="moreInfo">More Information</string> <string name="dataTitle">DATA</string> - <string name="dataIntro">Here you will be able to look at personal data in terms of progress, changes, variations and so on! Below you will find 3 categories of data visualisation:\nSingle value displays - looking at your current state;\nProgress - where you will be able to see your current state on the way to your goal;\nTimelines - looking at your progress through 3 different types of graphs. </string> - <string name="progressTitle">Progress</string> + <string name="dataIntro">Here you will be able to look at personal data in terms of progress, changes, variations and so on!\nSingle value displays - looking at your current state;\nImprovements - where you will be able to see what fields could be improved;\nTimelines - looking at your progress through 3 different types of graphs. </string> + <string name="progressTitle">Improvements</string> <string name="timelineTitle">Timelines</string> <string name="singleValueDisplayTitle">Single Value Display</string> <string name="chooseTitle">Choose a timeline target!</string> @@ -315,7 +355,6 @@ <string name="sleepHygienetitle">Sleep Hygiene?</string> - <string name="wannachatTitle">Wanna chat?</string> <string name="tuningTitle">Tuning - a process that works for you</string> <string name="tuning">What these sleep experiments are for, is to test the options that might work best for you to sleep better. You already sleep every day so you already have lots of practice sleeping - the goal in these experiments is to help you dial in ways that will help you sleep better.</string> @@ -342,7 +381,7 @@ To begin with, complete the consent form, input your name (that only YOU will be <string name="loggingExp">At the end of each day, you will be required to complete 2 short questionnaires (2-3 minutes in total) that would look at both how you approached the experiment in that day AND what is the outcome. The experiment logging asks you to rate whether you feel better/worse than yesterday, but also to answer a short series of questions on how you approached the chosen experiment (1-3 questions).</string> <string name="featuresTitle">Other Features</string> - <string name="features">By easily navigating through the Sleep Better menu you can access each category that helps you explore your self-experimentation.\n \n FACTORS helps you choose you preffered experiment, at every 5 days.\n \n GOAL DIARY keeps track of every note you save regarding your experience. You are free to add whatever observation you might have at anytme. \n \n DATA gives you insights on how your well-being changed for the duration of the experiments - you can look at graphs, progress bars and current states. \n \n QUESTIONNAIRE will only be able to be accessed at the end of each day, when you will be asked to log in your status. \n \n CALENDAR will look on your progress throughout the experiment, where colors suggest your overall well-being for the day. You are also able to look at the status of that day by clicking on it. \n \n HELP represents the Chatbot, that can help you by answering short questions about the experiments, the terms we are using and any other curiosity - check the Chatbot Guide on the first page.</string> + <string name="features">By easily navigating through the Sleep Better menu you can access each category that helps you explore your self-experimentation.\n \n FACTORS helps you choose you preffered experiment, at every 5 days.\n \n GOAL DIARY keeps track of every note you save regarding your experience. You are free to add whatever observation you might have at anytme. \n \n DATA gives you insights on how your well-being changed for the duration of the experiments - you can look at graphs, progress bars and current states. \n \n QUESTIONNAIRE will only be able to be accessed at the end of each day, when you will be asked to log in your status. \n \n CALENDAR will look on your progress throughout the experiment. You are also able to look at the status of that day by clicking on it.</string> <string name="chatbotGuide">CHATBOT GUIDE</string>