Newer
Older
IrisClient / app / src / main / java / org / ntlab / irisclient / TestDrawingActivity.java
package org.ntlab.irisclient;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

public class TestDrawingActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.test_activity_draw);

        //上の表示を削除
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }

        //ownerとして参加
        Button ownerButton = findViewById(R.id.ownerdraw);
        ownerButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                ((Iris) getApplication()).setRid("drawtest");
                ((Iris) getApplication()).setNickname("owner");
                Intent intent = new Intent(TestDrawingActivity.this,DrawingActivity.class);
                startActivity(intent);
            }
        });

        //memberとして参加
        Button memButton = findViewById(R.id.member);
        memButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                ((Iris) getApplication()).setRid("drawtest");
                ((Iris) getApplication()).setNickname("member");
                Intent intent = new Intent(TestDrawingActivity.this,DrawingActivity.class);
                startActivity(intent);
            }
        });

        //backボタン
        Button backButton = findViewById(R.id.fromdraw);
        backButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Intent intent = new Intent(TestDrawingActivity.this,TestEnterActivity.class);
                startActivity(intent);
            }
        });

    }
}