✨
This commit is contained in:
@@ -12,260 +12,283 @@
|
||||
<TextView
|
||||
android:id="@+id/display"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="160dp"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_weight="2"
|
||||
android:layout_weight="3"
|
||||
android:layout_marginTop="0dp"
|
||||
android:background="#00000000"
|
||||
android:elevation="4dp"
|
||||
android:gravity="end|bottom"
|
||||
android:padding="10dp"
|
||||
android:text="0"
|
||||
android:textSize="48sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="20sp"
|
||||
android:autoSizeMaxTextSize="48sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
tools:ignore="Suspicious0dp" />
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Calculator Buttons -->
|
||||
<GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:columnCount="4"
|
||||
android:layout_weight="5"
|
||||
android:layout_weight="4"
|
||||
android:rowCount="5">
|
||||
|
||||
<!-- Row 1 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnClear"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="4dp"
|
||||
android:textSize="30sp"
|
||||
android:text="C"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:cornerRadius="15dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPercent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="%"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDivide"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="÷"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/cut"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
app:icon="@drawable/backspace"
|
||||
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:iconSize="30dp"
|
||||
app:cornerRadius="15dp"/>
|
||||
<!-- Row 2 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn7"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="7"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:cornerRadius="15dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn8"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="8"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:cornerRadius="15dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn9"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="4dp"
|
||||
android:textSize="30sp"
|
||||
android:text="9"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnMultiply"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="4dp"
|
||||
android:textSize="30sp"
|
||||
android:text="×"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button"/>
|
||||
|
||||
<!-- Row 3 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn4"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
app:cornerRadius="15dp"
|
||||
android:text="4"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn5"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="5"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn6"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="6"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnMinus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="-"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button"/>
|
||||
|
||||
<!-- Row 4 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="1"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="4dp"
|
||||
android:text="2"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="4dp"
|
||||
android:text="3"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPlus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="+"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button"/>
|
||||
|
||||
<!-- Row 5 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn0"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnSpan="2"
|
||||
android:textSize="30sp"
|
||||
android:layout_columnWeight="2"
|
||||
android:layout_margin="4dp"
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
android:text="0" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDot"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_margin="4dp"
|
||||
android:text="."
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnEquals"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_rowWeight="1"
|
||||
android:textSize="30sp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="4dp"
|
||||
android:text="="
|
||||
app:cornerRadius="15dp"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
style="@style/Widget.MaterialComponents.Button"/>
|
||||
|
||||
</GridLayout>
|
||||
|
||||
Reference in New Issue
Block a user