FreeRDP
com.freerdp.freerdpcore.presentation.ScrollView2D Class Reference
Inheritance diagram for com.freerdp.freerdpcore.presentation.ScrollView2D:
Collaboration diagram for com.freerdp.freerdpcore.presentation.ScrollView2D:

Data Structures

interface  ScrollView2DListener
 

Public Member Functions

 ScrollView2D (Context context)
 
 ScrollView2D (Context context, AttributeSet attrs)
 
 ScrollView2D (Context context, AttributeSet attrs, int defStyle)
 
void setScrollEnabled (boolean enable)
 
int getMaxScrollAmountVertical ()
 
int getMaxScrollAmountHorizontal ()
 
void addView (View child)
 
void addView (View child, int index)
 
void addView (View child, ViewGroup.LayoutParams params)
 
void addView (View child, int index, ViewGroup.LayoutParams params)
 
boolean dispatchKeyEvent (KeyEvent event)
 
boolean executeKeyEvent (KeyEvent event)
 
boolean onInterceptTouchEvent (MotionEvent ev)
 
boolean onTouchEvent (MotionEvent ev)
 
boolean fullScroll (int direction, boolean horizontal)
 
boolean arrowScroll (int direction, boolean horizontal)
 
final void smoothScrollBy (int dx, int dy)
 
final void smoothScrollTo (int x, int y)
 
void computeScroll ()
 
void requestChildFocus (View child, View focused)
 
boolean requestChildRectangleOnScreen (View child, Rect rectangle, boolean immediate)
 
void requestLayout ()
 
void fling (int velocityX, int velocityY)
 
void scrollTo (int x, int y)
 
void setScrollViewListener (ScrollView2DListener scrollViewListener)
 

Protected Member Functions

float getTopFadingEdgeStrength ()
 
float getBottomFadingEdgeStrength ()
 
float getLeftFadingEdgeStrength ()
 
float getRightFadingEdgeStrength ()
 
int computeVerticalScrollRange ()
 
int computeHorizontalScrollRange ()
 
void measureChild (View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec)
 
void measureChildWithMargins (View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)
 
int computeScrollDeltaToGetChildRectOnScreen (Rect rect)
 
boolean onRequestFocusInDescendants (int direction, Rect previouslyFocusedRect)
 
void onLayout (boolean changed, int l, int t, int r, int b)
 
void onSizeChanged (int w, int h, int oldw, int oldh)
 
void onScrollChanged (int x, int y, int oldx, int oldy)
 

Detailed Description

Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A TwoDScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a vertical orientation, presenting a vertical array of top-level items that the user can scroll through.

The TextView class also takes care of its own scrolling, so does not require a TwoDScrollView, but using the two together is possible to achieve the effect of a text view within a larger container.

Constructor & Destructor Documentation

◆ ScrollView2D() [1/3]

com.freerdp.freerdpcore.presentation.ScrollView2D.ScrollView2D ( Context  context)
inline

◆ ScrollView2D() [2/3]

com.freerdp.freerdpcore.presentation.ScrollView2D.ScrollView2D ( Context  context,
AttributeSet  attrs 
)
inline

◆ ScrollView2D() [3/3]

com.freerdp.freerdpcore.presentation.ScrollView2D.ScrollView2D ( Context  context,
AttributeSet  attrs,
int  defStyle 
)
inline

Member Function Documentation

◆ addView() [1/4]

void com.freerdp.freerdpcore.presentation.ScrollView2D.addView ( View  child)
inline

◆ addView() [2/4]

void com.freerdp.freerdpcore.presentation.ScrollView2D.addView ( View  child,
int  index 
)
inline

◆ addView() [3/4]

void com.freerdp.freerdpcore.presentation.ScrollView2D.addView ( View  child,
int  index,
ViewGroup.LayoutParams  params 
)
inline

◆ addView() [4/4]

void com.freerdp.freerdpcore.presentation.ScrollView2D.addView ( View  child,
ViewGroup.LayoutParams  params 
)
inline

◆ arrowScroll()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.arrowScroll ( int  direction,
boolean  horizontal 
)
inline

Handle scrolling in response to an up or down arrow click.

Parameters
directionThe direction corresponding to the arrow key that was pressed
Returns
True if we consumed the event, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeHorizontalScrollRange()

int com.freerdp.freerdpcore.presentation.ScrollView2D.computeHorizontalScrollRange ( )
inlineprotected

◆ computeScroll()

void com.freerdp.freerdpcore.presentation.ScrollView2D.computeScroll ( )
inline
Here is the call graph for this function:

◆ computeScrollDeltaToGetChildRectOnScreen()

int com.freerdp.freerdpcore.presentation.ScrollView2D.computeScrollDeltaToGetChildRectOnScreen ( Rect  rect)
inlineprotected

Compute the amount to scroll in the Y direction in order to get a rectangle completely on the screen (or, if taller than the screen, at least the first screen size chunk of it).

Parameters
rectThe rect.
Returns
The scroll delta.
Here is the caller graph for this function:

◆ computeVerticalScrollRange()

int com.freerdp.freerdpcore.presentation.ScrollView2D.computeVerticalScrollRange ( )
inlineprotected

The scroll range of a scroll view is the overall height of all of its children.

◆ dispatchKeyEvent()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.dispatchKeyEvent ( KeyEvent  event)
inline
Here is the call graph for this function:

◆ executeKeyEvent()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.executeKeyEvent ( KeyEvent  event)
inline

You can call this function yourself to have the scroll view perform scrolling from a key event, just as if the event had been dispatched to it by the view hierarchy.

Parameters
eventThe key event to execute.
Returns
Return true if the event was handled, else false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fling()

void com.freerdp.freerdpcore.presentation.ScrollView2D.fling ( int  velocityX,
int  velocityY 
)
inline

Fling the scroll view

Parameters
velocityYThe initial velocity in the Y direction. Positive numbers mean that the finger/curor is moving down the screen, which means we want to scroll towards the top.
Here is the caller graph for this function:

◆ fullScroll()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.fullScroll ( int  direction,
boolean  horizontal 
)
inline

Handles scrolling in response to a "home/end" shortcut press. This method will scroll the view to the top or bottom and give the focus to the topmost/bottommost component in the new visible area. If no component is a good candidate for focus, this scrollview reclaims the focus.

Parameters
directionthe scroll direction: android.view.View#FOCUS_UP to go the top of the view or android.view.View#FOCUS_DOWN to go the bottom
Returns
true if the key event is consumed by this method, false otherwise
Here is the caller graph for this function:

◆ getBottomFadingEdgeStrength()

float com.freerdp.freerdpcore.presentation.ScrollView2D.getBottomFadingEdgeStrength ( )
inlineprotected

◆ getLeftFadingEdgeStrength()

float com.freerdp.freerdpcore.presentation.ScrollView2D.getLeftFadingEdgeStrength ( )
inlineprotected

◆ getMaxScrollAmountHorizontal()

int com.freerdp.freerdpcore.presentation.ScrollView2D.getMaxScrollAmountHorizontal ( )
inline
Here is the caller graph for this function:

◆ getMaxScrollAmountVertical()

int com.freerdp.freerdpcore.presentation.ScrollView2D.getMaxScrollAmountVertical ( )
inline
Returns
The maximum amount this scroll view will scroll in response to an arrow event.
Here is the caller graph for this function:

◆ getRightFadingEdgeStrength()

float com.freerdp.freerdpcore.presentation.ScrollView2D.getRightFadingEdgeStrength ( )
inlineprotected

◆ getTopFadingEdgeStrength()

float com.freerdp.freerdpcore.presentation.ScrollView2D.getTopFadingEdgeStrength ( )
inlineprotected

◆ measureChild()

void com.freerdp.freerdpcore.presentation.ScrollView2D.measureChild ( View  child,
int  parentWidthMeasureSpec,
int  parentHeightMeasureSpec 
)
inlineprotected

◆ measureChildWithMargins()

void com.freerdp.freerdpcore.presentation.ScrollView2D.measureChildWithMargins ( View  child,
int  parentWidthMeasureSpec,
int  widthUsed,
int  parentHeightMeasureSpec,
int  heightUsed 
)
inlineprotected

◆ onInterceptTouchEvent()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.onInterceptTouchEvent ( MotionEvent  ev)
inline

◆ onLayout()

void com.freerdp.freerdpcore.presentation.ScrollView2D.onLayout ( boolean  changed,
int  l,
int  t,
int  r,
int  b 
)
inlineprotected
Here is the call graph for this function:

◆ onRequestFocusInDescendants()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.onRequestFocusInDescendants ( int  direction,
Rect  previouslyFocusedRect 
)
inlineprotected

When looking for focus in children of a scroll view, need to be a little more careful not to give focus to something that is scrolled off screen.

This is more expensive than the default android.view.ViewGroup implementation, otherwise this behavior might have been made the default.

◆ onScrollChanged()

void com.freerdp.freerdpcore.presentation.ScrollView2D.onScrollChanged ( int  x,
int  y,
int  oldx,
int  oldy 
)
inlineprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onSizeChanged()

void com.freerdp.freerdpcore.presentation.ScrollView2D.onSizeChanged ( int  w,
int  h,
int  oldw,
int  oldh 
)
inlineprotected
Here is the call graph for this function:

◆ onTouchEvent()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.onTouchEvent ( MotionEvent  ev)
inline
Here is the call graph for this function:

◆ requestChildFocus()

void com.freerdp.freerdpcore.presentation.ScrollView2D.requestChildFocus ( View  child,
View  focused 
)
inline

◆ requestChildRectangleOnScreen()

boolean com.freerdp.freerdpcore.presentation.ScrollView2D.requestChildRectangleOnScreen ( View  child,
Rect  rectangle,
boolean  immediate 
)
inline

◆ requestLayout()

void com.freerdp.freerdpcore.presentation.ScrollView2D.requestLayout ( )
inline

◆ scrollTo()

void com.freerdp.freerdpcore.presentation.ScrollView2D.scrollTo ( int  x,
int  y 
)
inline

This version also clamps the scrolling to the bounds of our child.

Here is the caller graph for this function:

◆ setScrollEnabled()

void com.freerdp.freerdpcore.presentation.ScrollView2D.setScrollEnabled ( boolean  enable)
inline

Disable/Enable scrolling

Here is the caller graph for this function:

◆ setScrollViewListener()

void com.freerdp.freerdpcore.presentation.ScrollView2D.setScrollViewListener ( ScrollView2DListener  scrollViewListener)
inline
Here is the caller graph for this function:

◆ smoothScrollBy()

final void com.freerdp.freerdpcore.presentation.ScrollView2D.smoothScrollBy ( int  dx,
int  dy 
)
inline

Like View#scrollBy, but scroll smoothly instead of immediately.

Parameters
dxthe number of pixels to scroll by on the X axis
dythe number of pixels to scroll by on the Y axis
Here is the caller graph for this function:

◆ smoothScrollTo()

final void com.freerdp.freerdpcore.presentation.ScrollView2D.smoothScrollTo ( int  x,
int  y 
)
inline

Like scrollTo, but scroll smoothly instead of immediately.

Parameters
xthe position where to scroll on the X axis
ythe position where to scroll on the Y axis
Here is the call graph for this function:

The documentation for this class was generated from the following file: