Advertisement
Sajib_Ahmed

calculatoxml

Feb 28th, 2021
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 16.04 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.    xmlns:app="http://schemas.android.com/apk/res-auto"
  4.    xmlns:tools="http://schemas.android.com/tools"
  5.    android:layout_width="match_parent"
  6.    android:layout_height="match_parent"
  7.    android:orientation="vertical"
  8.    tools:context=".MainActivity"
  9.    android:layout_weight="9"
  10.    android:background="@color/colorPrimaryDark">
  11.  
  12.     <TextView
  13.       android:id="@+id/Output2"
  14.        android:layout_width="match_parent"
  15.        android:layout_height="90dp"
  16.        android:text=""
  17.        android:textSize="35dp"
  18.        android:gravity="bottom|right"
  19.        android:layout_weight="1"
  20.        android:background="@color/colordisplay"
  21.        android:textColor="@color/colorAccent"
  22.        />
  23.     <TextView
  24.        android:id="@+id/Output"
  25.        android:layout_width="match_parent"
  26.        android:layout_height="100dp"
  27.        android:text=""
  28.        android:textSize="40dp"
  29.        android:gravity="bottom|right"
  30.        android:layout_weight="1"
  31.        android:background="@color/colordisplay"
  32.        android:textColor="@color/colorAccent"
  33.        />
  34.     <LinearLayout
  35.        android:layout_width="match_parent"
  36.        android:layout_height="wrap_content"
  37.        android:orientation="horizontal"
  38.        android:weightSum="5"
  39.        android:layout_weight="1">
  40.         <Button
  41.            android:layout_width="wrap_content"
  42.            android:layout_height="match_parent"
  43.            android:text="√"
  44.            android:textSize="20dp"
  45.            android:layout_weight="1"
  46.            android:background="@drawable/buttondi"
  47.            android:textColor="@color/colorAccent"
  48.            android:onClick="squr"
  49.            ></Button>
  50.         <Button
  51.            android:layout_width="wrap_content"
  52.            android:layout_height="match_parent"
  53.            android:text="X²"
  54.            android:textSize="20dp"
  55.            android:layout_weight="1"
  56.            android:background="@drawable/buttondi"
  57.            android:textColor="@color/colorAccent"
  58.            android:onClick="power"
  59.            ></Button>
  60.  
  61.         <Button
  62.            android:layout_width="wrap_content"
  63.            android:layout_height="match_parent"
  64.            android:layout_weight="1"
  65.            android:text="X!"
  66.            android:textSize="20dp"
  67.            android:onClick="facto"
  68.            android:background="@drawable/buttondi"
  69.            android:textColor="@color/colorAccent"></Button>
  70.  
  71.         <Button
  72.            android:layout_width="wrap_content"
  73.            android:layout_height="match_parent"
  74.            android:layout_weight="1"
  75.            android:text="log"
  76.            android:textSize="20dp"
  77.            android:onClick="logf"
  78.            android:textAllCaps="false"
  79.            android:background="@drawable/buttondi"
  80.            android:textColor="@color/colorAccent"></Button>
  81.  
  82.         <Button
  83.            android:layout_width="wrap_content"
  84.            android:layout_height="match_parent"
  85.            android:layout_weight="1"
  86.            android:text="ln"
  87.            android:textSize="20dp"
  88.            android:onClick="lnf"
  89.            android:textAllCaps="false"
  90.            android:background="@drawable/buttondi"
  91.            android:textColor="@color/colorAccent"></Button>
  92.     </LinearLayout>
  93.     <LinearLayout
  94.        android:layout_width="match_parent"
  95.        android:layout_height="wrap_content"
  96.        android:orientation="horizontal"
  97.        android:weightSum="5"
  98.        android:layout_weight="1">
  99.  
  100.         <Button
  101.            android:layout_width="wrap_content"
  102.            android:layout_height="match_parent"
  103.            android:layout_weight="1"
  104.            android:text="nPr"
  105.            android:textAllCaps="false"
  106.            android:onClick="nprf"
  107.            android:textSize="20dp"
  108.            android:background="@drawable/buttondi"
  109.            android:textColor="@color/colorAccent"></Button>
  110.  
  111.         <Button
  112.            android:layout_width="wrap_content"
  113.            android:layout_height="match_parent"
  114.            android:layout_weight="1"
  115.            android:text="nCr"
  116.            android:onClick="ncr1"
  117.            android:textAllCaps="false"
  118.            android:textSize="20dp"
  119.            android:background="@drawable/buttondi"
  120.            android:textColor="@color/colorAccent"></Button>
  121.  
  122.         <Button
  123.            android:layout_width="wrap_content"
  124.            android:layout_height="match_parent"
  125.            android:layout_weight="1"
  126.            android:text="sin"
  127.            android:textAllCaps="false"
  128.            android:onClick="sinf"
  129.            android:textSize="20dp"
  130.            android:background="@drawable/buttondi"
  131.            android:textColor="@color/colorAccent"></Button>
  132.  
  133.         <Button
  134.            android:layout_width="wrap_content"
  135.            android:layout_height="match_parent"
  136.            android:layout_weight="1"
  137.            android:text="cos"
  138.            android:textAllCaps="false"
  139.            android:onClick="cosf"
  140.            android:textSize="20dp"
  141.            android:background="@drawable/buttondi"
  142.            android:textColor="@color/colorAccent"></Button>
  143.  
  144.         <Button
  145.            android:layout_width="wrap_content"
  146.            android:layout_height="match_parent"
  147.            android:layout_weight="1"
  148.            android:text="tan"
  149.            android:onClick="tanf"
  150.            android:textAllCaps="false"
  151.            android:textSize="20dp"
  152.            android:background="@drawable/buttondi"
  153.            android:textColor="@color/colorAccent"></Button>
  154.     </LinearLayout>
  155.     <LinearLayout
  156.        android:layout_width="match_parent"
  157.        android:layout_height="wrap_content"
  158.        android:orientation="horizontal"
  159.        android:weightSum="5"
  160.        android:layout_weight="1">
  161.  
  162.         <Button
  163.            android:layout_width="wrap_content"
  164.            android:layout_height="match_parent"
  165.            android:layout_weight="1"
  166.            android:text="π"
  167.            android:textSize="20dp"
  168.            android:onClick="pi1"
  169.            android:background="@drawable/buttondi"
  170.            android:textColor="@color/colorAccent"></Button>
  171.  
  172.         <Button
  173.            android:layout_width="wrap_content"
  174.            android:layout_height="match_parent"
  175.            android:layout_weight="1"
  176.            android:text="e"
  177.            android:textAllCaps="false"
  178.            android:textSize="20dp"
  179.            android:onClick="expression"
  180.            android:background="@drawable/buttondi"
  181.            android:textColor="@color/colorAccent"></Button>
  182.  
  183.         <Button
  184.            android:layout_width="wrap_content"
  185.            android:layout_height="match_parent"
  186.            android:layout_weight="1"
  187.            android:text="("
  188.            android:textSize="20dp"
  189.            android:background="@drawable/buttondi"
  190.            android:textColor="@color/colorAccent"
  191.            android:onClick="fb1"></Button>
  192.  
  193.         <Button
  194.            android:layout_width="wrap_content"
  195.            android:layout_height="match_parent"
  196.            android:layout_weight="1"
  197.            android:text=")"
  198.            android:onClick="fb2"
  199.            android:textSize="20dp"
  200.            android:background="@drawable/buttondi"
  201.            android:textColor="@color/colorAccent"></Button>
  202.  
  203.         <Button
  204.            android:layout_width="wrap_content"
  205.            android:layout_height="match_parent"
  206.            android:layout_weight="1"
  207.            android:text="%"
  208.            android:textSize="20dp"
  209.            android:background="@drawable/buttondi"
  210.            android:textColor="@color/colorAccent"
  211.            android:onClick="percent"></Button>
  212.     </LinearLayout>
  213.     <LinearLayout
  214.        android:layout_width="match_parent"
  215.        android:layout_height="wrap_content"
  216.        android:orientation="horizontal"
  217.        android:weightSum="5"
  218.        android:layout_weight="1"
  219.        >
  220.         <Button
  221.            android:id="@+id/seven"
  222.            android:layout_width="wrap_content"
  223.            android:layout_height="match_parent"
  224.            android:text="7"
  225.            android:textSize="20dp"
  226.            android:layout_weight="1"
  227.            android:background="@drawable/buttondi"
  228.            android:textColor="@color/colorAccent"
  229.            android:onClick="numseven"
  230.            ></Button>
  231.         <Button
  232.            android:id="@+id/eight"
  233.            android:layout_width="wrap_content"
  234.            android:layout_height="match_parent"
  235.            android:text="8"
  236.            android:textSize="20dp"
  237.            android:onClick="numeight"
  238.            android:layout_weight="1"
  239.            android:background="@drawable/buttondi"
  240.            android:textColor="@color/colorAccent"
  241.            ></Button>
  242.         <Button
  243.            android:id="@+id/nine"
  244.            android:layout_width="wrap_content"
  245.            android:layout_height="match_parent"
  246.            android:text="9"
  247.            android:textSize="20dp"
  248.            android:layout_weight="1"
  249.            android:onClick="numnine"
  250.            android:background="@drawable/buttondi"
  251.            android:textColor="@color/colorAccent"
  252.            ></Button>
  253.  
  254.         <Button
  255.            android:id="@+id/del"
  256.            android:layout_width="wrap_content"
  257.            android:layout_height="match_parent"
  258.            android:layout_weight="1"
  259.            android:text="DEL"
  260.            android:background="@drawable/acb"
  261.            android:textSize="20dp"
  262.            android:onClick="Del"></Button>
  263.  
  264.         <Button
  265.            android:id="@+id/AC"
  266.            android:background="@drawable/acb"
  267.            android:layout_width="wrap_content"
  268.            android:layout_height="match_parent"
  269.            android:layout_weight="1"
  270.            android:text="AC"
  271.            android:textSize="20dp"
  272.            android:onClick="AC"></Button>
  273.     </LinearLayout>
  274.     <LinearLayout
  275.        android:layout_width="match_parent"
  276.        android:layout_height="wrap_content"
  277.        android:orientation="horizontal"
  278.        android:weightSum="5"
  279.        android:layout_weight="1">
  280.  
  281.         <Button
  282.            android:id="@+id/four"
  283.            android:layout_width="wrap_content"
  284.            android:layout_height="match_parent"
  285.            android:layout_weight="1"
  286.            android:text="4"
  287.            android:textSize="20dp"
  288.            android:onClick="numfour"
  289.            android:background="@drawable/buttondi"
  290.            android:textColor="@color/colorAccent"></Button>
  291.  
  292.         <Button
  293.            android:id="@+id/five"
  294.            android:layout_width="wrap_content"
  295.            android:layout_height="match_parent"
  296.            android:layout_weight="1"
  297.            android:text="5"
  298.            android:onClick="numfive"
  299.            android:textSize="20dp"
  300.            android:background="@drawable/buttondi"
  301.            android:textColor="@color/colorAccent"></Button>
  302.  
  303.         <Button
  304.            android:id="@+id/six"
  305.            android:layout_width="wrap_content"
  306.            android:layout_height="match_parent"
  307.            android:layout_weight="1"
  308.            android:onClick="numsix"
  309.            android:text="6"
  310.            android:textSize="20dp"
  311.            android:background="@drawable/buttondi"
  312.            android:textColor="@color/colorAccent"></Button>
  313.         <Button
  314.            android:id="@+id/multi"
  315.            android:layout_width="wrap_content"
  316.            android:layout_height="match_parent"
  317.            android:text="X"
  318.            android:textSize="20dp"
  319.            android:layout_weight="1"
  320.            android:background="@drawable/buttondi"
  321.            android:textColor="@color/colorAccent"
  322.            android:onClick="nummulti"
  323.            ></Button>
  324.         <Button
  325.            android:id="@+id/div"
  326.            android:layout_width="wrap_content"
  327.            android:layout_height="match_parent"
  328.            android:text="÷"
  329.            android:textSize="20dp"
  330.            android:layout_weight="1"
  331.            android:background="@drawable/buttondi"
  332.            android:textColor="@color/colorAccent"
  333.            android:onClick="numdiv"
  334.            ></Button>
  335.     </LinearLayout>
  336.     <LinearLayout
  337.        android:layout_width="match_parent"
  338.        android:layout_height="wrap_content"
  339.        android:orientation="horizontal"
  340.        android:weightSum="5"
  341.        android:layout_weight="1"
  342.        >
  343.         <Button
  344.            android:id="@+id/one"
  345.            android:layout_width="wrap_content"
  346.            android:layout_height="match_parent"
  347.            android:text="1"
  348.            android:textSize="20dp"
  349.            android:layout_weight="1"
  350.            android:background="@drawable/buttondi"
  351.            android:textColor="@color/colorAccent"
  352.            android:onClick="numone"
  353.            ></Button>
  354.         <Button
  355.            android:id="@+id/two"
  356.            android:layout_width="wrap_content"
  357.            android:layout_height="match_parent"
  358.            android:text="2"
  359.            android:textSize="20dp"
  360.            android:layout_weight="1"
  361.            android:background="@drawable/buttondi"
  362.            android:textColor="@color/colorAccent"
  363.            android:onClick="numtwo"
  364.            ></Button>
  365.         <Button
  366.            android:id="@+id/three"
  367.            android:layout_width="wrap_content"
  368.            android:layout_height="match_parent"
  369.            android:text="3"
  370.            android:textSize="20dp"
  371.            android:onClick="numthree"
  372.            android:layout_weight="1"
  373.            android:background="@drawable/buttondi"
  374.            android:textColor="@color/colorAccent"
  375.            ></Button>
  376.         <Button
  377.            android:id="@+id/plus"
  378.            android:layout_width="wrap_content"
  379.            android:layout_height="match_parent"
  380.            android:text="+"
  381.            android:textSize="20dp"
  382.            android:layout_weight="1"
  383.            android:background="@drawable/buttondi"
  384.            android:textColor="@color/colorAccent"
  385.            android:onClick="numplus"
  386.            ></Button>
  387.         <Button
  388.            android:id="@+id/minus"
  389.            android:layout_width="wrap_content"
  390.            android:layout_height="match_parent"
  391.            android:text="-"
  392.            android:textSize="20dp"
  393.            android:layout_weight="1"
  394.            android:background="@drawable/buttondi"
  395.            android:textColor="@color/colorAccent"
  396.            android:onClick="numminus"
  397.            ></Button>
  398.     </LinearLayout>
  399.     <LinearLayout
  400.        android:layout_width="match_parent"
  401.        android:layout_height="wrap_content"
  402.        android:orientation="horizontal"
  403.        android:weightSum="3"
  404.        android:layout_weight="1">
  405.  
  406.         <Button
  407.            android:id="@+id/zero"
  408.            android:layout_width="wrap_content"
  409.            android:layout_height="match_parent"
  410.            android:text="0"
  411.            android:textSize="20dp"
  412.            android:layout_weight="1"
  413.            android:background="@drawable/buttondi"
  414.            android:textColor="@color/colorAccent"
  415.            android:onClick="numzero"
  416.            ></Button>
  417.         <Button
  418.            android:id="@+id/dots"
  419.            android:layout_width="wrap_content"
  420.            android:layout_height="match_parent"
  421.            android:text="."
  422.            android:onClick="numdot"
  423.            android:textSize="20dp"
  424.            android:layout_weight="1"
  425.            android:background="@drawable/buttondi"
  426.            android:textColor="@color/colorAccent"
  427.            ></Button>
  428.  
  429.         <Button
  430.            android:id="@+id/equal1"
  431.            android:background="@drawable/buttondi"
  432.            android:textColor="@color/colorAccent"
  433.            android:layout_width="wrap_content"
  434.            android:layout_height="match_parent"
  435.            android:text="="
  436.            android:textSize="20dp"
  437.            android:onClick="numequal"
  438.            android:layout_weight="1"
  439.            ></Button>
  440.     </LinearLayout>
  441.  
  442. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement