hello boi

main
Brett 2024-10-15 12:21:12 -04:00
parent d8ed9ea11c
commit 3dcf81b7e2
2 changed files with 276 additions and 0 deletions

View File

@ -0,0 +1,266 @@
<?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"
tools:context=".MainCalculatorActivity">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/materialToolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:clickable="false"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:subtitleTextAppearance="@style/TextAppearance.AppCompat.Large" />
<TextView
android:id="@+id/titleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="Balculator"
android:textColor="#FBFBFB"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="@+id/materialToolbar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/divider"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_marginTop="4dp"
android:background="?android:attr/listDivider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/materialToolbar" />
<TextView
android:id="@+id/output"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="6dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider" />
<View
android:id="@+id/divider2"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_marginTop="6dp"
android:background="?android:attr/listDivider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/output" />
<GridLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:columnCount="4"
android:rowCount="5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider2">
<!-- Row 1 -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="7"
android:id="@+id/b7"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="8"
android:id="@+id/b8"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="9"
android:id="@+id/b9"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="÷"
android:id="@+id/bdiv"
app:autoSizeTextType="uniform"/>
<!-- Row 2 -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="4"
android:id="@+id/b4"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="5"
android:id="@+id/b5"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="6"
android:id="@+id/b6"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="*"
android:id="@+id/bmul"
app:autoSizeTextType="uniform"/>
<!-- Row 3 -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="1"
android:id="@+id/b1"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="2"
android:id="@+id/b2"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="3"
android:id="@+id/b3"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="-"
android:id="@+id/bminus"
app:autoSizeTextType="uniform"/>
<!-- Row 4 -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="C"
android:id="@+id/bc"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="0"
android:id="@+id/b0"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="."
android:id="@+id/bdot"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="+"
android:id="@+id/bplus"
app:autoSizeTextType="uniform"/>
<!-- Row 5 -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="S"
android:id="@+id/bs"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="R"
android:id="@+id/br"
app:autoSizeTextType="uniform"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="A"
android:id="@+id/ba"
app:autoSizeTextType="uniform"/>
<!-- i put equals last because it puts it close to the thumb-->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_rowWeight="1"
android:layout_columnWeight="1"
android:text="="
android:id="@+id/bequals"
app:autoSizeTextType="uniform"/>
</GridLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- <style name="CalculatorButtonStyle">-->
<!-- <item name="android:autoSizeTextType">uniform</item>-->
<!-- <item name="android:autoSizeMinTextSize">12sp</item>-->
<!-- <item name="android:autoSizeMaxTextSize">30sp</item>-->
<!-- <item name="android:autoSizeStepGranularity">2sp</item>-->
<!-- <item name="android:textSize">18sp</item> &lt;!&ndash; Fallback default size &ndash;&gt;-->
<!-- </style>-->
</resources>