Moved radio buttons to another screen
This commit is contained in:
parent
749756101d
commit
fa49051a93
@ -38,7 +38,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
private String Match_numberString;
|
private String Match_numberString;
|
||||||
private String EventString;
|
private String EventString;
|
||||||
private String TeamString;
|
private String TeamString;
|
||||||
private String startingPostionString;
|
|
||||||
public static final String Postion_key = "POSTIONKEY";
|
public static final String Postion_key = "POSTIONKEY";
|
||||||
public static final String Event_Key = "EVENTCONFIRM";
|
public static final String Event_Key = "EVENTCONFIRM";
|
||||||
public static final String Match_key = "MATCHCONFIRM";
|
public static final String Match_key = "MATCHCONFIRM";
|
||||||
@ -70,8 +69,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
TeamString = Team.getText().toString();
|
TeamString = Team.getText().toString();
|
||||||
if ((Match_numberString == null || Match_numberString.isEmpty()) ||
|
if ((Match_numberString == null || Match_numberString.isEmpty()) ||
|
||||||
(EventString == null || EventString.isEmpty()) ||
|
(EventString == null || EventString.isEmpty()) ||
|
||||||
(TeamString == null || TeamString.isEmpty()) ||
|
(TeamString == null || TeamString.isEmpty())){
|
||||||
(startingPostionString == null || startingPostionString.isEmpty())){
|
|
||||||
Toast.makeText(getApplicationContext(), "Fill in EVERYTHING", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), "Fill in EVERYTHING", Toast.LENGTH_SHORT).show();
|
||||||
}else {
|
}else {
|
||||||
makeIntent();
|
makeIntent();
|
||||||
@ -88,41 +86,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
RadioButton Rbutton1 = findViewById(R.id.Rbutton1);
|
|
||||||
Rbutton1.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startingPostionString = "1";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RadioButton Rbutton2 = findViewById(R.id.Rbutton2);
|
|
||||||
Rbutton2.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startingPostionString = "2";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RadioButton Rbutton3 = findViewById(R.id.Rbutton3);
|
|
||||||
Rbutton3.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startingPostionString = "3";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RadioButton Rbutton4 = findViewById(R.id.Rbutton4);
|
|
||||||
Rbutton4.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startingPostionString = "4";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RadioButton Rbutton5 = findViewById(R.id.Rbutton5);
|
|
||||||
Rbutton5.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startingPostionString = "5";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
TextView TBAView = (TextView)findViewById(R.id.TBATest);
|
TextView TBAView = (TextView)findViewById(R.id.TBATest);
|
||||||
|
|
||||||
@ -206,11 +169,10 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void makeIntent()
|
private void makeIntent()
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(this, AutoActivity.class);
|
Intent intent = new Intent(this, startingActivity.class);
|
||||||
intent.putExtra(Event_Key, EventString);
|
intent.putExtra(Event_Key, EventString);
|
||||||
intent.putExtra(Match_key, Match_numberString);
|
intent.putExtra(Match_key, Match_numberString);
|
||||||
intent.putExtra(Team_key, TeamString);
|
intent.putExtra(Team_key, TeamString);
|
||||||
intent.putExtra(Postion_key, startingPostionString);
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.example.scoutingapp;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
public class startingActivity extends AppCompatActivity {
|
||||||
|
private String eventString, matchString, TeamString, startingPostionString;
|
||||||
|
public static final String Event_Key = "EVENTCONFIRM";
|
||||||
|
public static final String Match_key = "MATCHCONFIRM";
|
||||||
|
public static final String Team_key = "TEAMCONFIRM";
|
||||||
|
public static final String Postion_key = "POSTIONKEY";
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_starting);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
Intent intentinput = getIntent();
|
||||||
|
eventString = intentinput.getStringExtra(MainActivity.Event_Key);
|
||||||
|
matchString = intentinput.getStringExtra(MainActivity.Match_key);
|
||||||
|
TeamString = intentinput.getStringExtra(MainActivity.Team_key);
|
||||||
|
|
||||||
|
Button nextButton = (Button) findViewById(R.id.nextButton);
|
||||||
|
nextButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if ((startingPostionString == null || startingPostionString.isEmpty())){
|
||||||
|
Toast.makeText(getApplicationContext(), "Press a button", Toast.LENGTH_SHORT).show();
|
||||||
|
}else {
|
||||||
|
makeIntent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
RadioButton Rbutton1 = findViewById(R.id.Rbutton1);
|
||||||
|
Rbutton1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startingPostionString = "1";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RadioButton Rbutton2 = findViewById(R.id.Rbutton2);
|
||||||
|
Rbutton2.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startingPostionString = "2";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RadioButton Rbutton3 = findViewById(R.id.Rbutton3);
|
||||||
|
Rbutton3.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startingPostionString = "3";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RadioButton Rbutton4 = findViewById(R.id.Rbutton4);
|
||||||
|
Rbutton4.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startingPostionString = "4";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
RadioButton Rbutton5 = findViewById(R.id.Rbutton5);
|
||||||
|
Rbutton5.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startingPostionString = "5";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
private void makeIntent()
|
||||||
|
{
|
||||||
|
Intent intent = new Intent(this, AutoActivity.class);
|
||||||
|
intent.putExtra(Event_Key, eventString);
|
||||||
|
intent.putExtra(Match_key, matchString);
|
||||||
|
intent.putExtra(Team_key, TeamString);
|
||||||
|
intent.putExtra(Postion_key, startingPostionString);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user