added layout preview for startingactivity
This commit is contained in:
26
Generator/.idea/appInsightsSettings.xml
generated
Normal file
26
Generator/.idea/appInsightsSettings.xml
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AppInsightsSettings">
|
||||
<option name="tabSettings">
|
||||
<map>
|
||||
<entry key="Firebase Crashlytics">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="PLACEHOLDER" />
|
||||
<option name="mobileSdkAppId" value="" />
|
||||
<option name="projectId" value="" />
|
||||
<option name="projectNumber" value="" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
Generator/.idea/vcs.xml
generated
Normal file
6
Generator/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -41,6 +41,10 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
|
||||
implementation("androidx.multidex:multidex:2.0.1")
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:roundIcon="@drawable/ic_launcher_background"
|
||||
android:supportsRtl="true"
|
||||
android:largeHeap="true"
|
||||
android:theme="@style/Theme.Generator">
|
||||
<activity
|
||||
android:name=".StartingPreview"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".makeActivity"
|
||||
android:exported="false" />
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.example.generator;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
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 StartingPreview extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_starting_preview);
|
||||
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;
|
||||
});
|
||||
|
||||
ImageView imageView2 = findViewById(R.id.imageView2);
|
||||
String imageBase64 = getIntent().getStringExtra("EXTRA_IMAGE_BASE64");
|
||||
|
||||
if (imageBase64 != null && !imageBase64.isEmpty()) {
|
||||
try {
|
||||
byte[] decodedString = Base64.decode(imageBase64, Base64.DEFAULT);
|
||||
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
|
||||
imageView2.setImageBitmap(decodedByte);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("PreviewError", "Failed to decode base64 image asset");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -71,17 +71,20 @@ public class makeActivity extends AppCompatActivity {
|
||||
nextButton.setOnClickListener((v) -> {
|
||||
if (numPosEdit.getText().toString().trim().isEmpty()) {
|
||||
Toast.makeText(this, "choose a number", Toast.LENGTH_SHORT).show();
|
||||
} else
|
||||
} else {
|
||||
numPos = Integer.parseInt(numPosEdit.getText().toString().trim());
|
||||
if (Objects.equals(Base64img, "")) {
|
||||
Toast.makeText(this, "choose a image", Toast.LENGTH_SHORT).show();
|
||||
Log.d("test", Base64img);
|
||||
} else {
|
||||
Data.setNumPos(numPos);
|
||||
Data.setBase64(Base64img);
|
||||
Log.d("Pos", Data.getNumPos());
|
||||
Toast.makeText(this, "choose a image", Toast.LENGTH_SHORT).show();
|
||||
Log.d("test", Base64img);
|
||||
} else {
|
||||
Data.setNumPos(numPos);
|
||||
Data.setBase64(Base64img);
|
||||
Log.d("Pos", Data.getNumPos());
|
||||
Intent intent = new Intent(this, StartingPreview.class);
|
||||
intent.putExtra("EXTRA_IMAGE_BASE64", Base64img);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
chooseButton.setOnClickListener((v) -> {
|
||||
|
||||
180
Generator/app/src/main/res/layout/activity_starting_preview.xml
Normal file
180
Generator/app/src/main/res/layout/activity_starting_preview.xml
Normal file
@@ -0,0 +1,180 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
tools:context=".StartingPreview">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Preview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:ems="10"
|
||||
android:text="Layout Preview"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/button_next"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.25" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/notes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/notes"
|
||||
android:inputType="text|textCapSentences"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/gray_hint"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Preview" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/notes">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/Rbutton1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/starting_position_1"
|
||||
android:textColor="@color/white"
|
||||
app:buttonTint="@color/main" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/Rbutton2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/starting_position_2"
|
||||
android:textColor="@color/white"
|
||||
app:buttonTint="@color/main" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/Rbutton3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/starting_position_3"
|
||||
android:textColor="@color/white"
|
||||
app:buttonTint="@color/main" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/Rbutton4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/starting_position_4"
|
||||
android:textColor="@color/white"
|
||||
app:buttonTint="@color/main" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/Rbutton5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/starting_position_5"
|
||||
android:textColor="@color/white"
|
||||
app:buttonTint="@color/main" />
|
||||
</RadioGroup>
|
||||
|
||||
<!-- Empty ImageView: No source asset, but constraints are locked tight -->
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/teamnumber"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/radioGroup" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teamnumber"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/team_2648"
|
||||
android:textColor="@color/white"
|
||||
android:background="@color/alliance_blue"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2"
|
||||
app:layout_constraintBottom_toTopOf="@+id/BackButtonFake"
|
||||
app:layout_constraintEnd_toStartOf="@+id/matchNumber"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/matchNumber"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:background="@color/alliance_red"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintTop_toTopOf="@+id/teamnumber"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ButtonNextFake"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/teamnumber" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/BackButtonFake"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:backgroundTint="@color/main"
|
||||
android:text="Back (fake)"
|
||||
app:cornerRadius="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/backButton"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ButtonNextFake"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/ButtonNextFake"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:backgroundTint="@color/main"
|
||||
android:text="Next (fake)"
|
||||
app:cornerRadius="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/buttonNext"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/BackButtonFake" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/backButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:backgroundTint="@color/main"
|
||||
android:text="Back"
|
||||
app:cornerRadius="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/buttonNext"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonNext"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:backgroundTint="@color/main"
|
||||
android:text="Next"
|
||||
app:cornerRadius="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/backButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,3 +1,68 @@
|
||||
<resources>
|
||||
<string name="app_name">Generator</string>
|
||||
<string name="app_name">Scouting App</string>
|
||||
<string name="submit">Submit</string>
|
||||
<string name="l0">No climb</string>
|
||||
<string name="Preload">Only shoot Preload?</string>
|
||||
<string name="l1">L1</string>
|
||||
<string name="l2">L2</string>
|
||||
<string name="l3">L3</string>
|
||||
<string name="l4">L4</string>
|
||||
<string name="net">Net</string>
|
||||
<string name="next_hold">Next (Hold)</string>
|
||||
<string name="processor">Processor</string>
|
||||
<string name="can_leave">Go to center</string>
|
||||
<string name="can_remove_algae">Can Remove Algae</string>
|
||||
<string name="coral_pickup">Coral Pickup</string>
|
||||
<string name="auto">Auto</string>
|
||||
<string name="image_of_field">Image of field</string>
|
||||
<string name="tele">Tele</string>
|
||||
<string name="hold_button_to_ndecrement">Hold button to \ndecrement</string>
|
||||
<string name="google_sheet">The Google Sheet</string>
|
||||
<string name="offline_mode">Offline Mode/Manual</string>
|
||||
<string name="practice">Practice</string>
|
||||
<string name="match_number">Match Number</string>
|
||||
<string name="app_description">Scouting App for FRC team 2648</string>
|
||||
<string name="next">Next</string>
|
||||
<string name="settings">Settings</string>
|
||||
<string name="submit_old_data">Submit Old data</string>
|
||||
<string name="team_2648">2648</string>
|
||||
<string name="climb">Climb</string>
|
||||
<string name="back_hold">Back (Hold)</string>
|
||||
<string name="hub_reset">Hub back to 0</string>
|
||||
<string name="hub_15">Hub +15: %1$d</string>
|
||||
<string name="hub_25">Hub +25: %1$d</string>
|
||||
<string name="hub_50">Hub +50: %1$d</string>
|
||||
<string name="robot_died">Robot Died?</string>
|
||||
<string name="submit_data">Submit Data</string>
|
||||
<string name="notes">Notes</string>
|
||||
<string name="starting_position_1">Starting Position 1</string>
|
||||
<string name="starting_position_2">Starting Position 2</string>
|
||||
<string name="starting_position_3">Starting Position 3</string>
|
||||
<string name="starting_position_4">Starting Position 4</string>
|
||||
<string name="starting_position_5">Starting Position 5</string>
|
||||
<string name="back">Back</string>
|
||||
<string name="team_number_hint">Team Number</string>
|
||||
<string name="match">Match</string>
|
||||
<string name="offline_mode_title">Offline mode</string>
|
||||
<string name="red">Red</string>
|
||||
<string name="blue">Blue</string>
|
||||
<string name="event_2">NHDUR</string>
|
||||
<string name="event_1">MEFAL</string>
|
||||
<string name="event_necmp">NECMP</string>
|
||||
<string name="event_cmptx">CMPTX</string>
|
||||
<string name="name_hint">Name</string>
|
||||
<string name="tba_api_hint">TBA_API</string>
|
||||
<string name="sheets_api_hint">SheetsAPI</string>
|
||||
<string name="online_mode_toast">Online mode</string>
|
||||
<string name="fill_everything_error">Fill in Everything, check settings</string>
|
||||
<string name="upload_failed_toast">Online failed to upload</string>
|
||||
<string name="match_number_required_toast">Fill in MATCH NUMBER for teams</string>
|
||||
<string name="invalid_match_error">Invalid Match Number, Check settings</string>
|
||||
<string name="DN1">Defense -1, did\'t play defense</string>
|
||||
<string name="D0">Defense 0, Played defense on wrong alliance</string>
|
||||
<string name="D1">Defense 1, Did nothing of value</string>
|
||||
<string name="D2">Defense 2, stopped a few shots</string>
|
||||
<string name="D3">Defense 3, Got in the way nicely</string>
|
||||
<string name="D4">Defense 4, Possibly changed outcome</string>
|
||||
<string name="D5">Defense 5, Disabled a robot</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user