org.solovyev.android.view.drag
Class SimpleOnDragListener

java.lang.Object
  extended by org.solovyev.android.view.drag.SimpleOnDragListener
All Implemented Interfaces:
EventListener, DragPreferencesChangeListener, OnDragListener

public class SimpleOnDragListener
extends Object
implements OnDragListener, DragPreferencesChangeListener


Nested Class Summary
static class SimpleOnDragListener.DragPreference
           
static interface SimpleOnDragListener.DragProcessor
           
static class SimpleOnDragListener.Preference
           
static class SimpleOnDragListener.Preferences
           
static class SimpleOnDragListener.PreferenceType
           
 
Field Summary
static org.solovyev.common.math.Point2d axis
           
 
Constructor Summary
SimpleOnDragListener(SimpleOnDragListener.DragProcessor dragProcessor, SimpleOnDragListener.Preferences preferences)
           
SimpleOnDragListener(SimpleOnDragListener.Preferences preferences)
           
 
Method Summary
static SimpleOnDragListener.Preferences getDefaultPreferences(android.content.Context context)
           
 SimpleOnDragListener.DragProcessor getDragProcessor()
           
static String getPreferenceId(SimpleOnDragListener.PreferenceType preferenceType, DragDirection direction)
           
static SimpleOnDragListener.Preferences getPreferences(android.content.SharedPreferences preferences, android.content.Context context)
           
 boolean isSuppressOnClickEvent()
           
 boolean onDrag(DragButton dragButton, DragEvent event)
           
 void onDragPreferencesChange(SimpleOnDragListener.Preferences preferences)
           
 void setDragProcessor(SimpleOnDragListener.DragProcessor dragProcessor)
           
static org.solovyev.common.interval.Interval<Float> transformInterval(SimpleOnDragListener.PreferenceType preferenceType, DragDirection dragDirection, org.solovyev.common.interval.Interval<Float> interval)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

axis

@Nonnull
public static final org.solovyev.common.math.Point2d axis
Constructor Detail

SimpleOnDragListener

public SimpleOnDragListener(@Nonnull
                            SimpleOnDragListener.Preferences preferences)

SimpleOnDragListener

public SimpleOnDragListener(@Nonnull
                            SimpleOnDragListener.DragProcessor dragProcessor,
                            @Nonnull
                            SimpleOnDragListener.Preferences preferences)
Method Detail

onDrag

public boolean onDrag(@Nonnull
                      DragButton dragButton,
                      @Nonnull
                      DragEvent event)
Specified by:
onDrag in interface OnDragListener
Parameters:
dragButton - drag button object for which onDrag listener was set
event - drag event
Returns:
'true' if drag event occurred, 'false' otherwise

isSuppressOnClickEvent

public boolean isSuppressOnClickEvent()
Specified by:
isSuppressOnClickEvent in interface OnDragListener
Returns:
'true': if drag event has taken place (i.e. onDrag() method returned true) then click action will be suppresed

getDragProcessor

@Nonnull
public SimpleOnDragListener.DragProcessor getDragProcessor()

setDragProcessor

public void setDragProcessor(@Nonnull
                             SimpleOnDragListener.DragProcessor dragProcessor)

onDragPreferencesChange

public void onDragPreferencesChange(@Nonnull
                                    SimpleOnDragListener.Preferences preferences)
Specified by:
onDragPreferencesChange in interface DragPreferencesChangeListener

getPreferenceId

public static String getPreferenceId(@Nonnull
                                     SimpleOnDragListener.PreferenceType preferenceType,
                                     @Nonnull
                                     DragDirection direction)

getDefaultPreferences

@Nonnull
public static SimpleOnDragListener.Preferences getDefaultPreferences(@Nonnull
                                                                             android.content.Context context)

getPreferences

@Nonnull
public static SimpleOnDragListener.Preferences getPreferences(@Nonnull
                                                                      android.content.SharedPreferences preferences,
                                                                      @Nonnull
                                                                      android.content.Context context)

transformInterval

@Nonnull
public static org.solovyev.common.interval.Interval<Float> transformInterval(@Nonnull
                                                                                     SimpleOnDragListener.PreferenceType preferenceType,
                                                                                     @Nonnull
                                                                                     DragDirection dragDirection,
                                                                                     @Nonnull
                                                                                     org.solovyev.common.interval.Interval<Float> interval)


Copyright © 2014 se.solovyev. All Rights Reserved.