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 c14a52c..05da37c 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 @@ -26,7 +26,7 @@ private PaintToolBar paintToolBar; - // private PaintScreenShot paintScreenShot; + private ActivityPaintBinding binding; private PaintViewModel paintViewModel; @@ -37,8 +37,6 @@ @Override public void onDestroy() { super.onDestroy(); - paintViewModel.stop(); - // paintScreenShot.onDestroy(); } //----------------------------------------------------------------- @@ -48,50 +46,21 @@ setTheme(R.style.AppTheme_NoTitleBar);//タイトルバーを消す init(); initView(); - - //paintScreenShot.onCreate(); - -// Button button = findViewById(R.id.button_keep); -// button.setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View v) { -// //bottonタップで表示されてたら非表示にする。 -// if (buttonView) { -// findViewById(R.id.capture).setVisibility(View.INVISIBLE); -// findViewById(R.id.image).setVisibility(View.INVISIBLE); -// findViewById(R.id.textView3).setVisibility(View.INVISIBLE); -// -// buttonView = false; -// } else { -// findViewById(R.id.capture).setVisibility(View.VISIBLE); -// findViewById(R.id.image).setVisibility(View.VISIBLE); -// findViewById(R.id.textView3).setVisibility(View.VISIBLE); -// -// buttonView = true; -// } -// } -// }); } //----------------------------------------------------------------- @Override protected void onResume() { super.onResume(); - - displayAid(); + paintViewModel.start(); + paintCanvas.clearCanvas(); } //----------------------------------------------------------------- - // 描画全体のクリア - 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(); } //----------------------------------------------------------------- @@ -117,12 +86,7 @@ paintOnionCanvas = findViewById(R.id.paintOnionCanvas); paintOnionCanvas.init(paintViewModel); - // paintScreenShot = new PaintScreenShot(this); - paintToolBar = new PaintToolBar(this, paintCanvas); - -// findViewById(R.id.capture).setVisibility(View.INVISIBLE); -// findViewById(R.id.image).setVisibility(View.INVISIBLE); -// findViewById(R.id.textView3).setVisibility(View.INVISIBLE); + paintToolBar = new PaintToolBar(this, paintCanvas, paintOnionCanvas); } //----------------------------------------------------------------- @@ -145,37 +109,13 @@ } }); -//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()); } //------------------------------------------------------------------ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); - // paintScreenShot.onActivityResult(requestCode, resultCode, data); } + //------------------------------------------------------------------ } \ No newline at end of file