Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
machiko1016 committed Nov 3, 2014
1 parent 6babc37 commit ff3102a
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 100 deletions.
159 changes: 66 additions & 93 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified out/production/ManekkoDance/ManekkoDance.apk
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 23 additions & 2 deletions src/net/exkazuu/ManekkoDance/activities/DragViewListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ public class DragViewListener implements OnTouchListener {
private int flag[][];
private int resb[][];
private ImageView[][] canwrite;
private String lessonNumber;
private int oldx;
private int oldy;

public DragViewListener(ImageView dragView, ImageView[][] cells,
String[][] program, TextView text, int[][] flag, int[][] resb, ImageView[][] canwrite) {
String[][] program, TextView text, int[][] flag, int[][] resb, ImageView[][] canwrite, String lessonNumber) {
this.dragView = dragView;
this.cells = cells;
this.program = program;
this.text = text;
this.flag = flag;
this.resb = resb;
this.canwrite = canwrite;
this.lessonNumber = lessonNumber;
}

public boolean onTouch(View view, MotionEvent event) {
Expand Down Expand Up @@ -136,6 +138,23 @@ public boolean onTouch(View view, MotionEvent event) {
}
}
}

if (lessonNumber.equals("4")) {
for (int i = 0; i < 3; i++) {
for (int j = 8; j < 12; j++) {
program[i][j] = "";
}
}
} else if (lessonNumber.equals("2")) {
} else {
for (int i = 0; i < 3; i++) {
for (int j = 10; j < 12; j++) {
program[i][j] = "";
}
}
}

//アイコンに変更
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 12; j++) {
if (program[i][j] == "右腕を上げる") {
Expand Down Expand Up @@ -185,14 +204,16 @@ public boolean onTouch(View view, MotionEvent event) {
}
}
}

//次の入力場所の表示
for (int j = 0; j < 12; j++) {
int flag = 0;
for (int i = 0; i < 3; i++) {
if (program[i][j] == "") {
if (flag == 0) {
canwrite[i][j].setImageResource(R.drawable.haikei2);
flag = 1;
}else{
} else {
canwrite[i][j].setImageResource(R.drawable.haikei);
}
} else {
Expand Down
13 changes: 8 additions & 5 deletions src/net/exkazuu/ManekkoDance/activities/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public void onCreate(Bundle savedInstanceState) {
}

// 背景たち
Intent intent = getIntent();
message = intent.getStringExtra("message");
String lessonNumber = message;
int[][] resb = new int[3][12];
ImageView[][] cells = new ImageView[3][12];
DragViewListener[][] backgroundlistener = new DragViewListener[3][12];
Expand All @@ -129,7 +132,7 @@ public void onCreate(Bundle savedInstanceState) {
resb[i][j] = this.getResources().getIdentifier("image" + i + "_" + j, "id", this.getPackageName());
cells[i][j] = (ImageView) findViewById(resb[i][j]);
backgroundlistener[i][j] = new DragViewListener(cells[i][j], cells,
program, text, flag, resb, canwrite);
program, text, flag, resb, canwrite, lessonNumber);
cells[i][j].setOnTouchListener(backgroundlistener[i][j]);
}
}
Expand All @@ -146,15 +149,15 @@ public void onCreate(Bundle savedInstanceState) {
res[0][i] = this.getResources().getIdentifier("imageView" + (i + 1), "id", this.getPackageName());
dragView[0][i] = (ImageView) findViewById(res[0][i]);
listener[0][i] = new DragViewListener(dragView[0][i], cells,
program, text, flag, resb, canwrite);
program, text, flag, resb, canwrite, lessonNumber);
dragView[0][i].setOnTouchListener(listener[0][i]);
}
//アイコンたち(数字達)
for (int i = 0; i < 10; i++) {
res[1][i] = this.getResources().getIdentifier("imageView" + 0 + i, "id", this.getPackageName());
dragView[1][i] = (ImageView) findViewById(res[1][i]);
listener[1][i] = new DragViewListener(dragView[1][i], cells,
program, text, flag, resb, canwrite);
program, text, flag, resb, canwrite, lessonNumber);
dragView[1][i].setOnTouchListener(listener[1][i]);
}

Expand All @@ -167,9 +170,9 @@ public void onCreate(Bundle savedInstanceState) {
}

/********** Lesson data の 取得 **************/
Intent intent = getIntent();
// Intent intent = getIntent();
lesson = intent.getStringExtra("lesson");
message = intent.getStringExtra("message");
// message = intent.getStringExtra("message");
text_data = intent.getStringExtra("text_data");
Log.v("my_debug", "" + text_data);
if (text_data != null) {
Expand Down

0 comments on commit ff3102a

Please sign in to comment.