From e48fee2c238269a4fe20577353833d8a9adf43b5 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Mon, 19 Sep 2011 11:49:32 +0400 Subject: [PATCH] signature changed --- .../calculator/CalculatorActivity.java | 9 +++++---- ...DragPreferencesChangeListenerRegister.java | 20 ------------------- .../solovyev/android/view/OnDragListener.java | 4 +++- 3 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 src/main/java/org/solovyev/android/view/DragPreferencesChangeListenerRegister.java diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index affe981d..746027e8 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -21,6 +21,7 @@ import bsh.EvalError; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.solovyev.android.view.*; +import org.solovyev.common.utils.Announcer; import org.solovyev.common.utils.history.HistoryAction; import java.lang.reflect.Field; @@ -31,7 +32,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster { private static final int HVGA_WIDTH_PIXELS = 320; @NotNull - private final DragPreferencesChangeListenerRegister dpclRegister = new DragPreferencesChangeListenerRegister(); + private final Announcer dpclRegister = new Announcer(DragPreferencesChangeListener.class); @NotNull private CalculatorView calculatorView; @@ -62,7 +63,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster { final DragButtonCalibrationActivity.Preferences dragPreferences = DragButtonCalibrationActivity.getPreferences(this); final SimpleOnDragListener onDragListener = new SimpleOnDragListener(new DigitButtonDragProcessor(calculatorView), dragPreferences); - dpclRegister.add(onDragListener); + dpclRegister.addListener(onDragListener); // todo serso: check if there is more convenient method for doing this final R.id ids = new R.id(); @@ -84,12 +85,12 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster { final SimpleOnDragListener historyOnDragListener = new SimpleOnDragListener(new HistoryDragProcessor(this.calculatorView), dragPreferences); ((DragButton) findViewById(R.id.historyButton)).setOnDragListener(historyOnDragListener); - dpclRegister.add(historyOnDragListener); + dpclRegister.addListener(historyOnDragListener); final SimpleOnDragListener toPositionOnDragListener = new SimpleOnDragListener(new CursorDragProcessor(calculatorView), dragPreferences); ((DragButton) findViewById(R.id.rightButton)).setOnDragListener(toPositionOnDragListener); ((DragButton) findViewById(R.id.leftButton)).setOnDragListener(toPositionOnDragListener); - dpclRegister.add(toPositionOnDragListener); + dpclRegister.addListener(toPositionOnDragListener); preferencesChangesReceiver = new BroadcastReceiver() { diff --git a/src/main/java/org/solovyev/android/view/DragPreferencesChangeListenerRegister.java b/src/main/java/org/solovyev/android/view/DragPreferencesChangeListenerRegister.java deleted file mode 100644 index 0451003a..00000000 --- a/src/main/java/org/solovyev/android/view/DragPreferencesChangeListenerRegister.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2009-2011. Created by serso aka se.solovyev. - * For more information, please, contact se.solovyev@gmail.com - */ - -package org.solovyev.android.view; - -import org.solovyev.common.utils.Announcer; - -/** - * User: serso - * Date: 9/18/11 - * Time: 8:53 PM - */ -public class DragPreferencesChangeListenerRegister extends Announcer { - - public DragPreferencesChangeListenerRegister() { - super(DragPreferencesChangeListener.class); - } -} diff --git a/src/main/java/org/solovyev/android/view/OnDragListener.java b/src/main/java/org/solovyev/android/view/OnDragListener.java index 955d1c25..b1b6e440 100644 --- a/src/main/java/org/solovyev/android/view/OnDragListener.java +++ b/src/main/java/org/solovyev/android/view/OnDragListener.java @@ -7,8 +7,10 @@ package org.solovyev.android.view; import org.jetbrains.annotations.NotNull; +import java.util.EventListener; -public interface OnDragListener { + +public interface OnDragListener extends EventListener{ /** *