diff options
author | Alan Viverette <alanv@google.com> | 2014-03-05 17:57:05 -0800 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-03-05 17:57:05 -0800 |
commit | 7387add6feefeb9be1d99b7da0b5848996c9b45a (patch) | |
tree | 8de1ee17494a173028e0b523f847c885523fcf22 | |
parent | 8bea49415c6de57f7e14517bf64769d24e3f099d (diff) | |
download | android_packages_apps_ExactCalculator-7387add6feefeb9be1d99b7da0b5848996c9b45a.tar.gz android_packages_apps_ExactCalculator-7387add6feefeb9be1d99b7da0b5848996c9b45a.tar.bz2 android_packages_apps_ExactCalculator-7387add6feefeb9be1d99b7da0b5848996c9b45a.zip |
Rename calculator back to Calculator
Also renames some assets, removes the stationary button style, and
restores the default clear / delete icon switching.
BUG: 13322842
BUG: 13321800
Change-Id: I43ccf7a7eb40a670289ca61c3582f0914a4bacee
28 files changed, 84 insertions, 99 deletions
diff --git a/res/drawable-hdpi/btn_tintable.9.png b/res/drawable-hdpi/btn_tintable.9.png Binary files differdeleted file mode 100644 index d060fcb..0000000 --- a/res/drawable-hdpi/btn_tintable.9.png +++ /dev/null diff --git a/res/drawable-hdpi/calc_clear_symbol_tintable.png b/res/drawable-hdpi/calc_clear_symbol_tintable.png Binary files differdeleted file mode 100644 index 0095f30..0000000 --- a/res/drawable-hdpi/calc_clear_symbol_tintable.png +++ /dev/null diff --git a/res/drawable-hdpi/ic_delete_alpha.png b/res/drawable-hdpi/ic_delete_alpha.png Binary files differnew file mode 100644 index 0000000..03b6655 --- /dev/null +++ b/res/drawable-hdpi/ic_delete_alpha.png diff --git a/res/drawable-ldpi/ic_delete_alpha.png b/res/drawable-ldpi/ic_delete_alpha.png Binary files differnew file mode 100644 index 0000000..7f6b461 --- /dev/null +++ b/res/drawable-ldpi/ic_delete_alpha.png diff --git a/res/drawable-mdpi/calc_clear_symbol_tintable.png b/res/drawable-mdpi/calc_clear_symbol_tintable.png Binary files differdeleted file mode 100644 index 15dc1f2..0000000 --- a/res/drawable-mdpi/calc_clear_symbol_tintable.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_delete_alpha.png b/res/drawable-mdpi/ic_delete_alpha.png Binary files differnew file mode 100644 index 0000000..4765362 --- /dev/null +++ b/res/drawable-mdpi/ic_delete_alpha.png diff --git a/res/drawable-sw600dp-hdpi/calc_clear_symbol_tintable.png b/res/drawable-sw600dp-hdpi/calc_clear_symbol_tintable.png Binary files differdeleted file mode 100644 index e998eae..0000000 --- a/res/drawable-sw600dp-hdpi/calc_clear_symbol_tintable.png +++ /dev/null diff --git a/res/drawable-sw600dp-mdpi/calc_clear_symbol_tintable.png b/res/drawable-sw600dp-mdpi/calc_clear_symbol_tintable.png Binary files differdeleted file mode 100644 index 74f4a63..0000000 --- a/res/drawable-sw600dp-mdpi/calc_clear_symbol_tintable.png +++ /dev/null diff --git a/res/drawable-xhdpi/calc_clear_symbol_tintable.png b/res/drawable-xhdpi/calc_clear_symbol_tintable.png Binary files differdeleted file mode 100644 index 4c239bf..0000000 --- a/res/drawable-xhdpi/calc_clear_symbol_tintable.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_delete_alpha.png b/res/drawable-xhdpi/ic_delete_alpha.png Binary files differnew file mode 100644 index 0000000..8232c2a --- /dev/null +++ b/res/drawable-xhdpi/ic_delete_alpha.png diff --git a/res/drawable-xxhdpi/calc_clear_symbol_tintable.png b/res/drawable-xxhdpi/calc_clear_symbol_tintable.png Binary files differdeleted file mode 100644 index 8380d6d..0000000 --- a/res/drawable-xxhdpi/calc_clear_symbol_tintable.png +++ /dev/null diff --git a/res/drawable-xxhdpi/ic_delete_alpha.png b/res/drawable-xxhdpi/ic_delete_alpha.png Binary files differnew file mode 100644 index 0000000..e60f09c --- /dev/null +++ b/res/drawable-xxhdpi/ic_delete_alpha.png diff --git a/res/drawable/btn_stationary.xml b/res/drawable/btn_stationary.xml deleted file mode 100644 index a8d5b55..0000000 --- a/res/drawable/btn_stationary.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?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. ---> -<reveal xmlns:android="http://schemas.android.com/apk/res/android" > - - <item android:drawable="@color/primary_light"/> - <item android:drawable="@color/primary"/> - -</reveal>
\ No newline at end of file diff --git a/res/drawable/calc_clear_symbol.xml b/res/drawable/ic_delete.xml index 5bbc3ab..367e7cf 100644 --- a/res/drawable/calc_clear_symbol.xml +++ b/res/drawable/ic_delete.xml @@ -1,3 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" - android:src="@drawable/calc_clear_symbol_tintable" /> + android:src="@drawable/ic_delete_alpha" + android:tint="@color/text_light" /> diff --git a/res/layout-land/main.xml b/res/layout-land/main.xml index 34aaf44..a7d28ab 100644 --- a/res/layout-land/main.xml +++ b/res/layout-land/main.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project -<!-- -/* - * Copyright (C) 2008, 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. - */ + 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" @@ -25,7 +21,8 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="0dp" + android:layout_weight="1" android:orientation="horizontal" > <com.android.calculator2.CalculatorDisplay @@ -45,15 +42,13 @@ android:layout_width="100dp" android:layout_height="match_parent" > - <Button + <TextView android:id="@+id/clear" - style="@style/stationary_button" android:text="@string/clear" android:textSize="15dp" /> - <Button + <TextView android:id="@+id/del" - style="@style/stationary_button" android:contentDescription="@string/delDesc" android:text="@string/del" android:textSize="15dp" /> @@ -63,6 +58,6 @@ <com.android.calculator2.CalculatorViewPager android:id="@+id/panelswitch" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="wrap_content" /> </LinearLayout>
\ No newline at end of file diff --git a/res/layout-port/main.xml b/res/layout-port/main.xml index 64638bc..374321f 100644 --- a/res/layout-port/main.xml +++ b/res/layout-port/main.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project -<!-- -/* - * Copyright (C) 2008, 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. - */ + 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" @@ -27,7 +23,8 @@ android:id="@+id/display" style="@style/display_holder_style" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="0dp" + android:layout_weight="1" maxDigits="@integer/max_digits" > <com.android.calculator2.CalculatorEditText style="@style/display_style" /> diff --git a/res/layout-port/simple_pad.xml b/res/layout-port/simple_pad.xml index 606e16a..276e079 100644 --- a/res/layout-port/simple_pad.xml +++ b/res/layout-port/simple_pad.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The Android Open Source Project -<!-- -/* -* 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. -*/ + 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" @@ -116,13 +112,26 @@ android:layout_weight="1" android:orientation="vertical" > - <ImageButton - android:id="@+id/del" - style="@style/function_button" - android:contentDescription="@string/delDesc" - android:src="@drawable/calc_clear_symbol" - android:text="@string/del" - android:textSize="@dimen/small_text_size" /> + <FrameLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" > + + <ImageButton + android:id="@+id/del" + style="@style/function_button" + android:contentDescription="@string/delDesc" + android:src="@drawable/ic_delete" + android:textSize="@dimen/small_text_size" /> + + <Button + android:id="@+id/clear" + style="@style/function_button" + android:contentDescription="@string/clearDesc" + android:text="@string/clear" + android:textSize="@dimen/small_text_size" + android:visibility="invisible" /> + </FrameLayout> <Button android:id="@+id/div" @@ -149,4 +158,4 @@ android:text="@string/plus" /> </LinearLayout> -</LinearLayout> +</LinearLayout>
\ No newline at end of file diff --git a/res/layout-sw600dp-land/main.xml b/res/layout-sw600dp-land/main.xml index 9392f5a..19a382e 100644 --- a/res/layout-sw600dp-land/main.xml +++ b/res/layout-sw600dp-land/main.xml @@ -67,7 +67,7 @@ android:contentDescription="@string/delDesc" android:paddingLeft="5dip" android:paddingRight="5dip" - android:src="@drawable/calc_clear_symbol_tintable" + android:src="@drawable/ic_delete_alpha" android:visibility="invisible" /> </FrameLayout> </LinearLayout> diff --git a/res/layout-sw600dp/main.xml b/res/layout-sw600dp/main.xml index 9ede6f3..93a8aad 100644 --- a/res/layout-sw600dp/main.xml +++ b/res/layout-sw600dp/main.xml @@ -69,7 +69,7 @@ android:contentDescription="@string/delDesc" android:paddingLeft="5dip" android:paddingRight="5dip" - android:src="@drawable/calc_clear_symbol_tintable" + android:src="@drawable/ic_delete_alpha" android:visibility="invisible" /> </FrameLayout> </LinearLayout> diff --git a/res/mipmap-hdpi/ic_launcher_calculator.png b/res/mipmap-hdpi/ic_launcher_calculator.png Binary files differindex 9ab10bc..737788f 100644 --- a/res/mipmap-hdpi/ic_launcher_calculator.png +++ b/res/mipmap-hdpi/ic_launcher_calculator.png diff --git a/res/mipmap-mdpi/ic_launcher_calculator.png b/res/mipmap-mdpi/ic_launcher_calculator.png Binary files differindex 4344be6..8500be8 100644 --- a/res/mipmap-mdpi/ic_launcher_calculator.png +++ b/res/mipmap-mdpi/ic_launcher_calculator.png diff --git a/res/mipmap-xhdpi/ic_launcher_calculator.png b/res/mipmap-xhdpi/ic_launcher_calculator.png Binary files differindex aa955e2..f7f2c15 100644 --- a/res/mipmap-xhdpi/ic_launcher_calculator.png +++ b/res/mipmap-xhdpi/ic_launcher_calculator.png diff --git a/res/mipmap-xxhdpi/ic_launcher_calculator.png b/res/mipmap-xxhdpi/ic_launcher_calculator.png Binary files differindex 830ec41..274bca7 100644 --- a/res/mipmap-xxhdpi/ic_launcher_calculator.png +++ b/res/mipmap-xxhdpi/ic_launcher_calculator.png diff --git a/res/mipmap-xxxhdpi/ic_launcher_calculator.png b/res/mipmap-xxxhdpi/ic_launcher_calculator.png Binary files differindex 497f27e..2ad08c2 100644 --- a/res/mipmap-xxxhdpi/ic_launcher_calculator.png +++ b/res/mipmap-xxxhdpi/ic_launcher_calculator.png diff --git a/res/values/strings.xml b/res/values/strings.xml index 5fdb725..b1c990a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -18,7 +18,7 @@ <resources> <!-- Application name --> - <string name="app_name">Quantum Calculator</string> + <string name="app_name">Calculator</string> <!-- If there is a syntax error in the user entered calculation, an error dialog will appear. This is the title. --> <string name="error">Error</string> <!-- Displayed numbers for the digit buttons --> diff --git a/res/values/styles.xml b/res/values/styles.xml index 3011d8c..46e4c5c 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -16,19 +16,15 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="button_style"> + <style name="button_style" parent="@android:style/Widget.Quantum.Button.Borderless"> <item name="android:textSize">24dp</item> + <item name="android:fontFamily">sans-serif-light</item> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">match_parent</item> <item name="android:layout_weight">1</item> <item name="android:focusable">true</item> <item name="android:onClick">onClick</item> </style> - - <style name="stationary_button" parent="button_style"> - <item name="android:background">@drawable/btn_stationary</item> - <item name="android:textColor">@color/text_dark</item> - </style> <style name="function_pad"> <item name="android:background">@color/gray_40</item> diff --git a/src/com/android/calculator2/Calculator.java b/src/com/android/calculator2/Calculator.java index d8e53de..d8f047d 100644 --- a/src/com/android/calculator2/Calculator.java +++ b/src/com/android/calculator2/Calculator.java @@ -115,8 +115,17 @@ public class Calculator extends Activity implements PanelSwitcher.Listener, Logi } @Override - public void onDeleteModeChange() { - // Meh? + public void onDeleteModeChange(int deleteMode) { + final View clear = findViewById(R.id.clear); + final View delete = findViewById(R.id.del); + + if (deleteMode == Logic.DELETE_MODE_BACKSPACE) { + delete.setVisibility(View.VISIBLE); + clear.setVisibility(View.GONE); + } else { + delete.setVisibility(View.GONE); + clear.setVisibility(View.VISIBLE); + } } static void log(String message) { diff --git a/src/com/android/calculator2/Logic.java b/src/com/android/calculator2/Logic.java index 0deea04..839e6f3 100644 --- a/src/com/android/calculator2/Logic.java +++ b/src/com/android/calculator2/Logic.java @@ -60,7 +60,7 @@ class Logic { private int mDeleteMode = DELETE_MODE_BACKSPACE; public interface Listener { - void onDeleteModeChange(); + void onDeleteModeChange(int mode); } private Listener mListener; @@ -82,7 +82,7 @@ class Logic { public void setDeleteMode(int mode) { if (mDeleteMode != mode) { mDeleteMode = mode; - mListener.onDeleteModeChange(); + mListener.onDeleteModeChange(mode); } } |