From a091b876616e40d1ea74120afc305407db0c6b8e Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Wed, 7 Dec 2011 18:31:53 +0400 Subject: [PATCH] drag button should be extended for left swipe --- .../view/widgets/DirectionDragButton.java | 53 ++++++++++++++----- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/solovyev/android/view/widgets/DirectionDragButton.java b/src/main/java/org/solovyev/android/view/widgets/DirectionDragButton.java index cb50bf2d..31eeca1b 100644 --- a/src/main/java/org/solovyev/android/view/widgets/DirectionDragButton.java +++ b/src/main/java/org/solovyev/android/view/widgets/DirectionDragButton.java @@ -28,26 +28,51 @@ public class DirectionDragButton extends DragButton { @NotNull private final static Float DEFAULT_DIRECTION_TEXT_SCALE = 0.33f; - @Nullable - private String textUp; - - @Nullable - private String textDown; - @Nullable private String textMiddle; - @NotNull - private Point2d textUpPosition; + private static class DirectionTextData { - @NotNull - private Point2d textDownPosition; + @NotNull + private String text; - @NotNull - private TextPaint upTextPaint; + @NotNull + private Point2d position; - @NotNull - private TextPaint downTextPaint; + @NotNull + private TextPaint paint; + + private DirectionTextData(@NotNull String text) { + this.text = text; + } + + @NotNull + public String getText() { + return text; + } + + public void setText(@NotNull String text) { + this.text = text; + } + + @NotNull + public Point2d getPosition() { + return position; + } + + public void setPosition(@NotNull Point2d position) { + this.position = position; + } + + @NotNull + public TextPaint getPaint() { + return paint; + } + + public void setPaint(@NotNull TextPaint paint) { + this.paint = paint; + } + } @Nullable private Float directionTextScale = DEFAULT_DIRECTION_TEXT_SCALE;