Last active
March 25, 2020 12:10
-
-
Save lehaiquantb/6609d74c97d10c60abc15f4bcbb40bfc to your computer and use it in GitHub Desktop.
Android Homework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout 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:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| tools:context=".MainActivity"> | |
| <TextView | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_weight="2" | |
| android:gravity="bottom|right" | |
| android:text="0" | |
| android:textSize="100dp" /> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_weight="1" | |
| android:orientation="horizontal"> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="CE" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="C" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="BS" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="/" | |
| android:textSize="35dp"></Button> | |
| </LinearLayout> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_weight="1" | |
| android:orientation="horizontal"> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="7" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="8" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="9" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="x" | |
| android:textSize="35dp"></Button> | |
| </LinearLayout> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_weight="1" | |
| android:orientation="horizontal"> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="4" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="5" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="6" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="-" | |
| android:textSize="35dp"></Button> | |
| </LinearLayout> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_weight="1" | |
| android:orientation="horizontal"> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="1" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="2" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="3" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="+" | |
| android:textSize="35dp"></Button> | |
| </LinearLayout> | |
| <LinearLayout | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_weight="1" | |
| android:orientation="horizontal"> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="+/-" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="0" | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="." | |
| android:textSize="35dp"></Button> | |
| <Button | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layout_weight="1" | |
| android:text="=" | |
| android:textSize="35dp"></Button> | |
| </LinearLayout> | |
| </LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <RelativeLayout 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:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| tools:context=".MainActivity"> | |
| <TextView | |
| android:id="@+id/text" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:gravity="bottom|right" | |
| android:layout_above="@id/layout_R5" | |
| android:text="0" | |
| android:textSize="150dp" /> | |
| <RelativeLayout | |
| android:id="@+id/layout_R1" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="20dp" | |
| android:layout_alignParentBottom="true"> | |
| <Button | |
| android:id="@+id/btn_1" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="+/-" | |
| android:height="100dp" | |
| android:textSize="40dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_2" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="0" | |
| android:layout_toRightOf="@id/btn_1" | |
| android:layout_marginLeft="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_3" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="." | |
| android:layout_toLeftOf="@id/btn_4" | |
| android:layout_marginRight="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_4" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="=" | |
| android:layout_alignParentRight="true" | |
| android:layout_marginRight="20dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| </RelativeLayout> | |
| <RelativeLayout | |
| android:id="@+id/layout_R2" | |
| android:layout_above="@id/layout_R1" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="20dp"> | |
| <Button | |
| android:id="@+id/btn_5" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="1" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_6" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="2" | |
| android:layout_toRightOf="@id/btn_5" | |
| android:layout_marginLeft="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_7" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="3" | |
| android:layout_toLeftOf="@id/btn_8" | |
| android:layout_marginRight="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_8" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="+" | |
| android:layout_alignParentRight="true" | |
| android:layout_marginRight="20dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| </RelativeLayout> | |
| <RelativeLayout | |
| android:id="@+id/layout_R3" | |
| android:layout_above="@id/layout_R2" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="20dp"> | |
| <Button | |
| android:id="@+id/btn_9" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="4" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_10" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="5" | |
| android:layout_toRightOf="@id/btn_9" | |
| android:layout_marginLeft="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_11" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="6" | |
| android:layout_toLeftOf="@id/btn_12" | |
| android:layout_marginRight="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_12" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="-" | |
| android:layout_alignParentRight="true" | |
| android:layout_marginRight="20dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| </RelativeLayout> | |
| <RelativeLayout | |
| android:id="@+id/layout_R4" | |
| android:layout_above="@id/layout_R3" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="20dp"> | |
| <Button | |
| android:id="@+id/btn_13" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="7" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_14" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="8" | |
| android:layout_toRightOf="@id/btn_13" | |
| android:layout_marginLeft="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_15" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="9" | |
| android:layout_toLeftOf="@id/btn_16" | |
| android:layout_marginRight="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_16" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="x" | |
| android:layout_alignParentRight="true" | |
| android:layout_marginRight="20dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| </RelativeLayout> | |
| <RelativeLayout | |
| android:id="@+id/layout_R5" | |
| android:layout_above="@id/layout_R4" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:paddingLeft="20dp"> | |
| <Button | |
| android:id="@+id/btn_17" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="CE" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_18" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="C" | |
| android:layout_toRightOf="@id/btn_17" | |
| android:layout_marginLeft="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_19" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="BS" | |
| android:layout_toLeftOf="@id/btn_20" | |
| android:layout_marginRight="5dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| <Button | |
| android:id="@+id/btn_20" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="/" | |
| android:layout_alignParentRight="true" | |
| android:layout_marginRight="20dp" | |
| android:textSize="40dp" | |
| android:height="100dp"> | |
| </Button> | |
| </RelativeLayout> | |
| </RelativeLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment