ExactCalculator: Restructure advanced pads

Change-Id: I899348074c94f7045e4dc3affa42097ab18e3b98
diff --git a/res/layout/pad_advanced_4x4.xml b/res/layout/pad_advanced_3x4.xml
similarity index 86%
rename from res/layout/pad_advanced_4x4.xml
rename to res/layout/pad_advanced_3x4.xml
index 8a43cfa..bf0bb67 100644
--- a/res/layout/pad_advanced_4x4.xml
+++ b/res/layout/pad_advanced_3x4.xml
@@ -22,31 +22,65 @@
     style="@style/PadLayoutStyle.Advanced"
     android:background="@color/pad_advanced_background_color"
     app:rowCount="4"
-    app:columnCount="4">
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/toggle_inv"
-        style="@style/PadButtonStyle.Advanced.Text"
-        android:background="@drawable/pad_button_inverse_background"
-        android:contentDescription="@string/desc_inv_off"
-        android:text="@string/inv"
-        app:layout_row="0"
-        app:layout_column="0" />
+    app:columnCount="3">
 
     <com.android.calculator2.HapticButton
         android:id="@+id/toggle_mode"
         style="@style/PadButtonStyle.Advanced.Text"
         android:contentDescription="@string/desc_switch_deg"
         android:text="@string/mode_deg"
+        android:background="@color/pad_advanced_background_color"
+        app:layout_row="0"
+        app:layout_column="0" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/op_sqrt"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_sqrt"
+        android:text="@string/op_sqrt"
         app:layout_row="0"
         app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/op_pct"
+        android:id="@+id/op_sqr"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_pct"
-        android:text="@string/op_pct"
+        android:contentDescription="@string/desc_op_sqr"
+        android:fontFamily="sans-serif-medium"
+        android:text="@string/op_sqr"
+        android:visibility="gone"
         app:layout_row="0"
+        app:layout_column="1" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/const_pi"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_const_pi"
+        android:text="@string/const_pi"
+        app:layout_row="0"
+        app:layout_column="2" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/toggle_inv"
+        style="@style/PadButtonStyle.Advanced.Text"
+        android:contentDescription="@string/desc_inv_off"
+        android:text="@string/inv"
+        app:layout_row="1"
+        app:layout_column="0" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/op_pow"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_pow"
+        android:text="@string/op_pow"
+        app:layout_row="1"
+        app:layout_column="1" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/op_fact"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_fact"
+        android:text="@string/op_fact"
+        app:layout_row="1"
         app:layout_column="2" />
 
     <com.android.calculator2.HapticButton
@@ -54,7 +88,7 @@
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_fun_sin"
         android:text="@string/fun_sin"
-        app:layout_row="1"
+        app:layout_row="2"
         app:layout_column="0" />
 
     <com.android.calculator2.HapticButton
@@ -64,7 +98,7 @@
         android:fontFamily="sans-serif-medium"
         android:text="@string/fun_arcsin"
         android:visibility="gone"
-        app:layout_row="1"
+        app:layout_row="2"
         app:layout_column="0" />
 
     <com.android.calculator2.HapticButton
@@ -72,7 +106,7 @@
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_fun_cos"
         android:text="@string/fun_cos"
-        app:layout_row="1"
+        app:layout_row="2"
         app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
@@ -82,7 +116,7 @@
         android:fontFamily="sans-serif-medium"
         android:text="@string/fun_arccos"
         android:visibility="gone"
-        app:layout_row="1"
+        app:layout_row="2"
         app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
@@ -90,7 +124,7 @@
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_fun_tan"
         android:text="@string/fun_tan"
-        app:layout_row="1"
+        app:layout_row="2"
         app:layout_column="2" />
 
     <com.android.calculator2.HapticButton
@@ -100,58 +134,6 @@
         android:fontFamily="sans-serif-medium"
         android:text="@string/fun_arctan"
         android:visibility="gone"
-        app:layout_row="1"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/const_pi"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_const_pi"
-        android:text="@string/const_pi"
-        app:layout_row="1"
-        app:layout_column="3" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_ln"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_ln"
-        android:text="@string/fun_ln"
-        app:layout_row="2"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_exp"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_exp"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_exp"
-        android:visibility="gone"
-        app:layout_row="2"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_log"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_log"
-        android:text="@string/fun_log"
-        app:layout_row="2"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_10pow"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_10pow"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_10pow"
-        android:visibility="gone"
-        app:layout_row="2"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_fact"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_fact"
-        android:text="@string/op_fact"
         app:layout_row="2"
         app:layout_column="2" />
 
@@ -160,49 +142,43 @@
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_const_e"
         android:text="@string/const_e"
-        app:layout_row="2"
-        app:layout_column="3" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/lparen"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_lparen"
-        android:text="@string/lparen"
         app:layout_row="3"
         app:layout_column="0" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/rparen"
+        android:id="@+id/fun_ln"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_rparen"
-        android:text="@string/rparen"
+        android:contentDescription="@string/desc_fun_ln"
+        android:text="@string/fun_ln"
         app:layout_row="3"
         app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/op_sqrt"
+        android:id="@+id/fun_exp"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_sqrt"
-        android:text="@string/op_sqrt"
+        android:contentDescription="@string/desc_fun_exp"
+        android:fontFamily="sans-serif-medium"
+        android:text="@string/fun_exp"
+        android:visibility="gone"
+        app:layout_row="3"
+        app:layout_column="1" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/fun_log"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_fun_log"
+        android:text="@string/fun_log"
         app:layout_row="3"
         app:layout_column="2" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/op_sqr"
+        android:id="@+id/fun_10pow"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_sqr"
+        android:contentDescription="@string/desc_fun_10pow"
         android:fontFamily="sans-serif-medium"
-        android:text="@string/op_sqr"
+        android:text="@string/fun_10pow"
         android:visibility="gone"
         app:layout_row="3"
         app:layout_column="2" />
 
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_pow"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_pow"
-        android:text="@string/op_pow"
-        app:layout_row="3"
-        app:layout_column="3" />
-
 </androidx.gridlayout.widget.GridLayout>
diff --git a/res/layout/pad_advanced_3x5.xml b/res/layout/pad_advanced_3x5.xml
deleted file mode 100644
index dfd283d..0000000
--- a/res/layout/pad_advanced_3x5.xml
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2015 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<androidx.gridlayout.widget.GridLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:id="@+id/pad_advanced"
-    style="@style/PadLayoutStyle.Advanced"
-    android:background="@color/pad_advanced_background_color"
-    app:rowCount="5"
-    app:columnCount="3">
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/toggle_inv"
-        style="@style/PadButtonStyle.Advanced.Text"
-        android:background="@drawable/pad_button_inverse_background"
-        android:contentDescription="@string/desc_inv_off"
-        android:text="@string/inv"
-        app:layout_row="0"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/toggle_mode"
-        style="@style/PadButtonStyle.Advanced.Text"
-        android:contentDescription="@string/desc_switch_deg"
-        android:text="@string/mode_deg"
-        app:layout_row="0"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_pct"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_pct"
-        android:text="@string/op_pct"
-        app:layout_row="0"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_sin"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_sin"
-        android:text="@string/fun_sin"
-        app:layout_row="1"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_arcsin"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_arcsin"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_arcsin"
-        android:visibility="gone"
-        app:layout_row="1"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_cos"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_cos"
-        android:text="@string/fun_cos"
-        app:layout_row="1"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_arccos"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_arccos"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_arccos"
-        android:visibility="gone"
-        app:layout_row="1"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_tan"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_tan"
-        android:text="@string/fun_tan"
-        app:layout_row="1"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_arctan"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_arctan"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_arctan"
-        android:visibility="gone"
-        app:layout_row="1"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_ln"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_ln"
-        android:text="@string/fun_ln"
-        app:layout_row="2"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_exp"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_exp"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_exp"
-        android:visibility="gone"
-        app:layout_row="2"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_log"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_log"
-        android:text="@string/fun_log"
-        app:layout_row="2"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_10pow"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_10pow"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_10pow"
-        android:visibility="gone"
-        app:layout_row="2"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_fact"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_fact"
-        android:text="@string/op_fact"
-        app:layout_row="2"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/const_pi"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_const_pi"
-        android:text="@string/const_pi"
-        app:layout_row="3"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/const_e"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_const_e"
-        android:text="@string/const_e"
-        app:layout_row="3"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_pow"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_pow"
-        android:text="@string/op_pow"
-        app:layout_row="3"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/lparen"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_lparen"
-        android:text="@string/lparen"
-        app:layout_row="4"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/rparen"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_rparen"
-        android:text="@string/rparen"
-        app:layout_row="4"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_sqrt"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_sqrt"
-        android:text="@string/op_sqrt"
-        app:layout_row="4"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_sqr"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_sqr"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/op_sqr"
-        android:visibility="gone"
-        app:layout_row="4"
-        app:layout_column="2" />
-
-</androidx.gridlayout.widget.GridLayout>
diff --git a/res/layout/pad_advanced_5x3.xml b/res/layout/pad_advanced_4x3.xml
similarity index 86%
rename from res/layout/pad_advanced_5x3.xml
rename to res/layout/pad_advanced_4x3.xml
index 8367255..d652318 100644
--- a/res/layout/pad_advanced_5x3.xml
+++ b/res/layout/pad_advanced_4x3.xml
@@ -22,32 +22,65 @@
     style="@style/PadLayoutStyle.Advanced"
     android:background="@color/pad_advanced_background_color"
     app:rowCount="3"
-    app:columnCount="5">
+    app:columnCount="4">
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/toggle_inv"
-        style="@style/PadButtonStyle.Advanced.Text"
-        android:background="@drawable/pad_button_inverse_background"
-        android:contentDescription="@string/desc_inv_off"
-        android:text="@string/inv"
+        android:id="@+id/op_sqrt"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_sqrt"
+        android:text="@string/op_sqrt"
         app:layout_row="0"
         app:layout_column="0" />
 
     <com.android.calculator2.HapticButton
+        android:id="@+id/op_sqr"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_sqr"
+        android:fontFamily="sans-serif-medium"
+        android:text="@string/op_sqr"
+        android:visibility="gone"
+        app:layout_row="0"
+        app:layout_column="0" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/const_pi"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_const_pi"
+        android:text="@string/const_pi"
+        app:layout_row="0"
+        app:layout_column="1" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/op_pow"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_pow"
+        android:text="@string/op_pow"
+        app:layout_row="0"
+        app:layout_column="2" /> 
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/op_fact"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_op_fact"
+        android:text="@string/op_fact"
+        app:layout_row="0"
+        app:layout_column="3" />
+
+    <com.android.calculator2.HapticButton
         android:id="@+id/toggle_mode"
         style="@style/PadButtonStyle.Advanced.Text"
         android:contentDescription="@string/desc_switch_deg"
         android:text="@string/mode_deg"
-        app:layout_row="0"
-        app:layout_column="1" />
+        app:layout_row="1"
+        app:layout_column="0" />
 
     <com.android.calculator2.HapticButton
         android:id="@+id/fun_sin"
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_fun_sin"
         android:text="@string/fun_sin"
-        app:layout_row="0"
-        app:layout_column="2" />
+        app:layout_row="1"
+        app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
         android:id="@+id/fun_arcsin"
@@ -56,16 +89,16 @@
         android:fontFamily="sans-serif-medium"
         android:text="@string/fun_arcsin"
         android:visibility="gone"
-        app:layout_row="0"
-        app:layout_column="2" />
+        app:layout_row="1"
+        app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
         android:id="@+id/fun_cos"
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_fun_cos"
         android:text="@string/fun_cos"
-        app:layout_row="0"
-        app:layout_column="3" />
+        app:layout_row="1"
+        app:layout_column="2" />
 
     <com.android.calculator2.HapticButton
         android:id="@+id/fun_arccos"
@@ -74,16 +107,16 @@
         android:fontFamily="sans-serif-medium"
         android:text="@string/fun_arccos"
         android:visibility="gone"
-        app:layout_row="0"
-        app:layout_column="3" />
+        app:layout_row="1"
+        app:layout_column="2" />
 
     <com.android.calculator2.HapticButton
         android:id="@+id/fun_tan"
         style="@style/PadButtonStyle.Advanced"
         android:contentDescription="@string/desc_fun_tan"
         android:text="@string/fun_tan"
-        app:layout_row="0"
-        app:layout_column="4" />
+        app:layout_row="1"
+        app:layout_column="3" />
 
     <com.android.calculator2.HapticButton
         android:id="@+id/fun_arctan"
@@ -92,74 +125,14 @@
         android:fontFamily="sans-serif-medium"
         android:text="@string/fun_arctan"
         android:visibility="gone"
-        app:layout_row="0"
-        app:layout_column="4" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_pct"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_pct"
-        android:text="@string/op_pct"
-        app:layout_row="1"
-        app:layout_column="0" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_ln"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_ln"
-        android:text="@string/fun_ln"
-        app:layout_row="1"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_exp"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_exp"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_exp"
-        android:visibility="gone"
-        app:layout_row="1"
-        app:layout_column="1" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_log"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_log"
-        android:text="@string/fun_log"
-        app:layout_row="1"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/fun_10pow"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_fun_10pow"
-        android:fontFamily="sans-serif-medium"
-        android:text="@string/fun_10pow"
-        android:visibility="gone"
-        app:layout_row="1"
-        app:layout_column="2" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_fact"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_fact"
-        android:text="@string/op_fact"
         app:layout_row="1"
         app:layout_column="3" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/op_pow"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_pow"
-        android:text="@string/op_pow"
-        app:layout_row="1"
-        app:layout_column="4" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/const_pi"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_const_pi"
-        android:text="@string/const_pi"
+        android:id="@+id/toggle_inv"
+        style="@style/PadButtonStyle.Advanced.Text"
+        android:contentDescription="@string/desc_inv_off"
+        android:text="@string/inv"
         app:layout_row="2"
         app:layout_column="0" />
 
@@ -172,37 +145,39 @@
         app:layout_column="1" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/lparen"
+        android:id="@+id/fun_ln"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_lparen"
-        android:text="@string/lparen"
+        android:contentDescription="@string/desc_fun_ln"
+        android:text="@string/fun_ln"
         app:layout_row="2"
         app:layout_column="2" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/rparen"
+        android:id="@+id/fun_exp"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_rparen"
-        android:text="@string/rparen"
+        android:contentDescription="@string/desc_fun_exp"
+        android:fontFamily="sans-serif-medium"
+        android:text="@string/fun_exp"
+        android:visibility="gone"
+        app:layout_row="2"
+        app:layout_column="2" />
+
+    <com.android.calculator2.HapticButton
+        android:id="@+id/fun_log"
+        style="@style/PadButtonStyle.Advanced"
+        android:contentDescription="@string/desc_fun_log"
+        android:text="@string/fun_log"
         app:layout_row="2"
         app:layout_column="3" />
 
     <com.android.calculator2.HapticButton
-        android:id="@+id/op_sqrt"
+        android:id="@+id/fun_10pow"
         style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_sqrt"
-        android:text="@string/op_sqrt"
-        app:layout_row="2"
-        app:layout_column="4" />
-
-    <com.android.calculator2.HapticButton
-        android:id="@+id/op_sqr"
-        style="@style/PadButtonStyle.Advanced"
-        android:contentDescription="@string/desc_op_sqr"
+        android:contentDescription="@string/desc_fun_10pow"
         android:fontFamily="sans-serif-medium"
-        android:text="@string/op_sqr"
+        android:text="@string/fun_10pow"
         android:visibility="gone"
         app:layout_row="2"
-        app:layout_column="4" />
+        app:layout_column="3" />
 
 </androidx.gridlayout.widget.GridLayout>
diff --git a/res/values-w375dp-h768dp-port/layout.xml b/res/values-w375dp-h768dp-port/layout.xml
index 815fd38..1da323ac 100644
--- a/res/values-w375dp-h768dp-port/layout.xml
+++ b/res/values-w375dp-h768dp-port/layout.xml
@@ -17,6 +17,6 @@
 
 <resources>
     <item name="display" type="layout">@layout/display_two_line</item>
-    <item name="pad_advanced" type="layout">@layout/pad_advanced_5x3</item>
+    <item name="pad_advanced" type="layout">@layout/pad_advanced_4x3</item>
     <item name="pad_operator" type="layout">@layout/pad_operator_two_col</item>
 </resources>
diff --git a/res/values-w520dp-h375dp-land/layout.xml b/res/values-w520dp-h375dp-land/layout.xml
index 15b5b1b..6aed628 100644
--- a/res/values-w520dp-h375dp-land/layout.xml
+++ b/res/values-w520dp-h375dp-land/layout.xml
@@ -18,6 +18,6 @@
 <resources>
     <item name="activity_calculator" type="layout">@layout/activity_calculator_land</item>
     <item name="display" type="layout">@layout/display_two_line</item>
-    <item name="pad_advanced" type="layout">@layout/pad_advanced_3x5</item>
+    <item name="pad_advanced" type="layout">@layout/pad_advanced_3x4</item>
     <item name="pad_operator" type="layout">@layout/pad_operator_two_col</item>
 </resources>
diff --git a/res/values-w520dp-h500dp-land/layout.xml b/res/values-w520dp-h500dp-land/layout.xml
index 15b5b1b..6aed628 100644
--- a/res/values-w520dp-h500dp-land/layout.xml
+++ b/res/values-w520dp-h500dp-land/layout.xml
@@ -18,6 +18,6 @@
 <resources>
     <item name="activity_calculator" type="layout">@layout/activity_calculator_land</item>
     <item name="display" type="layout">@layout/display_two_line</item>
-    <item name="pad_advanced" type="layout">@layout/pad_advanced_3x5</item>
+    <item name="pad_advanced" type="layout">@layout/pad_advanced_3x4</item>
     <item name="pad_operator" type="layout">@layout/pad_operator_two_col</item>
 </resources>
diff --git a/res/values-w520dp-h768dp-land/layout.xml b/res/values-w520dp-h768dp-land/layout.xml
index 15b5b1b..6aed628 100644
--- a/res/values-w520dp-h768dp-land/layout.xml
+++ b/res/values-w520dp-h768dp-land/layout.xml
@@ -18,6 +18,6 @@
 <resources>
     <item name="activity_calculator" type="layout">@layout/activity_calculator_land</item>
     <item name="display" type="layout">@layout/display_two_line</item>
-    <item name="pad_advanced" type="layout">@layout/pad_advanced_3x5</item>
+    <item name="pad_advanced" type="layout">@layout/pad_advanced_3x4</item>
     <item name="pad_operator" type="layout">@layout/pad_operator_two_col</item>
 </resources>
diff --git a/res/values-w520dp-h768dp-port/layout.xml b/res/values-w520dp-h768dp-port/layout.xml
index 815fd38..1da323ac 100644
--- a/res/values-w520dp-h768dp-port/layout.xml
+++ b/res/values-w520dp-h768dp-port/layout.xml
@@ -17,6 +17,6 @@
 
 <resources>
     <item name="display" type="layout">@layout/display_two_line</item>
-    <item name="pad_advanced" type="layout">@layout/pad_advanced_5x3</item>
+    <item name="pad_advanced" type="layout">@layout/pad_advanced_4x3</item>
     <item name="pad_operator" type="layout">@layout/pad_operator_two_col</item>
 </resources>
diff --git a/res/values/layout.xml b/res/values/layout.xml
index 0e698d5..3c7bc99 100644
--- a/res/values/layout.xml
+++ b/res/values/layout.xml
@@ -19,5 +19,5 @@
     <item name="activity_calculator" type="layout">@layout/activity_calculator_port</item>
     <item name="display" type="layout">@layout/display_one_line</item>
     <item name="pad_operator" type="layout">@layout/pad_operator_one_col</item>
-    <item name="pad_advanced" type="layout">@layout/pad_advanced_4x4</item>
+    <item name="pad_advanced" type="layout">@layout/pad_advanced_4x3</item>
 </resources>