質問編集履歴
68
test
CHANGED
File without changes
|
test
CHANGED
@@ -280,7 +280,7 @@
|
|
280
280
|
|
281
281
|
break;
|
282
282
|
|
283
|
-
//4から9も同じ感じで
|
283
|
+
//4から9も同じ感じで
|
284
284
|
|
285
285
|
}
|
286
286
|
|
67
test
CHANGED
File without changes
|
test
CHANGED
@@ -224,47 +224,51 @@
|
|
224
224
|
|
225
225
|
}
|
226
226
|
|
227
|
+
}
|
228
|
+
|
227
|
-
|
229
|
+
```
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
233
|
-
``
|
235
|
+
``//ここから悩んでる所です。``
|
236
|
+
|
237
|
+
|
238
|
+
|
234
|
-
|
239
|
+
```java:abr
|
235
|
-
|
236
240
|
|
237
241
|
class Click implements View.OnClickListener {
|
238
242
|
|
239
243
|
@Override
|
240
244
|
|
241
|
-
|
245
|
+
public void onClick(View v) {
|
242
246
|
|
243
247
|
int y=
|
244
248
|
|
245
|
-
getResources().getColor(R.color.y);
|
249
|
+
getResources().getColor(R.color.y);
|
246
250
|
|
247
251
|
int x=
|
248
252
|
|
249
|
-
getResources().getColor(R.color.x);
|
253
|
+
getResources().getColor(R.color.x);
|
250
|
-
|
251
|
-
|
252
|
-
|
254
|
+
|
255
|
+
|
256
|
+
|
253
|
-
|
257
|
+
switch (v.getId()) {
|
254
258
|
|
255
259
|
case (R.id.button):
|
256
260
|
|
257
|
-
//ここをif文とかで判定したい
|
261
|
+
//ここをif文とかで判定したい
|
258
262
|
|
259
263
|
Button button=
|
260
264
|
|
261
|
-
findViewById(R.id.button);
|
265
|
+
findViewById(R.id.button);
|
262
266
|
|
263
267
|
button2.setBackgroundColor(x);
|
264
268
|
|
265
|
-
//if(ここがわからない)
|
269
|
+
//if(ここがわからない)
|
266
|
-
|
270
|
+
|
267
|
-
break;
|
271
|
+
break;
|
268
272
|
|
269
273
|
case (R.id.button2):
|
270
274
|
|
@@ -274,14 +278,16 @@
|
|
274
278
|
|
275
279
|
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
276
280
|
|
277
|
-
break;
|
281
|
+
break;
|
278
|
-
|
282
|
+
|
279
|
-
//4から9も同じ感じで```
|
283
|
+
//4から9も同じ感じで```
|
280
|
-
|
284
|
+
|
281
|
-
}
|
285
|
+
}
|
282
|
-
|
286
|
+
|
283
|
-
}
|
287
|
+
}
|
284
288
|
|
285
289
|
}
|
286
290
|
|
287
291
|
}
|
292
|
+
|
293
|
+
```
|
66
test
CHANGED
File without changes
|
test
CHANGED
@@ -86,7 +86,7 @@
|
|
86
86
|
|
87
87
|
@Override
|
88
88
|
|
89
|
-
protected void onCreate(Bundle
|
89
|
+
protected void onCreate(Bundle savedInstanceState) {
|
90
90
|
|
91
91
|
super.onCreate(savedInstanceState);
|
92
92
|
|
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
Button button_r =
|
98
98
|
|
99
|
-
findViewById(R.id.button_r);
|
99
|
+
findViewById(R.id.button_r);
|
100
100
|
|
101
101
|
button_r.setOnClickListener(new MyClickListener());
|
102
102
|
|
@@ -104,182 +104,184 @@
|
|
104
104
|
|
105
105
|
Button button1=
|
106
106
|
|
107
|
+
findViewById(R.id.button);
|
108
|
+
|
109
|
+
button1.setOnClickListener(new Click());
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
Button button2=
|
114
|
+
|
115
|
+
findViewById(R.id.button2);
|
116
|
+
|
117
|
+
button2.setOnClickListener(new Click());
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
//3~8も同じ
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
Button button9=
|
128
|
+
|
129
|
+
findViewById(R.id.button9);
|
130
|
+
|
131
|
+
button9.setOnClickListener(new Click());
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
```
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
``//ここはリセットなのできにしないで``
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```java:rb
|
146
|
+
|
147
|
+
class MyClickListener implements View.OnClickListener {
|
148
|
+
|
149
|
+
@Override
|
150
|
+
|
151
|
+
public void onClick(View v) {
|
152
|
+
|
153
|
+
Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
Button button=
|
158
|
+
|
159
|
+
findViewById(R.id.button);
|
160
|
+
|
161
|
+
Button button1=
|
162
|
+
|
163
|
+
findViewById(R.id.button2);
|
164
|
+
|
165
|
+
Button button2=
|
166
|
+
|
167
|
+
findViewById(R.id.button3);
|
168
|
+
|
169
|
+
Button button3=
|
170
|
+
|
171
|
+
findViewById(R.id.button4);
|
172
|
+
|
173
|
+
Button button4=
|
174
|
+
|
175
|
+
findViewById(R.id.button5);
|
176
|
+
|
177
|
+
Button button5=
|
178
|
+
|
179
|
+
findViewById(R.id.button6);
|
180
|
+
|
181
|
+
Button button6=
|
182
|
+
|
183
|
+
findViewById(R.id.button7);
|
184
|
+
|
185
|
+
Button button7=
|
186
|
+
|
187
|
+
findViewById(R.id.button8);
|
188
|
+
|
189
|
+
Button button8=
|
190
|
+
|
191
|
+
findViewById(R.id.button9);
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
int y= getResources().getColor(R.color.y);
|
196
|
+
|
197
|
+
//R.color.xxx は name=”xxx”とした時
|
198
|
+
|
199
|
+
button.setBackgroundColor(y);
|
200
|
+
|
201
|
+
// view は変更対象の部品に適宜置き換える
|
202
|
+
|
203
|
+
button1.setBackgroundColor(y);
|
204
|
+
|
205
|
+
// view は変更対象の部品に適宜置き換える
|
206
|
+
|
207
|
+
button2.setBackgroundColor(y);
|
208
|
+
|
209
|
+
// view は変更対象の部品に適宜置き換える
|
210
|
+
|
211
|
+
button3.setBackgroundColor(y);
|
212
|
+
|
213
|
+
button4.setBackgroundColor(y);
|
214
|
+
|
215
|
+
button5.setBackgroundColor(y);
|
216
|
+
|
217
|
+
button6.setBackgroundColor(y);
|
218
|
+
|
219
|
+
button7.setBackgroundColor(y);
|
220
|
+
|
221
|
+
button8.setBackgroundColor(y);
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
}
|
226
|
+
|
227
|
+
}```
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
```//ここから悩んでる所です。```
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
class Click implements View.OnClickListener {
|
238
|
+
|
239
|
+
@Override
|
240
|
+
|
241
|
+
```public void onClick(View v) {
|
242
|
+
|
243
|
+
int y=
|
244
|
+
|
245
|
+
getResources().getColor(R.color.y);
|
246
|
+
|
247
|
+
int x=
|
248
|
+
|
249
|
+
getResources().getColor(R.color.x);
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
```switch (v.getId()) {
|
254
|
+
|
255
|
+
case (R.id.button):
|
256
|
+
|
257
|
+
//ここをif文とかで判定したい
|
258
|
+
|
259
|
+
Button button=
|
260
|
+
|
107
261
|
findViewById(R.id.button);
|
108
262
|
|
109
|
-
button
|
263
|
+
button2.setBackgroundColor(x);
|
110
|
-
|
111
|
-
|
112
|
-
|
264
|
+
|
113
|
-
|
265
|
+
//if(ここがわからない)
|
266
|
+
|
114
|
-
|
267
|
+
break;
|
268
|
+
|
115
|
-
|
269
|
+
case (R.id.button2):
|
270
|
+
|
116
|
-
|
271
|
+
break;
|
272
|
+
|
117
|
-
button
|
273
|
+
case (R.id.button3):
|
274
|
+
|
118
|
-
|
275
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
276
|
+
|
119
|
-
|
277
|
+
break;
|
120
|
-
|
278
|
+
|
121
|
-
//
|
279
|
+
//4から9も同じ感じで```
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
280
|
+
|
127
|
-
|
281
|
+
}```
|
128
|
-
|
282
|
+
|
129
|
-
|
283
|
+
}```
|
130
|
-
|
131
|
-
button9.setOnClickListener(new Click());
|
132
284
|
|
133
285
|
}
|
134
286
|
|
135
|
-
```
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
``//ここはリセットなのできにしないで``
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
```java:rb
|
146
|
-
|
147
|
-
class MyClickListener implements View.OnClickListener {
|
148
|
-
|
149
|
-
@Override
|
150
|
-
|
151
|
-
public void onClick(View v) {
|
152
|
-
|
153
|
-
Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
Button button=
|
158
|
-
|
159
|
-
findViewById(R.id.button);
|
160
|
-
|
161
|
-
Button button1=
|
162
|
-
|
163
|
-
findViewById(R.id.button2);
|
164
|
-
|
165
|
-
Button button2=
|
166
|
-
|
167
|
-
findViewById(R.id.button3);
|
168
|
-
|
169
|
-
Button button3=
|
170
|
-
|
171
|
-
findViewById(R.id.button4);
|
172
|
-
|
173
|
-
Button button4=
|
174
|
-
|
175
|
-
findViewById(R.id.button5);
|
176
|
-
|
177
|
-
Button button5=
|
178
|
-
|
179
|
-
findViewById(R.id.button6);
|
180
|
-
|
181
|
-
Button button6=
|
182
|
-
|
183
|
-
findViewById(R.id.button7);
|
184
|
-
|
185
|
-
Button button7=
|
186
|
-
|
187
|
-
findViewById(R.id.button8);
|
188
|
-
|
189
|
-
Button button8=
|
190
|
-
|
191
|
-
findViewById(R.id.button9);
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
int y= getResources().getColor(R.color.y);
|
196
|
-
|
197
|
-
//R.color.xxx は name=”xxx”とした時
|
198
|
-
|
199
|
-
button.setBackgroundColor(y);
|
200
|
-
|
201
|
-
// view は変更対象の部品に適宜置き換える
|
202
|
-
|
203
|
-
button1.setBackgroundColor(y);
|
204
|
-
|
205
|
-
// view は変更対象の部品に適宜置き換える
|
206
|
-
|
207
|
-
button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
208
|
-
|
209
|
-
```button3.setBackgroundColor(y);```
|
210
|
-
|
211
|
-
```button4.setBackgroundColor(y);```
|
212
|
-
|
213
|
-
```button5.setBackgroundColor(y); ```
|
214
|
-
|
215
|
-
```button6.setBackgroundColor(y); ```
|
216
|
-
|
217
|
-
```button7.setBackgroundColor(y);```
|
218
|
-
|
219
|
-
```button8.setBackgroundColor(y);```
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
}```
|
224
|
-
|
225
|
-
}```
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
```//ここから悩んでる所です。```
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
class Click implements View.OnClickListener {
|
236
|
-
|
237
|
-
@Override
|
238
|
-
|
239
|
-
```public void onClick(View v) {
|
240
|
-
|
241
|
-
int y=
|
242
|
-
|
243
|
-
getResources().getColor(R.color.y);
|
244
|
-
|
245
|
-
int x=
|
246
|
-
|
247
|
-
getResources().getColor(R.color.x);
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
```switch (v.getId()) {
|
252
|
-
|
253
|
-
case (R.id.button):
|
254
|
-
|
255
|
-
//ここをif文とかで判定したい
|
256
|
-
|
257
|
-
Button button=
|
258
|
-
|
259
|
-
findViewById(R.id.button);
|
260
|
-
|
261
|
-
button2.setBackgroundColor(x);
|
262
|
-
|
263
|
-
//if(ここがわからない)
|
264
|
-
|
265
|
-
break;
|
266
|
-
|
267
|
-
case (R.id.button2):
|
268
|
-
|
269
|
-
break;
|
270
|
-
|
271
|
-
case (R.id.button3):
|
272
|
-
|
273
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
274
|
-
|
275
|
-
break;
|
276
|
-
|
277
|
-
//4から9も同じ感じで```
|
278
|
-
|
279
|
-
}```
|
280
|
-
|
281
|
-
}```
|
282
|
-
|
283
|
-
}
|
284
|
-
|
285
287
|
}
|
65
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,41 +78,43 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
+
```java:br
|
82
|
+
|
81
83
|
public class MainActivity extends AppCompatActivity {
|
82
84
|
|
83
85
|
|
84
86
|
|
85
87
|
@Override
|
86
88
|
|
87
|
-
|
89
|
+
protected void onCreate(Bundle savedInstanceState) {
|
88
|
-
|
90
|
+
|
89
|
-
|
91
|
+
super.onCreate(savedInstanceState);
|
90
|
-
|
92
|
+
|
91
|
-
|
93
|
+
setContentView(R.layout.activity_main);
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
|
95
|
+
|
96
|
+
|
95
|
-
|
97
|
+
Button button_r =
|
96
98
|
|
97
99
|
findViewById(R.id.button_r);
|
98
100
|
|
99
|
-
button_r.setOnClickListener(new MyClickListener());
|
101
|
+
button_r.setOnClickListener(new MyClickListener());
|
100
|
-
|
101
|
-
|
102
|
-
|
102
|
+
|
103
|
+
|
104
|
+
|
103
|
-
|
105
|
+
Button button1=
|
104
106
|
|
105
107
|
findViewById(R.id.button);
|
106
108
|
|
107
|
-
button1.setOnClickListener(new Click());
|
109
|
+
button1.setOnClickListener(new Click());
|
108
|
-
|
109
|
-
|
110
|
-
|
110
|
+
|
111
|
+
|
112
|
+
|
111
|
-
|
113
|
+
Button button2=
|
112
114
|
|
113
115
|
findViewById(R.id.button2);
|
114
116
|
|
115
|
-
button2.setOnClickListener(new Click());
|
117
|
+
button2.setOnClickListener(new Click());
|
116
118
|
|
117
119
|
|
118
120
|
|
@@ -122,156 +124,162 @@
|
|
122
124
|
|
123
125
|
|
124
126
|
|
125
|
-
|
127
|
+
Button button9=
|
126
128
|
|
127
129
|
findViewById(R.id.button9);
|
128
130
|
|
129
|
-
button9.setOnClickListener(new Click());
|
131
|
+
button9.setOnClickListener(new Click());
|
132
|
+
|
130
|
-
|
133
|
+
}
|
134
|
+
|
131
|
-
|
135
|
+
```
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
137
|
-
``
|
141
|
+
``//ここはリセットなのできにしないで``
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```java:rb
|
138
146
|
|
139
147
|
class MyClickListener implements View.OnClickListener {
|
140
148
|
|
141
149
|
@Override
|
142
150
|
|
151
|
+
public void onClick(View v) {
|
152
|
+
|
153
|
+
Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
Button button=
|
158
|
+
|
159
|
+
findViewById(R.id.button);
|
160
|
+
|
161
|
+
Button button1=
|
162
|
+
|
163
|
+
findViewById(R.id.button2);
|
164
|
+
|
165
|
+
Button button2=
|
166
|
+
|
167
|
+
findViewById(R.id.button3);
|
168
|
+
|
169
|
+
Button button3=
|
170
|
+
|
171
|
+
findViewById(R.id.button4);
|
172
|
+
|
173
|
+
Button button4=
|
174
|
+
|
175
|
+
findViewById(R.id.button5);
|
176
|
+
|
177
|
+
Button button5=
|
178
|
+
|
179
|
+
findViewById(R.id.button6);
|
180
|
+
|
181
|
+
Button button6=
|
182
|
+
|
183
|
+
findViewById(R.id.button7);
|
184
|
+
|
185
|
+
Button button7=
|
186
|
+
|
187
|
+
findViewById(R.id.button8);
|
188
|
+
|
189
|
+
Button button8=
|
190
|
+
|
191
|
+
findViewById(R.id.button9);
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
int y= getResources().getColor(R.color.y);
|
196
|
+
|
197
|
+
//R.color.xxx は name=”xxx”とした時
|
198
|
+
|
199
|
+
button.setBackgroundColor(y);
|
200
|
+
|
201
|
+
// view は変更対象の部品に適宜置き換える
|
202
|
+
|
203
|
+
button1.setBackgroundColor(y);
|
204
|
+
|
205
|
+
// view は変更対象の部品に適宜置き換える
|
206
|
+
|
207
|
+
button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
208
|
+
|
209
|
+
```button3.setBackgroundColor(y);```
|
210
|
+
|
211
|
+
```button4.setBackgroundColor(y);```
|
212
|
+
|
213
|
+
```button5.setBackgroundColor(y); ```
|
214
|
+
|
215
|
+
```button6.setBackgroundColor(y); ```
|
216
|
+
|
217
|
+
```button7.setBackgroundColor(y);```
|
218
|
+
|
219
|
+
```button8.setBackgroundColor(y);```
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
}```
|
224
|
+
|
225
|
+
}```
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
```//ここから悩んでる所です。```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
class Click implements View.OnClickListener {
|
236
|
+
|
237
|
+
@Override
|
238
|
+
|
143
239
|
```public void onClick(View v) {
|
144
240
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
f
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
findViewById(R.id.button
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
f
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
```int y= getResources().getColor(R.color.y); ```
|
188
|
-
|
189
|
-
//R.color.xxx は name=”xxx”とした時
|
190
|
-
|
191
|
-
```button.setBackgroundColor(y); ```
|
192
|
-
|
193
|
-
// view は変更対象の部品に適宜置き換える
|
194
|
-
|
195
|
-
```button1.setBackgroundColor(y);```
|
196
|
-
|
197
|
-
// view は変更対象の部品に適宜置き換える
|
198
|
-
|
199
|
-
```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
|
200
|
-
|
201
|
-
```button3.setBackgroundColor(y);```
|
202
|
-
|
203
|
-
```button4.setBackgroundColor(y);```
|
204
|
-
|
205
|
-
```button5.setBackgroundColor(y); ```
|
206
|
-
|
207
|
-
```button6.setBackgroundColor(y); ```
|
208
|
-
|
209
|
-
```button7.setBackgroundColor(y);```
|
210
|
-
|
211
|
-
```button8.setBackgroundColor(y);```
|
212
|
-
|
213
|
-
|
241
|
+
int y=
|
242
|
+
|
243
|
+
getResources().getColor(R.color.y);
|
244
|
+
|
245
|
+
int x=
|
246
|
+
|
247
|
+
getResources().getColor(R.color.x);
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
```switch (v.getId()) {
|
252
|
+
|
253
|
+
case (R.id.button):
|
254
|
+
|
255
|
+
//ここをif文とかで判定したい
|
256
|
+
|
257
|
+
Button button=
|
258
|
+
|
259
|
+
findViewById(R.id.button);
|
260
|
+
|
261
|
+
button2.setBackgroundColor(x);
|
262
|
+
|
263
|
+
//if(ここがわからない)
|
264
|
+
|
265
|
+
break;
|
266
|
+
|
267
|
+
case (R.id.button2):
|
268
|
+
|
269
|
+
break;
|
270
|
+
|
271
|
+
case (R.id.button3):
|
272
|
+
|
273
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
274
|
+
|
275
|
+
break;
|
276
|
+
|
277
|
+
//4から9も同じ感じで```
|
278
|
+
|
279
|
+
}```
|
214
280
|
|
215
281
|
}```
|
216
282
|
|
217
|
-
}```
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
```//ここから悩んでる所です。```
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
class Click implements View.OnClickListener {
|
228
|
-
|
229
|
-
@Override
|
230
|
-
|
231
|
-
```public void onClick(View v) {
|
232
|
-
|
233
|
-
int y=
|
234
|
-
|
235
|
-
getResources().getColor(R.color.y);
|
236
|
-
|
237
|
-
int x=
|
238
|
-
|
239
|
-
getResources().getColor(R.color.x);
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
```switch (v.getId()) {
|
244
|
-
|
245
|
-
case (R.id.button):
|
246
|
-
|
247
|
-
//ここをif文とかで判定したい
|
248
|
-
|
249
|
-
Button button=
|
250
|
-
|
251
|
-
findViewById(R.id.button);
|
252
|
-
|
253
|
-
button2.setBackgroundColor(x);
|
254
|
-
|
255
|
-
//if(ここがわからない)
|
256
|
-
|
257
|
-
break;
|
258
|
-
|
259
|
-
case (R.id.button2):
|
260
|
-
|
261
|
-
break;
|
262
|
-
|
263
|
-
case (R.id.button3):
|
264
|
-
|
265
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
266
|
-
|
267
|
-
break;
|
268
|
-
|
269
|
-
//4から9も同じ感じで```
|
270
|
-
|
271
|
-
}```
|
272
|
-
|
273
|
-
}```
|
274
|
-
|
275
283
|
}
|
276
284
|
|
277
285
|
}
|
64
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
android studioで、3×3のボタンがあるんですが、そのボタンの1つを押すとそのボタンと上下左右のボタンの色が変える
|
6
6
|
|
7
|
-
ってやつをやりたいんですが、どうやったらいいですかね?
|
7
|
+
ってやつをやりたいんですが、どうやったらいいですかね?
|
8
8
|
|
9
9
|
色は2色でcolors.xmlでxとyって名前になってます。
|
10
10
|
|
63
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
android studioで、3×3のボタンがあるんですが、そのボタンの1つを押すとそのボタンと上下左右のボタンの色が変える
|
6
6
|
|
7
|
-
ってやつをやりたいんですが、どうやったらいいですかね?
|
7
|
+
ってやつをやりたいんですが、どうやったらいいですかね?
|
8
8
|
|
9
9
|
色は2色でcolors.xmlでxとyって名前になってます。
|
10
10
|
|
62
test
CHANGED
File without changes
|
test
CHANGED
@@ -266,7 +266,7 @@
|
|
266
266
|
|
267
267
|
break;
|
268
268
|
|
269
|
-
//4から9も同じ感じで
|
269
|
+
//4から9も同じ感じで```
|
270
270
|
|
271
271
|
}```
|
272
272
|
|
61
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,7 +230,7 @@
|
|
230
230
|
|
231
231
|
```public void onClick(View v) {
|
232
232
|
|
233
|
-
|
233
|
+
int y=
|
234
234
|
|
235
235
|
getResources().getColor(R.color.y);
|
236
236
|
|
@@ -266,7 +266,7 @@
|
|
266
266
|
|
267
267
|
break;
|
268
268
|
|
269
|
-
//4から9も同じ感じで
|
269
|
+
//4から9も同じ感じで
|
270
270
|
|
271
271
|
}```
|
272
272
|
|
60
test
CHANGED
File without changes
|
test
CHANGED
@@ -232,11 +232,11 @@
|
|
232
232
|
|
233
233
|
```int y=
|
234
234
|
|
235
|
-
getResources().getColor(R.color.y);
|
235
|
+
getResources().getColor(R.color.y);
|
236
|
-
|
236
|
+
|
237
|
-
|
237
|
+
int x=
|
238
|
-
|
238
|
+
|
239
|
-
getResources().getColor(R.color.x);
|
239
|
+
getResources().getColor(R.color.x);
|
240
240
|
|
241
241
|
|
242
242
|
|
59
test
CHANGED
File without changes
|
test
CHANGED
@@ -268,7 +268,7 @@
|
|
268
268
|
|
269
269
|
//4から9も同じ感じで```
|
270
270
|
|
271
|
-
}
|
271
|
+
}```
|
272
272
|
|
273
273
|
}```
|
274
274
|
|
58
test
CHANGED
File without changes
|
test
CHANGED
@@ -232,15 +232,15 @@
|
|
232
232
|
|
233
233
|
```int y=
|
234
234
|
|
235
|
-
getResources().getColor(R.color.y);
|
235
|
+
getResources().getColor(R.color.y);```
|
236
|
-
|
236
|
+
|
237
|
-
int x=
|
237
|
+
```int x=
|
238
238
|
|
239
239
|
getResources().getColor(R.color.x);```
|
240
240
|
|
241
241
|
|
242
242
|
|
243
|
-
switch (v.getId()) {
|
243
|
+
```switch (v.getId()) {
|
244
244
|
|
245
245
|
case (R.id.button):
|
246
246
|
|
@@ -266,7 +266,7 @@
|
|
266
266
|
|
267
267
|
break;
|
268
268
|
|
269
|
-
//4から9も同じ感じで
|
269
|
+
//4から9も同じ感じで```
|
270
270
|
|
271
271
|
}
|
272
272
|
|
57
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,7 +230,7 @@
|
|
230
230
|
|
231
231
|
```public void onClick(View v) {
|
232
232
|
|
233
|
-
int y=
|
233
|
+
```int y=
|
234
234
|
|
235
235
|
getResources().getColor(R.color.y);
|
236
236
|
|
@@ -242,7 +242,7 @@
|
|
242
242
|
|
243
243
|
switch (v.getId()) {
|
244
244
|
|
245
|
-
|
245
|
+
case (R.id.button):
|
246
246
|
|
247
247
|
//ここをif文とかで判定したい
|
248
248
|
|
@@ -264,7 +264,7 @@
|
|
264
264
|
|
265
265
|
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
266
266
|
|
267
|
-
break;
|
267
|
+
break;
|
268
268
|
|
269
269
|
//4から9も同じ感じで
|
270
270
|
|
56
test
CHANGED
File without changes
|
test
CHANGED
@@ -242,7 +242,7 @@
|
|
242
242
|
|
243
243
|
switch (v.getId()) {
|
244
244
|
|
245
|
-
case (R.id.button):
|
245
|
+
```case (R.id.button):
|
246
246
|
|
247
247
|
//ここをif文とかで判定したい
|
248
248
|
|
@@ -264,7 +264,7 @@
|
|
264
264
|
|
265
265
|
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
266
266
|
|
267
|
-
break;
|
267
|
+
break;```
|
268
268
|
|
269
269
|
//4から9も同じ感じで
|
270
270
|
|
55
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,7 +230,7 @@
|
|
230
230
|
|
231
231
|
```public void onClick(View v) {
|
232
232
|
|
233
|
-
|
233
|
+
int y=
|
234
234
|
|
235
235
|
getResources().getColor(R.color.y);
|
236
236
|
|
@@ -240,7 +240,7 @@
|
|
240
240
|
|
241
241
|
|
242
242
|
|
243
|
-
|
243
|
+
switch (v.getId()) {
|
244
244
|
|
245
245
|
case (R.id.button):
|
246
246
|
|
@@ -268,7 +268,7 @@
|
|
268
268
|
|
269
269
|
//4から9も同じ感じで
|
270
270
|
|
271
|
-
}
|
271
|
+
}
|
272
272
|
|
273
273
|
}```
|
274
274
|
|
54
test
CHANGED
File without changes
|
test
CHANGED
@@ -228,15 +228,19 @@
|
|
228
228
|
|
229
229
|
@Override
|
230
230
|
|
231
|
-
```public void onClick(View v) {
|
231
|
+
```public void onClick(View v) {
|
232
|
+
|
232
|
-
|
233
|
+
```int y=
|
234
|
+
|
233
|
-
|
235
|
+
getResources().getColor(R.color.y);
|
236
|
+
|
234
|
-
|
237
|
+
int x=
|
238
|
+
|
235
|
-
|
239
|
+
getResources().getColor(R.color.x);```
|
236
|
-
|
237
|
-
|
238
|
-
|
240
|
+
|
241
|
+
|
242
|
+
|
239
|
-
switch (v.getId()) {
|
243
|
+
```switch (v.getId()) {
|
240
244
|
|
241
245
|
case (R.id.button):
|
242
246
|
|
@@ -264,9 +268,9 @@
|
|
264
268
|
|
265
269
|
//4から9も同じ感じで
|
266
270
|
|
267
|
-
}
|
268
|
-
|
269
|
-
|
271
|
+
}```
|
272
|
+
|
273
|
+
}```
|
270
274
|
|
271
275
|
}
|
272
276
|
|
53
test
CHANGED
File without changes
|
test
CHANGED
@@ -228,9 +228,9 @@
|
|
228
228
|
|
229
229
|
@Override
|
230
230
|
|
231
|
-
```public void onClick(View v) {
|
231
|
+
```public void onClick(View v) {```
|
232
|
-
|
232
|
+
|
233
|
-
|
233
|
+
int y= getResources().getColor(R.color.y);
|
234
234
|
|
235
235
|
int x= getResources().getColor(R.color.x);
|
236
236
|
|
52
test
CHANGED
File without changes
|
test
CHANGED
@@ -266,7 +266,7 @@
|
|
266
266
|
|
267
267
|
}
|
268
268
|
|
269
|
-
}```
|
269
|
+
```}```
|
270
270
|
|
271
271
|
}
|
272
272
|
|
51
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,7 +230,7 @@
|
|
230
230
|
|
231
231
|
```public void onClick(View v) {
|
232
232
|
|
233
|
-
int y= getResources().getColor(R.color.y);
|
233
|
+
```int y= getResources().getColor(R.color.y);
|
234
234
|
|
235
235
|
int x= getResources().getColor(R.color.x);
|
236
236
|
|
50
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,7 +230,7 @@
|
|
230
230
|
|
231
231
|
```public void onClick(View v) {
|
232
232
|
|
233
|
-
|
233
|
+
int y= getResources().getColor(R.color.y);
|
234
234
|
|
235
235
|
int x= getResources().getColor(R.color.x);
|
236
236
|
|
@@ -242,9 +242,9 @@
|
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
245
|
-
Button
|
245
|
+
Button button=
|
246
|
-
|
246
|
+
|
247
|
-
|
247
|
+
findViewById(R.id.button);
|
248
248
|
|
249
249
|
button2.setBackgroundColor(x);
|
250
250
|
|
49
test
CHANGED
File without changes
|
test
CHANGED
@@ -230,15 +230,15 @@
|
|
230
230
|
|
231
231
|
```public void onClick(View v) {
|
232
232
|
|
233
|
-
```int y= getResources().getColor(R.color.y);
|
233
|
+
```int y= getResources().getColor(R.color.y);
|
234
|
-
|
234
|
+
|
235
|
-
|
235
|
+
int x= getResources().getColor(R.color.x);
|
236
|
-
|
237
|
-
|
238
|
-
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
-
|
239
|
+
switch (v.getId()) {
|
240
|
-
|
240
|
+
|
241
|
-
|
241
|
+
case (R.id.button):
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
@@ -250,23 +250,23 @@
|
|
250
250
|
|
251
251
|
//if(ここがわからない)
|
252
252
|
|
253
|
-
break;
|
253
|
+
break;
|
254
|
-
|
254
|
+
|
255
|
-
|
255
|
+
case (R.id.button2):
|
256
|
-
|
256
|
+
|
257
|
-
break;
|
257
|
+
break;
|
258
|
-
|
258
|
+
|
259
|
-
|
259
|
+
case (R.id.button3):
|
260
260
|
|
261
261
|
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
262
262
|
|
263
|
-
break;
|
263
|
+
break;
|
264
264
|
|
265
265
|
//4から9も同じ感じで
|
266
266
|
|
267
|
+
}
|
268
|
+
|
267
|
-
|
269
|
+
}```
|
268
|
-
|
269
|
-
}
|
270
270
|
|
271
271
|
}
|
272
272
|
|
48
test
CHANGED
File without changes
|
test
CHANGED
@@ -236,7 +236,7 @@
|
|
236
236
|
|
237
237
|
|
238
238
|
|
239
|
-
```switch (v.getId()) {
|
239
|
+
```switch (v.getId()) {```
|
240
240
|
|
241
241
|
```case (R.id.button):
|
242
242
|
|
47
test
CHANGED
File without changes
|
test
CHANGED
@@ -266,8 +266,8 @@
|
|
266
266
|
|
267
267
|
}```
|
268
268
|
|
269
|
-
}
|
269
|
+
}
|
270
|
-
|
270
|
+
|
271
|
-
}
|
271
|
+
}
|
272
272
|
|
273
273
|
}
|
46
test
CHANGED
File without changes
|
test
CHANGED
@@ -268,6 +268,6 @@
|
|
268
268
|
|
269
269
|
}```
|
270
270
|
|
271
|
-
}
|
271
|
+
}```
|
272
272
|
|
273
273
|
}
|
45
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,29 +238,29 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
245
|
-
|
245
|
+
Button
|
246
|
-
|
246
|
+
|
247
|
-
button=findViewById(R.id.button);
|
247
|
+
button=findViewById(R.id.button);
|
248
|
-
|
248
|
+
|
249
|
-
|
249
|
+
button2.setBackgroundColor(x);
|
250
250
|
|
251
251
|
//if(ここがわからない)
|
252
252
|
|
253
|
-
|
253
|
+
break;```
|
254
|
-
|
254
|
+
|
255
|
-
```case (R.id.button2):
|
255
|
+
```case (R.id.button2):
|
256
|
-
|
256
|
+
|
257
|
-
|
257
|
+
break;```
|
258
|
-
|
258
|
+
|
259
|
-
```case (R.id.button3):
|
259
|
+
```case (R.id.button3):
|
260
|
-
|
260
|
+
|
261
|
-
|
261
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
262
|
-
|
262
|
+
|
263
|
-
|
263
|
+
break;```
|
264
264
|
|
265
265
|
//4から9も同じ感じで
|
266
266
|
|
44
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,7 +238,7 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):```
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
@@ -250,33 +250,19 @@
|
|
250
250
|
|
251
251
|
//if(ここがわからない)
|
252
252
|
|
253
|
-
//色を変える作業
|
254
|
-
|
255
|
-
//else
|
256
|
-
|
257
|
-
//色を変える作業
|
258
|
-
|
259
|
-
break;```
|
253
|
+
```break;```
|
260
|
-
|
254
|
+
|
261
|
-
```case (R.id.button2):
|
255
|
+
```case (R.id.button2):```
|
262
|
-
|
256
|
+
|
263
|
-
break;```
|
257
|
+
```break;```
|
264
|
-
|
258
|
+
|
265
|
-
```case (R.id.button3):
|
259
|
+
```case (R.id.button3):```
|
266
260
|
|
267
261
|
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
262
|
|
269
|
-
break;```
|
263
|
+
```break;```
|
270
|
-
|
264
|
+
|
271
|
-
//4から
|
265
|
+
//4から9も同じ感じで
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
```case (R.id.button9):
|
276
|
-
|
277
|
-
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
|
-
|
279
|
-
break;```
|
280
266
|
|
281
267
|
}```
|
282
268
|
|
43
test
CHANGED
File without changes
|
test
CHANGED
@@ -264,9 +264,9 @@
|
|
264
264
|
|
265
265
|
```case (R.id.button3):
|
266
266
|
|
267
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
267
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
|
-
|
268
|
+
|
269
|
-
|
269
|
+
break;```
|
270
270
|
|
271
271
|
//4から8も同じ感じで
|
272
272
|
|
@@ -276,7 +276,7 @@
|
|
276
276
|
|
277
277
|
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
278
|
|
279
|
-
|
279
|
+
break;```
|
280
280
|
|
281
281
|
}```
|
282
282
|
|
42
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,7 +238,7 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
@@ -256,28 +256,28 @@
|
|
256
256
|
|
257
257
|
//色を変える作業
|
258
258
|
|
259
|
+
break;```
|
260
|
+
|
261
|
+
```case (R.id.button2):
|
262
|
+
|
263
|
+
break;```
|
264
|
+
|
265
|
+
```case (R.id.button3):
|
266
|
+
|
267
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
|
+
|
259
269
|
```break;```
|
260
270
|
|
271
|
+
//4から8も同じ感じで
|
272
|
+
|
273
|
+
|
274
|
+
|
261
|
-
```case (R.id.button
|
275
|
+
```case (R.id.button9):
|
262
|
-
|
263
|
-
|
276
|
+
|
264
|
-
|
265
|
-
```case (R.id.button3):
|
266
|
-
|
267
|
-
Toast.makeText(MainActivity.this, "
|
277
|
+
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
268
278
|
|
269
279
|
```break;```
|
270
280
|
|
271
|
-
//4から8も同じ感じで
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
```case (R.id.button9):
|
276
|
-
|
277
|
-
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
|
-
|
279
|
-
```break;```
|
280
|
-
|
281
281
|
}```
|
282
282
|
|
283
283
|
}```
|
41
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,23 +238,23 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):```
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
245
|
-
Button
|
245
|
+
```Button
|
246
246
|
|
247
247
|
button=findViewById(R.id.button);```
|
248
248
|
|
249
249
|
```button2.setBackgroundColor(x);```
|
250
250
|
|
251
|
-
|
251
|
+
//if(ここがわからない)
|
252
|
-
|
252
|
+
|
253
|
-
|
253
|
+
//色を変える作業
|
254
|
-
|
254
|
+
|
255
|
-
|
255
|
+
//else
|
256
|
-
|
256
|
+
|
257
|
-
|
257
|
+
//色を変える作業
|
258
258
|
|
259
259
|
```break;```
|
260
260
|
|
40
test
CHANGED
File without changes
|
test
CHANGED
@@ -282,6 +282,6 @@
|
|
282
282
|
|
283
283
|
}```
|
284
284
|
|
285
|
-
|
285
|
+
}
|
286
|
-
|
286
|
+
|
287
|
-
|
287
|
+
}
|
39
test
CHANGED
File without changes
|
test
CHANGED
@@ -248,17 +248,15 @@
|
|
248
248
|
|
249
249
|
```button2.setBackgroundColor(x);```
|
250
250
|
|
251
|
-
```//if(ここがわからない)
|
251
|
+
```//if(ここがわからない)```
|
252
|
-
|
252
|
+
|
253
|
-
//色を変える作業
|
253
|
+
```//色を変える作業```
|
254
|
-
|
254
|
+
|
255
|
-
//
|
255
|
+
```//else```
|
256
|
-
|
256
|
+
|
257
|
-
//色を変える作業
|
257
|
+
```//色を変える作業```
|
258
|
-
|
259
|
-
|
258
|
+
|
260
|
-
|
261
|
-
break;```
|
259
|
+
```break;```
|
262
260
|
|
263
261
|
```case (R.id.button2):
|
264
262
|
|
@@ -268,7 +266,7 @@
|
|
268
266
|
|
269
267
|
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
270
268
|
|
271
|
-
break;```
|
269
|
+
```break;```
|
272
270
|
|
273
271
|
//4から8も同じ感じで
|
274
272
|
|
38
test
CHANGED
File without changes
|
test
CHANGED
@@ -242,9 +242,11 @@
|
|
242
242
|
|
243
243
|
//ここをif文とかで判定したい
|
244
244
|
|
245
|
+
Button
|
246
|
+
|
245
|
-
|
247
|
+
button=findViewById(R.id.button);```
|
246
|
-
|
248
|
+
|
247
|
-
button2.setBackgroundColor(x);```
|
249
|
+
```button2.setBackgroundColor(x);```
|
248
250
|
|
249
251
|
```//if(ここがわからない){
|
250
252
|
|
37
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,11 +238,11 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):
|
242
|
-
|
242
|
+
|
243
|
-
|
243
|
+
//ここをif文とかで判定したい
|
244
|
-
|
244
|
+
|
245
|
-
|
245
|
+
Button button=findViewById(R.id.button);
|
246
246
|
|
247
247
|
button2.setBackgroundColor(x);```
|
248
248
|
|
@@ -254,30 +254,30 @@
|
|
254
254
|
|
255
255
|
//色を変える作業
|
256
256
|
|
257
|
-
//}
|
257
|
+
//}
|
258
|
+
|
259
|
+
break;```
|
260
|
+
|
261
|
+
```case (R.id.button2):
|
262
|
+
|
263
|
+
break;```
|
264
|
+
|
265
|
+
```case (R.id.button3):
|
266
|
+
|
267
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
|
+
|
269
|
+
break;```
|
270
|
+
|
271
|
+
//4から8も同じ感じで
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
```case (R.id.button9):
|
276
|
+
|
277
|
+
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
258
278
|
|
259
279
|
```break;```
|
260
280
|
|
261
|
-
```case (R.id.button2):```
|
262
|
-
|
263
|
-
```break;```
|
264
|
-
|
265
|
-
```case (R.id.button3):```
|
266
|
-
|
267
|
-
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
|
-
|
269
|
-
```break;```
|
270
|
-
|
271
|
-
//4から8も同じ感じで
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
```case (R.id.button9):```
|
276
|
-
|
277
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
|
-
|
279
|
-
```break;```
|
280
|
-
|
281
281
|
}```
|
282
282
|
|
283
283
|
}```
|
36
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,11 +238,11 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):```
|
242
|
-
|
242
|
+
|
243
|
-
//ここをif文とかで判定したい
|
243
|
+
```//ここをif文とかで判定したい```
|
244
|
-
|
244
|
+
|
245
|
-
Button button=findViewById(R.id.button);
|
245
|
+
```Button button=findViewById(R.id.button);
|
246
246
|
|
247
247
|
button2.setBackgroundColor(x);```
|
248
248
|
|
@@ -254,27 +254,27 @@
|
|
254
254
|
|
255
255
|
//色を変える作業
|
256
256
|
|
257
|
-
//}
|
257
|
+
//}```
|
258
|
-
|
259
|
-
break;```
|
260
|
-
|
261
|
-
```case (R.id.button2):
|
262
|
-
|
263
|
-
break;```
|
264
|
-
|
265
|
-
```case (R.id.button3):
|
266
|
-
|
267
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
258
|
|
269
259
|
```break;```
|
270
260
|
|
261
|
+
```case (R.id.button2):```
|
262
|
+
|
263
|
+
```break;```
|
264
|
+
|
265
|
+
```case (R.id.button3):```
|
266
|
+
|
267
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
|
+
|
269
|
+
```break;```
|
270
|
+
|
271
271
|
//4から8も同じ感じで
|
272
272
|
|
273
273
|
|
274
274
|
|
275
|
-
```case (R.id.button9):
|
275
|
+
```case (R.id.button9):```
|
276
|
-
|
276
|
+
|
277
|
-
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
277
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
278
|
|
279
279
|
```break;```
|
280
280
|
|
35
test
CHANGED
File without changes
|
test
CHANGED
@@ -244,9 +244,9 @@
|
|
244
244
|
|
245
245
|
Button button=findViewById(R.id.button);
|
246
246
|
|
247
|
-
button2.setBackgroundColor(x);
|
247
|
+
button2.setBackgroundColor(x);```
|
248
|
-
|
248
|
+
|
249
|
-
//if(ここがわからない){
|
249
|
+
```//if(ここがわからない){
|
250
250
|
|
251
251
|
//色を変える作業
|
252
252
|
|
@@ -260,24 +260,24 @@
|
|
260
260
|
|
261
261
|
```case (R.id.button2):
|
262
262
|
|
263
|
-
break;```
|
263
|
+
break;```
|
264
264
|
|
265
265
|
```case (R.id.button3):
|
266
266
|
|
267
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
267
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
268
|
-
|
269
|
-
break;```
|
270
|
-
|
271
|
-
```//4から8も同じ感じで```
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
```case (R.id.button9):```
|
276
|
-
|
277
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
268
|
|
279
269
|
```break;```
|
280
270
|
|
271
|
+
//4から8も同じ感じで
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
```case (R.id.button9):
|
276
|
+
|
277
|
+
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
278
|
+
|
279
|
+
```break;```
|
280
|
+
|
281
281
|
}```
|
282
282
|
|
283
283
|
}```
|
34
test
CHANGED
File without changes
|
test
CHANGED
@@ -246,42 +246,38 @@
|
|
246
246
|
|
247
247
|
button2.setBackgroundColor(x);
|
248
248
|
|
249
|
-
|
250
|
-
|
251
|
-
|
249
|
+
//if(ここがわからない){
|
252
|
-
|
253
|
-
色を変える作業
|
254
|
-
|
255
|
-
}else{
|
256
250
|
|
257
251
|
//色を変える作業
|
258
252
|
|
253
|
+
//}else{
|
254
|
+
|
255
|
+
//色を変える作業
|
256
|
+
|
259
|
-
}
|
257
|
+
//}
|
260
258
|
|
261
259
|
break;```
|
262
260
|
|
261
|
+
```case (R.id.button2):
|
262
|
+
|
263
|
+
break;```
|
264
|
+
|
265
|
+
```case (R.id.button3):
|
266
|
+
|
267
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
268
|
+
|
269
|
+
break;```
|
270
|
+
|
271
|
+
```//4から8も同じ感じで```
|
272
|
+
|
273
|
+
|
274
|
+
|
263
|
-
```case (R.id.button
|
275
|
+
```case (R.id.button9):```
|
264
|
-
|
276
|
+
|
265
|
-
```
|
277
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
278
|
|
267
279
|
```break;```
|
268
280
|
|
269
|
-
```case (R.id.button3):```
|
270
|
-
|
271
|
-
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
272
|
-
|
273
|
-
```break;```
|
274
|
-
|
275
|
-
```//4から8も同じ感じで```
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
```case (R.id.button9):```
|
280
|
-
|
281
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
282
|
-
|
283
|
-
```break;```
|
284
|
-
|
285
281
|
}```
|
286
282
|
|
287
283
|
}```
|
33
test
CHANGED
File without changes
|
test
CHANGED
@@ -238,15 +238,11 @@
|
|
238
238
|
|
239
239
|
```switch (v.getId()) {
|
240
240
|
|
241
|
-
```case (R.id.button):
|
241
|
+
```case (R.id.button):
|
242
|
-
|
243
|
-
|
244
|
-
|
242
|
+
|
245
|
-
|
243
|
+
//ここをif文とかで判定したい
|
246
|
-
|
247
|
-
|
248
|
-
|
244
|
+
|
249
|
-
|
245
|
+
Button button=findViewById(R.id.button);
|
250
246
|
|
251
247
|
button2.setBackgroundColor(x);
|
252
248
|
|
32
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
31
test
CHANGED
File without changes
|
test
CHANGED
@@ -290,6 +290,6 @@
|
|
290
290
|
|
291
291
|
}```
|
292
292
|
|
293
|
-
}```
|
293
|
+
```}```
|
294
|
-
|
294
|
+
|
295
|
-
}```
|
295
|
+
```}```
|
30
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
-
|
81
|
+
public class MainActivity extends AppCompatActivity {
|
82
82
|
|
83
83
|
|
84
84
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
```//ここはリセットなのできにしないで```
|
138
138
|
|
139
|
-
|
139
|
+
class MyClickListener implements View.OnClickListener {
|
140
140
|
|
141
141
|
@Override
|
142
142
|
|
29
test
CHANGED
File without changes
|
test
CHANGED
@@ -246,9 +246,9 @@
|
|
246
246
|
|
247
247
|
|
248
248
|
|
249
|
-
```Button button=findViewById(R.id.button);
|
249
|
+
```Button button=findViewById(R.id.button);
|
250
|
-
|
250
|
+
|
251
|
-
|
251
|
+
button2.setBackgroundColor(x);
|
252
252
|
|
253
253
|
|
254
254
|
|
@@ -262,30 +262,30 @@
|
|
262
262
|
|
263
263
|
}```
|
264
264
|
|
265
|
+
break;```
|
266
|
+
|
267
|
+
```case (R.id.button2):```
|
268
|
+
|
269
|
+
```//ここからボタン9までボタン1と同じ判定ような判定がしたい```
|
270
|
+
|
265
271
|
```break;```
|
266
272
|
|
267
|
-
```case (R.id.button
|
273
|
+
```case (R.id.button3):```
|
268
|
-
|
274
|
+
|
269
|
-
```
|
275
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
270
276
|
|
271
277
|
```break;```
|
272
278
|
|
279
|
+
```//4から8も同じ感じで```
|
280
|
+
|
281
|
+
|
282
|
+
|
273
|
-
```case (R.id.button
|
283
|
+
```case (R.id.button9):```
|
274
|
-
|
284
|
+
|
275
|
-
```Toast.makeText(MainActivity.this, "
|
285
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
276
286
|
|
277
287
|
```break;```
|
278
288
|
|
279
|
-
```//4から8も同じ感じで```
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
```case (R.id.button9):```
|
284
|
-
|
285
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
286
|
-
|
287
|
-
```break;```
|
288
|
-
|
289
289
|
}```
|
290
290
|
|
291
291
|
}```
|
28
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
|
81
|
-
public class MainActivity extends AppCompatActivity {
|
81
|
+
```public class MainActivity extends AppCompatActivity {
|
82
82
|
|
83
83
|
|
84
84
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
```//ここはリセットなのできにしないで```
|
138
138
|
|
139
|
-
class MyClickListener implements View.OnClickListener {
|
139
|
+
```class MyClickListener implements View.OnClickListener {
|
140
140
|
|
141
141
|
@Override
|
142
142
|
|
@@ -290,6 +290,6 @@
|
|
290
290
|
|
291
291
|
}```
|
292
292
|
|
293
|
-
|
293
|
+
}```
|
294
|
-
|
294
|
+
|
295
|
-
|
295
|
+
}```
|
27
test
CHANGED
File without changes
|
test
CHANGED
@@ -288,7 +288,7 @@
|
|
288
288
|
|
289
289
|
}```
|
290
290
|
|
291
|
-
|
291
|
+
}```
|
292
292
|
|
293
293
|
```}```
|
294
294
|
|
26
test
CHANGED
File without changes
|
test
CHANGED
@@ -228,7 +228,7 @@
|
|
228
228
|
|
229
229
|
@Override
|
230
230
|
|
231
|
-
```public void onClick(View v) {
|
231
|
+
```public void onClick(View v) {
|
232
232
|
|
233
233
|
```int y= getResources().getColor(R.color.y);```
|
234
234
|
|
@@ -242,7 +242,7 @@
|
|
242
242
|
|
243
243
|
|
244
244
|
|
245
|
-
//ここをif文とかで判定したい
|
245
|
+
```//ここをif文とかで判定したい```
|
246
246
|
|
247
247
|
|
248
248
|
|
@@ -252,7 +252,7 @@
|
|
252
252
|
|
253
253
|
|
254
254
|
|
255
|
-
//if(ここがわからない){
|
255
|
+
```//if(ここがわからない){
|
256
256
|
|
257
257
|
色を変える作業
|
258
258
|
|
@@ -260,13 +260,13 @@
|
|
260
260
|
|
261
261
|
//色を変える作業
|
262
262
|
|
263
|
-
}
|
263
|
+
}```
|
264
264
|
|
265
265
|
```break;```
|
266
266
|
|
267
267
|
```case (R.id.button2):```
|
268
268
|
|
269
|
-
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
269
|
+
```//ここからボタン9までボタン1と同じ判定ような判定がしたい```
|
270
270
|
|
271
271
|
```break;```
|
272
272
|
|
@@ -276,7 +276,7 @@
|
|
276
276
|
|
277
277
|
```break;```
|
278
278
|
|
279
|
-
//4から8も同じ感じで
|
279
|
+
```//4から8も同じ感じで```
|
280
280
|
|
281
281
|
|
282
282
|
|
25
test
CHANGED
File without changes
|
test
CHANGED
@@ -228,7 +228,7 @@
|
|
228
228
|
|
229
229
|
@Override
|
230
230
|
|
231
|
-
```public void onClick(View v) {
|
231
|
+
```public void onClick(View v) {```
|
232
232
|
|
233
233
|
```int y= getResources().getColor(R.color.y);```
|
234
234
|
|
24
test
CHANGED
File without changes
|
test
CHANGED
@@ -288,7 +288,7 @@
|
|
288
288
|
|
289
289
|
}```
|
290
290
|
|
291
|
-
}```
|
291
|
+
```}```
|
292
292
|
|
293
293
|
```}```
|
294
294
|
|
23
test
CHANGED
File without changes
|
test
CHANGED
@@ -290,6 +290,6 @@
|
|
290
290
|
|
291
291
|
}```
|
292
292
|
|
293
|
-
}```
|
293
|
+
```}```
|
294
294
|
|
295
295
|
```}```
|
22
test
CHANGED
File without changes
|
test
CHANGED
@@ -224,10 +224,6 @@
|
|
224
224
|
|
225
225
|
|
226
226
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
227
|
class Click implements View.OnClickListener {
|
232
228
|
|
233
229
|
@Override
|
@@ -296,4 +292,4 @@
|
|
296
292
|
|
297
293
|
}```
|
298
294
|
|
299
|
-
}```
|
295
|
+
```}```
|
21
test
CHANGED
File without changes
|
test
CHANGED
@@ -220,7 +220,7 @@
|
|
220
220
|
|
221
221
|
|
222
222
|
|
223
|
-
//ここから悩んでる所です。
|
223
|
+
```//ここから悩んでる所です。```
|
224
224
|
|
225
225
|
|
226
226
|
|
20
test
CHANGED
File without changes
|
test
CHANGED
@@ -294,6 +294,6 @@
|
|
294
294
|
|
295
295
|
}```
|
296
296
|
|
297
|
-
|
297
|
+
}```
|
298
|
-
|
298
|
+
|
299
|
-
|
299
|
+
}```
|
19
test
CHANGED
File without changes
|
test
CHANGED
@@ -214,7 +214,7 @@
|
|
214
214
|
|
215
215
|
}```
|
216
216
|
|
217
|
-
}```
|
217
|
+
}```
|
218
218
|
|
219
219
|
|
220
220
|
|
@@ -228,11 +228,11 @@
|
|
228
228
|
|
229
229
|
|
230
230
|
|
231
|
-
|
231
|
+
class Click implements View.OnClickListener {
|
232
|
-
|
232
|
+
|
233
|
-
|
233
|
+
@Override
|
234
|
-
|
234
|
+
|
235
|
-
```
|
235
|
+
```public void onClick(View v) {
|
236
236
|
|
237
237
|
```int y= getResources().getColor(R.color.y);```
|
238
238
|
|
@@ -240,7 +240,7 @@
|
|
240
240
|
|
241
241
|
|
242
242
|
|
243
|
-
```switch (v.getId()) {
|
243
|
+
```switch (v.getId()) {
|
244
244
|
|
245
245
|
```case (R.id.button):```
|
246
246
|
|
@@ -290,9 +290,9 @@
|
|
290
290
|
|
291
291
|
```break;```
|
292
292
|
|
293
|
-
|
293
|
+
}```
|
294
|
-
|
294
|
+
|
295
|
-
|
295
|
+
}```
|
296
296
|
|
297
297
|
```}```
|
298
298
|
|
18
test
CHANGED
File without changes
|
test
CHANGED
@@ -200,7 +200,7 @@
|
|
200
200
|
|
201
201
|
```button3.setBackgroundColor(y);```
|
202
202
|
|
203
|
-
```
|
203
|
+
```button4.setBackgroundColor(y);```
|
204
204
|
|
205
205
|
```button5.setBackgroundColor(y); ```
|
206
206
|
|
@@ -214,7 +214,7 @@
|
|
214
214
|
|
215
215
|
}```
|
216
216
|
|
217
|
-
}
|
217
|
+
}```
|
218
218
|
|
219
219
|
|
220
220
|
|
17
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,7 +136,7 @@
|
|
136
136
|
|
137
137
|
```//ここはリセットなのできにしないで```
|
138
138
|
|
139
|
-
|
139
|
+
class MyClickListener implements View.OnClickListener {
|
140
140
|
|
141
141
|
@Override
|
142
142
|
|
@@ -214,7 +214,7 @@
|
|
214
214
|
|
215
215
|
}```
|
216
216
|
|
217
|
-
}
|
217
|
+
}
|
218
218
|
|
219
219
|
|
220
220
|
|
16
test
CHANGED
File without changes
|
test
CHANGED
@@ -136,10 +136,6 @@
|
|
136
136
|
|
137
137
|
```//ここはリセットなのできにしないで```
|
138
138
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
139
|
```class MyClickListener implements View.OnClickListener {
|
144
140
|
|
145
141
|
@Override
|
15
test
CHANGED
File without changes
|
test
CHANGED
@@ -134,7 +134,7 @@
|
|
134
134
|
|
135
135
|
|
136
136
|
|
137
|
-
```//ここはリセットなのできにしないで
|
137
|
+
```//ここはリセットなのできにしないで```
|
138
138
|
|
139
139
|
|
140
140
|
|
14
test
CHANGED
File without changes
|
test
CHANGED
@@ -134,7 +134,7 @@
|
|
134
134
|
|
135
135
|
|
136
136
|
|
137
|
-
|
137
|
+
```//ここはリセットなのできにしないで
|
138
138
|
|
139
139
|
|
140
140
|
|
13
test
CHANGED
File without changes
|
test
CHANGED
@@ -108,9 +108,9 @@
|
|
108
108
|
|
109
109
|
|
110
110
|
|
111
|
-
```Button button2
|
111
|
+
```Button button2=
|
112
|
-
|
112
|
+
|
113
|
-
|
113
|
+
findViewById(R.id.button2);
|
114
114
|
|
115
115
|
button2.setOnClickListener(new Click());```
|
116
116
|
|
@@ -122,11 +122,9 @@
|
|
122
122
|
|
123
123
|
|
124
124
|
|
125
|
-
```Button button9
|
125
|
+
```Button button9=
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
|
129
|
-
|
127
|
+
findViewById(R.id.button9);
|
130
128
|
|
131
129
|
button9.setOnClickListener(new Click());```
|
132
130
|
|
12
test
CHANGED
File without changes
|
test
CHANGED
@@ -124,6 +124,8 @@
|
|
124
124
|
|
125
125
|
```Button button9
|
126
126
|
|
127
|
+
|
128
|
+
|
127
129
|
=findViewById(R.id.button9);
|
128
130
|
|
129
131
|
button9.setOnClickListener(new Click());```
|
11
test
CHANGED
File without changes
|
test
CHANGED
@@ -122,7 +122,11 @@
|
|
122
122
|
|
123
123
|
|
124
124
|
|
125
|
+
```Button button9
|
126
|
+
|
127
|
+
=findViewById(R.id.button9);
|
128
|
+
|
125
|
-
|
129
|
+
button9.setOnClickListener(new Click());```
|
126
130
|
|
127
131
|
}```
|
128
132
|
|
10
test
CHANGED
File without changes
|
test
CHANGED
@@ -92,19 +92,25 @@
|
|
92
92
|
|
93
93
|
|
94
94
|
|
95
|
+
```Button button_r =
|
96
|
+
|
95
|
-
|
97
|
+
findViewById(R.id.button_r);
|
96
98
|
|
97
99
|
button_r.setOnClickListener(new MyClickListener());```
|
98
100
|
|
99
101
|
|
100
102
|
|
103
|
+
```Button button1=
|
104
|
+
|
101
|
-
|
105
|
+
findViewById(R.id.button);
|
102
106
|
|
103
107
|
button1.setOnClickListener(new Click());```
|
104
108
|
|
105
109
|
|
106
110
|
|
111
|
+
```Button button2
|
112
|
+
|
107
|
-
|
113
|
+
=findViewById(R.id.button2);
|
108
114
|
|
109
115
|
button2.setOnClickListener(new Click());```
|
110
116
|
|
@@ -124,7 +130,7 @@
|
|
124
130
|
|
125
131
|
|
126
132
|
|
127
|
-
|
133
|
+
>ここはリセットなのできにしないで
|
128
134
|
|
129
135
|
|
130
136
|
|
@@ -140,23 +146,41 @@
|
|
140
146
|
|
141
147
|
|
142
148
|
|
149
|
+
```Button button=
|
150
|
+
|
143
|
-
|
151
|
+
findViewById(R.id.button);```
|
152
|
+
|
144
|
-
|
153
|
+
```Button button1=
|
154
|
+
|
145
|
-
|
155
|
+
findViewById(R.id.button2);```
|
156
|
+
|
146
|
-
|
157
|
+
```Button button2=
|
158
|
+
|
147
|
-
|
159
|
+
findViewById(R.id.button3);```
|
160
|
+
|
148
|
-
|
161
|
+
```Button button3=
|
162
|
+
|
149
|
-
|
163
|
+
findViewById(R.id.button4);```
|
164
|
+
|
150
|
-
|
165
|
+
```Button button4=
|
166
|
+
|
151
|
-
|
167
|
+
findViewById(R.id.button5);```
|
168
|
+
|
152
|
-
|
169
|
+
```Button button5=
|
170
|
+
|
153
|
-
|
171
|
+
findViewById(R.id.button6);```
|
172
|
+
|
154
|
-
|
173
|
+
```Button button6=
|
174
|
+
|
155
|
-
|
175
|
+
findViewById(R.id.button7);```
|
176
|
+
|
156
|
-
|
177
|
+
```Button button7=
|
178
|
+
|
157
|
-
|
179
|
+
findViewById(R.id.button8);```
|
180
|
+
|
158
|
-
|
181
|
+
```Button button8=
|
182
|
+
|
159
|
-
|
183
|
+
findViewById(R.id.button9);```
|
160
184
|
|
161
185
|
|
162
186
|
|
9
test
CHANGED
File without changes
|
test
CHANGED
@@ -130,11 +130,11 @@
|
|
130
130
|
|
131
131
|
|
132
132
|
|
133
|
-
```class MyClickListener implements View.OnClickListener {
|
133
|
+
```class MyClickListener implements View.OnClickListener {
|
134
134
|
|
135
135
|
@Override
|
136
136
|
|
137
|
-
```public void onClick(View v) {
|
137
|
+
```public void onClick(View v) {
|
138
138
|
|
139
139
|
```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
|
140
140
|
|
@@ -188,88 +188,88 @@
|
|
188
188
|
|
189
189
|
|
190
190
|
|
191
|
+
}```
|
192
|
+
|
193
|
+
}```
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
//ここから悩んでる所です。
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
```class Click implements View.OnClickListener {```
|
208
|
+
|
209
|
+
```@Override```
|
210
|
+
|
211
|
+
```、public void onClick(View v) {```
|
212
|
+
|
213
|
+
```int y= getResources().getColor(R.color.y);```
|
214
|
+
|
215
|
+
```int x= getResources().getColor(R.color.x);```
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
```switch (v.getId()) {```
|
220
|
+
|
221
|
+
```case (R.id.button):```
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
//ここをif文とかで判定したい
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
```Button button=findViewById(R.id.button);```
|
230
|
+
|
231
|
+
```button2.setBackgroundColor(x);```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
//if(ここがわからない){
|
236
|
+
|
237
|
+
色を変える作業
|
238
|
+
|
239
|
+
}else{
|
240
|
+
|
241
|
+
//色を変える作業
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
```break;```
|
246
|
+
|
247
|
+
```case (R.id.button2):```
|
248
|
+
|
249
|
+
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
250
|
+
|
251
|
+
```break;```
|
252
|
+
|
253
|
+
```case (R.id.button3):```
|
254
|
+
|
255
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
256
|
+
|
257
|
+
```break;```
|
258
|
+
|
259
|
+
//4から8も同じ感じで
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
```case (R.id.button9):```
|
264
|
+
|
265
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
|
+
|
267
|
+
```break;```
|
268
|
+
|
269
|
+
```}```
|
270
|
+
|
191
271
|
```}```
|
192
272
|
|
193
273
|
```}```
|
194
274
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
//ここから悩んでる所です。
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
```class Click implements View.OnClickListener {```
|
208
|
-
|
209
|
-
```@Override```
|
210
|
-
|
211
|
-
```、public void onClick(View v) {```
|
212
|
-
|
213
|
-
```int y= getResources().getColor(R.color.y);```
|
214
|
-
|
215
|
-
```int x= getResources().getColor(R.color.x);```
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
```switch (v.getId()) {```
|
220
|
-
|
221
|
-
```case (R.id.button):```
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
//ここをif文とかで判定したい
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
```Button button=findViewById(R.id.button);```
|
230
|
-
|
231
|
-
```button2.setBackgroundColor(x);```
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
//if(ここがわからない){
|
236
|
-
|
237
|
-
色を変える作業
|
238
|
-
|
239
|
-
}else{
|
240
|
-
|
241
|
-
//色を変える作業
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
```break;```
|
246
|
-
|
247
|
-
```case (R.id.button2):```
|
248
|
-
|
249
|
-
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
250
|
-
|
251
|
-
```break;```
|
252
|
-
|
253
|
-
```case (R.id.button3):```
|
254
|
-
|
255
|
-
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
256
|
-
|
257
|
-
```break;```
|
258
|
-
|
259
|
-
//4から8も同じ感じで
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
```case (R.id.button9):```
|
264
|
-
|
265
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
|
-
|
267
|
-
```break;```
|
268
|
-
|
269
|
-
```}```
|
270
|
-
|
271
|
-
```}```
|
272
|
-
|
273
|
-
```}```
|
274
|
-
|
275
275
|
```}```
|
8
test
CHANGED
File without changes
|
test
CHANGED
@@ -132,144 +132,144 @@
|
|
132
132
|
|
133
133
|
```class MyClickListener implements View.OnClickListener {```
|
134
134
|
|
135
|
+
@Override
|
136
|
+
|
137
|
+
```public void onClick(View v) {```
|
138
|
+
|
139
|
+
```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
```Button button=findViewById(R.id.button);```
|
144
|
+
|
145
|
+
```Button button1=findViewById(R.id.button2);```
|
146
|
+
|
147
|
+
```Button button2=findViewById(R.id.button3);```
|
148
|
+
|
149
|
+
```Button button3=findViewById(R.id.button4);```
|
150
|
+
|
151
|
+
```Button button4=findViewById(R.id.button5);```
|
152
|
+
|
153
|
+
```Button button5=findViewById(R.id.button6);```
|
154
|
+
|
155
|
+
```Button button6=findViewById(R.id.button7);```
|
156
|
+
|
157
|
+
```Button button7=findViewById(R.id.button8);```
|
158
|
+
|
159
|
+
```Button button8=findViewById(R.id.button9);```
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
```int y= getResources().getColor(R.color.y); ```
|
164
|
+
|
165
|
+
//R.color.xxx は name=”xxx”とした時
|
166
|
+
|
167
|
+
```button.setBackgroundColor(y); ```
|
168
|
+
|
169
|
+
// view は変更対象の部品に適宜置き換える
|
170
|
+
|
171
|
+
```button1.setBackgroundColor(y);```
|
172
|
+
|
173
|
+
// view は変更対象の部品に適宜置き換える
|
174
|
+
|
175
|
+
```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
|
176
|
+
|
177
|
+
```button3.setBackgroundColor(y);```
|
178
|
+
|
179
|
+
```はbutton4.setBackgroundColor(y);```
|
180
|
+
|
181
|
+
```button5.setBackgroundColor(y); ```
|
182
|
+
|
183
|
+
```button6.setBackgroundColor(y); ```
|
184
|
+
|
185
|
+
```button7.setBackgroundColor(y);```
|
186
|
+
|
187
|
+
```button8.setBackgroundColor(y);```
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
```}```
|
192
|
+
|
193
|
+
```}```
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
//ここから悩んでる所です。
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
```class Click implements View.OnClickListener {```
|
208
|
+
|
135
209
|
```@Override```
|
136
210
|
|
137
|
-
```public void onClick(View v) {```
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
```
|
146
|
-
|
147
|
-
```
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
```Button button
|
156
|
-
|
157
|
-
```
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
```b
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
```b
|
178
|
-
|
179
|
-
```
|
180
|
-
|
181
|
-
```
|
182
|
-
|
183
|
-
```b
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
211
|
+
```、public void onClick(View v) {```
|
212
|
+
|
213
|
+
```int y= getResources().getColor(R.color.y);```
|
214
|
+
|
215
|
+
```int x= getResources().getColor(R.color.x);```
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
```switch (v.getId()) {```
|
220
|
+
|
221
|
+
```case (R.id.button):```
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
//ここをif文とかで判定したい
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
```Button button=findViewById(R.id.button);```
|
230
|
+
|
231
|
+
```button2.setBackgroundColor(x);```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
//if(ここがわからない){
|
236
|
+
|
237
|
+
色を変える作業
|
238
|
+
|
239
|
+
}else{
|
240
|
+
|
241
|
+
//色を変える作業
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
```break;```
|
246
|
+
|
247
|
+
```case (R.id.button2):```
|
248
|
+
|
249
|
+
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
250
|
+
|
251
|
+
```break;```
|
252
|
+
|
253
|
+
```case (R.id.button3):```
|
254
|
+
|
255
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
256
|
+
|
257
|
+
```break;```
|
258
|
+
|
259
|
+
//4から8も同じ感じで
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
```case (R.id.button9):```
|
264
|
+
|
265
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
|
+
|
267
|
+
```break;```
|
268
|
+
|
269
|
+
```}```
|
190
270
|
|
191
271
|
```}```
|
192
272
|
|
193
273
|
```}```
|
194
274
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
//ここから悩んでる所です。
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
```class Click implements View.OnClickListener {```
|
208
|
-
|
209
|
-
```@Override```
|
210
|
-
|
211
|
-
```、public void onClick(View v) {```
|
212
|
-
|
213
|
-
```int y= getResources().getColor(R.color.y);```
|
214
|
-
|
215
|
-
```int x= getResources().getColor(R.color.x);```
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
```switch (v.getId()) {```
|
220
|
-
|
221
|
-
```case (R.id.button):```
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
//ここをif文とかで判定したい
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
```Button button=findViewById(R.id.button);```
|
230
|
-
|
231
|
-
```button2.setBackgroundColor(x);```
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
//if(ここがわからない){
|
236
|
-
|
237
|
-
色を変える作業
|
238
|
-
|
239
|
-
}else{
|
240
|
-
|
241
|
-
//色を変える作業
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
```break;```
|
246
|
-
|
247
|
-
```case (R.id.button2):```
|
248
|
-
|
249
|
-
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
250
|
-
|
251
|
-
```break;```
|
252
|
-
|
253
|
-
```case (R.id.button3):```
|
254
|
-
|
255
|
-
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
256
|
-
|
257
|
-
```break;```
|
258
|
-
|
259
|
-
//4から8も同じ感じで
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
```case (R.id.button9):```
|
264
|
-
|
265
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
|
-
|
267
|
-
```break;```
|
268
|
-
|
269
|
-
```}```
|
270
|
-
|
271
|
-
```}```
|
272
|
-
|
273
|
-
```}```
|
274
|
-
|
275
275
|
```}```
|
7
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
|
85
|
+
@Override
|
86
86
|
|
87
87
|
```protected void onCreate(Bundle savedInstanceState) {
|
88
88
|
|
6
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
5
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
4
test
CHANGED
File without changes
|
test
CHANGED
@@ -84,7 +84,7 @@
|
|
84
84
|
|
85
85
|
```@Override```
|
86
86
|
|
87
|
-
```protected void onCreate(Bundle savedInstanceState) {
|
87
|
+
```protected void onCreate(Bundle savedInstanceState) {
|
88
88
|
|
89
89
|
```super.onCreate(savedInstanceState);```
|
90
90
|
|
@@ -118,158 +118,158 @@
|
|
118
118
|
|
119
119
|
```Button button9 =findViewById(R.id.button9);button9.setOnClickListener(new Click());```
|
120
120
|
|
121
|
+
}```
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
//ここはリセットなのできにしないで
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
```class MyClickListener implements View.OnClickListener {```
|
134
|
+
|
135
|
+
```@Override```
|
136
|
+
|
137
|
+
```public void onClick(View v) {```
|
138
|
+
|
139
|
+
```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
```Button button=findViewById(R.id.button);```
|
144
|
+
|
145
|
+
```Button button1=findViewById(R.id.button2);```
|
146
|
+
|
147
|
+
```Button button2=findViewById(R.id.button3);```
|
148
|
+
|
149
|
+
```Button button3=findViewById(R.id.button4);```
|
150
|
+
|
151
|
+
```Button button4=findViewById(R.id.button5);```
|
152
|
+
|
153
|
+
```Button button5=findViewById(R.id.button6);```
|
154
|
+
|
155
|
+
```Button button6=findViewById(R.id.button7);```
|
156
|
+
|
157
|
+
```Button button7=findViewById(R.id.button8);```
|
158
|
+
|
159
|
+
```Button button8=findViewById(R.id.button9);```
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
```int y= getResources().getColor(R.color.y); ```
|
164
|
+
|
165
|
+
//R.color.xxx は name=”xxx”とした時
|
166
|
+
|
167
|
+
```button.setBackgroundColor(y); ```
|
168
|
+
|
169
|
+
// view は変更対象の部品に適宜置き換える
|
170
|
+
|
171
|
+
```button1.setBackgroundColor(y);```
|
172
|
+
|
173
|
+
// view は変更対象の部品に適宜置き換える
|
174
|
+
|
175
|
+
```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
|
176
|
+
|
177
|
+
```button3.setBackgroundColor(y);```
|
178
|
+
|
179
|
+
```はbutton4.setBackgroundColor(y);```
|
180
|
+
|
181
|
+
```button5.setBackgroundColor(y); ```
|
182
|
+
|
183
|
+
```button6.setBackgroundColor(y); ```
|
184
|
+
|
185
|
+
```button7.setBackgroundColor(y);```
|
186
|
+
|
187
|
+
```button8.setBackgroundColor(y);```
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
```}```
|
192
|
+
|
121
193
|
```}```
|
122
194
|
|
123
195
|
|
124
196
|
|
125
197
|
|
126
198
|
|
127
|
-
//ここ
|
199
|
+
//ここから悩んでる所です。
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
133
|
-
```class
|
207
|
+
```class Click implements View.OnClickListener {```
|
134
208
|
|
135
209
|
```@Override```
|
136
210
|
|
137
|
-
```public void onClick(View v) {```
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
```
|
146
|
-
|
147
|
-
```
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
```Button button
|
156
|
-
|
157
|
-
```
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
```b
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
```b
|
178
|
-
|
179
|
-
```
|
180
|
-
|
181
|
-
```
|
182
|
-
|
183
|
-
```b
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
211
|
+
```、public void onClick(View v) {```
|
212
|
+
|
213
|
+
```int y= getResources().getColor(R.color.y);```
|
214
|
+
|
215
|
+
```int x= getResources().getColor(R.color.x);```
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
```switch (v.getId()) {```
|
220
|
+
|
221
|
+
```case (R.id.button):```
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
//ここをif文とかで判定したい
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
```Button button=findViewById(R.id.button);```
|
230
|
+
|
231
|
+
```button2.setBackgroundColor(x);```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
//if(ここがわからない){
|
236
|
+
|
237
|
+
色を変える作業
|
238
|
+
|
239
|
+
}else{
|
240
|
+
|
241
|
+
//色を変える作業
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
```break;```
|
246
|
+
|
247
|
+
```case (R.id.button2):```
|
248
|
+
|
249
|
+
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
250
|
+
|
251
|
+
```break;```
|
252
|
+
|
253
|
+
```case (R.id.button3):```
|
254
|
+
|
255
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
256
|
+
|
257
|
+
```break;```
|
258
|
+
|
259
|
+
//4から8も同じ感じで
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
```case (R.id.button9):```
|
264
|
+
|
265
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
|
+
|
267
|
+
```break;```
|
268
|
+
|
269
|
+
```}```
|
190
270
|
|
191
271
|
```}```
|
192
272
|
|
193
273
|
```}```
|
194
274
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
//ここから悩んでる所です。
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
```class Click implements View.OnClickListener {```
|
208
|
-
|
209
|
-
```@Override```
|
210
|
-
|
211
|
-
```、public void onClick(View v) {```
|
212
|
-
|
213
|
-
```int y= getResources().getColor(R.color.y);```
|
214
|
-
|
215
|
-
```int x= getResources().getColor(R.color.x);```
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
```switch (v.getId()) {```
|
220
|
-
|
221
|
-
```case (R.id.button):```
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
//ここをif文とかで判定したい
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
```Button button=findViewById(R.id.button);```
|
230
|
-
|
231
|
-
```button2.setBackgroundColor(x);```
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
//if(ここがわからない){
|
236
|
-
|
237
|
-
色を変える作業
|
238
|
-
|
239
|
-
}else{
|
240
|
-
|
241
|
-
//色を変える作業
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
```break;```
|
246
|
-
|
247
|
-
```case (R.id.button2):```
|
248
|
-
|
249
|
-
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
250
|
-
|
251
|
-
```break;```
|
252
|
-
|
253
|
-
```case (R.id.button3):```
|
254
|
-
|
255
|
-
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
256
|
-
|
257
|
-
```break;```
|
258
|
-
|
259
|
-
//4から8も同じ感じで
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
```case (R.id.button9):```
|
264
|
-
|
265
|
-
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
266
|
-
|
267
|
-
```break;```
|
268
|
-
|
269
|
-
```}```
|
270
|
-
|
271
|
-
```}```
|
272
|
-
|
273
|
-
```}```
|
274
|
-
|
275
275
|
```}```
|
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -92,23 +92,21 @@
|
|
92
92
|
|
93
93
|
|
94
94
|
|
95
|
-
```Button button_r = findViewById(R.id.button_r);
|
95
|
+
```Button button_r = findViewById(R.id.button_r);
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
|
99
|
-
|
97
|
+
button_r.setOnClickListener(new MyClickListener());```
|
100
|
-
|
101
|
-
|
102
|
-
|
98
|
+
|
99
|
+
|
100
|
+
|
103
|
-
```Button button1=findViewById(R.id.button);
|
101
|
+
```Button button1=findViewById(R.id.button);
|
104
|
-
|
102
|
+
|
105
|
-
|
103
|
+
button1.setOnClickListener(new Click());```
|
106
|
-
|
107
|
-
|
108
|
-
|
104
|
+
|
105
|
+
|
106
|
+
|
109
|
-
```Button button2 =findViewById(R.id.button2);
|
107
|
+
```Button button2 =findViewById(R.id.button2);
|
110
|
-
|
108
|
+
|
111
|
-
|
109
|
+
button2.setOnClickListener(new Click());```
|
112
110
|
|
113
111
|
|
114
112
|
|
@@ -118,9 +116,7 @@
|
|
118
116
|
|
119
117
|
|
120
118
|
|
121
|
-
```Button button9 =findViewById(R.id.button9);```
|
119
|
+
```Button button9 =findViewById(R.id.button9);button9.setOnClickListener(new Click());```
|
122
|
-
|
123
|
-
```button9.setOnClickListener(new Click());```
|
124
120
|
|
125
121
|
```}```
|
126
122
|
|
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,33 +82,33 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
@Override
|
85
|
+
```@Override```
|
86
|
-
|
86
|
+
|
87
|
-
protected void onCreate(Bundle savedInstanceState) {
|
87
|
+
```protected void onCreate(Bundle savedInstanceState) {```
|
88
|
-
|
88
|
+
|
89
|
-
super.onCreate(savedInstanceState);
|
89
|
+
```super.onCreate(savedInstanceState);```
|
90
|
-
|
90
|
+
|
91
|
-
setContentView(R.layout.activity_main);
|
91
|
+
```setContentView(R.layout.activity_main);```
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
-
Button button_r = findViewById(R.id.button_r);
|
95
|
+
```Button button_r = findViewById(R.id.button_r);```
|
96
|
-
|
96
|
+
|
97
|
+
|
98
|
+
|
97
|
-
|
99
|
+
```button_r.setOnClickListener(new MyClickListener());```
|
98
|
-
|
99
|
-
|
100
|
-
|
100
|
+
|
101
|
+
|
102
|
+
|
101
|
-
Button button1=findViewById(R.id.button);
|
103
|
+
```Button button1=findViewById(R.id.button);```
|
102
|
-
|
104
|
+
|
103
|
-
button1.setOnClickListener(new Click());
|
105
|
+
```button1.setOnClickListener(new Click());```
|
104
|
-
|
105
|
-
|
106
|
-
|
106
|
+
|
107
|
+
|
108
|
+
|
107
|
-
Button button2 =findViewById(R.id.button2);
|
109
|
+
```Button button2 =findViewById(R.id.button2);```
|
108
|
-
|
110
|
+
|
109
|
-
button2.setOnClickListener(new Click());
|
111
|
+
```button2.setOnClickListener(new Click());```
|
110
|
-
|
111
|
-
|
112
112
|
|
113
113
|
|
114
114
|
|
@@ -118,11 +118,11 @@
|
|
118
118
|
|
119
119
|
|
120
120
|
|
121
|
-
Button button9 =findViewById(R.id.button9);
|
121
|
+
```Button button9 =findViewById(R.id.button9);```
|
122
|
-
|
122
|
+
|
123
|
-
button9.setOnClickListener(new Click());
|
123
|
+
```button9.setOnClickListener(new Click());```
|
124
|
-
|
124
|
+
|
125
|
-
}
|
125
|
+
```}```
|
126
126
|
|
127
127
|
|
128
128
|
|
@@ -134,61 +134,67 @@
|
|
134
134
|
|
135
135
|
|
136
136
|
|
137
|
-
class MyClickListener implements View.OnClickListener {
|
138
|
-
|
139
|
-
@Override
|
140
|
-
|
141
|
-
public void onClick(View v) {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
Button button=findViewById(R.id.button);
|
148
|
-
|
149
|
-
Button button1=findViewById(R.id.button2);
|
150
|
-
|
151
|
-
Button button2=findViewById(R.id.button3);
|
152
|
-
|
153
|
-
Button button3=findViewById(R.id.button4);
|
154
|
-
|
155
|
-
Button button4=findViewById(R.id.button5);
|
156
|
-
|
157
|
-
Button button5=findViewById(R.id.button6);
|
158
|
-
|
159
|
-
Button button6=findViewById(R.id.button7);
|
160
|
-
|
161
|
-
Button button7=findViewById(R.id.button8);
|
162
|
-
|
163
|
-
Button button8=findViewById(R.id.button9);
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
int y= getResources().getColor(R.color.y);
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
button
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
button
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
button
|
180
|
-
|
181
|
-
button
|
182
|
-
|
183
|
-
button
|
184
|
-
|
185
|
-
button
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
137
|
+
```class MyClickListener implements View.OnClickListener {```
|
138
|
+
|
139
|
+
```@Override```
|
140
|
+
|
141
|
+
```public void onClick(View v) {```
|
142
|
+
|
143
|
+
```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
```Button button=findViewById(R.id.button);```
|
148
|
+
|
149
|
+
```Button button1=findViewById(R.id.button2);```
|
150
|
+
|
151
|
+
```Button button2=findViewById(R.id.button3);```
|
152
|
+
|
153
|
+
```Button button3=findViewById(R.id.button4);```
|
154
|
+
|
155
|
+
```Button button4=findViewById(R.id.button5);```
|
156
|
+
|
157
|
+
```Button button5=findViewById(R.id.button6);```
|
158
|
+
|
159
|
+
```Button button6=findViewById(R.id.button7);```
|
160
|
+
|
161
|
+
```Button button7=findViewById(R.id.button8);```
|
162
|
+
|
163
|
+
```Button button8=findViewById(R.id.button9);```
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
```int y= getResources().getColor(R.color.y); ```
|
168
|
+
|
169
|
+
//R.color.xxx は name=”xxx”とした時
|
170
|
+
|
171
|
+
```button.setBackgroundColor(y); ```
|
172
|
+
|
173
|
+
// view は変更対象の部品に適宜置き換える
|
174
|
+
|
175
|
+
```button1.setBackgroundColor(y);```
|
176
|
+
|
177
|
+
// view は変更対象の部品に適宜置き換える
|
178
|
+
|
179
|
+
```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
|
180
|
+
|
181
|
+
```button3.setBackgroundColor(y);```
|
182
|
+
|
183
|
+
```はbutton4.setBackgroundColor(y);```
|
184
|
+
|
185
|
+
```button5.setBackgroundColor(y); ```
|
186
|
+
|
187
|
+
```button6.setBackgroundColor(y); ```
|
188
|
+
|
189
|
+
```button7.setBackgroundColor(y);```
|
190
|
+
|
191
|
+
```button8.setBackgroundColor(y);```
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
```}```
|
196
|
+
|
197
|
+
```}```
|
192
198
|
|
193
199
|
|
194
200
|
|
@@ -202,21 +208,21 @@
|
|
202
208
|
|
203
209
|
|
204
210
|
|
205
|
-
class Click implements View.OnClickListener {
|
211
|
+
```class Click implements View.OnClickListener {```
|
206
|
-
|
212
|
+
|
207
|
-
@Override
|
213
|
+
```@Override```
|
208
|
-
|
214
|
+
|
209
|
-
public void onClick(View v) {
|
215
|
+
```、public void onClick(View v) {```
|
210
|
-
|
216
|
+
|
211
|
-
int y= getResources().getColor(R.color.y);
|
217
|
+
```int y= getResources().getColor(R.color.y);```
|
212
|
-
|
218
|
+
|
213
|
-
int x= getResources().getColor(R.color.x);
|
219
|
+
```int x= getResources().getColor(R.color.x);```
|
214
|
-
|
215
|
-
|
216
|
-
|
220
|
+
|
221
|
+
|
222
|
+
|
217
|
-
switch (v.getId()) {
|
223
|
+
```switch (v.getId()) {```
|
218
|
-
|
224
|
+
|
219
|
-
case (R.id.button):
|
225
|
+
```case (R.id.button):```
|
220
226
|
|
221
227
|
|
222
228
|
|
@@ -224,9 +230,9 @@
|
|
224
230
|
|
225
231
|
|
226
232
|
|
227
|
-
Button button=findViewById(R.id.button);
|
233
|
+
```Button button=findViewById(R.id.button);```
|
228
|
-
|
234
|
+
|
229
|
-
button2.setBackgroundColor(x);
|
235
|
+
```button2.setBackgroundColor(x);```
|
230
236
|
|
231
237
|
|
232
238
|
|
@@ -240,60 +246,34 @@
|
|
240
246
|
|
241
247
|
}
|
242
248
|
|
243
|
-
break;
|
249
|
+
```break;```
|
244
|
-
|
250
|
+
|
245
|
-
case (R.id.button2):
|
251
|
+
```case (R.id.button2):```
|
246
252
|
|
247
253
|
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
248
254
|
|
249
|
-
break;
|
255
|
+
```break;```
|
250
|
-
|
256
|
+
|
251
|
-
case (R.id.button3):
|
257
|
+
```case (R.id.button3):```
|
252
|
-
|
258
|
+
|
253
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
259
|
+
```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
|
254
|
-
|
260
|
+
|
255
|
-
break;
|
261
|
+
```break;```
|
256
|
-
|
262
|
+
|
257
|
-
|
263
|
+
//4から8も同じ感じで
|
258
|
-
|
259
|
-
|
264
|
+
|
260
|
-
|
261
|
-
|
265
|
+
|
262
|
-
|
263
|
-
|
266
|
+
|
264
|
-
|
265
|
-
Toast.makeText(MainActivity.this, "5がおされた", Toast.LENGTH_SHORT).show();
|
266
|
-
|
267
|
-
break;
|
268
|
-
|
269
|
-
case (R.id.button6):
|
270
|
-
|
271
|
-
Toast.makeText(MainActivity.this, "6がおされた", Toast.LENGTH_SHORT).show();
|
272
|
-
|
273
|
-
break;
|
274
|
-
|
275
|
-
case (R.id.button7):
|
276
|
-
|
277
|
-
Toast.makeText(MainActivity.this, "7がおされた", Toast.LENGTH_SHORT).show();
|
278
|
-
|
279
|
-
break;
|
280
|
-
|
281
|
-
case (R.id.button8):
|
282
|
-
|
283
|
-
Toast.makeText(MainActivity.this, "8がおされた", Toast.LENGTH_SHORT).show();
|
284
|
-
|
285
|
-
break;
|
286
|
-
|
287
|
-
case (R.id.button9):
|
267
|
+
```case (R.id.button9):```
|
288
|
-
|
268
|
+
|
289
|
-
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();
|
269
|
+
```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
|
290
|
-
|
270
|
+
|
291
|
-
break;
|
271
|
+
```break;```
|
292
|
-
|
272
|
+
|
293
|
-
}
|
273
|
+
```}```
|
294
|
-
|
274
|
+
|
295
|
-
}
|
275
|
+
```}```
|
296
|
-
|
276
|
+
|
297
|
-
}
|
277
|
+
```}```
|
298
|
-
|
278
|
+
|
299
|
-
}
|
279
|
+
```}```
|
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,31 +82,31 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
@Override
|
85
|
+
@Override
|
86
|
-
|
86
|
+
|
87
|
-
protected void onCreate(Bundle savedInstanceState) {
|
87
|
+
protected void onCreate(Bundle savedInstanceState) {
|
88
|
-
|
88
|
+
|
89
|
-
super.onCreate(savedInstanceState);
|
89
|
+
super.onCreate(savedInstanceState);
|
90
|
-
|
90
|
+
|
91
|
-
setContentView(R.layout.activity_main);
|
91
|
+
setContentView(R.layout.activity_main);
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
-
Button button_r = findViewById(R.id.button_r);
|
95
|
+
Button button_r = findViewById(R.id.button_r);
|
96
|
-
|
96
|
+
|
97
|
-
button_r.setOnClickListener(new MyClickListener());
|
97
|
+
button_r.setOnClickListener(new MyClickListener());
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
-
Button button1=findViewById(R.id.button);
|
101
|
+
Button button1=findViewById(R.id.button);
|
102
|
-
|
102
|
+
|
103
|
-
button1.setOnClickListener(new Click());
|
103
|
+
button1.setOnClickListener(new Click());
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
-
Button button2 =findViewById(R.id.button2);
|
107
|
+
Button button2 =findViewById(R.id.button2);
|
108
|
-
|
108
|
+
|
109
|
-
button2.setOnClickListener(new Click());
|
109
|
+
button2.setOnClickListener(new Click());
|
110
110
|
|
111
111
|
|
112
112
|
|
@@ -118,190 +118,182 @@
|
|
118
118
|
|
119
119
|
|
120
120
|
|
121
|
-
Button button9 =findViewById(R.id.button9);
|
121
|
+
Button button9 =findViewById(R.id.button9);
|
122
|
-
|
122
|
+
|
123
|
-
button9.setOnClickListener(new Click());
|
123
|
+
button9.setOnClickListener(new Click());
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
//ここはリセットなのできにしないで
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
class MyClickListener implements View.OnClickListener {
|
138
|
+
|
139
|
+
@Override
|
140
|
+
|
141
|
+
public void onClick(View v) {
|
142
|
+
|
143
|
+
Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
Button button=findViewById(R.id.button);
|
148
|
+
|
149
|
+
Button button1=findViewById(R.id.button2);
|
150
|
+
|
151
|
+
Button button2=findViewById(R.id.button3);
|
152
|
+
|
153
|
+
Button button3=findViewById(R.id.button4);
|
154
|
+
|
155
|
+
Button button4=findViewById(R.id.button5);
|
156
|
+
|
157
|
+
Button button5=findViewById(R.id.button6);
|
158
|
+
|
159
|
+
Button button6=findViewById(R.id.button7);
|
160
|
+
|
161
|
+
Button button7=findViewById(R.id.button8);
|
162
|
+
|
163
|
+
Button button8=findViewById(R.id.button9);
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
int y= getResources().getColor(R.color.y); //R.color.xxx は name=”xxx”とした時
|
168
|
+
|
169
|
+
button.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
170
|
+
|
171
|
+
button1.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
172
|
+
|
173
|
+
button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
174
|
+
|
175
|
+
button3.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
176
|
+
|
177
|
+
button4.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
178
|
+
|
179
|
+
button5.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
180
|
+
|
181
|
+
button6.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
182
|
+
|
183
|
+
button7.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
184
|
+
|
185
|
+
button8.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
//ここから悩んでる所です。
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
class Click implements View.OnClickListener {
|
206
|
+
|
207
|
+
@Override
|
208
|
+
|
209
|
+
public void onClick(View v) {
|
210
|
+
|
211
|
+
int y= getResources().getColor(R.color.y);
|
212
|
+
|
213
|
+
int x= getResources().getColor(R.color.x);
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
switch (v.getId()) {
|
218
|
+
|
219
|
+
case (R.id.button):
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
//ここをif文とかで判定したい
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
Button button=findViewById(R.id.button);
|
228
|
+
|
229
|
+
button2.setBackgroundColor(x);
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
//if(ここがわからない){
|
234
|
+
|
235
|
+
色を変える作業
|
236
|
+
|
237
|
+
}else{
|
238
|
+
|
239
|
+
//色を変える作業
|
124
240
|
|
125
241
|
}
|
126
242
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
//ここ
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
Toast.makeText(MainActivity.this, "
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
int
|
168
|
-
|
169
|
-
b
|
170
|
-
|
171
|
-
button
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
b
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
button7.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
184
|
-
|
185
|
-
button8.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
|
186
|
-
|
187
|
-
|
243
|
+
break;
|
244
|
+
|
245
|
+
case (R.id.button2):
|
246
|
+
|
247
|
+
//ここからボタン9までボタン1と同じ判定ような判定がしたい
|
248
|
+
|
249
|
+
break;
|
250
|
+
|
251
|
+
case (R.id.button3):
|
252
|
+
|
253
|
+
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
254
|
+
|
255
|
+
break;
|
256
|
+
|
257
|
+
case (R.id.button4):
|
258
|
+
|
259
|
+
Toast.makeText(MainActivity.this, "4がおされた", Toast.LENGTH_SHORT).show();
|
260
|
+
|
261
|
+
break;
|
262
|
+
|
263
|
+
case (R.id.button5):
|
264
|
+
|
265
|
+
Toast.makeText(MainActivity.this, "5がおされた", Toast.LENGTH_SHORT).show();
|
266
|
+
|
267
|
+
break;
|
268
|
+
|
269
|
+
case (R.id.button6):
|
270
|
+
|
271
|
+
Toast.makeText(MainActivity.this, "6がおされた", Toast.LENGTH_SHORT).show();
|
272
|
+
|
273
|
+
break;
|
274
|
+
|
275
|
+
case (R.id.button7):
|
276
|
+
|
277
|
+
Toast.makeText(MainActivity.this, "7がおされた", Toast.LENGTH_SHORT).show();
|
278
|
+
|
279
|
+
break;
|
280
|
+
|
281
|
+
case (R.id.button8):
|
282
|
+
|
283
|
+
Toast.makeText(MainActivity.this, "8がおされた", Toast.LENGTH_SHORT).show();
|
284
|
+
|
285
|
+
break;
|
286
|
+
|
287
|
+
case (R.id.button9):
|
288
|
+
|
289
|
+
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();
|
290
|
+
|
291
|
+
break;
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
}
|
296
|
+
|
297
|
+
}
|
188
298
|
|
189
299
|
}
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
//ここから悩んでる所です。
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
class Click implements View.OnClickListener {
|
206
|
-
|
207
|
-
@Override
|
208
|
-
|
209
|
-
public void onClick(View v) {
|
210
|
-
|
211
|
-
int y= getResources().getColor(R.color.y);
|
212
|
-
|
213
|
-
int x= getResources().getColor(R.color.x);
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
switch (v.getId()) {
|
218
|
-
|
219
|
-
case (R.id.button):
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
//ここをif文とかで判定したい
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
Button button=findViewById(R.id.button);
|
228
|
-
|
229
|
-
button2.setBackgroundColor(x);
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
//if(ここがわからない){
|
234
|
-
|
235
|
-
色を変える作業
|
236
|
-
|
237
|
-
}else{
|
238
|
-
|
239
|
-
//色を変える作業
|
240
|
-
|
241
|
-
}
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
break;
|
248
|
-
|
249
|
-
case (R.id.button2):
|
250
|
-
|
251
|
-
break;
|
252
|
-
|
253
|
-
case (R.id.button3):
|
254
|
-
|
255
|
-
Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
|
256
|
-
|
257
|
-
break;
|
258
|
-
|
259
|
-
case (R.id.button4):
|
260
|
-
|
261
|
-
Toast.makeText(MainActivity.this, "4がおされた", Toast.LENGTH_SHORT).show();
|
262
|
-
|
263
|
-
break;
|
264
|
-
|
265
|
-
case (R.id.button5):
|
266
|
-
|
267
|
-
Toast.makeText(MainActivity.this, "5がおされた", Toast.LENGTH_SHORT).show();
|
268
|
-
|
269
|
-
break;
|
270
|
-
|
271
|
-
case (R.id.button6):
|
272
|
-
|
273
|
-
Toast.makeText(MainActivity.this, "6がおされた", Toast.LENGTH_SHORT).show();
|
274
|
-
|
275
|
-
break;
|
276
|
-
|
277
|
-
case (R.id.button7):
|
278
|
-
|
279
|
-
Toast.makeText(MainActivity.this, "7がおされた", Toast.LENGTH_SHORT).show();
|
280
|
-
|
281
|
-
break;
|
282
|
-
|
283
|
-
case (R.id.button8):
|
284
|
-
|
285
|
-
Toast.makeText(MainActivity.this, "8がおされた", Toast.LENGTH_SHORT).show();
|
286
|
-
|
287
|
-
break;
|
288
|
-
|
289
|
-
case (R.id.button9):
|
290
|
-
|
291
|
-
Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();
|
292
|
-
|
293
|
-
break;
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
}
|
298
|
-
|
299
|
-
}
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
}
|