Skip to content

Commit

Permalink
Merge pull request #22 from gscdev/cm-13.0
Browse files Browse the repository at this point in the history
#16 Change 'del' by delete icon
  • Loading branch information
literacyapp authored Nov 4, 2016
2 parents 1f28f43 + e6bf853 commit 24238b8
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.literacyapp.calculator"
minSdkVersion 21
targetSdkVersion 23
versionCode 1000000
versionName "1.0.0"
versionCode 1000001
versionName "1.0.1"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import org.literacyapp.calculator.R;
import com.android.calculator2.view.display.AdvancedDisplay;

import com.android.calculator2.util.AnimationUtil;
import com.android.calculator2.view.display.AdvancedDisplay;

import org.literacyapp.calculator.R;

/**
* The display overlay is a container that intercepts touch events on top of:
Expand Down Expand Up @@ -115,7 +117,8 @@ protected void onFinishInflate() {

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
int action = MotionEventCompat.getActionMasked(ev);
//Don't show history display
/*int action = MotionEventCompat.getActionMasked(ev);
float y = ev.getRawY();
TranslateState state = getTranslateState();
Expand Down Expand Up @@ -143,7 +146,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
}
break;
}
}*/

return false;
}
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_delete_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>
15 changes: 8 additions & 7 deletions app/src/main/res/layout/pad_operator_one_col.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@
android:columnCount="1"
android:rowCount="5">

<com.android.calculator2.view.AutoFitButtonView
<ImageButton
android:id="@+id/del"
style="@style/PadButtonStyle.Operator.Text"
style="@style/PadButtonStyle.Icon"
android:contentDescription="@string/desc_del"
android:onClick="onButtonClick"
android:singleLine="true"
android:text="@string/del" />
android:src="@drawable/ic_delete_black_24dp"
android:tint="#FFF"/>

<Button
<ImageButton
android:id="@+id/clr"
style="@style/PadButtonStyle.Operator.Text"
style="@style/PadButtonStyle.Icon"
android:contentDescription="@string/desc_clr"
android:onClick="onButtonClick"
android:text="@string/clr"
android:src="@drawable/ic_delete_black_24dp"
android:tint="#FFF"
android:visibility="gone" />

<Button
Expand Down
15 changes: 8 additions & 7 deletions app/src/main/res/layout/pad_operator_two_col.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@
android:text="@string/op_div"
android:visibility="invisible"/>

<com.android.calculator2.view.AutoFitButtonView
<ImageButton
android:id="@+id/del"
style="@style/PadButtonStyle.Operator.Text"
style="@style/PadButtonStyle.Icon"
android:contentDescription="@string/desc_del"
android:onClick="onButtonClick"
android:singleLine="true"
android:text="@string/del" />
android:background="@drawable/ic_delete_black_24dp"
android:tint="#FFF"/>

<Button
<ImageButton
android:id="@+id/clr"
style="@style/PadButtonStyle.Operator.Text"
style="@style/PadButtonStyle.Icon"
android:contentDescription="@string/desc_clr"
android:onClick="onButtonClick"
android:text="@string/clr"
android:background="@drawable/ic_delete_black_24dp"
android:tint="#FFF"
android:visibility="gone" />

<Button
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-land/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<item name="android:textSize">15sp</item>
</style>

<style name="PadButtonStyle.Icon">
<item name="android:layout_margin">6dip</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="PadButtonStyle.Numeric">
<item name="android:textSize">23sp</item>
</style>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-sw600dp-land/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<item name="android:textSize">27sp</item>
</style>

<style name="PadButtonStyle.Icon">
<item name="android:layout_margin">14dip</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="PadButtonStyle.Numeric">
<item name="android:textSize">36sp</item>
</style>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-sw600dp-port/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<item name="android:textSize">27sp</item>
</style>

<style name="PadButtonStyle.Icon">
<item name="android:layout_margin">28dip</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="PadButtonStyle.Numeric">
<item name="android:layout_margin">8dip</item>
<item name="android:textSize">36sp</item>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-sw800dp-land/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<item name="android:textSize">36sp</item>
</style>

<style name="PadButtonStyle.Icon">
<item name="android:layout_margin">14dip</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="PadButtonStyle.Numeric">
<item name="android:textSize">48sp</item>
</style>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-sw800dp-port/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<item name="android:textSize">36sp</item>
</style>

<style name="PadButtonStyle.Icon">
<item name="android:layout_margin">28dip</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="PadButtonStyle.Numeric">
<item name="android:layout_margin">8dip</item>
<item name="android:textSize">48sp</item>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
<item name="android:textColor">@color/pad_button_toggle_text_color</item>
</style>

<style name="PadButtonStyle.Icon">
<item name="android:layout_margin">14dip</item>
<item name="android:scaleType">fitCenter</item>
</style>

<style name="PadButtonStyle.Numeric">
<item name="android:textSize">32sp</item>
</style>
Expand All @@ -158,7 +163,7 @@
<item name="android:textAllCaps">true</item>
<item name="android:textSize">15sp</item>
</style>

<style name="PadLayoutStyle.Aux" />

<style name="PadLayoutStyle.Advanced">
Expand Down

0 comments on commit 24238b8

Please sign in to comment.