Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleaning things up, tweaking res values

  • Loading branch information...
commit fec3d0d8d22f85de692aea28833c608179534ef8 1 parent d46ee65
@Xlythe authored
View
2  AndroidManifest.xml
@@ -12,8 +12,6 @@
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h" />
- <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w" />
- <meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h" />
<activity android:name=".Calculator"
android:theme="@android:style/Theme.Holo.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"
View
139 res/layout-h400dp-port/advanced_pad.xml
@@ -0,0 +1,139 @@
+<?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/advancedPad"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:layout_gravity="center"
+ >
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/sin"
+ android:text="@string/sin"
+ android:hint="@string/arcsin"
+ style="@style/button_small_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/cos"
+ android:text="@string/cos"
+ android:hint="@string/arccos"
+ style="@style/button_small_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/tan"
+ android:text="@string/tan"
+ android:hint="@string/arctan"
+ style="@style/button_small_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/i"
+ android:text="@string/i"
+ style="@style/button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/ln"
+ android:text="@string/ln"
+ style="@style/button_small_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/lg"
+ android:text="@string/lg"
+ style="@style/button_small_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/pi"
+ android:text="@string/pi"
+ style="@style/button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/e"
+ android:text="@string/e"
+ style="@style/button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/percentage"
+ android:text="@string/percentage"
+ style="@style/button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/factorial"
+ android:text="@string/factorial"
+ style="@style/button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/sqrt"
+ android:text="@string/sqrt"
+ style="@style/button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/power"
+ android:text="@string/power"
+ style="@style/button_style"
+ />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ >
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/leftParen"
+ android:text="@string/leftParen"
+ style="@style/button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/rightParen"
+ android:text="@string/rightParen"
+ style="@style/button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/X"
+ android:text="@string/X"
+ style="@style/digit_button_style"
+ />
+ <com.android2.calculator3.view.ColorButton
+ android:id="@+id/Y"
+ android:text="@string/Y"
+ style="@style/digit_button_style"
+ />
+ </LinearLayout>
+</LinearLayout>
View
5 res/layout-land/main.xml
@@ -62,7 +62,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="0dp"
- android:textSize="15dp"
+ android:textSize="15sp"
style="@style/button_style"
/>
<!-- marginRight has to be 0 to catch border-touch -->
@@ -72,7 +72,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="0dp"
- android:textSize="15dp"
+ android:textSize="15sp"
+ android:padding="10dp"
style="@style/button_style"
/>
</FrameLayout>
View
3  res/layout-port/advanced_pad.xml
@@ -34,19 +34,16 @@
<com.android2.calculator3.view.ColorButton
android:id="@+id/sin"
android:text="@string/sin"
- android:hint="@string/arcsin"
style="@style/button_small_style"
/>
<com.android2.calculator3.view.ColorButton
android:id="@+id/cos"
android:text="@string/cos"
- android:hint="@string/arccos"
style="@style/button_small_style"
/>
<com.android2.calculator3.view.ColorButton
android:id="@+id/tan"
android:text="@string/tan"
- android:hint="@string/arctan"
style="@style/button_small_style"
/>
<com.android2.calculator3.view.ColorButton
View
18 res/layout-port/matrix_pad.xml
@@ -34,14 +34,12 @@
<com.android2.calculator3.view.ColorButton
android:id="@+id/matrix_transpose"
android:text="@string/matrix_transpose"
- android:textSize="25sp"
- style="@style/button_style"
+ style="@style/button_half_style"
/>
<com.android2.calculator3.view.ColorButton
android:id="@+id/matrix_inverse"
android:text="@string/matrix_inverse"
- android:textSize="25sp"
- style="@style/button_style"
+ style="@style/button_half_style"
/>
</LinearLayout>
<LinearLayout
@@ -51,14 +49,12 @@
<com.android2.calculator3.view.ColorButton
android:id="@+id/minus_row"
android:text="@string/minus_row"
- android:textSize="25sp"
- style="@style/button_style"
+ style="@style/button_half_style"
/>
<com.android2.calculator3.view.ColorButton
android:id="@+id/plus_row"
android:text="@string/plus_row"
- android:textSize="25sp"
- style="@style/button_style"
+ style="@style/button_half_style"
/>
</LinearLayout>
<LinearLayout
@@ -68,14 +64,12 @@
<com.android2.calculator3.view.ColorButton
android:id="@+id/minus_col"
android:text="@string/minus_col"
- android:textSize="25sp"
- style="@style/button_style"
+ style="@style/button_half_style"
/>
<com.android2.calculator3.view.ColorButton
android:id="@+id/plus_col"
android:text="@string/plus_col"
- android:textSize="25sp"
- style="@style/button_style"
+ style="@style/button_half_style"
/>
</LinearLayout>
<com.android2.calculator3.view.ColorButton
View
1  res/values-port/styles.xml
@@ -15,5 +15,4 @@
-->
<resources>
<dimen name="barHeight">60dp</dimen>
- <integer name="barHeight">60</integer>
</resources>
View
1  res/values-sw600dp-port/styles.xml
@@ -16,5 +16,4 @@
<resources>
<dimen name="group_padding">48sp</dimen>
<dimen name="barHeight">25dp</dimen>
- <integer name="barHeight">25</integer>
</resources>
View
7 res/values/styles.xml
@@ -24,11 +24,8 @@
<dimen name="min_display_height">100dp</dimen>
<dimen name="max_display_height">200dp</dimen>
<dimen name="barHeight">25dp</dimen>
- <integer name="barHeight">25</integer>
<dimen name="app_defaultsize_w">632.0dip</dimen>
<dimen name="app_defaultsize_h">598.0dip</dimen>
- <dimen name="app_minimumsize_w">632.0dip</dimen>
- <dimen name="app_minimumsize_h">598.0dip</dimen>
<!-- Cling -->
<dimen name="clingPunchThroughGraphicCenterRadius">94dp</dimen>
@@ -55,6 +52,10 @@
<item name="android:textSize">30sp</item>
</style>
+ <style name="button_half_style" parent="button_style">
+ <item name="android:textSize">25sp</item>
+ </style>
+
<style name="display_style">
<item name="android:textSize">@dimen/display_text_size</item>
<item name="android:inputType">text|textNoSuggestions</item>
View
3  src/com/android2/calculator3/Calculator.java
@@ -151,8 +151,7 @@ public void onCreate(Bundle state) {
mDisplay = (CalculatorDisplay) findViewById(R.id.display);
mPulldown = (Slider) findViewById(R.id.pulldown);
- int barHeight = getResources().getInteger(R.integer.barHeight);
- mPulldown.setBarHeight(LogicalDensity.convertDpToPixel(barHeight, this));
+ mPulldown.setBarHeight(getResources().getDimensionPixelSize(R.dimen.barHeight));
mPulldown.setSlideDirection(Direction.DOWN);
mPulldown.setOnSlideListener(new OnSlideListener() {
@Override
View
3  src/com/android2/calculator3/EventListener.java
@@ -33,6 +33,7 @@
import com.android2.calculator3.view.MatrixEditText;
import com.android2.calculator3.view.MatrixInverseView;
import com.android2.calculator3.view.MatrixTransposeView;
+import com.android2.calculator3.view.MatrixView;
public class EventListener implements View.OnKeyListener, View.OnClickListener, View.OnLongClickListener {
Context mContext;
@@ -125,7 +126,7 @@ public void onClick(View view) {
break;
case R.id.matrix:
- mHandler.insert("[[,][,]]");
+ mHandler.insert(MatrixView.PATTERN);
returnToBasic();
break;
View
1  src/com/android2/calculator3/view/MatrixView.java
@@ -20,6 +20,7 @@
private static String FORMAT = "#.######";
private static DecimalFormat FORMATTER = new DecimalFormat(FORMAT);
private static final String VALID_MATRIX = "\\[(\\[[\u2212-]?[A-F0-9]*(\\.[A-F0-9]*)?(,[\u2212-]?[A-F0-9]*(\\.[A-F0-9]*)?)*\\])+\\].*";
+ public final static String PATTERN = "[[,][,]]";
private int rows, columns = 0;
private AdvancedDisplay parent;
Please sign in to comment.
Something went wrong with that request. Please try again.