Fixed cursor arrows issues

This commit is contained in:
serso 2014-09-10 22:54:41 +02:00
parent 4ca3099ef3
commit a1ee20ad81
7 changed files with 12 additions and 13 deletions

View File

@ -24,5 +24,5 @@
<Button xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@id/cpp_button_left"
a:text=""
a:text=""
style="@style/cpp_simple_metro_control_button_style"/>

View File

@ -24,5 +24,5 @@
<Button xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@id/cpp_button_right"
a:text=""
a:text=""
style="@style/cpp_simple_metro_control_button_style"/>

View File

@ -25,8 +25,8 @@
<org.solovyev.android.view.drag.DirectionDragButton xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:c="http://schemas.android.com/apk/res/org.solovyev.android.calculator"
a:id="@id/cpp_button_left"
c:textUp="◀◀"
a:text=""
c:textUp="◁◁"
a:text="◁"
c:directionTextScale="0.5"
style="?cpp_control_button_style"
a:onClick="digitButtonClickHandler"/>

View File

@ -25,8 +25,8 @@
<org.solovyev.android.view.drag.DirectionDragButton xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:c="http://schemas.android.com/apk/res/org.solovyev.android.calculator"
a:id="@id/cpp_button_right"
c:textUp="▶▶"
a:text=""
c:textUp="▷▷"
a:text=""
c:directionTextScale="0.5"
style="?cpp_control_button_style"
a:onClick="digitButtonClickHandler"/>

View File

@ -23,15 +23,14 @@
package org.solovyev.android.calculator;
import android.view.MotionEvent;
import javax.annotation.Nonnull;
import org.solovyev.android.view.drag.DirectionDragButton;
import org.solovyev.android.view.drag.DragButton;
import org.solovyev.android.view.drag.DragDirection;
import org.solovyev.android.view.drag.SimpleOnDragListener;
import org.solovyev.common.math.Point2d;
import javax.annotation.Nonnull;
/**
* User: serso
* Date: 9/16/11
@ -48,10 +47,10 @@ public class CursorDragProcessor implements SimpleOnDragListener.DragProcessor {
if (dragButton instanceof DirectionDragButton) {
String text = ((DirectionDragButton) dragButton).getText(dragDirection);
if ("◀◀".equals(text)) {
if ("◁◁".equals(text)) {
Locator.getInstance().getEditor().setCursorOnStart();
result = true;
} else if ("▶▶".equals(text)) {
} else if ("▷▷".equals(text)) {
Locator.getInstance().getEditor().setCursorOnEnd();
result = true;
}

View File

@ -47,13 +47,13 @@ public enum CalculatorSpecialButton {
Locator.getInstance().getCalculator().fireCalculatorEvent(CalculatorEventType.show_history_detached, null);
}
},
cursor_right("") {
cursor_right("") {
@Override
public void onClick(@Nonnull CalculatorKeyboard keyboard) {
keyboard.moveCursorRight();
}
},
cursor_left("") {
cursor_left("") {
@Override
public void onClick(@Nonnull CalculatorKeyboard keyboard) {
keyboard.moveCursorLeft();