| | package org.ntlab.irisclient; |
---|
| | |
---|
| | import android.content.Intent; |
---|
| | import android.graphics.Color; |
---|
| | import android.os.Bundle; |
---|
| | import android.view.View; |
---|
| | import android.widget.ArrayAdapter; |
---|
| | import android.widget.Button; |
---|
| | import android.widget.EditText; |
---|
| | import android.widget.ImageButton; |
---|
| | import android.widget.ListView; |
---|
| | import android.widget.TextView; |
---|
| | |
---|
| | import androidx.appcompat.app.AppCompatActivity; |
---|
| | import androidx.lifecycle.Observer; |
---|
| | import androidx.lifecycle.ViewModelProvider; |
---|
| | |
---|
| | import org.ntlab.irisclient.entities.RoomJson; |
---|
| | import org.ntlab.irisclient.models.Member; |
---|
| | import org.ntlab.irisclient.resources.RoomsRest; |
---|
| | import org.ntlab.irisclient.viewmodels.RoomViewModel; |
---|
| | |
---|
| |
---|
| | //部屋ID情報 |
---|
| | TextView RoomIdText = findViewById(R.id.roomID); |
---|
| | RoomIdText.setText(r); |
---|
| | |
---|
| | //スタートボタンをクリックすると、(絵を描く?)次の画面に遷移 |
---|
| | Button nextButton = (Button)findViewById(R.id.start); |
---|
| | nextButton.setOnClickListener(new View.OnClickListener() { |
---|
| | public void onClick(View v) { |
---|
| | /* |
---|
| | //ニックネームが入力されていない場合エラーメッセージを表示する |
---|
| | if (text.getText().toString().isEmpty()) { |
---|
| | text.setError("ニックネームを入力されていません"); |
---|
| | |
---|
| | //ニックネームが入力されていれば次の画面へ |
---|
| | } else { |
---|
| | |
---|
| | */ |
---|
| | //サーバーとの通信のために呼び出す |
---|
| | /* Call<RoomJson> call = roomRest.makeRooms(nickname); |
---|
| | call.enqueue(new Callback<RoomJson>() { |
---|
| | //onResponseで成功 |
---|
| | public void onResponse(Call<RoomJson> call, Response<RoomJson> response) { |
---|
| | if (response.isSuccessful()) { |
---|
| | //ridとnicknameをIrisへ |
---|
| | String rid = response.body().getRid(); |
---|
| | ((Iris) getApplication()).setRid(rid); |
---|
| | ((Iris) getApplication()).setNickname(nickname); |
---|
| | |
---|
| | */ |
---|
| | //次の画面へ遷移 |
---|
| | Intent intent = new Intent(OwnerRoomActivity.this,DrawingActivity.class); |
---|
| | startActivity(intent); |
---|
| | } |
---|
| | |
---|
| | /* } |
---|
| | //onFailureで失敗 |
---|
| | public void onFailure(Call<RoomJson> call, Throwable t) { |
---|
| | } |
---|
| | }); |
---|
| | |
---|
| | //} |
---|
| | } |
---|
| | */ |
---|
| | }); |
---|
| | |
---|
| | |
---|
| | |
---|
| | roomViewModel.start(500); |
---|
| | } |
---|
| |
---|
| | |
スタートボタンで次の画面に遷移するコードを追加しました。
OwnerRoomActivityの作成
e0b9050
intomaster
fromOwnerRoomActivity
on 4 Oct 2022