Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b028318 authored by Justin Klaassen's avatar Justin Klaassen
Browse files

Merge remote-tracking branch 'goog/ub-calculator-calculus'

* goog/ub-calculator-calculus:
  Fix tap handling in CalculatorPadViewPager
  Don't use Fragment#getContext()
  Polish layout configurations
  Further iterate over ViewGroups to en/disable children.
  Display error message onEquals with invalid expression
  Draw the toolbar on top
  Add digit separators to pre-evaluated results
  Fix formula TalkBack
  Fix TalkBack for advanced panel
  Crush pngs -> save space
  Add digit grouping to display
  Ensure formula/result textSize is correct
  Scale error messages and prevent wrapping
  Make Calculator compatible with API 21+
  Adjust padding for some layouts.
  Drop height bucket from 569dp to 500dp.
  Show result in ERROR mode for one line displays.
  Calculator multiwindow support R3.
  Make arccos call the correct function
  Calculator multiwindow support.
  Ignore "=" if formula contains no operators
  Handle font with missing FIGURE SPACE.
  Ensure CalculatorText is at least as wide as it's container
  Show toolbar when DEG/RAD mode matters
  Remove CAB workaround for N+ devices
  Stop the action mode in Activity#onBackPressed()
  Don't intercept "BACK" key events
  Fix hw keyboard support
  Fix result positioning on evaluate
  Refactor arithmetic code.  More symbolic result tracking.
  Wrap CalculatorText in custom HorizontalScrollView.
  Add contentDescription for empty formula view.
  Correctly handle parenthesized percent expressions
  Copy and truncate rational results exactly

Change-Id: I175f23a52ac17ec3e62594df8ba584e8926ca6dd
parents efa2533e 2cf12891
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -28,9 +28,14 @@
        <activity
            android:name=".Calculator"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@style/Theme.Calculator">
            <layout
                android:minHeight="220dp"
                android:minWidth="230dp" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.APP_CALCULATOR" />
            </intent-filter>
@@ -38,9 +43,9 @@

        <activity
            android:name=".Licenses"
            android:launchMode="singleTop"
            android:parentActivityName=".Calculator"
            android:theme="@style/Theme.Licenses" />

    </application>

</manifest>
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
        android:layout_weight="1">

        <include layout="@layout/pad_numeric" />
        <include layout="@layout/pad_operator_two_col" />
        <include layout="@layout/pad_operator" />
        <include layout="@layout/pad_advanced" />

    </LinearLayout>
+2 −5
Original line number Diff line number Diff line
@@ -21,10 +21,7 @@
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include
        layout="@layout/display"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <include layout="@layout/display"/>

    <com.android.calculator2.CalculatorPadViewPager
        android:id="@+id/pad_pager"
@@ -38,7 +35,7 @@
            android:layout_height="match_parent">

            <include layout="@layout/pad_numeric" />
            <include layout="@layout/pad_operator_one_col" />
            <include layout="@layout/pad_operator" />

        </LinearLayout>

+8 −8
Original line number Diff line number Diff line
@@ -21,17 +21,17 @@
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include
        layout="@layout/display"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <include layout="@layout/display" />

    <include layout="@layout/pad_advanced_tablet_port" />
    <include layout="@layout/pad_advanced" />

    <LinearLayout style="@style/PadLinearLayoutStyle">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="500">

        <include layout="@layout/pad_numeric"/>
        <include layout="@layout/pad_operator_two_col" />
        <include layout="@layout/pad_operator" />

    </LinearLayout>

+70 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2016 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.
  -->

<com.android.calculator2.CalculatorDisplay
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/display"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/display_background_color"
    android:clipChildren="false"
    android:elevation="4dip"
    android:orientation="vertical">

    <include layout="@layout/toolbar" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.android.calculator2.CalculatorScrollView
            android:id="@+id/formula_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:overScrollMode="never"
            android:scrollbars="none">

            <com.android.calculator2.CalculatorText
                android:id="@+id/formula"
                style="@style/DisplayTextStyle.Formula"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="bottom|end"
                android:ellipsize="none"
                android:gravity="bottom|end"
                android:longClickable="true"
                android:singleLine="true"
                android:textColor="@color/display_formula_text_color"
                android:textIsSelectable="false" />

        </com.android.calculator2.CalculatorScrollView>

        <com.android.calculator2.CalculatorResult
            android:id="@+id/result"
            style="@style/DisplayTextStyle.Result"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:bufferType="spannable"
            android:singleLine="true"
            android:textColor="@color/display_result_text_color"
            android:visibility="invisible" />

    </FrameLayout>

</com.android.calculator2.CalculatorDisplay>
Loading