<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="4"
android:rowCount="7">
<TextView
android:id="@+id/result_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_columnSpan="4"
android:background="#eee"
android:text="0"
android:textColor="#000"
android:textSize="50sp" />
<Button
android:id="@+id/clear_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_columnSpan="4"
android:text="Clear" />
<Button
android:id="@+id/one_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="1" />
<Button
android:id="@+id/two_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="2" />
<Button
android:id="@+id/three_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="3" />
<Button
android:id="@+id/devide_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="/" />
<Button
android:id="@+id/four_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="4" />
<Button
android:id="@+id/five_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="5" />
<Button
android:id="@+id/six_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="6" />
<Button
android:id="@+id/multiply_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="×" />
<Button
android:id="@+id/seven_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="7" />
<Button
android:id="@+id/eight_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="8" />
<Button
android:id="@+id/nine_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="9" />
<Button
android:id="@+id/minus_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="-" />
<Button
android:id="@+id/zero_btn"
android:layout_columnSpan="2"
android:layout_columnWeight="1"
android:layout_gravity="fill"
android:layout_rowWeight="1"
android:text="0" />
<Button
android:id="@+id/point_btn"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="." />
<Button
android:id="@+id/plus_btn"
android:layout_columnWeight="1"
android:layout_rowSpan="2"
android:layout_rowWeight="1"
android:text="+" />
<Button
android:id="@+id/equal_btn"
android:layout_columnSpan="3"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
android:text="=" />
</GridLayout>
|