teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

68

2020/09/10 05:18

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -139,7 +139,7 @@
139
139
      case (R.id.button3):
140
140
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
141
141
        break;
142
-     //4から9も同じ感じで```
142
+     //4から9も同じ感じで
143
143
     }
144
144
    }
145
145
   }

67

2020/09/10 05:18

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -111,34 +111,37 @@
111
111
     button8.setBackgroundColor(y);
112
112
 
113
113
    }
114
+  }
114
-  }```
115
+ ```
115
116
 
116
117
 
117
- ```//ここから悩んでる所です。```
118
+ ``//ここから悩んでる所です。``
118
119
 
120
+  ```java:abr
119
121
   class Click implements View.OnClickListener {
120
122
    @Override
121
-   ```public void onClick(View v) {
123
+   public void onClick(View v) {
122
124
     int y=
123
- getResources().getColor(R.color.y);
125
+    getResources().getColor(R.color.y);
124
126
     int x=
125
- getResources().getColor(R.color.x);
127
+    getResources().getColor(R.color.x);
126
128
 
127
-    ```switch (v.getId()) {
129
+    switch (v.getId()) {
128
130
      case (R.id.button):
129
- //ここをif文とかで判定したい
131
+     //ここをif文とかで判定したい
130
132
       Button button=
131
- findViewById(R.id.button);
133
+      findViewById(R.id.button);
132
134
       button2.setBackgroundColor(x);
133
- //if(ここがわからない)
135
+       //if(ここがわからない)
134
-      break;
136
+       break;
135
137
      case (R.id.button2):
136
138
        break;
137
139
      case (R.id.button3):
138
140
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
139
-      break;
141
+       break;
140
- //4から9も同じ感じで```
142
+     //4から9も同じ感じで```
141
-    }```
143
+    }
142
-   }```
144
+   }
143
145
   }
144
- }
146
+ }
147
+ ```

66

2020/09/10 05:17

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -42,28 +42,28 @@
42
42
  public class MainActivity extends AppCompatActivity {
43
43
 
44
44
   @Override
45
-  protected void onCreate(Bundle savedInstanceState) {
45
+  protected void onCreate(Bundle savedInstanceState) {
46
46
    super.onCreate(savedInstanceState);
47
47
    setContentView(R.layout.activity_main);
48
48
 
49
49
    Button button_r =
50
- findViewById(R.id.button_r);
50
+   findViewById(R.id.button_r);
51
51
  button_r.setOnClickListener(new MyClickListener());
52
52
 
53
53
    Button button1=
54
- findViewById(R.id.button);
54
+   findViewById(R.id.button);
55
55
    button1.setOnClickListener(new Click());
56
56
 
57
57
    Button button2=
58
- findViewById(R.id.button2);
58
+   findViewById(R.id.button2);
59
59
    button2.setOnClickListener(new Click());
60
60
 
61
61
  //3~8も同じ
62
62
 
63
63
 
64
64
    Button button9=
65
- findViewById(R.id.button9);
65
+   findViewById(R.id.button9);
66
- button9.setOnClickListener(new Click());
66
+   button9.setOnClickListener(new Click());
67
67
   }
68
68
  ```
69
69
 
@@ -77,39 +77,40 @@
77
77
     Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
78
78
 
79
79
     Button button=
80
- findViewById(R.id.button);
80
+    findViewById(R.id.button);
81
81
     Button button1=
82
- findViewById(R.id.button2);
82
+    findViewById(R.id.button2);
83
83
     Button button2=
84
- findViewById(R.id.button3);
84
+    findViewById(R.id.button3);
85
85
     Button button3=
86
- findViewById(R.id.button4);
86
+    findViewById(R.id.button4);
87
87
     Button button4=
88
- findViewById(R.id.button5);
88
+    findViewById(R.id.button5);
89
89
     Button button5=
90
- findViewById(R.id.button6);
90
+    findViewById(R.id.button6);
91
91
     Button button6=
92
- findViewById(R.id.button7);
92
+    findViewById(R.id.button7);
93
93
     Button button7=
94
- findViewById(R.id.button8);
94
+    findViewById(R.id.button8);
95
95
     Button button8=
96
- findViewById(R.id.button9);
96
+    findViewById(R.id.button9);
97
97
 
98
98
     int y= getResources().getColor(R.color.y);
99
- //R.color.xxx は name=”xxx”とした時
99
+    //R.color.xxx は name=”xxx”とした時
100
100
     button.setBackgroundColor(y);
101
- // view は変更対象の部品に適宜置き換える
101
+    // view は変更対象の部品に適宜置き換える
102
102
     button1.setBackgroundColor(y);
103
- // view は変更対象の部品に適宜置き換える
103
+    // view は変更対象の部品に適宜置き換える
104
+    button2.setBackgroundColor(y);
104
-    button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
105
+    // view は変更対象の部品に適宜置き換える
105
-    ```button3.setBackgroundColor(y);```
106
+    button3.setBackgroundColor(y);
106
-    ```button4.setBackgroundColor(y);```
107
+    button4.setBackgroundColor(y);
107
-    ```button5.setBackgroundColor(y); ```
108
+    button5.setBackgroundColor(y);
108
-    ```button6.setBackgroundColor(y); ```
109
+    button6.setBackgroundColor(y);
109
-    ```button7.setBackgroundColor(y);```
110
+    button7.setBackgroundColor(y);
110
-    ```button8.setBackgroundColor(y);```
111
+    button8.setBackgroundColor(y);
111
112
 
112
-   }```
113
+   }
113
114
   }```
114
115
 
115
116
 

65

2020/09/10 05:13

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -38,66 +38,70 @@
38
38
  一応自分の作ってるやつ載せておきます。
39
39
 
40
40
 
41
+ ```java:br
41
42
  public class MainActivity extends AppCompatActivity {
42
43
 
43
44
   @Override
44
-  ```protected void onCreate(Bundle savedInstanceState) {
45
+  protected void onCreate(Bundle savedInstanceState) {
45
-   ```super.onCreate(savedInstanceState);```
46
+   super.onCreate(savedInstanceState);
46
-   ```setContentView(R.layout.activity_main);```
47
+   setContentView(R.layout.activity_main);
47
48
 
48
-   ```Button button_r =
49
+   Button button_r =
49
50
  findViewById(R.id.button_r);
50
- button_r.setOnClickListener(new MyClickListener());```
51
+ button_r.setOnClickListener(new MyClickListener());
51
52
 
52
-   ```Button button1=
53
+   Button button1=
53
54
  findViewById(R.id.button);
54
-   button1.setOnClickListener(new Click());```
55
+   button1.setOnClickListener(new Click());
55
56
 
56
-   ```Button button2=
57
+   Button button2=
57
58
  findViewById(R.id.button2);
58
-   button2.setOnClickListener(new Click());```
59
+   button2.setOnClickListener(new Click());
59
60
 
60
61
  //3~8も同じ
61
62
 
62
63
 
63
-   ```Button button9=
64
+   Button button9=
64
65
  findViewById(R.id.button9);
65
- button9.setOnClickListener(new Click());```
66
+ button9.setOnClickListener(new Click());
67
+  }
66
-  }```
68
+ ```
67
69
 
68
70
 
69
- ```//ここはリセットなのできにしないで```
71
+ ``//ここはリセットなのできにしないで``
72
+
73
+ ```java:rb
70
74
   class MyClickListener implements View.OnClickListener {
71
75
    @Override
72
-   ```public void onClick(View v) {
76
+   public void onClick(View v) {
73
-    ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
77
+    Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
74
78
 
75
-    ```Button button=
79
+    Button button=
76
- findViewById(R.id.button);```
80
+ findViewById(R.id.button);
77
-    ```Button button1=
81
+    Button button1=
78
- findViewById(R.id.button2);```
82
+ findViewById(R.id.button2);
79
-    ```Button button2=
83
+    Button button2=
80
- findViewById(R.id.button3);```
84
+ findViewById(R.id.button3);
81
-    ```Button button3=
85
+    Button button3=
82
- findViewById(R.id.button4);```
86
+ findViewById(R.id.button4);
83
-    ```Button button4=
87
+    Button button4=
84
- findViewById(R.id.button5);```
88
+ findViewById(R.id.button5);
85
-    ```Button button5=
89
+    Button button5=
86
- findViewById(R.id.button6);```
90
+ findViewById(R.id.button6);
87
-    ```Button button6=
91
+    Button button6=
88
- findViewById(R.id.button7);```
92
+ findViewById(R.id.button7);
89
-    ```Button button7=
93
+    Button button7=
90
- findViewById(R.id.button8);```
94
+ findViewById(R.id.button8);
91
-    ```Button button8=
95
+    Button button8=
92
- findViewById(R.id.button9);```
96
+ findViewById(R.id.button9);
93
97
 
94
-    ```int y= getResources().getColor(R.color.y); ```
98
+    int y= getResources().getColor(R.color.y);
95
99
  //R.color.xxx は name=”xxx”とした時
96
-    ```button.setBackgroundColor(y); ```
100
+    button.setBackgroundColor(y);
97
101
  // view は変更対象の部品に適宜置き換える
98
-    ```button1.setBackgroundColor(y);```
102
+    button1.setBackgroundColor(y);
99
103
  // view は変更対象の部品に適宜置き換える
100
-    ```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
104
+    button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
101
105
     ```button3.setBackgroundColor(y);```
102
106
     ```button4.setBackgroundColor(y);```
103
107
     ```button5.setBackgroundColor(y); ```

64

2020/09/10 05:10

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -1,7 +1,7 @@
1
1
  前提・実現したい
2
2
 
3
3
  android studioで、3×3のボタンがあるんですが、そのボタンの1つを押すとそのボタンと上下左右のボタンの色が変える
4
- ってやつをやりたいんですが、どうやったらいいですかね? 
4
+ ってやつをやりたいんですが、どうやったらいいですかね?
5
5
  色は2色でcolors.xmlでxとyって名前になってます。
6
6
 
7
7
  一応ボタンの色がxの時はyにyの時はxにするって処理なんですが

63

2020/09/10 03:35

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -1,7 +1,7 @@
1
1
  前提・実現したい
2
2
 
3
3
  android studioで、3×3のボタンがあるんですが、そのボタンの1つを押すとそのボタンと上下左右のボタンの色が変える
4
- ってやつをやりたいんですが、どうやったらいいですかね?
4
+ ってやつをやりたいんですが、どうやったらいいですかね? 
5
5
  色は2色でcolors.xmlでxとyって名前になってます。
6
6
 
7
7
  一応ボタンの色がxの時はyにyの時はxにするって処理なんですが

62

2020/09/10 03:35

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -132,7 +132,7 @@
132
132
      case (R.id.button3):
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
134
       break;
135
- //4から9も同じ感じで
135
+ //4から9も同じ感じで```
136
136
     }```
137
137
    }```
138
138
   }

61

2020/09/10 03:34

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -114,7 +114,7 @@
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
-    ```int y=
117
+    int y=
118
118
  getResources().getColor(R.color.y);
119
119
     int x=
120
120
  getResources().getColor(R.color.x);
@@ -132,7 +132,7 @@
132
132
      case (R.id.button3):
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
134
       break;
135
- //4から9も同じ感じで```
135
+ //4から9も同じ感じで
136
136
     }```
137
137
    }```
138
138
   }

60

2020/09/10 03:33

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -115,9 +115,9 @@
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
117
     ```int y=
118
- getResources().getColor(R.color.y);```
118
+ getResources().getColor(R.color.y);
119
-    ```int x=
119
+    int x=
120
- getResources().getColor(R.color.x);```
120
+ getResources().getColor(R.color.x);
121
121
 
122
122
     ```switch (v.getId()) {
123
123
      case (R.id.button):

59

2020/09/10 03:33

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -133,7 +133,7 @@
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
134
       break;
135
135
  //4から9も同じ感じで```
136
-    }
136
+    }```
137
137
    }```
138
138
   }
139
139
  }

58

2020/09/10 03:32

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -115,11 +115,11 @@
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
117
     ```int y=
118
- getResources().getColor(R.color.y);
118
+ getResources().getColor(R.color.y);```
119
-    int x=
119
+    ```int x=
120
120
  getResources().getColor(R.color.x);```
121
121
 
122
-    switch (v.getId()) {
122
+    ```switch (v.getId()) {
123
123
      case (R.id.button):
124
124
  //ここをif文とかで判定したい
125
125
       Button button=
@@ -132,7 +132,7 @@
132
132
      case (R.id.button3):
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
134
       break;
135
- //4から9も同じ感じで
135
+ //4から9も同じ感じで```
136
136
     }
137
137
    }```
138
138
   }

57

2020/09/10 03:32

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -114,13 +114,13 @@
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
-    int y=
117
+    ```int y=
118
118
  getResources().getColor(R.color.y);
119
119
     int x=
120
120
  getResources().getColor(R.color.x);```
121
121
 
122
122
     switch (v.getId()) {
123
-     ```case (R.id.button):
123
+     case (R.id.button):
124
124
  //ここをif文とかで判定したい
125
125
       Button button=
126
126
  findViewById(R.id.button);
@@ -131,7 +131,7 @@
131
131
        break;
132
132
      case (R.id.button3):
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
-      break;```
134
+      break;
135
135
  //4から9も同じ感じで
136
136
     }
137
137
    }```

56

2020/09/10 03:31

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -120,7 +120,7 @@
120
120
  getResources().getColor(R.color.x);```
121
121
 
122
122
     switch (v.getId()) {
123
-     case (R.id.button):
123
+     ```case (R.id.button):
124
124
  //ここをif文とかで判定したい
125
125
       Button button=
126
126
  findViewById(R.id.button);
@@ -131,7 +131,7 @@
131
131
        break;
132
132
      case (R.id.button3):
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
-      break;
134
+      break;```
135
135
  //4から9も同じ感じで
136
136
     }
137
137
    }```

55

2020/09/10 03:30

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -114,12 +114,12 @@
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
-    ```int y=
117
+    int y=
118
118
  getResources().getColor(R.color.y);
119
119
     int x=
120
120
  getResources().getColor(R.color.x);```
121
121
 
122
-    ```switch (v.getId()) {
122
+    switch (v.getId()) {
123
123
      case (R.id.button):
124
124
  //ここをif文とかで判定したい
125
125
       Button button=
@@ -133,7 +133,7 @@
133
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
134
       break;
135
135
  //4から9も同じ感じで
136
-    }```
136
+    }
137
137
    }```
138
138
   }
139
139
  }

54

2020/09/10 03:29

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -113,11 +113,13 @@
113
113
 
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
-   ```public void onClick(View v) {```
116
+   ```public void onClick(View v) {
117
+    ```int y=
117
-    int y= getResources().getColor(R.color.y);
118
+ getResources().getColor(R.color.y);
119
+    int x=
118
-    int x= getResources().getColor(R.color.x);
120
+ getResources().getColor(R.color.x);```
119
121
 
120
-    switch (v.getId()) {
122
+    ```switch (v.getId()) {
121
123
      case (R.id.button):
122
124
  //ここをif文とかで判定したい
123
125
       Button button=
@@ -131,7 +133,7 @@
131
133
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
132
134
       break;
133
135
  //4から9も同じ感じで
134
-    }
135
-   ```}```
136
+    }```
137
+   }```
136
138
   }
137
139
  }

53

2020/09/10 03:28

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -113,8 +113,8 @@
113
113
 
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
-   ```public void onClick(View v) {
116
+   ```public void onClick(View v) {```
117
-    ```int y= getResources().getColor(R.color.y);
117
+    int y= getResources().getColor(R.color.y);
118
118
     int x= getResources().getColor(R.color.x);
119
119
 
120
120
     switch (v.getId()) {

52

2020/09/10 03:26

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -132,6 +132,6 @@
132
132
       break;
133
133
  //4から9も同じ感じで
134
134
     }
135
-   }```
135
+   ```}```
136
136
   }
137
137
  }

51

2020/09/10 03:24

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -114,7 +114,7 @@
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
-    int y= getResources().getColor(R.color.y);
117
+    ```int y= getResources().getColor(R.color.y);
118
118
     int x= getResources().getColor(R.color.x);
119
119
 
120
120
     switch (v.getId()) {

50

2020/09/10 03:24

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -114,14 +114,14 @@
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
-    ```int y= getResources().getColor(R.color.y);
117
+    int y= getResources().getColor(R.color.y);
118
118
     int x= getResources().getColor(R.color.x);
119
119
 
120
120
     switch (v.getId()) {
121
121
      case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
-      Button
123
+      Button button=
124
- button=findViewById(R.id.button);
124
+ findViewById(R.id.button);
125
125
       button2.setBackgroundColor(x);
126
126
  //if(ここがわからない)
127
127
       break;

49

2020/09/10 03:23

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -114,24 +114,24 @@
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
116
    ```public void onClick(View v) {
117
-    ```int y= getResources().getColor(R.color.y);```
117
+    ```int y= getResources().getColor(R.color.y);
118
-    ```int x= getResources().getColor(R.color.x);```
118
+    int x= getResources().getColor(R.color.x);
119
119
 
120
-    ```switch (v.getId()) {```
120
+    switch (v.getId()) {
121
-     ```case (R.id.button):
121
+     case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
123
       Button
124
124
  button=findViewById(R.id.button);
125
125
       button2.setBackgroundColor(x);
126
126
  //if(ここがわからない)
127
-      break;```
127
+      break;
128
-     ```case (R.id.button2):
128
+     case (R.id.button2):
129
-       break;```
129
+       break;
130
-     ```case (R.id.button3):
130
+     case (R.id.button3):
131
131
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
132
-      break;```
132
+      break;
133
133
  //4から9も同じ感じで
134
+    }
134
-    }```
135
+   }```
135
-   }
136
136
   }
137
137
  }

48

2020/09/10 03:21

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -117,7 +117,7 @@
117
117
     ```int y= getResources().getColor(R.color.y);```
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
-    ```switch (v.getId()) {
120
+    ```switch (v.getId()) {```
121
121
      ```case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
123
       Button

47

2020/09/10 03:19

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -132,6 +132,6 @@
132
132
       break;```
133
133
  //4から9も同じ感じで
134
134
     }```
135
-   }```
135
+   }
136
-  }```
136
+  }
137
137
  }

46

2020/09/10 03:18

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -133,5 +133,5 @@
133
133
  //4から9も同じ感じで
134
134
     }```
135
135
    }```
136
-  }
136
+  }```
137
137
  }

45

2020/09/10 03:18

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,18 +118,18 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):```
121
+     ```case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
-      ```Button
123
+      Button
124
- button=findViewById(R.id.button);```
124
+ button=findViewById(R.id.button);
125
-      ```button2.setBackgroundColor(x);```
125
+      button2.setBackgroundColor(x);
126
126
  //if(ここがわからない)
127
-      ```break;```
127
+      break;```
128
-     ```case (R.id.button2):```
128
+     ```case (R.id.button2):
129
-       ```break;```
129
+       break;```
130
-     ```case (R.id.button3):```
130
+     ```case (R.id.button3):
131
-      ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
131
+      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
132
-      ```break;```
132
+      break;```
133
133
  //4から9も同じ感じで
134
134
     }```
135
135
    }```

44

2020/09/10 03:13

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,26 +118,19 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):
121
+     ```case (R.id.button):```
122
122
  //ここをif文とかで判定したい
123
123
       ```Button
124
124
  button=findViewById(R.id.button);```
125
125
       ```button2.setBackgroundColor(x);```
126
126
  //if(ここがわからない)
127
- //色を変える作業
128
- //else
129
- //色を変える作業
130
-      break;```
127
+      ```break;```
131
-     ```case (R.id.button2):
128
+     ```case (R.id.button2):```
132
-       break;```
129
+       ```break;```
133
-     ```case (R.id.button3):
130
+     ```case (R.id.button3):```
134
131
       ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
135
-      break;```
132
+      ```break;```
136
- //4から8も同じ感じで
133
+ //4から9も同じ感じで
137
-
138
-      ```case (R.id.button9):
139
-      Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
140
-      break;```
141
134
     }```
142
135
    }```
143
136
   }

43

2020/09/10 03:12

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -131,13 +131,13 @@
131
131
      ```case (R.id.button2):
132
132
        break;```
133
133
      ```case (R.id.button3):
134
-      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
134
+      ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
135
-      ```break;```
135
+      break;```
136
136
  //4から8も同じ感じで
137
137
 
138
138
       ```case (R.id.button9):
139
139
       Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
140
-      ```break;```
140
+      break;```
141
141
     }```
142
142
    }```
143
143
   }

42

2020/09/10 03:10

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,7 +118,7 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):```
121
+     ```case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
123
       ```Button
124
124
  button=findViewById(R.id.button);```
@@ -127,7 +127,7 @@
127
127
  //色を変える作業
128
128
  //else
129
129
  //色を変える作業
130
-      ```break;```
130
+      break;```
131
131
      ```case (R.id.button2):
132
132
        break;```
133
133
      ```case (R.id.button3):

41

2020/09/10 03:08

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,15 +118,15 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):
121
+     ```case (R.id.button):```
122
122
  //ここをif文とかで判定したい
123
-      Button
123
+      ```Button
124
124
  button=findViewById(R.id.button);```
125
125
       ```button2.setBackgroundColor(x);```
126
- ```//if(ここがわからない)```
126
+ //if(ここがわからない)
127
- ```//色を変える作業```
127
+ //色を変える作業
128
- ```//else```
128
+ //else
129
- ```//色を変える作業```
129
+ //色を変える作業
130
130
       ```break;```
131
131
      ```case (R.id.button2):
132
132
        break;```

40

2020/09/10 03:08

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -140,5 +140,5 @@
140
140
       ```break;```
141
141
     }```
142
142
    }```
143
-  ```}```
143
+  }
144
- ```}```
144
+ }

39

2020/09/10 03:05

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -123,17 +123,16 @@
123
123
       Button
124
124
  button=findViewById(R.id.button);```
125
125
       ```button2.setBackgroundColor(x);```
126
- ```//if(ここがわからない){
126
+ ```//if(ここがわからない)```
127
- //色を変える作業
127
+ ```//色を変える作業```
128
- //}else{
128
+ ```//else```
129
- //色を変える作業
129
+ ```//色を変える作業```
130
- //}
131
-      break;```
130
+      ```break;```
132
131
      ```case (R.id.button2):
133
132
        break;```
134
133
      ```case (R.id.button3):
135
134
       Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
136
-      break;```
135
+      ```break;```
137
136
  //4から8も同じ感じで
138
137
 
139
138
       ```case (R.id.button9):

38

2020/09/10 03:04

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -120,8 +120,9 @@
120
120
     ```switch (v.getId()) {
121
121
      ```case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
+      Button
123
-      Button button=findViewById(R.id.button);
124
+ button=findViewById(R.id.button);```
124
-      button2.setBackgroundColor(x);```
125
+      ```button2.setBackgroundColor(x);```
125
126
  ```//if(ここがわからない){
126
127
  //色を変える作業
127
128
  //}else{

37

2020/09/10 03:01

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,25 +118,25 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):```
121
+     ```case (R.id.button):
122
- ```//ここをif文とかで判定したい```
122
+ //ここをif文とかで判定したい
123
-      ```Button button=findViewById(R.id.button);
123
+      Button button=findViewById(R.id.button);
124
124
       button2.setBackgroundColor(x);```
125
125
  ```//if(ここがわからない){
126
126
  //色を変える作業
127
127
  //}else{
128
128
  //色を変える作業
129
- //}```
129
+ //}
130
-      ```break;```
130
+      break;```
131
-     ```case (R.id.button2):```
131
+     ```case (R.id.button2):
132
-       ```break;```
132
+       break;```
133
-     ```case (R.id.button3):```
133
+     ```case (R.id.button3):
134
-      ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
134
+      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
135
-      ```break;```
135
+      break;```
136
136
  //4から8も同じ感じで
137
137
 
138
-      ```case (R.id.button9):```
138
+      ```case (R.id.button9):
139
-      ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
139
+      Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
140
140
       ```break;```
141
141
     }```
142
142
    }```

36

2020/09/10 02:59

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,25 +118,25 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):
121
+     ```case (R.id.button):```
122
- //ここをif文とかで判定したい
122
+ ```//ここをif文とかで判定したい```
123
-      Button button=findViewById(R.id.button);
123
+      ```Button button=findViewById(R.id.button);
124
124
       button2.setBackgroundColor(x);```
125
125
  ```//if(ここがわからない){
126
126
  //色を変える作業
127
127
  //}else{
128
128
  //色を変える作業
129
- //}
129
+ //}```
130
-      break;```
131
-     ```case (R.id.button2):
132
-       break;```
133
-     ```case (R.id.button3):
134
-      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
135
130
       ```break;```
131
+     ```case (R.id.button2):```
132
+       ```break;```
133
+     ```case (R.id.button3):```
134
+      ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
135
+      ```break;```
136
136
  //4から8も同じ感じで
137
137
 
138
-      ```case (R.id.button9):
138
+      ```case (R.id.button9):```
139
-      Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
139
+      ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
140
140
       ```break;```
141
141
     }```
142
142
    }```

35

2020/09/10 02:57

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -121,22 +121,22 @@
121
121
      ```case (R.id.button):
122
122
  //ここをif文とかで判定したい
123
123
       Button button=findViewById(R.id.button);
124
-      button2.setBackgroundColor(x);
124
+      button2.setBackgroundColor(x);```
125
- //if(ここがわからない){
125
+ ```//if(ここがわからない){
126
126
  //色を変える作業
127
127
  //}else{
128
128
  //色を変える作業
129
129
  //}
130
130
       break;```
131
131
      ```case (R.id.button2):
132
-      break;```
132
+       break;```
133
133
      ```case (R.id.button3):
134
-      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
134
+      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
135
-      break;```
135
+      ```break;```
136
- ```//4から8も同じ感じで```
136
+ //4から8も同じ感じで
137
137
 
138
-      ```case (R.id.button9):```
138
+      ```case (R.id.button9):
139
-      ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
139
+      Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
140
140
       ```break;```
141
141
     }```
142
142
    }```

34

2020/09/10 02:54

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -122,19 +122,17 @@
122
122
  //ここをif文とかで判定したい
123
123
       Button button=findViewById(R.id.button);
124
124
       button2.setBackgroundColor(x);
125
-
126
- ```//if(ここがわからない){
125
+ //if(ここがわからない){
127
- 色を変える作業
128
- }else{
129
126
  //色を変える作業
127
+ //}else{
128
+ //色を変える作業
130
- }```
129
+ //}
131
130
       break;```
132
-     ```case (R.id.button2):```
131
+     ```case (R.id.button2):
133
- ```//ここからボタン9までボタン1と同じ判定ような判定がしたい```
134
-      ```break;```
132
+      break;```
135
-     ```case (R.id.button3):```
133
+     ```case (R.id.button3):
136
-      ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
134
+      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
137
-      ```break;```
135
+      break;```
138
136
  ```//4から8も同じ感じで```
139
137
 
140
138
       ```case (R.id.button9):```

33

2020/09/10 02:52

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -118,11 +118,9 @@
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
-     ```case (R.id.button):```
121
+     ```case (R.id.button):
122
-
123
- ```//ここをif文とかで判定したい```
122
+ //ここをif文とかで判定したい
124
-
125
-      ```Button button=findViewById(R.id.button);
123
+      Button button=findViewById(R.id.button);
126
124
       button2.setBackgroundColor(x);
127
125
 
128
126
  ```//if(ここがわからない){

32

2020/09/10 02:49

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
File without changes

31

2020/09/10 02:48

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -144,5 +144,5 @@
144
144
       ```break;```
145
145
     }```
146
146
    }```
147
-  }```
147
+  ```}```
148
- }```
148
+ ```}```

30

2020/09/10 02:48

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -38,7 +38,7 @@
38
38
  一応自分の作ってるやつ載せておきます。
39
39
 
40
40
 
41
- ```public class MainActivity extends AppCompatActivity {
41
+ public class MainActivity extends AppCompatActivity {
42
42
 
43
43
   @Override
44
44
   ```protected void onCreate(Bundle savedInstanceState) {
@@ -67,7 +67,7 @@
67
67
 
68
68
 
69
69
  ```//ここはリセットなのできにしないで```
70
-  ```class MyClickListener implements View.OnClickListener {
70
+  class MyClickListener implements View.OnClickListener {
71
71
    @Override
72
72
    ```public void onClick(View v) {
73
73
     ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```

29

2020/09/10 02:47

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -122,15 +122,15 @@
122
122
 
123
123
  ```//ここをif文とかで判定したい```
124
124
 
125
-      ```Button button=findViewById(R.id.button);```
125
+      ```Button button=findViewById(R.id.button);
126
-      ```button2.setBackgroundColor(x);```
126
+      button2.setBackgroundColor(x);
127
127
 
128
128
  ```//if(ここがわからない){
129
129
  色を変える作業
130
130
  }else{
131
131
  //色を変える作業
132
132
  }```
133
-      ```break;```
133
+      break;```
134
134
      ```case (R.id.button2):```
135
135
  ```//ここからボタン9までボタン1と同じ判定ような判定がしたい```
136
136
       ```break;```

28

2020/09/10 02:46

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -38,7 +38,7 @@
38
38
  一応自分の作ってるやつ載せておきます。
39
39
 
40
40
 
41
- public class MainActivity extends AppCompatActivity {
41
+ ```public class MainActivity extends AppCompatActivity {
42
42
 
43
43
   @Override
44
44
   ```protected void onCreate(Bundle savedInstanceState) {
@@ -67,7 +67,7 @@
67
67
 
68
68
 
69
69
  ```//ここはリセットなのできにしないで```
70
-  class MyClickListener implements View.OnClickListener {
70
+  ```class MyClickListener implements View.OnClickListener {
71
71
    @Override
72
72
    ```public void onClick(View v) {
73
73
     ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
@@ -144,5 +144,5 @@
144
144
       ```break;```
145
145
     }```
146
146
    }```
147
-  ```}```
147
+  }```
148
- ```}```
148
+ }```

27

2020/09/10 02:44

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -143,6 +143,6 @@
143
143
       ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
144
144
       ```break;```
145
145
     }```
146
-   ```}```
146
+   }```
147
147
   ```}```
148
148
  ```}```

26

2020/09/10 02:42

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -113,31 +113,31 @@
113
113
 
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
-   ```public void onClick(View v) {```
116
+   ```public void onClick(View v) {
117
117
     ```int y= getResources().getColor(R.color.y);```
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 
120
120
     ```switch (v.getId()) {
121
121
      ```case (R.id.button):```
122
122
 
123
- //ここをif文とかで判定したい
123
+ ```//ここをif文とかで判定したい```
124
124
 
125
125
       ```Button button=findViewById(R.id.button);```
126
126
       ```button2.setBackgroundColor(x);```
127
127
 
128
- //if(ここがわからない){
128
+ ```//if(ここがわからない){
129
129
  色を変える作業
130
130
  }else{
131
131
  //色を変える作業
132
- }
132
+ }```
133
133
       ```break;```
134
134
      ```case (R.id.button2):```
135
- //ここからボタン9までボタン1と同じ判定ような判定がしたい
135
+ ```//ここからボタン9までボタン1と同じ判定ような判定がしたい```
136
136
       ```break;```
137
137
      ```case (R.id.button3):```
138
138
       ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
139
139
       ```break;```
140
- //4から8も同じ感じで
140
+ ```//4から8も同じ感じで```
141
141
 
142
142
       ```case (R.id.button9):```
143
143
       ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```

25

2020/09/10 02:41

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -113,7 +113,7 @@
113
113
 
114
114
   class Click implements View.OnClickListener {
115
115
    @Override
116
-   ```public void onClick(View v) {
116
+   ```public void onClick(View v) {```
117
117
     ```int y= getResources().getColor(R.color.y);```
118
118
     ```int x= getResources().getColor(R.color.x);```
119
119
 

24

2020/09/10 02:39

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -143,6 +143,6 @@
143
143
       ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
144
144
       ```break;```
145
145
     }```
146
-   }```
146
+   ```}```
147
147
   ```}```
148
148
  ```}```

23

2020/09/10 02:37

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -144,5 +144,5 @@
144
144
       ```break;```
145
145
     }```
146
146
    }```
147
-  }```
147
+  ```}```
148
148
  ```}```

22

2020/09/10 02:37

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -111,8 +111,6 @@
111
111
 
112
112
  ```//ここから悩んでる所です。```
113
113
 
114
-
115
-
116
114
   class Click implements View.OnClickListener {
117
115
    @Override
118
116
    ```public void onClick(View v) {
@@ -147,4 +145,4 @@
147
145
     }```
148
146
    }```
149
147
   }```
150
- }```
148
+ ```}```

21

2020/09/10 02:36

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -109,7 +109,7 @@
109
109
   }```
110
110
 
111
111
 
112
- //ここから悩んでる所です。
112
+ ```//ここから悩んでる所です。```
113
113
 
114
114
 
115
115
 

20

2020/09/10 02:35

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -146,5 +146,5 @@
146
146
       ```break;```
147
147
     }```
148
148
    }```
149
-  ```}```
149
+  }```
150
- ```}```
150
+ }```

19

2020/09/10 02:34

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -106,20 +106,20 @@
106
106
     ```button8.setBackgroundColor(y);```
107
107
 
108
108
    }```
109
-  }```
109
+  }```
110
110
 
111
111
 
112
112
  //ここから悩んでる所です。
113
113
 
114
114
 
115
115
 
116
-  ```class Click implements View.OnClickListener {```
116
+  class Click implements View.OnClickListener {
117
-   ```@Override```
117
+   @Override
118
-   ```public void onClick(View v) {```
118
+   ```public void onClick(View v) {
119
119
     ```int y= getResources().getColor(R.color.y);```
120
120
     ```int x= getResources().getColor(R.color.x);```
121
121
 
122
-    ```switch (v.getId()) {```
122
+    ```switch (v.getId()) {
123
123
      ```case (R.id.button):```
124
124
 
125
125
  //ここをif文とかで判定したい
@@ -144,7 +144,7 @@
144
144
       ```case (R.id.button9):```
145
145
       ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
146
146
       ```break;```
147
-    ```}```
147
+    }```
148
-   ```}```
148
+   }```
149
149
   ```}```
150
150
  ```}```

18

2020/09/10 02:33

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -99,14 +99,14 @@
99
99
  // view は変更対象の部品に適宜置き換える
100
100
     ```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
101
101
     ```button3.setBackgroundColor(y);```
102
-    ```button4.setBackgroundColor(y);```
102
+    ```button4.setBackgroundColor(y);```
103
103
     ```button5.setBackgroundColor(y); ```
104
104
     ```button6.setBackgroundColor(y); ```
105
105
     ```button7.setBackgroundColor(y);```
106
106
     ```button8.setBackgroundColor(y);```
107
107
 
108
108
    }```
109
-  }
109
+  }```
110
110
 
111
111
 
112
112
  //ここから悩んでる所です。

17

2020/09/10 02:31

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -67,7 +67,7 @@
67
67
 
68
68
 
69
69
  ```//ここはリセットなのできにしないで```
70
-  ```class MyClickListener implements View.OnClickListener {
70
+  class MyClickListener implements View.OnClickListener {
71
71
    @Override
72
72
    ```public void onClick(View v) {
73
73
     ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
@@ -106,7 +106,7 @@
106
106
     ```button8.setBackgroundColor(y);```
107
107
 
108
108
    }```
109
-  }```
109
+  }
110
110
 
111
111
 
112
112
  //ここから悩んでる所です。

16

2020/09/10 02:30

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -67,8 +67,6 @@
67
67
 
68
68
 
69
69
  ```//ここはリセットなのできにしないで```
70
-
71
-
72
70
   ```class MyClickListener implements View.OnClickListener {
73
71
    @Override
74
72
    ```public void onClick(View v) {

15

2020/09/10 02:28

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -66,7 +66,7 @@
66
66
   }```
67
67
 
68
68
 
69
- ```//ここはリセットなのできにしないで
69
+ ```//ここはリセットなのできにしないで```
70
70
 
71
71
 
72
72
   ```class MyClickListener implements View.OnClickListener {

14

2020/09/10 02:27

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -66,7 +66,7 @@
66
66
   }```
67
67
 
68
68
 
69
- >ここはリセットなのできにしないで
69
+ ```//ここはリセットなのできにしないで
70
70
 
71
71
 
72
72
   ```class MyClickListener implements View.OnClickListener {

13

2020/09/10 02:27

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -53,16 +53,15 @@
53
53
  findViewById(R.id.button);
54
54
    button1.setOnClickListener(new Click());```
55
55
 
56
-   ```Button button2
56
+   ```Button button2=
57
- =findViewById(R.id.button2);
57
+ findViewById(R.id.button2);
58
58
    button2.setOnClickListener(new Click());```
59
59
 
60
60
  //3~8も同じ
61
61
 
62
62
 
63
-   ```Button button9
63
+   ```Button button9=
64
-
65
- =findViewById(R.id.button9);
64
+ findViewById(R.id.button9);
66
65
  button9.setOnClickListener(new Click());```
67
66
   }```
68
67
 

12

2020/09/10 02:26

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -61,6 +61,7 @@
61
61
 
62
62
 
63
63
    ```Button button9
64
+
64
65
  =findViewById(R.id.button9);
65
66
  button9.setOnClickListener(new Click());```
66
67
   }```

11

2020/09/10 02:25

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -60,7 +60,9 @@
60
60
  //3~8も同じ
61
61
 
62
62
 
63
+   ```Button button9
64
+ =findViewById(R.id.button9);
63
-   ```Button button9 =findViewById(R.id.button9);button9.setOnClickListener(new Click());```
65
+ button9.setOnClickListener(new Click());```
64
66
   }```
65
67
 
66
68
 

10

2020/09/10 02:25

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -45,13 +45,16 @@
45
45
    ```super.onCreate(savedInstanceState);```
46
46
    ```setContentView(R.layout.activity_main);```
47
47
 
48
+   ```Button button_r =
48
-   ```Button button_r = findViewById(R.id.button_r);
49
+ findViewById(R.id.button_r);
49
50
  button_r.setOnClickListener(new MyClickListener());```
50
51
 
52
+   ```Button button1=
51
-   ```Button button1=findViewById(R.id.button);
53
+ findViewById(R.id.button);
52
54
    button1.setOnClickListener(new Click());```
53
55
 
56
+   ```Button button2
54
-   ```Button button2 =findViewById(R.id.button2);
57
+ =findViewById(R.id.button2);
55
58
    button2.setOnClickListener(new Click());```
56
59
 
57
60
  //3~8も同じ
@@ -61,7 +64,7 @@
61
64
   }```
62
65
 
63
66
 
64
- //ここはリセットなのできにしないで
67
+ >ここはリセットなのできにしないで
65
68
 
66
69
 
67
70
   ```class MyClickListener implements View.OnClickListener {
@@ -69,15 +72,24 @@
69
72
    ```public void onClick(View v) {
70
73
     ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
71
74
 
75
+    ```Button button=
72
-    ```Button button=findViewById(R.id.button);```
76
+ findViewById(R.id.button);```
77
+    ```Button button1=
73
-    ```Button button1=findViewById(R.id.button2);```
78
+ findViewById(R.id.button2);```
79
+    ```Button button2=
74
-    ```Button button2=findViewById(R.id.button3);```
80
+ findViewById(R.id.button3);```
81
+    ```Button button3=
75
-    ```Button button3=findViewById(R.id.button4);```
82
+ findViewById(R.id.button4);```
83
+    ```Button button4=
76
-    ```Button button4=findViewById(R.id.button5);```
84
+ findViewById(R.id.button5);```
85
+    ```Button button5=
77
-    ```Button button5=findViewById(R.id.button6);```
86
+ findViewById(R.id.button6);```
87
+    ```Button button6=
78
-    ```Button button6=findViewById(R.id.button7);```
88
+ findViewById(R.id.button7);```
89
+    ```Button button7=
79
-    ```Button button7=findViewById(R.id.button8);```
90
+ findViewById(R.id.button8);```
91
+    ```Button button8=
80
-    ```Button button8=findViewById(R.id.button9);```
92
+ findViewById(R.id.button9);```
81
93
 
82
94
     ```int y= getResources().getColor(R.color.y); ```
83
95
  //R.color.xxx は name=”xxx”とした時

9

2020/09/10 02:24

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -64,9 +64,9 @@
64
64
  //ここはリセットなのできにしないで
65
65
 
66
66
 
67
-  ```class MyClickListener implements View.OnClickListener {```
67
+  ```class MyClickListener implements View.OnClickListener {
68
68
    @Override
69
-   ```public void onClick(View v) {```
69
+   ```public void onClick(View v) {
70
70
     ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
71
71
 
72
72
     ```Button button=findViewById(R.id.button);```
@@ -93,8 +93,8 @@
93
93
     ```button7.setBackgroundColor(y);```
94
94
     ```button8.setBackgroundColor(y);```
95
95
 
96
-   ```}```
96
+   }```
97
-  ```}```
97
+  }```
98
98
 
99
99
 
100
100
  //ここから悩んでる所です。

8

2020/09/10 02:21

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -65,7 +65,7 @@
65
65
 
66
66
 
67
67
   ```class MyClickListener implements View.OnClickListener {```
68
-   ```@Override```
68
+   @Override
69
69
    ```public void onClick(View v) {```
70
70
     ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
71
71
 

7

2020/09/10 02:20

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -40,7 +40,7 @@
40
40
 
41
41
  public class MainActivity extends AppCompatActivity {
42
42
 
43
-  ```@Override```
43
+  @Override
44
44
   ```protected void onCreate(Bundle savedInstanceState) {
45
45
    ```super.onCreate(savedInstanceState);```
46
46
    ```setContentView(R.layout.activity_main);```

6

2020/09/10 02:20

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
File without changes

5

2020/09/10 02:19

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
File without changes

4

2020/09/10 02:19

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -41,7 +41,7 @@
41
41
  public class MainActivity extends AppCompatActivity {
42
42
 
43
43
   ```@Override```
44
-  ```protected void onCreate(Bundle savedInstanceState) {```
44
+  ```protected void onCreate(Bundle savedInstanceState) {
45
45
    ```super.onCreate(savedInstanceState);```
46
46
    ```setContentView(R.layout.activity_main);```
47
47
 
@@ -58,7 +58,7 @@
58
58
 
59
59
 
60
60
    ```Button button9 =findViewById(R.id.button9);button9.setOnClickListener(new Click());```
61
-  ```}```
61
+  }```
62
62
 
63
63
 
64
64
  //ここはリセットなのできにしないで

3

2020/09/10 02:18

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -45,21 +45,19 @@
45
45
    ```super.onCreate(savedInstanceState);```
46
46
    ```setContentView(R.layout.activity_main);```
47
47
 
48
-   ```Button button_r = findViewById(R.id.button_r);```
48
+   ```Button button_r = findViewById(R.id.button_r);
49
+ button_r.setOnClickListener(new MyClickListener());```
49
50
 
51
+   ```Button button1=findViewById(R.id.button);
50
- ```button_r.setOnClickListener(new MyClickListener());```
52
+   button1.setOnClickListener(new Click());```
51
53
 
52
-   ```Button button1=findViewById(R.id.button);```
54
+   ```Button button2 =findViewById(R.id.button2);
53
-   ```button1.setOnClickListener(new Click());```
55
+   button2.setOnClickListener(new Click());```
54
56
 
55
-   ```Button button2 =findViewById(R.id.button2);```
56
-   ```button2.setOnClickListener(new Click());```
57
-
58
57
  //3~8も同じ
59
58
 
60
59
 
61
-   ```Button button9 =findViewById(R.id.button9);```
60
+   ```Button button9 =findViewById(R.id.button9);button9.setOnClickListener(new Click());```
62
-   ```button9.setOnClickListener(new Click());```
63
61
   ```}```
64
62
 
65
63
 

2

2020/09/10 02:17

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -40,111 +40,101 @@
40
40
 
41
41
  public class MainActivity extends AppCompatActivity {
42
42
 
43
-  @Override
43
+  ```@Override```
44
-  protected void onCreate(Bundle savedInstanceState) {
44
+  ```protected void onCreate(Bundle savedInstanceState) {```
45
-   super.onCreate(savedInstanceState);
45
+   ```super.onCreate(savedInstanceState);```
46
-   setContentView(R.layout.activity_main);
46
+   ```setContentView(R.layout.activity_main);```
47
47
 
48
-   Button button_r = findViewById(R.id.button_r);
48
+   ```Button button_r = findViewById(R.id.button_r);```
49
-   button_r.setOnClickListener(new MyClickListener());
50
49
 
51
-   Button button1=findViewById(R.id.button);
52
-   button1.setOnClickListener(new Click());
50
+ ```button_r.setOnClickListener(new MyClickListener());```
53
51
 
54
-   Button button2 =findViewById(R.id.button2);
52
+   ```Button button1=findViewById(R.id.button);```
55
-   button2.setOnClickListener(new Click());
53
+   ```button1.setOnClickListener(new Click());```
56
54
 
55
+   ```Button button2 =findViewById(R.id.button2);```
56
+   ```button2.setOnClickListener(new Click());```
57
57
 
58
58
  //3~8も同じ
59
59
 
60
60
 
61
-   Button button9 =findViewById(R.id.button9);
61
+   ```Button button9 =findViewById(R.id.button9);```
62
-   button9.setOnClickListener(new Click());
62
+   ```button9.setOnClickListener(new Click());```
63
-  }
63
+  ```}```
64
64
 
65
65
 
66
66
  //ここはリセットなのできにしないで
67
67
 
68
68
 
69
-  class MyClickListener implements View.OnClickListener {
69
+  ```class MyClickListener implements View.OnClickListener {```
70
-   @Override
70
+   ```@Override```
71
-   public void onClick(View v) {
71
+   ```public void onClick(View v) {```
72
-    Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
72
+    ```Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show(); ```
73
73
 
74
-    Button button=findViewById(R.id.button);
74
+    ```Button button=findViewById(R.id.button);```
75
-    Button button1=findViewById(R.id.button2);
75
+    ```Button button1=findViewById(R.id.button2);```
76
-    Button button2=findViewById(R.id.button3);
76
+    ```Button button2=findViewById(R.id.button3);```
77
-    Button button3=findViewById(R.id.button4);
77
+    ```Button button3=findViewById(R.id.button4);```
78
-    Button button4=findViewById(R.id.button5);
78
+    ```Button button4=findViewById(R.id.button5);```
79
-    Button button5=findViewById(R.id.button6);
79
+    ```Button button5=findViewById(R.id.button6);```
80
-    Button button6=findViewById(R.id.button7);
80
+    ```Button button6=findViewById(R.id.button7);```
81
-    Button button7=findViewById(R.id.button8);
81
+    ```Button button7=findViewById(R.id.button8);```
82
-    Button button8=findViewById(R.id.button9);
82
+    ```Button button8=findViewById(R.id.button9);```
83
83
 
84
-    int y= getResources().getColor(R.color.y); //R.color.xxx は name=”xxx”とした時
84
+    ```int y= getResources().getColor(R.color.y); ```
85
+ //R.color.xxx は name=”xxx”とした時
86
+    ```button.setBackgroundColor(y); ```
85
-    button.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
87
+ // view は変更対象の部品に適宜置き換える
88
+    ```button1.setBackgroundColor(y);```
86
-    button1.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
89
+ // view は変更対象の部品に適宜置き換える
87
-    button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
90
+    ```button2.setBackgroundColor(y); ```// view は変更対象の部品に適宜置き換える
88
-    button3.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
91
+    ```button3.setBackgroundColor(y);```
89
-    button4.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
92
+    ```はbutton4.setBackgroundColor(y);```
90
-    button5.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
93
+    ```button5.setBackgroundColor(y); ```
91
-    button6.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
94
+    ```button6.setBackgroundColor(y); ```
92
-    button7.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
95
+    ```button7.setBackgroundColor(y);```
93
-    button8.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
96
+    ```button8.setBackgroundColor(y);```
94
97
 
95
-   }
98
+   ```}```
96
-  }
99
+  ```}```
97
100
 
98
101
 
99
102
  //ここから悩んでる所です。
100
103
 
101
104
 
102
105
 
103
-  class Click implements View.OnClickListener {
106
+  ```class Click implements View.OnClickListener {```
104
-   @Override
107
+   ```@Override```
105
-   public void onClick(View v) {
108
+   ```、public void onClick(View v) {```
106
-    int y= getResources().getColor(R.color.y);
109
+    ```int y= getResources().getColor(R.color.y);```
107
-    int x= getResources().getColor(R.color.x);
110
+    ```int x= getResources().getColor(R.color.x);```
108
111
 
109
-    switch (v.getId()) {
112
+    ```switch (v.getId()) {```
110
-     case (R.id.button):
113
+     ```case (R.id.button):```
111
114
 
112
115
  //ここをif文とかで判定したい
113
116
 
114
-      Button button=findViewById(R.id.button);
117
+      ```Button button=findViewById(R.id.button);```
115
-      button2.setBackgroundColor(x);
118
+      ```button2.setBackgroundColor(x);```
116
119
 
117
120
  //if(ここがわからない){
118
121
  色を変える作業
119
122
  }else{
120
123
  //色を変える作業
121
124
  }
122
-      break;
125
+      ```break;```
123
-     case (R.id.button2):
126
+     ```case (R.id.button2):```
124
127
  //ここからボタン9までボタン1と同じ判定ような判定がしたい
125
-      break;
128
+      ```break;```
126
-     case (R.id.button3):
129
+     ```case (R.id.button3):```
127
-      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
130
+      ```Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();```
128
-      break;
131
+      ```break;```
129
-     case (R.id.button4):
132
+ //4から8も同じ感じで
130
-      Toast.makeText(MainActivity.this, "4がおされた", Toast.LENGTH_SHORT).show();
133
+
131
-      break;
132
-     case (R.id.button5):
133
-      Toast.makeText(MainActivity.this, "5がおされた", Toast.LENGTH_SHORT).show();
134
-      break;
135
-     case (R.id.button6):
136
-      Toast.makeText(MainActivity.this, "6がおされた", Toast.LENGTH_SHORT).show();
137
-      break;
138
-     case (R.id.button7):
139
-      Toast.makeText(MainActivity.this, "7がおされた", Toast.LENGTH_SHORT).show();
140
-      break;
141
-     case (R.id.button8):
142
-      Toast.makeText(MainActivity.this, "8がおされた", Toast.LENGTH_SHORT).show();
143
-      break;
144
-     case (R.id.button9):
134
+      ```case (R.id.button9):```
145
-      Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();
135
+      ```Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();```
146
-      break;
136
+      ```break;```
147
-    }
137
+    ```}```
148
-   }
138
+   ```}```
149
-  }
139
+  ```}```
150
- }
140
+ ```}```

1

2020/09/10 02:12

投稿

schrodinger0120
schrodinger0120

スコア1

title CHANGED
File without changes
body CHANGED
@@ -40,115 +40,111 @@
40
40
 
41
41
  public class MainActivity extends AppCompatActivity {
42
42
 
43
- @Override
43
+  @Override
44
- protected void onCreate(Bundle savedInstanceState) {
44
+  protected void onCreate(Bundle savedInstanceState) {
45
- super.onCreate(savedInstanceState);
45
+   super.onCreate(savedInstanceState);
46
- setContentView(R.layout.activity_main);
46
+   setContentView(R.layout.activity_main);
47
47
 
48
- Button button_r = findViewById(R.id.button_r);
48
+   Button button_r = findViewById(R.id.button_r);
49
- button_r.setOnClickListener(new MyClickListener());
49
+   button_r.setOnClickListener(new MyClickListener());
50
50
 
51
- Button button1=findViewById(R.id.button);
51
+   Button button1=findViewById(R.id.button);
52
- button1.setOnClickListener(new Click());
52
+   button1.setOnClickListener(new Click());
53
53
 
54
- Button button2 =findViewById(R.id.button2);
54
+   Button button2 =findViewById(R.id.button2);
55
- button2.setOnClickListener(new Click());
55
+   button2.setOnClickListener(new Click());
56
56
 
57
57
 
58
58
  //3~8も同じ
59
59
 
60
60
 
61
- Button button9 =findViewById(R.id.button9);
61
+   Button button9 =findViewById(R.id.button9);
62
- button9.setOnClickListener(new Click());
62
+   button9.setOnClickListener(new Click());
63
- }
63
+  }
64
64
 
65
65
 
66
66
  //ここはリセットなのできにしないで
67
67
 
68
68
 
69
- class MyClickListener implements View.OnClickListener {
69
+  class MyClickListener implements View.OnClickListener {
70
- @Override
70
+   @Override
71
- public void onClick(View v) {
71
+   public void onClick(View v) {
72
- Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
72
+    Toast.makeText(MainActivity.this, "リセットしました", Toast.LENGTH_SHORT).show();
73
73
 
74
- Button button=findViewById(R.id.button);
74
+    Button button=findViewById(R.id.button);
75
- Button button1=findViewById(R.id.button2);
75
+    Button button1=findViewById(R.id.button2);
76
- Button button2=findViewById(R.id.button3);
76
+    Button button2=findViewById(R.id.button3);
77
- Button button3=findViewById(R.id.button4);
77
+    Button button3=findViewById(R.id.button4);
78
- Button button4=findViewById(R.id.button5);
78
+    Button button4=findViewById(R.id.button5);
79
- Button button5=findViewById(R.id.button6);
79
+    Button button5=findViewById(R.id.button6);
80
- Button button6=findViewById(R.id.button7);
80
+    Button button6=findViewById(R.id.button7);
81
- Button button7=findViewById(R.id.button8);
81
+    Button button7=findViewById(R.id.button8);
82
- Button button8=findViewById(R.id.button9);
82
+    Button button8=findViewById(R.id.button9);
83
83
 
84
- int y= getResources().getColor(R.color.y); //R.color.xxx は name=”xxx”とした時
84
+    int y= getResources().getColor(R.color.y); //R.color.xxx は name=”xxx”とした時
85
- button.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
85
+    button.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
86
- button1.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
86
+    button1.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
87
- button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
87
+    button2.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
88
- button3.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
88
+    button3.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
89
- button4.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
89
+    button4.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
90
- button5.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
90
+    button5.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
91
- button6.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
91
+    button6.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
92
- button7.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
92
+    button7.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
93
- button8.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
93
+    button8.setBackgroundColor(y); // view は変更対象の部品に適宜置き換える
94
94
 
95
- }
95
+   }
96
- }
96
+  }
97
97
 
98
98
 
99
99
  //ここから悩んでる所です。
100
100
 
101
101
 
102
102
 
103
- class Click implements View.OnClickListener {
103
+  class Click implements View.OnClickListener {
104
- @Override
104
+   @Override
105
- public void onClick(View v) {
105
+   public void onClick(View v) {
106
- int y= getResources().getColor(R.color.y);
106
+    int y= getResources().getColor(R.color.y);
107
- int x= getResources().getColor(R.color.x);
107
+    int x= getResources().getColor(R.color.x);
108
108
 
109
- switch (v.getId()) {
109
+    switch (v.getId()) {
110
- case (R.id.button):
110
+     case (R.id.button):
111
111
 
112
112
  //ここをif文とかで判定したい
113
113
 
114
-        Button button=findViewById(R.id.button);
114
+      Button button=findViewById(R.id.button);
115
- button2.setBackgroundColor(x);
115
+      button2.setBackgroundColor(x);
116
116
 
117
117
  //if(ここがわからない){
118
118
  色を変える作業
119
119
  }else{
120
120
  //色を変える作業
121
121
  }
122
-
123
-
124
- break;
122
+      break;
125
- case (R.id.button2):
123
+     case (R.id.button2):
124
+ //ここからボタン9までボタン1と同じ判定ような判定がしたい
126
- break;
125
+      break;
127
- case (R.id.button3):
126
+     case (R.id.button3):
128
- Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
127
+      Toast.makeText(MainActivity.this, "3がおされた", Toast.LENGTH_SHORT).show();
129
- break;
128
+      break;
130
- case (R.id.button4):
129
+     case (R.id.button4):
131
- Toast.makeText(MainActivity.this, "4がおされた", Toast.LENGTH_SHORT).show();
130
+      Toast.makeText(MainActivity.this, "4がおされた", Toast.LENGTH_SHORT).show();
132
- break;
131
+      break;
133
- case (R.id.button5):
132
+     case (R.id.button5):
134
- Toast.makeText(MainActivity.this, "5がおされた", Toast.LENGTH_SHORT).show();
133
+      Toast.makeText(MainActivity.this, "5がおされた", Toast.LENGTH_SHORT).show();
135
- break;
134
+      break;
136
- case (R.id.button6):
135
+     case (R.id.button6):
137
- Toast.makeText(MainActivity.this, "6がおされた", Toast.LENGTH_SHORT).show();
136
+      Toast.makeText(MainActivity.this, "6がおされた", Toast.LENGTH_SHORT).show();
138
- break;
137
+      break;
139
- case (R.id.button7):
138
+     case (R.id.button7):
140
- Toast.makeText(MainActivity.this, "7がおされた", Toast.LENGTH_SHORT).show();
139
+      Toast.makeText(MainActivity.this, "7がおされた", Toast.LENGTH_SHORT).show();
141
- break;
140
+      break;
142
- case (R.id.button8):
141
+     case (R.id.button8):
143
- Toast.makeText(MainActivity.this, "8がおされた", Toast.LENGTH_SHORT).show();
142
+      Toast.makeText(MainActivity.this, "8がおされた", Toast.LENGTH_SHORT).show();
144
- break;
143
+      break;
145
- case (R.id.button9):
144
+     case (R.id.button9):
146
- Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();
145
+      Toast.makeText(MainActivity.this, "9がおされた", Toast.LENGTH_SHORT).show();
147
- break;
146
+      break;
148
-
149
- }
147
+    }
150
- }
148
+   }
151
-
152
- }
149
+  }
153
-
154
150
  }