diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java b/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java index 7c680f8..ff2a349 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java +++ b/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java @@ -37,7 +37,7 @@ @Override public void onDestroy() { super.onDestroy(); - paintViewModel.stop(); + paintScreenShot.onDestroy(); } @@ -48,8 +48,6 @@ init(); initView(); - //paintScreenShot.onCreate(); - Button button = findViewById(R.id.button_keep); button.setOnClickListener(new View.OnClickListener() { @Override @@ -76,21 +74,14 @@ @Override protected void onResume() { super.onResume(); - - displayAid(); + paintViewModel.start(); } //----------------------------------------------------------------- - // 描画全体のクリア - public void onClickClear(View view) { - paintCanvas.deleteStroke(); - } - - //----------------------------------------------------------------- - // 招待する - public void onClickInvite(View view) { - Integer dummyId = 2; - paintViewModel.inviteNewUserRequest(dummyId); + @Override + protected void onPause(){ + super.onPause(); + paintViewModel.stop(); } //----------------------------------------------------------------- @@ -116,8 +107,9 @@ paintOnionCanvas = findViewById(R.id.paintOnionCanvas); paintOnionCanvas.init(paintViewModel); + paintScreenShot = new PaintScreenShot(this); - paintToolBar = new PaintToolBar(this, paintCanvas); + paintToolBar = new PaintToolBar(this, paintCanvas, paintOnionCanvas); findViewById(R.id.capture).setVisibility(View.INVISIBLE); findViewById(R.id.image).setVisibility(View.INVISIBLE); @@ -144,30 +136,6 @@ } }); -//1時的コメントアウトここから - // paintViewModel.getmStrokeNo().observe(this, new Observer() { -// @Override -// public void onChanged(Integer integer) { -// paintViewModel.getPosition(integer); -// } -// }); -// paintViewModel.getMlatestPosition().observe(this, new Observer>() { -// @Override -// public void onChanged(Collection positions) { -// if(positions.size()!=1){ -// //paintCanvas.latestPositionWrite(positions); -// } -// } -// }); -//ここまで - } - - //------------------------------------------------------------------ - // デバッグ用の現在編集中のAid表示 - private void displayAid() { - Acanthus acanthus = (Acanthus) getApplication(); - TextView view = findViewById(R.id.textViewCurAid); - view.setText("aid:" + acanthus.getAid().toString()); } //------------------------------------------------------------------ @@ -176,5 +144,6 @@ super.onActivityResult(requestCode, resultCode, data); paintScreenShot.onActivityResult(requestCode, resultCode, data); } + //------------------------------------------------------------------ } \ No newline at end of file