Skip to content

Commit

Permalink
new page with Hex digits, a few optimizations
Browse files Browse the repository at this point in the history
dec, hex, and bin don't work properly atm
  • Loading branch information
Xlythe committed Aug 14, 2012
1 parent 41765f8 commit b04ffb8
Show file tree
Hide file tree
Showing 18 changed files with 680 additions and 180 deletions.
Binary file modified bin/android_packages_apps_Calculator.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file modified bin/resources.ap_
Binary file not shown.
2 changes: 1 addition & 1 deletion res/layout-land/function_pad.xml
Expand Up @@ -19,7 +19,7 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/advancedPad"
android:id="@+id/functionPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
Expand Down
93 changes: 93 additions & 0 deletions res/layout-land/hex_pad.xml
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
/*
* Copyright (C) 2011, 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.
*/
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/hexPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center"
>

<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/A"
android:text="@string/A"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/B"
android:text="@string/B"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/C"
android:text="@string/C"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/D"
android:text="@string/D"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/E"
android:text="@string/E"
style="@style/digit_button_style"
/>
</LinearLayout>

<LinearLayout
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/F"
android:text="@string/F"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:text="@null"
android:clickable="false"
style="@style/button_small_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/dec"
android:text="@string/dec"
style="@style/button_small_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/bin"
android:text="@string/bin"
style="@style/button_small_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/hex"
android:text="@string/hex"
style="@style/button_small_style"
/>
</LinearLayout>
</LinearLayout>
106 changes: 106 additions & 0 deletions res/layout-port/hex_pad.xml
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
/*
* Copyright (C) 2011, 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.
*/
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/hexPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/A"
android:text="@string/A"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/B"
android:text="@string/B"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/C"
android:text="@string/C"
style="@style/digit_button_style"
/>
</LinearLayout>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/D"
android:text="@string/D"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/E"
android:text="@string/E"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/F"
android:text="@string/F"
style="@style/digit_button_style"
/>
</LinearLayout>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:text="@null"
android:clickable="false"
style="@style/button_style"
/>
</LinearLayout>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/dec"
android:text="@string/dec"
style="@style/button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/bin"
android:text="@string/bin"
style="@style/button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/hex"
android:text="@string/hex"
style="@style/button_style"
/>
</LinearLayout>
</LinearLayout>
94 changes: 94 additions & 0 deletions res/layout-sw600dp-land/hex_pad.xml
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
/*
* Copyright (C) 2011, 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.
*/
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/functionPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/A"
android:text="@string/A"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/B"
android:text="@string/B"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/C"
android:text="@string/C"
style="@style/digit_button_style"
/>
</LinearLayout>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/D"
android:text="@string/D"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/E"
android:text="@string/E"
style="@style/digit_button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/F"
android:text="@string/F"
style="@style/digit_button_style"
/>
</LinearLayout>

<LinearLayout
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="0dp"
>
<com.android2.calculator3.ColorButton
android:id="@+id/dec"
android:text="@string/dec"
style="@style/button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/bin"
android:text="@string/bin"
style="@style/button_style"
/>
<com.android2.calculator3.ColorButton
android:id="@+id/hex"
android:text="@string/hex"
style="@style/button_style"
/>
</LinearLayout>
</LinearLayout>
84 changes: 84 additions & 0 deletions res/layout-sw600dp/hex_pad.xml
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
/*
* Copyright (C) 2011, 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.
*/
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/functionPad"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="2"
android:orientation="vertical"
android:layout_marginBottom="@dimen/group_padding">

<LinearLayout
style="@style/btn_row_style">
<Button
android:id="@+id/A"
android:text="@string/A"
style="@style/btn_digit_cell_style"
/>
<Button
android:id="@+id/B"
android:text="@string/B"
style="@style/btn_digit_cell_style"
/>
<Button
android:id="@+id/C"
android:text="@string/C"
style="@style/btn_digit_cell_style"
/>
<Button
android:id="@+id/D"
android:text="@string/D"
style="@style/btn_digit_cell_style"
/>
<Button
android:id="@+id/E"
android:text="@string/E"
style="@style/btn_digit_cell_style"
/>
</LinearLayout>
<LinearLayout
style="@style/btn_row_style">
<Button
android:id="@+id/F"
android:text="@string/F"
style="@style/btn_digit_cell_style"
/>
<Button
android:text="@null"
style="@style/btn_function_cell_style"
/>
<Button
android:id="@+id/dec"
android:text="@string/dec"
style="@style/btn_function_cell_style"
/>
<Button
android:id="@+id/bin"
android:text="@string/bin"
style="@style/btn_function_cell_style"
/>
<Button
android:id="@+id/hex"
android:text="@string/hex"
style="@style/btn_function_cell_style"
/>
</LinearLayout>
</LinearLayout>

0 comments on commit b04ffb8

Please sign in to comment.