Skip to content
Snippets Groups Projects
Commit 47ababed authored by ect1u17's avatar ect1u17
Browse files

Initial commit

parent 243f7695
No related branches found
No related tags found
No related merge requests found
Showing
with 1576 additions and 318 deletions
......@@ -21,10 +21,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
}
......@@ -3,9 +3,12 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.yearthreeproject.xbframework">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@raw/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
......@@ -37,7 +40,7 @@
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".ExperimentsListActivity"
android:name=".ExperimentActivity"
android:label="Experiment"
android:theme="@style/AppTheme.NoActionBar"/>
......@@ -51,6 +54,19 @@
android:label="Progress"
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".NewBox"
android:label="NewBox"
android:theme="@style/AppTheme.NoActionBar"/>
<activity
android:name=".ExperimentSurveyCreatorActivity"
android:label="ExperimentSurveyCreator"
android:theme="@style/AppTheme.NoActionBar"/>
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
android:theme="@style/Base.Theme.AppCompat"/>
</application>
</manifest>
\ No newline at end of file
app/src/main/ic_launcher-web.png

26.9 KiB

......@@ -10,19 +10,22 @@ import androidx.appcompat.widget.Toolbar;
public class AboutActivity extends AppCompatActivity {
private Button homeButton;
private Toolbar myToolbar;
private Button backHomeButton;
private Toolbar toolbar;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
myToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
homeButton=(Button) findViewById(R.id.backHomeAbout);
homeButton.setOnClickListener(new View.OnClickListener(){
backHomeButton = (Button) findViewById(R.id.AboutBackHomeButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
......
package com.yearthreeproject.xbframework;
import android.app.ActionBar;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
......@@ -26,22 +25,18 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import static android.util.Log.d;
public class BoxesActivity extends AppCompatActivity {
private Toolbar myToolbar;
private Button backHome;
private Toolbar toolbar;
private Button backHomeButton;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuItem item = menu.add("Testing");
item.setTitle("Testing!");
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
MenuItem createBox = menu.add("Create New Box!");
createBox.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
// do stuff
d("Menu", (String) item.getTitle());
startActivity(new Intent(BoxesActivity.this, NewBox.class));
return false;
}
});
......@@ -53,16 +48,19 @@ public class BoxesActivity extends AppCompatActivity {
// Ordinary setup of UI for general app purposes
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_boxes);
myToolbar = findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
LinearLayout grid = findViewById(R.id.experimentsGrid);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
LinearLayout inFiveLayout = findViewById(R.id.BoxesInFiveLayout);
// JSON loading from local directory, could be implemented to stream from online
InputStream inputStream = getResources().openRawResource(R.raw.box);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
final JSONArray MEECS;
JSONArray boxes = new JSONArray();
final String[] inFive = {"Move", "Eat", "Engage", "Cogitate", "Sleep"};
int ctr;
// Try, in order to avoid errors in compilation and catastrophic errors
......@@ -75,69 +73,72 @@ public class BoxesActivity extends AppCompatActivity {
}
inputStream.close();
// Full loading of json array with each data item included
MEECS = new JSONArray(byteArrayOutputStream.toString());
boxes = new JSONArray(byteArrayOutputStream.toString());
LinearLayout[] meecsHolder = new LinearLayout[5];
LinearLayout[] inFiveLayoutArray = new LinearLayout[5];
LinearLayout[] layoutHolder = new LinearLayout[MEECS.length()];
LinearLayout[] inFiveAvailableBoxes = new LinearLayout[boxes.length()];
for(int i = 0; i < MEECS.length(); i++){
final JSONArray boxes = MEECS.getJSONObject(i).getJSONArray("Box");
meecsHolder[i] = new LinearLayout(this);
TextView groupTitle = new TextView(this);
for (int i = 0; i < inFive.length; i++) {
inFiveLayoutArray[i] = new LinearLayout(this);
groupTitle.setText(MEECS.getJSONObject(i).getString("Group"));
groupTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 36);
groupTitle.setPadding(0,8,0,0);
TextView inFiveTitle = new TextView(this);
meecsHolder[i].setOrientation(LinearLayout.VERTICAL);
meecsHolder[i].addView(groupTitle);
inFiveTitle.setText(inFive[i]);
inFiveTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 36);
inFiveTitle.setPadding(0, 8, 0, 0);
inFiveLayoutArray[i].setOrientation(LinearLayout.VERTICAL);
inFiveLayoutArray[i].addView(inFiveTitle);
View hr = new View(this);
ViewGroup.LayoutParams tempLayout = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 4);
hr.setLayoutParams(tempLayout);
ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 4);
hr.setLayoutParams(hrLayoutParams);
hr.setBackgroundColor(Color.parseColor("#888888"));
meecsHolder[i].addView(hr);
inFiveLayoutArray[i].addView(hr);
for (int j = 0; j < boxes.length(); j++) {
layoutHolder[j] = new LinearLayout(this);
layoutHolder[j].setOrientation(LinearLayout.HORIZONTAL);
layoutHolder[j].setPadding(0, 8, 0, 8);
final JSONObject box = boxes.getJSONObject(j);
if(box.getString("Group").matches(inFive[i])){
inFiveAvailableBoxes[j] = new LinearLayout(this);
inFiveAvailableBoxes[j].setOrientation(LinearLayout.HORIZONTAL);
inFiveAvailableBoxes[j].setPadding(0, 8, 0, 8);
LinearLayout textBox = new LinearLayout(this);
textBox.setOrientation(LinearLayout.VERTICAL);
textBox.setPadding(16, 0, 0, 0);
LinearLayout boxLayout = new LinearLayout(this);
boxLayout.setOrientation(LinearLayout.VERTICAL);
boxLayout.setPadding(16, 0, 0, 0);
TextView titleOfItem = new TextView(this);
titleOfItem.setText(boxes.getJSONObject(j).getString("Name"));
titleOfItem.setTextSize(TypedValue.COMPLEX_UNIT_SP,28);
TextView titleOfBox = new TextView(this);
titleOfBox.setText(box.getString("Name"));
titleOfBox.setTextSize(TypedValue.COMPLEX_UNIT_SP, 28);
TextView descOfItem = new TextView(this);
TextView descriptionOfBox = new TextView(this);
descOfItem.setText(boxes.getJSONObject(j).getString("Locked"));
textBox.addView(titleOfItem);
textBox.addView(descOfItem);
descriptionOfBox.setText(box.getString("Blurb"));
ImageView iV;
if(!boxes.getJSONObject(j).getString("Image").equals("null")) {
iV = new ImageView(this);
iV.setImageResource(R.mipmap.ic_launcher);
layoutHolder[j].addView(iV);
boxLayout.addView(titleOfBox);
boxLayout.addView(descriptionOfBox);
ImageView boxLogo;
if (!box.getString("Image").equals("null")) {
boxLogo = new ImageView(this);
boxLogo.setImageResource(R.mipmap.ic_launcher);
inFiveAvailableBoxes[j].addView(boxLogo);
}
layoutHolder[j].addView(textBox);
inFiveAvailableBoxes[j].addView(boxLayout);
layoutHolder[j].setId(j);
layoutHolder[j].setOnClickListener(new View.OnClickListener() {
inFiveAvailableBoxes[j].setId(j);
inFiveAvailableBoxes[j].setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
boolean locked = boxes.getJSONObject(v.getId()).getBoolean("Locked");
boolean locked = box.getBoolean("Locked");
if (!locked) {
Intent openPage = new Intent(BoxesActivity.this, ExperimentsListActivity.class);
openPage.putExtra("JSON", boxes.getJSONObject(v.getId()).toString());
Intent openPage = new Intent(BoxesActivity.this, ExperimentActivity.class);
openPage.putExtra("JSON", box.toString());
startActivity(openPage);
finish();
}
......@@ -146,9 +147,10 @@ public class BoxesActivity extends AppCompatActivity {
}
}
});
meecsHolder[i].addView(layoutHolder[j]);
inFiveLayoutArray[i].addView(inFiveAvailableBoxes[j]);
}
}
grid.addView(meecsHolder[i]);
inFiveLayout.addView(inFiveLayoutArray[i]);
}
} catch (JSONException e) {
e.printStackTrace();
......@@ -156,14 +158,13 @@ public class BoxesActivity extends AppCompatActivity {
e.printStackTrace();
}
backHome=findViewById(R.id.experimentsBackHome);
backHome.setOnClickListener(new View.OnClickListener(){
backHomeButton = findViewById(R.id.BoxesBackHomeButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
}
}
package com.yearthreeproject.xbframework;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.annotation.Nullable;
......@@ -18,32 +16,33 @@ import androidx.appcompat.widget.Toolbar;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Text;
import java.util.ArrayList;
import java.util.Objects;
import static android.util.Log.d;
public class ExperimentsListActivity extends AppCompatActivity {
public class ExperimentActivity extends AppCompatActivity {
private Toolbar myToolbar;
private Button backHome;
private Button submit;
private Toolbar toolbar;
private Button backHomeButton;
private Button submitButton;
private ArrayList<RadioButton> experimentsRadioButtonArray;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_experiments_list);
myToolbar = findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
d("Launched", "Experiments");
setContentView(R.layout.activity_experiment);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
LinearLayout linLayout = findViewById(R.id.experimentLayout);
LinearLayout experimentInfoLayout = findViewById(R.id.ExperimentInfoLayout);
try {
JSONObject jsonObj = new JSONObject(getIntent().getStringExtra("JSON"));
setTitle(jsonObj.getString("Name"));
JSONObject boxJSON = new JSONObject(getIntent().getStringExtra("JSON"));
setTitle(boxJSON.getString("Name")); // Sets the title of the page (in the toolbar)
/* Description | TextView
* Warning | TextView (Red)
......@@ -53,72 +52,79 @@ public class ExperimentsListActivity extends AppCompatActivity {
* Repeat from experiment group name
*/
TextView description = new TextView(this);
TextView warning = new TextView(this);
TextView boxDescription = new TextView(this);
TextView boxWarning = new TextView(this);
description.setText(jsonObj.getString("Description"));
warning.setText(jsonObj.getString("WarningText"));
warning.setTextColor(Color.parseColor("#f00808"));
boxDescription.setText(boxJSON.getString("Description"));
boxWarning.setText(boxJSON.getString("WarningText"));
boxWarning.setTextColor(Color.parseColor("#f00808"));
linLayout.addView(description);
linLayout.addView(warning);
experimentInfoLayout.addView(boxDescription);
experimentInfoLayout.addView(boxWarning);
JSONArray experimentsJSONArray = boxJSON.getJSONArray("Experiments");
JSONArray experimentsList = jsonObj.getJSONArray("Experiments");
experimentsRadioButtonArray = new ArrayList<RadioButton>();
final ArrayList<RadioButton> rbArray = new ArrayList<RadioButton>();
int radioButtonUniqueId = 0;
int uniqueId = 0;
for( int i = 0; i < experimentsList.length(); i++){
for (int i = 0; i < experimentsJSONArray.length(); i++) {
View hr = new View(this);
ViewGroup.LayoutParams tempLayout = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 4);
hr.setLayoutParams(tempLayout);
ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 4);
hr.setLayoutParams(hrLayoutParams);
hr.setBackgroundColor(Color.parseColor("#888888"));
hr.setPadding(0, 0, 0, 16);
TextView experimentGroupName = new TextView(this);
experimentGroupName.setText(experimentsList.getJSONObject(i).getString("Group"));
experimentGroupName.setText(experimentsJSONArray.getJSONObject(i).getString("Group"));
experimentGroupName.setPadding(0, 8, 0, 8);
linLayout.addView(hr);
linLayout.addView(experimentGroupName);
experimentInfoLayout.addView(hr);
experimentInfoLayout.addView(experimentGroupName);
JSONArray experimentOptions = experimentsList.getJSONObject(i).getJSONArray("Options");
JSONArray experimentChoices = experimentsJSONArray.getJSONObject(i).getJSONArray("Options");
for( int j = 0; j < experimentOptions.length(); j++){
for (int j = 0; j < experimentChoices.length(); j++) {
RadioButton experimentRadioButton = new RadioButton(this);
JSONObject experimentData = experimentChoices.getJSONObject(j);
RadioButton rB = new RadioButton(this);
rB.setId(uniqueId);
rB.setText(experimentOptions.getString(j));
rB.setOnClickListener(new View.OnClickListener(){
experimentRadioButton.setId(radioButtonUniqueId);
experimentRadioButton.setText(experimentData.getString("Title"));
experimentRadioButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
for(int x = 0; x < rbArray.size(); x++){
if(x != v.getId()) rbArray.get(x).setChecked(false);
else rbArray.get(x).setChecked(true);
for (int x = 0; x < experimentsRadioButtonArray.size(); x++) {
if (x != v.getId())
experimentsRadioButtonArray.get(x).setChecked(false);
else experimentsRadioButtonArray.get(x).setChecked(true);
}
}
});
uniqueId += 1;
rbArray.add(rB);
linLayout.addView(rB);
experimentsRadioButtonArray.add(experimentRadioButton);
experimentInfoLayout.addView(experimentRadioButton);
radioButtonUniqueId++;
}
}
} catch (JSONException e) {
e.printStackTrace();
}
submit = findViewById(R.id.experimentSubmit);
submit.setOnClickListener(new View.OnClickListener(){
submitButton = findViewById(R.id.ExperimentSubmitButton);
submitButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
d("Button", "Submit!");
for(int x = 0; x < experimentsRadioButtonArray.size(); x++)
if(experimentsRadioButtonArray.get(x).isChecked()){
d("submit", experimentsRadioButtonArray.get(x).getText().toString());
}
}
});
backHome=findViewById(R.id.experimentsBackHome);
backHome.setOnClickListener(new View.OnClickListener(){
backHomeButton = findViewById(R.id.ExperimentBackHomeButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
......
package com.yearthreeproject.xbframework;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.FileNotFoundException;
import java.io.InputStream;
import static android.util.Log.d;
public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
private Toolbar toolbar;
private Button submitButton, backHomeButton;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_experiment_survey_creator);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(true);
try{
final JSONObject boxInfo = new JSONObject(getIntent().getStringExtra("JSON"));
d("sub, gI", String.valueOf(getIntent().getIntExtra("GroupIndex", 0)));
d("sub, eI", String.valueOf(getIntent().getIntExtra("ExperimentIndex", 0)));
JSONObject groupJSON = boxInfo.getJSONArray("Experiments").getJSONObject(getIntent().getIntExtra("GroupIndex", 0));
JSONArray experimentJSON = groupJSON.getJSONArray("Options");
d("sub, grpLen", String.valueOf(boxInfo.getJSONArray("Experiments").length()));
d("sub, exLen", String.valueOf(experimentJSON.length()));
d("sub, grpJSON", boxInfo.getJSONArray("Experiments").toString());
d("sub, exJSON", boxInfo.getJSONArray("Experiments").getJSONObject(getIntent().getIntExtra("GroupIndex",0)).getJSONArray("Options").getJSONObject(getIntent().getIntExtra("ExperimentIndex", 0)).toString());
submitButton = findViewById(R.id.ExperimentSurveyCreatorSubmitButton);
submitButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
try{
Intent openPage = new Intent(ExperimentSurveyCreatorActivity.this, ExperimentSurveyCreatorActivity.class);
//d("sub", boxInfo.getJSONArray("Experiments").toString());
openPage.putExtra("JSON", getIntent().getStringExtra("JSON"));
JSONObject groupJSON = boxInfo.getJSONArray("Experiments").getJSONObject(getIntent().getIntExtra("GroupIndex", 0));
JSONArray experimentJSON = groupJSON.getJSONArray("Options");
if(getIntent().getIntExtra("ExperimentIndex", 0)+1 >= experimentJSON.length()){
openPage.putExtra("ExperimentIndex", 0);
if(getIntent().getIntExtra("GroupIndex", 0)+1 >= boxInfo.getJSONArray("Experiments").length()){
d("sub", "end of json check 1");
// do the thing with saving into the current JSON, then return to the box page and show the new file (close every previous page if possible and launch new activity)
Intent intent = new Intent(getApplicationContext(), BoxesActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
} else{
d("sub", "end of group");
openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0)+1);
startActivity(openPage);
}
} else if (getIntent().getIntExtra("GroupIndex", 0)+1 >= boxInfo.getJSONArray("Experiments").length()) {
// Should never enter this check, but edge case just incase of bug, so run function just the same
d("sub", "end of json check 2");
openPage.putExtra("ExperimentIndex", getIntent().getIntExtra("ExperimentIndex", 0));
openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0));
startActivity(openPage);
} else {
d("sub", "remain in the same group");
openPage.putExtra("ExperimentIndex", getIntent().getIntExtra("ExperimentIndex", 0) + 1);
openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0));
startActivity(openPage);
}
} catch(JSONException e){
e.printStackTrace();
}
}
});
if(!boxInfo.getString("Image").isEmpty()){
Drawable yourDrawable;
InputStream inputStream = getContentResolver().openInputStream(Uri.parse(boxInfo.getString("Image")));
yourDrawable = Drawable.createFromStream(inputStream, boxInfo.getString("Image"));
getSupportActionBar().setLogo(yourDrawable);
} else{
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
}
setTitle(boxInfo.getString("Name"));
LinearLayout scrollLayout = findViewById(R.id.SurveyCreationLayout);
TextView boxDescription = new TextView(this);
TextView boxWarning = new TextView(this);
boxDescription.setText(boxInfo.getString("Description"));
boxWarning.setText(boxInfo.getString("WarningText"));
boxWarning.setTextColor(Color.parseColor("#f00808"));
scrollLayout.addView(boxDescription);
scrollLayout.addView(boxWarning);
JSONObject experimentObject = boxInfo.getJSONArray("Experiments").getJSONObject(getIntent().getIntExtra("GroupIndex", 0));
View hr = new View(ExperimentSurveyCreatorActivity.this);
ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 4);
hr.setLayoutParams(hrLayoutParams);
hr.setBackgroundColor(Color.parseColor("#888888"));
scrollLayout.addView(hr);
TextView groupTitle = new TextView(this);
groupTitle.setText(experimentObject.getString("Group"));
scrollLayout.addView(groupTitle);
JSONObject experiment = experimentObject.getJSONArray("Options").getJSONObject(getIntent().getIntExtra("ExperimentIndex", 0));
TextView experimentTitle = new TextView(this);
experimentTitle.setText(experiment.getString("Title"));
TextView experimentDesc = new TextView(this);
experimentDesc.setText(experiment.getString("Description"));
scrollLayout.addView(experimentTitle);
scrollLayout.addView(experimentDesc);
View hr2 = new View(ExperimentSurveyCreatorActivity.this);
hr2.setLayoutParams(hrLayoutParams);
hr2.setBackgroundColor(Color.parseColor("#888888"));
scrollLayout.addView(hr2);
TextView surveyTitle = new TextView(this);
surveyTitle.setText("Survey");
scrollLayout.addView(surveyTitle);
LinearLayout surveyCreationHorizontalLinearLayout = new LinearLayout(this);
surveyCreationHorizontalLinearLayout.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout surveyCreationLabelLayout = new LinearLayout(this);
surveyCreationLabelLayout.setOrientation(LinearLayout.VERTICAL);
TextView questionNumberLabel = new TextView(this);
int questionIndex = 1;
String questionLabel = "Question " + questionIndex + ":";
questionNumberLabel.setText(questionLabel);
surveyCreationLabelLayout.addView(questionNumberLabel);
surveyCreationHorizontalLinearLayout.addView(surveyCreationLabelLayout);
scrollLayout.addView(surveyCreationHorizontalLinearLayout);
} catch (JSONException e){
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
backHomeButton = findViewById(R.id.ExperimentSurveyCreatorBackHomeButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
}
}
package com.yearthreeproject.xbframework;
import android.content.Context;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class FileStoreReader {
public static void saveFile(Context intentContext, String title, String data){
// Check if file exists and if not, create
File file = new File(intentContext.getFilesDir(), title);
if(!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
// After it is known to exist, open the file stream and try to place data
try {
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(intentContext.openFileOutput(title, Context.MODE_PRIVATE));
outputStreamWriter.write(data);
outputStreamWriter.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
public static String readFile(Context intentContext, String title){
String ret = "";
try {
InputStream inputStream = intentContext.openFileInput(title);
if ( inputStream != null ) {
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String receiveString = "";
StringBuilder stringBuilder = new StringBuilder();
while ( (receiveString = bufferedReader.readLine()) != null ) {
stringBuilder.append(receiveString);
}
inputStream.close();
ret = stringBuilder.toString();
}
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return ret;
}
}
......@@ -12,26 +12,29 @@ import static android.util.Log.d;
public class LoginActivity extends AppCompatActivity {
private Button loginButton, homeButton;
private Toolbar myToolbar;
private Button submitLoginButton, backHomeButton;
private Toolbar toolbar;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
myToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
loginButton=(Button) findViewById(R.id.loginButton);
loginButton.setOnClickListener(new View.OnClickListener(){
submitLoginButton = (Button) findViewById(R.id.LoginSubmitButton);
submitLoginButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//TODO: implement what happens on submitting login
}
});
homeButton=(Button) findViewById(R.id.backHomeLogin);
homeButton.setOnClickListener(new View.OnClickListener(){
backHomeButton = (Button) findViewById(R.id.LoginBackHomeButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
......
package com.yearthreeproject.xbframework;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.Manifest;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.widget.Button;
import android.content.Intent;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.Random;
import static android.util.Log.d;
......@@ -17,71 +29,107 @@ import static android.util.Log.d;
public class MainActivity extends AppCompatActivity {
private Button homeButton, loginButton, shopButton, experimentsButton, progressButton, aboutButton;
private Toolbar myToolbar;
private Toolbar toolbar;
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myToolbar = findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
SharedPreferences savedSettings = this.getSharedPreferences("com.yearthreeproject.xbframework.PREFERENCE_FILE_KEY", Context.MODE_PRIVATE);
SharedPreferences.Editor savedSettingsEditor = savedSettings.edit();
askForWriteAccess();
// Load Box Json and initialise to internal storage
SharedPreferences settings = this.getSharedPreferences("com.yearthreeproject.xbframework.PREFERENCE_FILE_KEY", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit();
InputStream inputStream = getResources().openRawResource(R.raw.box);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
String boxesData = "";
int ctr;
try {
ctr = inputStream.read();
while (ctr != -1) {
byteArrayOutputStream.write(ctr);
ctr = inputStream.read();
}
inputStream.close();
boxesData = byteArrayOutputStream.toString();
} catch (Exception e){
e.printStackTrace();
}
FileStoreReader.saveFile(this, "boxData.json", boxesData);
d("file", FileStoreReader.readFile(this, "boxData.json"));
homeButton = findViewById(R.id.HomeHomeButton);
loginButton = findViewById(R.id.HomeLoginButton);
shopButton = findViewById(R.id.HomeShopButton);
experimentsButton = findViewById(R.id.HomeExperimentsButton);
progressButton = findViewById(R.id.HomeProgressButton);
aboutButton = findViewById(R.id.HomeAboutButton);
if(settings.getString("salt", "").equals("")){
Random gen = new Random();
StringBuilder randString = new StringBuilder();
Character tempChar;
if (savedSettings.getString("salt", "").equals("")) {
Random saltGenerator = new Random();
StringBuilder saltString = new StringBuilder();
Character iterativeCharacter;
for (int i = 0; i < 10; i++) {
tempChar = Integer.toString(gen.nextInt(96) + 32).charAt(0);
randString.append(tempChar);
iterativeCharacter = Integer.toString(saltGenerator.nextInt(96) + 32).charAt(0);
saltString.append(iterativeCharacter);
}
editor.putString("salt", randString.toString());
editor.apply();
savedSettingsEditor.putString("Salt", saltString.toString());
savedSettingsEditor.apply();
} else {
d("Salt", settings.getString("salt", ""));
d("Salt", savedSettings.getString("Salt", ""));
}
homeButton=findViewById(R.id.homeButton);
homeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
d("testing", "homeButton clicked");
}
});
loginButton=findViewById(R.id.loginButton);
loginButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, LoginActivity.class));
}
});
shopButton=findViewById(R.id.shopButton);
shopButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, ShopActivity.class));
}
});
experimentsButton=findViewById(R.id.experimentsButton);
experimentsButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, BoxesActivity.class));
}
});
progressButton=findViewById(R.id.progressButton);
progressButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, ProgressActivity.class));
}
});
aboutButton=findViewById(R.id.aboutButton);
aboutButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, AboutActivity.class));
......@@ -89,4 +137,65 @@ public class MainActivity extends AppCompatActivity {
});
}
// Image permission check
private void askForWriteAccess() {
if (ContextCompat.checkSelfPermission(MainActivity.this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Permission Required")
.setMessage("Permission to device storage is required for image upload.")
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.fromParts("package", getPackageName(), null));
startActivityForResult(intent, 5);
}
}).setNegativeButton("Cancel", null).show();
} else {
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
1);
}
} else {
d("Perm", "Already granted");
}
if (ContextCompat.checkSelfPermission(MainActivity.this,
Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
Manifest.permission.READ_EXTERNAL_STORAGE)) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Permission Required")
.setMessage("Permission to device storage is required for image upload.")
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.fromParts("package", getPackageName(), null));
startActivityForResult(intent, 5);
}
}).setNegativeButton("Cancel", null).show();
} else {
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
1);
}
} else {
d("Perm", "Already granted");
}
}
}
\ No newline at end of file
This diff is collapsed.
package com.yearthreeproject.xbframework;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
......@@ -8,15 +10,29 @@ import androidx.appcompat.widget.Toolbar;
public class ProgressActivity extends AppCompatActivity {
private Toolbar myToolbar;
private Toolbar toolbar;
private Button backHomeButton;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shop);
setContentView(R.layout.activity_progress);
// TODO: implement any of this page / class
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
backHomeButton = findViewById(R.id.ProgressBackHomButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
myToolbar = findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
}
}
package com.yearthreeproject.xbframework;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.media.Image;
import android.os.Build;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.GridLayout;
import android.widget.GridLayout.Alignment;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import com.google.android.material.snackbar.Snackbar;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import static android.util.Log.d;
import static android.widget.GridLayout.*;
public class ShopActivity extends AppCompatActivity {
private Toolbar myToolbar;
private Toolbar toolbar;
private Button backHomeButton;
private Toast attemptToBuyPopup;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@SuppressLint("ResourceType")
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shop);
myToolbar = findViewById(R.id.toolbar);
setSupportActionBar(myToolbar);
// TODO: implement more ideas into the data array, but have the functionality on click to express that you cannot buy at the moment
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
GridLayout shopLayout = findViewById(R.id.ShopContentLayout);
shopLayout.setAlignmentMode(ALIGN_BOUNDS);
InputStream inputStream = getResources().openRawResource(R.raw.shop);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
final JSONArray shopItemsJSONArray;
int ctr;
try {
ctr = inputStream.read();
while (ctr != -1) {
byteArrayOutputStream.write(ctr);
ctr = inputStream.read();
}
inputStream.close();
// Full loading of json array with each data item included
shopItemsJSONArray = new JSONArray(byteArrayOutputStream.toString());
int uniqueId = 1;
for (int i = 0; i < shopItemsJSONArray.length(); i++) {
JSONObject shopItem = shopItemsJSONArray.getJSONObject(i);
d("shopitems", shopItem.toString());
CardView shopItemCard = new CardView(ShopActivity.this);
GridLayout.LayoutParams cardParams = new GridLayout.LayoutParams(GridLayout.spec(
UNDEFINED, ALIGN_MARGINS, 1f),
GridLayout.spec(UNDEFINED, ALIGN_MARGINS, 1f));
cardParams.setMargins(16, 0, 16, 16);
cardParams.width = 0;
shopItemCard.setLayoutParams(cardParams);
shopItemCard.setCardBackgroundColor(Color.parseColor("#E6E6E6"));
shopItemCard.setMaxCardElevation((float) 0.0);
shopItemCard.setRadius((float) 5.0);
RelativeLayout shopItemLL = new RelativeLayout(ShopActivity.this);
ImageView itemImage = new ImageView(ShopActivity.this);
itemImage.setImageResource(R.mipmap.ic_launcher);
itemImage.setId(uniqueId++);
TextView itemTitle = new TextView(ShopActivity.this);
itemTitle.setId(uniqueId++);
itemTitle.setText(shopItem.getString("Title"));
TextView itemDesc = new TextView(ShopActivity.this);
itemDesc.setId(uniqueId++);
itemDesc.setText(shopItem.getString("Blurb"));
TextView itemPrice = new TextView(ShopActivity.this);
itemPrice.setId(uniqueId++);
itemPrice.setText(Double.toString(shopItem.getDouble("Price")));
itemPrice.setBackgroundColor(Color.parseColor("#FFFFFF"));
RelativeLayout.LayoutParams imageParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
imageParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
imageParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
imageParams.height = 378;
imageParams.width = 378;
RelativeLayout.LayoutParams titleParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
titleParams.addRule(RelativeLayout.BELOW, itemImage.getId());
RelativeLayout.LayoutParams priceParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
priceParams.addRule(RelativeLayout.ALIGN_BOTTOM, itemImage.getId());
priceParams.addRule(RelativeLayout.ALIGN_RIGHT, itemImage.getId());
itemPrice.setGravity(Gravity.RIGHT);
RelativeLayout.LayoutParams descParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
descParams.addRule(RelativeLayout.BELOW, itemTitle.getId());
shopItemLL.addView(itemImage, imageParams);
shopItemLL.addView(itemTitle, titleParams);
shopItemLL.addView(itemPrice, priceParams);
shopItemLL.addView(itemDesc, descParams);
shopItemCard.addView(shopItemLL);
shopItemCard.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
// Essentially if else, but because it causes a fatal error is try catch
try {
d("attempt", String.valueOf(attemptToBuyPopup.getView().isShown()));
if(attemptToBuyPopup.getView().isShown()){
// Do nothing
}else {
attemptToBuyPopup.show();
}
} catch (Exception e){
attemptToBuyPopup = Toast.makeText(getApplicationContext(), "This item is not available for purchase at the moment", Toast.LENGTH_SHORT);
attemptToBuyPopup.show();
}
}
});
shopLayout.addView(shopItemCard, i);
}
} catch (JSONException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
backHomeButton = findViewById(R.id.ShopBackHomeButton);
backHomeButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
finish();
}
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z"/>
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
......@@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ExperimentsListActivity">
tools:context=".ExperimentActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
......@@ -23,7 +23,7 @@
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_experiments_list" />
<include layout="@layout/content_experiment" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ExperimentSurveyCreatorActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:minHeight="56dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_experiment_survey_creator" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NewBox">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:minHeight="56dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_new_box" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
......@@ -2,6 +2,7 @@
<LinearLayout 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:id="@+id/AboutActivityLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
......@@ -12,18 +13,33 @@
tools:showIn="@layout/activity_about">
<ScrollView
android:id="@+id/AboutScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:id="@+id/AboutScrollParagraphLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/aboutParagraph"
android:id="@+id/AboutParagraphTextView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/about_about_para"
android:textSize="22sp" />
</LinearLayout>
</ScrollView>
<Button
android:id="@+id/backHomeAbout"
android:id="@+id/AboutBackHomeButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/about_back_home_button" />
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<LinearLayout 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:id="@+id/contentExperiments"
android:id="@+id/BoxesActivityLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
......@@ -13,12 +13,13 @@
tools:showIn="@layout/activity_boxes">
<ScrollView
android:id="@+id/BoxesActivityScrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:id="@+id/experimentsGrid"
android:id="@+id/BoxesInFiveLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
......@@ -26,7 +27,7 @@
</ScrollView>
<Button
android:id="@+id/experimentsBackHome"
android:id="@+id/BoxesBackHomeButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about_back_home_button" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment