layout changed
This commit is contained in:
parent
7f4b5d00dd
commit
4e6ac9c74b
@ -29,7 +29,7 @@
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/equalsButton"
|
||||
a:text="="
|
||||
a:layout_width="fill_parent"
|
||||
a:layout_weight="3"
|
||||
a:layout_weight="4"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="numericButtonClickHandler"/>
|
||||
|
||||
@ -64,6 +64,11 @@
|
||||
calc:textDown="^2" style="@style/digitButtonStyle"
|
||||
a:onClick="digitButtonClickHandler"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/clearButton"
|
||||
a:text="clear"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="clearButtonClickHandler"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
|
||||
@ -90,6 +95,11 @@
|
||||
style="@style/digitButtonStyle"
|
||||
a:onClick="digitButtonClickHandler"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/eraseButton"
|
||||
a:text="↚"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="eraseButtonClickHandler"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
|
||||
@ -112,6 +122,11 @@
|
||||
style="@style/digitButtonStyle"
|
||||
a:onClick="digitButtonClickHandler"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/pasteButton"
|
||||
a:text="paste"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="pasteButtonClickHandler"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -140,6 +155,11 @@
|
||||
style="@style/digitButtonStyle"
|
||||
a:onClick="digitButtonClickHandler"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/historyButton"
|
||||
a:text=""
|
||||
calc:textUp="undo"
|
||||
calc:textDown="redo"
|
||||
style="@style/controlButtonStyle"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -154,10 +174,6 @@
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/simplifyButton" a:text="simplify"
|
||||
style="@style/digitButtonStyle"
|
||||
a:onClick="simplifyButtonClickHandler"/>-->
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/eraseButton"
|
||||
a:text="↚"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="eraseButtonClickHandler"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/leftButton"
|
||||
calc:textUp="↞"
|
||||
@ -171,17 +187,12 @@
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="moveRightButtonClickHandler"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/pasteButton"
|
||||
a:text="paste"
|
||||
calc:textUp="redo"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="pasteButtonClickHandler"/>
|
||||
<org.solovyev.android.view.DirectionDragButton a:text="" style="@style/controlButtonStyle"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:text="" style="@style/controlButtonStyle"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:text="" style="@style/controlButtonStyle"/>
|
||||
|
||||
<org.solovyev.android.view.DirectionDragButton a:id="@+id/clearButton"
|
||||
a:text="clear"
|
||||
calc:textUp="undo"
|
||||
style="@style/controlButtonStyle"
|
||||
a:onClick="clearButtonClickHandler"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -87,8 +87,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster {
|
||||
}
|
||||
|
||||
final SimpleOnDragListener historyOnDragListener = new SimpleOnDragListener(new HistoryDragProcessor(), dragPreferences);
|
||||
((DragButton) findViewById(R.id.clearButton)).setOnDragListener(historyOnDragListener);
|
||||
((DragButton) findViewById(R.id.pasteButton)).setOnDragListener(historyOnDragListener);
|
||||
((DragButton) findViewById(R.id.historyButton)).setOnDragListener(historyOnDragListener);
|
||||
onDragListeners.add(historyOnDragListener);
|
||||
|
||||
final SimpleOnDragListener toPositionOnDragListener = new SimpleOnDragListener(new SimpleOnDragListener.DragProcessor() {
|
||||
|
@ -101,13 +101,14 @@ public class CalculatorView implements CursorControl{
|
||||
} catch (EvalError evalError) {
|
||||
// actually nothing shall be logged while text operations are done
|
||||
}
|
||||
|
||||
saveHistoryState();
|
||||
}
|
||||
}
|
||||
|
||||
private void evaluate(@Nullable String expression) throws EvalError {
|
||||
if (!StringUtils.isEmpty(expression)) {
|
||||
display.setText(calculator.evaluate(JsclOperation.numeric, expression));
|
||||
saveHistoryState();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user