-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefinitionActivity.java
More file actions
86 lines (73 loc) · 3.03 KB
/
DefinitionActivity.java
File metadata and controls
86 lines (73 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.example.puzzlewise;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class DefinitionActivity extends AppCompatActivity {
TextView reminderList, cardList_result;
Button add_def, def_next;
String[] cardList = new String[10];
String[] def = new String[5];
EditText input10, input20, input30, input40, input50;
String def1, def2, def3, def4, def5;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_definition);
Bundle extras = getIntent().getExtras();
final String[] list = extras.getStringArray("list");
cardList_result = findViewById(R.id.cardList_result);
reminderList = findViewById(R.id.reminderList);
reminderList.setText(list[0] + "\n" + list[1] + "\n" + list[2] + "\n" + list[3] + "\n" + list[4]);
input10 = findViewById(R.id.input01);
input20 = findViewById(R.id.input02);
input30 = findViewById(R.id.input03);
input40 = findViewById(R.id.input04);
input50 = findViewById(R.id.input05);
add_def = findViewById(R.id.add_def);
add_def.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
def1 = input10.getText().toString();
def2 = input20.getText().toString();
def3 = input30.getText().toString();
def4 = input40.getText().toString();
def5 = input50.getText().toString();
def[0] = def1;
def[1] = def2;
def[2] = def3;
def[3] = def4;
def[4] = def5;
// It's gross, I know, but it's the only way it works :/
cardList[0] = list[0];
cardList[1] = def[0];
cardList[2] = list[1];
cardList[3] = def[1];
cardList[4] = list[2];
cardList[5] = def[2];
cardList[6] = list[3];
cardList[7] = def[3];
cardList[8] = list[4];
cardList[9] = def[4];
cardList_result.setText(cardList[0] + "\n" + cardList[1] + "\n" + cardList[2] + "\n" + cardList[3] + "\n" + cardList[4] + "\n" + cardList[5] + "\n" + cardList[6] + "\n" + cardList[7] + "\n" + cardList[8] + "\n" + cardList[9]);
}
});
def_next = findViewById(R.id.def_next);
def_next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view)
{
openCardActivity();
}
});
}
public void openCardActivity()
{
Intent intent = new Intent(this, CardActivity.class);
intent.putExtra("cardList", cardList);
startActivity(intent);
}
}