signature changed

This commit is contained in:
serso 2011-09-19 11:49:32 +04:00
parent e3a504f62d
commit 9cb310bf4f
3 changed files with 8 additions and 25 deletions

View File

@ -21,6 +21,7 @@ import bsh.EvalError;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.solovyev.android.view.*; import org.solovyev.android.view.*;
import org.solovyev.common.utils.Announcer;
import org.solovyev.common.utils.history.HistoryAction; import org.solovyev.common.utils.history.HistoryAction;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -31,7 +32,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster {
private static final int HVGA_WIDTH_PIXELS = 320; private static final int HVGA_WIDTH_PIXELS = 320;
@NotNull @NotNull
private final DragPreferencesChangeListenerRegister dpclRegister = new DragPreferencesChangeListenerRegister(); private final Announcer<DragPreferencesChangeListener> dpclRegister = new Announcer<DragPreferencesChangeListener>(DragPreferencesChangeListener.class);
@NotNull @NotNull
private CalculatorView calculatorView; private CalculatorView calculatorView;
@ -62,7 +63,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster {
final DragButtonCalibrationActivity.Preferences dragPreferences = DragButtonCalibrationActivity.getPreferences(this); final DragButtonCalibrationActivity.Preferences dragPreferences = DragButtonCalibrationActivity.getPreferences(this);
final SimpleOnDragListener onDragListener = new SimpleOnDragListener(new DigitButtonDragProcessor(calculatorView), dragPreferences); 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 // todo serso: check if there is more convenient method for doing this
final R.id ids = new R.id(); 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<CalculatorHistoryState>(this.calculatorView), dragPreferences); final SimpleOnDragListener historyOnDragListener = new SimpleOnDragListener(new HistoryDragProcessor<CalculatorHistoryState>(this.calculatorView), dragPreferences);
((DragButton) findViewById(R.id.historyButton)).setOnDragListener(historyOnDragListener); ((DragButton) findViewById(R.id.historyButton)).setOnDragListener(historyOnDragListener);
dpclRegister.add(historyOnDragListener); dpclRegister.addListener(historyOnDragListener);
final SimpleOnDragListener toPositionOnDragListener = new SimpleOnDragListener(new CursorDragProcessor(calculatorView), dragPreferences); final SimpleOnDragListener toPositionOnDragListener = new SimpleOnDragListener(new CursorDragProcessor(calculatorView), dragPreferences);
((DragButton) findViewById(R.id.rightButton)).setOnDragListener(toPositionOnDragListener); ((DragButton) findViewById(R.id.rightButton)).setOnDragListener(toPositionOnDragListener);
((DragButton) findViewById(R.id.leftButton)).setOnDragListener(toPositionOnDragListener); ((DragButton) findViewById(R.id.leftButton)).setOnDragListener(toPositionOnDragListener);
dpclRegister.add(toPositionOnDragListener); dpclRegister.addListener(toPositionOnDragListener);
preferencesChangesReceiver = new BroadcastReceiver() { preferencesChangesReceiver = new BroadcastReceiver() {

View File

@ -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<DragPreferencesChangeListener> {
public DragPreferencesChangeListenerRegister() {
super(DragPreferencesChangeListener.class);
}
}

View File

@ -7,8 +7,10 @@ package org.solovyev.android.view;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.EventListener;
public interface OnDragListener {
public interface OnDragListener extends EventListener{
/** /**
* *