Amir_RecyclerView
-
Functions:
- ItemId (position As Int) As Long
Return the stable ID for the item at position. If HasStableIds
would return false this method should return -1. The default implementation
of this method returns -1.
Position : Adapter position to query
Return the stable ID of the item at position
- ItemViewType (position As Int) As Int
Return the view type of the item at position for the purposes
of view recycling.
- NotifyDataItemChanged (position As Int)
- NotifyDataItemChanged2 (positionStart As Int, itemCount As Int)
- NotifyDataItemInserted (position As Int)
- NotifyDataItemRangeInserted (positionStart As Int, itemCount As Int)
- NotifyDataItemRangeRemoved (positionStart As Int, itemCount As Int)
- NotifyDataItemRemoved (position As Int)
- NotifyDataSetChanged
- NotifyItemChanged (Position As Int)
- NotifyItemChanged2 (Position As Int, payload As Object)
- NotifyItemInserted (Position As Int)
- NotifyItemMoved (fromPosition As Int, toPosition As Int)
- NotifyItemRemoved (Position As Int)
Properties:
- HasObservers As Boolean [read only]
- HasStableIds As Boolean
Returns true if this adapter publishes a unique long value that can
act as a key for the item at a given position in the data set. If that item is relocated
in the data set, the ID returned for that item should be the same.
Return true if this adapter's items have stable IDs
- ItemCount As Int [read only]
-
Functions:
- GridView As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- ListView As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- StaggeredGridView As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
-
Functions:
- GridView (SpanCount As Int) As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- ListView As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- NoLayout
- StaggeredGridView (SpanCount As Int) As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
-
Functions:
- Build
- GapStrategy (GapStrategy As String) As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
"GAP_HANDLING_LAZY"
"GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS"
"GAP_HANDLING_NONE"
- Horizontal As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
- ReverseLayout (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
- SpanCount (SpanCount As Int) As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
- Vertical As com.aghajari.rv.Amir_RecyclerView.StaggeredGridLayoutBuilder
-
Functions:
- Build
Set RecyclerView Layout
Note : Don't call this when you want
update recyclerview layout
- Horizontal As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- RecycleChildrenOnDetach (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- ReverseLayout (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- SmoothScrollbarEnabled (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- SpanCount (SpanCount As Int) As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- StackFromEnd (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
- Vertical As com.aghajari.rv.Amir_RecyclerView.GridLayoutBuilder
-
Functions:
- GridView (HorizontalSpacing As Int, VerticalSpacing As Int, includeEdge As Boolean)
- GridView2 (IncludeEdge As Boolean, FixedSize As Boolean, FirstItem As Int(), FirstRow As Int(), Rows As Int(), LastRow As Int(), LastItem As Int())
Set Custom Space for Grid Layout
array as int (left,top,right,bottom)
- ListView (Space As Int, AddSpaceAboveFirstItem As Boolean, AddSpaceBelowLastItem As Boolean)
- ListView2 (FirstItem As Int(), Item As Int(), LastItem As Int())
Set Custom Space for Linear Layout
array as int (left,top,right,bottom)
Example :
Recycler.SpaceItemDecoration.ListView2( _
Array As Int(10dip,10dip,10dip,0),Array As Int(10dip,10dip,10dip,0),Array As Int(10dip,10dip,10dip,10dip))
-
Functions:
- Build
Set RecyclerView Layout
Note : Don't call this when you want
update recyclerview layout
- Horizontal As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- RecycleChildrenOnDetach (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- ReverseLayout (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- SmoothScrollbarEnabled (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- StackFromEnd (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
- Vertical As com.aghajari.rv.Amir_RecyclerView.LinerLayoutBuilder
-
Fields:
- OVER_SCROLL_ALWAYS As Int
Always allow a user to over-scroll this view, provided it is a
view that can scroll.
- OVER_SCROLL_IF_CONTENT_SCROLLS As Int
Allow a user to over-scroll this view only if the content is large
enough to meaningfully scroll, provided it is a view that can scroll.
- OVER_SCROLL_NEVER As Int
Never allow a user to over-scroll this view.
- SCROLLBAR_POSITION_DEFAULT As Int
Position the scroll bar at the default position as determined by the system.
- SCROLLBAR_POSITION_LEFT As Int
Position the scroll bar along the left edge.
- SCROLLBAR_POSITION_RIGHT As Int
Position the scroll bar along the right edge.
- SCROLLBARS_INSIDE_INSET As Int
The scrollbar style to display the scrollbars inside the padded area,
increasing the padding of the view. The scrollbars will not overlap the
content area of the view.
- SCROLLBARS_INSIDE_OVERLAY As Int
The scrollbar style to display the scrollbars inside the content area,
without increasing the padding. The scrollbars will be overlaid with
translucency on the view's content.
- SCROLLBARS_OUTSIDE_INSET As Int
The scrollbar style to display the scrollbars at the edge of the view,
increasing the padding of the view. The scrollbars will only overlap the
background, if any.
- SCROLLBARS_OUTSIDE_OVERLAY As Int
The scrollbar style to display the scrollbars at the edge of the view,
without increasing the padding. The scrollbars will be overlaid with
translucency.
Properties:
- AlwaysDrawHorizontalScrollbarTrack As Boolean
Indicate whether the horizontal scrollbar track should always be drawn regardless of the
extent. Defaults to false. Set to true if the track should always be drawn
- AlwaysDrawVerticalScrollbarTrack As Boolean
Indicate whether the vertical scrollbar track should always be drawn regardless of the
extent. Defaults to false. Set to true if the track should always be drawn
- HorizontalFadingEdgeEnabled As Boolean
Define whether the horizontal edges should be faded when
this view is scrolled horizontally.
- HorizontalScrollBarEnabled As Boolean
Define whether the horizontal scrollbar should be drawn or not.
- HorizontalScrollbarThumbDrawable As android.graphics.drawable.Drawable [write only]
- HorizontalScrollbarTrackDrawable As android.graphics.drawable.Drawable [write only]
- OverScrollMode As Int
Set the over-scroll mode for this view.
- ScrollBarAlpha As Int [write only]
- ScrollBarDelayBeforeFade As Int
Define the delay before scrollbars fade.
- ScrollbarFadingEnabled As Boolean
Define whether scrollbars will fade when the view is not scrolling.
- ScrollBarSize As Int
Define the scrollbar size.
- ScrollBarStyle As Int [write only]
Specify the style of the scrollbars. The scrollbars can be overlaid or inset.
When inset, they add to the padding of the view. And the scrollbars can be
drawn inside the padding area or on the edge of the view. For example, if a
view has a background drawable and you want to draw the scrollbars inside the
padding specified by the drawable, you can use SCROLLBARS_INSIDE_OVERLAY or
SCROLLBARS_INSIDE_INSET. If you want them to appear at the edge of the view,
ignoring the padding, then you can use SCROLLBARS_OUTSIDE_OVERLAY or
SCROLLBARS_OUTSIDE_INSET.
- VerticalFadingEdgeEnabled As Boolean
Define whether the vertical edges should be faded when
this view is scrolled vertically.
- VerticalScrollBarEnabled As Boolean
Define whether the vertical scrollbar should be drawn or not.
- VerticalScrollbarPosition As Int
Set the position of the vertical scroll bar.
- VerticalScrollbarThumbDrawable As android.graphics.drawable.Drawable [write only]
- VerticalScrollbarTrackDrawable As android.graphics.drawable.Drawable [write only]
-
Functions:
- Build
- Horizontal As com.aghajari.rv.Amir_RecyclerViewPager.Builder
set Orientation To HORIZONTAL
- RecycleChildrenOnDetach (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerViewPager.Builder
- ReverseLayout (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerViewPager.Builder
RTL Page
- SmoothScrollbarEnabled (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerViewPager.Builder
- SnapMode (SnapMode As Int) As com.aghajari.rv.Amir_RecyclerViewPager.Builder
Snap Mode
None : 0
Start : 1
Center : 2
End : 3
- StackFromEnd (enabled As Boolean) As com.aghajari.rv.Amir_RecyclerViewPager.Builder
- Vertical As com.aghajari.rv.Amir_RecyclerViewPager.Builder
set Orientation To VERTICAL
-
Functions:
- Alpha (alpha As Float) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Background (color As Int) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Build
- Color (color As Int) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- DelayClick (delayClick As Boolean) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Diameter (diameterDp As Int) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Duration (duration As Int) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- FadeDuration (fadeDuration As Int) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Hover (hover As Boolean) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Overlay (overlay As Boolean) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- Persistent (persistent As Boolean) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- RoundedCorners (radiusDp As Int) As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
-
Functions:
- Alpha (alpha As Float) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Background (color As Int) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Build
- Color (color As Int) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- DelayClick (delayClick As Boolean) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Diameter (diameterDp As Int) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Duration (duration As Int) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- FadeDuration (fadeDuration As Int) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Hover (hover As Boolean) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- InAdapter (inAdapter As Boolean) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Overlay (overlay As Boolean) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- Persistent (persistent As Boolean) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
- RoundedCorners (radiusDp As Int) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
-
Functions:
- Build
- Color (Color As Int) As com.aghajari.rv.utils.DividarH
- ColorProvider (EventName As String) As com.aghajari.rv.utils.DividarH
Event :
EventName_DividerColor (Position As Int) As Int
- Drawable (drawable As android.graphics.drawable.Drawable) As com.aghajari.rv.utils.DividarH
- Margin (horizontalMargin As Int) As com.aghajari.rv.utils.DividarH
- Margin2 (left As Int, right As Int) As com.aghajari.rv.utils.DividarH
- MarginProvider (EventName As String) As com.aghajari.rv.utils.DividarH
Event :
EventName_DividerLeftMargin (Position As Int) As Int
EventName_DividerRightMargin (Position As Int) As Int
- Paint (paint As android.graphics.Paint) As com.aghajari.rv.utils.DividarH
- PositionInsideItem (positionInsideItem As Boolean) As com.aghajari.rv.utils.DividarH
- ShowLastDivider As com.aghajari.rv.utils.DividarH
- Size (Size As Int) As com.aghajari.rv.utils.DividarH
- SizeProvider (EventName As String) As com.aghajari.rv.utils.DividarH
Event :
EventName_DividerSize (Position As Int) As Int
- VisibilityProvider (EventName As String) As com.aghajari.rv.utils.DividarH
Event :
EventName_DividerVisibility (Position As Int) As Boolean
-
Functions:
- ActiveColor (Color As Int) As com.aghajari.rv.utils.DividarP
- Build
- Color (Color As Int) As com.aghajari.rv.utils.DividarP
- IndicatorHeight (Height As Int) As com.aghajari.rv.utils.DividarP
- IndicatorItemLength (ItemLength As Int) As com.aghajari.rv.utils.DividarP
- IndicatorItemPadding (Padding As Int) As com.aghajari.rv.utils.DividarP
- IndicatorStrokeWidth (StrokeWidth As Int) As com.aghajari.rv.utils.DividarP
-
Functions:
- Build
- Color (Color As Int) As com.aghajari.rv.utils.DividarV
- ColorProvider (EventName As String) As com.aghajari.rv.utils.DividarV
Event :
EventName_DividerColor (Position As Int) As Int
- Drawable (drawable As android.graphics.drawable.Drawable) As com.aghajari.rv.utils.DividarV
- Margin (VerticalMargin As Int) As com.aghajari.rv.utils.DividarV
- Margin2 (Top As Int, Bottom As Int) As com.aghajari.rv.utils.DividarV
- MarginProvider (EventName As String) As com.aghajari.rv.utils.DividarV
Event :
EventName_DividerTopMargin (Position As Int) As Int
EventName_DividerBottomMargin (Position As Int) As Int
- Paint (paint As android.graphics.Paint) As com.aghajari.rv.utils.DividarV
- PositionInsideItem (positionInsideItem As Boolean) As com.aghajari.rv.utils.DividarV
- ShowLastDivider As com.aghajari.rv.utils.DividarV
- Size (Size As Int) As com.aghajari.rv.utils.DividarV
- SizeProvider (EventName As String) As com.aghajari.rv.utils.DividarV
Event :
EventName_DividerSize (Position As Int) As Int
- VisibilityProvider (EventName As String) As com.aghajari.rv.utils.DividarV
Event :
EventName_DividerVisibility (Position As Int) As Boolean
-
Functions:
- Contains (SearchFor As CharSequence) As java.util.List
Check content contains value
- EndsWith (EndsWith As String) As java.util.List
Check content ends with value
- Equal (Value As String) As java.util.List
Select for Equal contents
- IsMatch (pattern As CharSequence) As java.util.List
Check content matches with pattern
- Matcher (pattern As String, index As Int) As java.util.List
Check content matches with pattern
pass index -1 for default
- Matches (Pattern As String) As java.util.List
Check content matches with pattern
- StartsWith (StartsWith As String) As java.util.List
Check content starts with value
-
Functions:
- EndAnimation (ItemObject As android.view.View)
- EndAnimations
- RunPendingAnimations
- StartAnimation (ItemObject As android.view.View)
Properties:
- AddDuration As Long
- ChangeDuration As Long
- IsRunning As Boolean [read only]
- MoveDuration As Long
- RemoveDuration As Long
-
Properties:
- AdapterPosition As Int [read only]
- isRecyclable As Boolean
- ItemId As Long [read only]
- ItemObject As Object [read only]
- ItemViewType As Int [read only]
- LayoutPosition As Int [read only]
- OldPosition As Int [read only]
- Parent As Panel [read only]
- Position As Int [read only]
Amir_RVAdapter
Events:
- GetItemCount As Int
- GetItemId (Position As Int) As Long
- GetItemViewType (Position As Int) As Int
- GetLoopPosition (Parent As Panel, LoopPosition As Int, Position As Int)
- onBindViewHolder (Parent As Panel, Position As Int)
- onCreateViewHolder (Parent As Panel, ViewType As Int)
- onItemClick (Parent As Panel, Position As Int)
- onItemLongClick (Parent As Panel, Position As Int)
- onItemTouch (Parent As Panel, Position As Int, Action As Int, X As Float, Y As Float)
- onLoadAnimation (Parent As Panel, Position As Int)
- onViewRecycled (Parent As Panel, Position As Int)
Fields:
- LOOP_BOTTOM As Int
- LOOP_FULL As Int
- LOOP_NEVER As Int
Functions:
- EnableAdapterDataObserver
Add Adapter Data Change Events
EventName_onChanged As Boolean
EventName_onItemRangeChanged (PositionStart As int,ItemCount As int) As Boolean
EventName_onItemRangeInserted (PositionStart As int,ItemCount As int) As Boolean
EventName_onItemRangeRemoved (PositionStart As int,ItemCount As int) As Boolean
- Initialize (EventName As String, LoopMode As Int)
Initialize New Adapter for RecyclerView
- IntoRecyclerView (RecyclerView As android.support.v7.widget.RecyclerView)
- IsInitialized As Boolean
- Ripple As com.aghajari.rv.Amir_RVAdapter.RippleBuilder
- SetLayout (Width As Int, Height As Int)
Amir_RVMultiAdapter
Functions:
- AddAdapter (adapter As android.support.v7.widget.RecyclerView.Adapter)
Add Adapter
- AddAdapter2 (adapter As android.support.v7.widget.RecyclerView.Adapter, Index As Int)
Add Adapter
- Clear
Clear Adapters
- GetAdapter (Index As Int) As android.support.v7.widget.RecyclerView.Adapter
Get Adapter
- GetAdapterIndex (Adapter As android.support.v7.widget.RecyclerView.Adapter) As Int
Get Index Of Adapter
- getItemId (position As Int) As Long
Return the stable ID for the item at position. If HasStableIds
would return false this method should return -1. The default implementation
of this method returns -1.
Position : Adapter position to query
Return the stable ID of the item at position
- getItemViewType (position As Int) As Int
Return the view type of the item at position for the purposes
of view recycling.
- Initialize
- IntoRecyclerView (RecyclerView As android.support.v7.widget.RecyclerView)
- IsInitialized As Boolean
- NotifyDataItemInserted (position As Int)
- NotifyDataItemRangeInserted (positionStart As Int, itemCount As Int)
- NotifyDataItemRangeRemoved (positionStart As Int, itemCount As Int)
- NotifyDataItemRemoved (position As Int)
- NotifyDataSetChanged
- NotifyItemChanged (position As Int)
- NotifyItemRangeChanged (positionStart As Int, itemCount As Int)
- RemoveAdapter (adapter As android.support.v7.widget.RecyclerView.Adapter)
Remove Adapter
- RemoveAdapter2 (Index As Int)
Remove Adapter
Properties:
- DefaultAdapter As Int
- HasObservers As Boolean [read only]
- HasStableIds As Boolean
Returns true if this adapter publishes a unique long value that can
act as a key for the item at a given position in the data set. If that item is relocated
in the data set, the ID returned for that item should be the same.
Return true if this adapter's items have stable IDs
- Size As Int [read only]
Get Adapters Size
Amir_RVSmoothScroller
RecyclerView Linear Smooth Scroller
Events:
- CalculateSpeedPerPixel (DefaultSpeed As Float) As Float
- CalculateTimeForDeceleration (Dx As Int, DefaultTime As Int) As Int
- CalculateTimeForScrolling (Dx As Int, DefaultTime As Int) As Int
- onStartSmoothScrolling
- onStopSmoothScrolling
Functions:
- CalculateSpeedPerPixel As Float
Calculates the scroll speed.
return : The time (in ms) it should take for each pixel.
For instance, if returned value is2 ms, it means scrolling
1000 pixels with LinearInterpolation should take 2 seconds.
- CalculateTimeForDeceleration (dx As Int) As Int
Calculates the time for deceleration so that transition from
LinearInterpolator toDecelerateInterpolator looks smooth.
dx : Distance to scroll
return : Time for DecelerateInterpolator to smoothly traverse
the distance when transitioningfrom LinearInterpolation
- CalculateTimeForScrolling (dx As Int) As Int
Calculates the time it should take to scroll the given distance (in pixels)
dx : Distance in pixels that we want to scroll
return : Time in milliseconds
- DefaultSpeedPerPixel As Float
- DefaultTimeForDeceleration (dx As Int) As Int
- DefaultTimeForScrolling (dx As Int) As Int
- Initialize (RecyclerView As Amir_RecyclerView)
- Initialize2 (RecyclerView As Amir_RecyclerViewPager)
- InstantScrollToPosition (position As Int)
- SetSpeedPerPixel (Speed As Float)
Speed : Milliseconds per inch or -1 for set default speed
- Start
Start Smooth Scroll
- Stop
Stops running the SmoothScroller in each animation callback.
Properties:
- IsPendingInitialRun As Boolean [read only]
Returns true if SmoothScroller has been started but has not received the first
animation callback yet.
return True if this SmoothScroller is waiting to start
- IsRunning As Boolean [read only]
return True if SmoothScroller is currently active
- TargetPosition As Int
set target adapter position for scroll
Amir_RVUtils
Functions:
- EnableAdapterDataObserver (Adapter As android.support.v7.widget.RecyclerView.Adapter, ba As BA, EventName As String)
Add Adapter Data Change Events
EventName_onChanged As Boolean
EventName_onItemRangeChanged (PositionStart As int,ItemCount As int) As Boolean
EventName_onItemRangeInserted (PositionStart As int,ItemCount As int) As Boolean
EventName_onItemRangeRemoved (PositionStart As int,ItemCount As int) As Boolean
- FilterSearchList (TypeName As String, DataCopy As java.util.List) As com.aghajari.rv.utils.Filter
Search in Adapter Data With TypeName
List of data can instanceof Map , String , CustomType
if Data value is String pass "" for TypeName
- GetLoopNextPosition (adapter As android.support.v7.widget.RecyclerView.Adapter, position As Int, Current As Int) As Int
Get Next Loop Position of Item Position on Amir_RVLoopAdapter (FullLoop)
return -1 if adapter is not in full loop mode
- GetLoopPosition (adapter As android.support.v7.widget.RecyclerView.Adapter, position As Int, Current As Int) As Int
Get Loop Position from Item Position on Amir_RVLoopAdapter (FullLoop)
return -1 if adapter is not in full loop mode
- GetLoopPrevPosition (adapter As android.support.v7.widget.RecyclerView.Adapter, position As Int, Current As Int) As Int
Get Previous Loop Position of Item Position on Amir_RVLoopAdapter (FullLoop)
return -1 if adapter is not in full loop mode
- GetParentFromItemObject (RecyclerView As android.support.v7.widget.RecyclerView, Item As Object) As Panel
Get Recycler View Item Parent From Object if Using Default
RecyclerView Adapter (Amir_RVAdapter)
- GetPositionFromLoop (adapter As android.support.v7.widget.RecyclerView.Adapter, LoopPosition As Int) As Int
Get Real Item Position from Loop Position
return -1 if adapter is not in Loop mode
- GetRippleView (RippleView As android.view.View) As android.view.View
Get View From Ripple Parent
- GetRVLayoutName (RecyclerView As android.support.v7.widget.RecyclerView) As String
Get Simple Name Of RecyclerView Layout Manager Class Name
- GetSpanSize (Position As Int, Recycler As android.support.v7.widget.RecyclerView) As Int
Check Position In Grid Layout
- GetTextHeight (Label As android.widget.TextView, Text As CharSequence) As Int
Get Measure Multiline Text (CharSequence) Height
- GetTextWidth (Label As android.widget.TextView) As Float
Get Measure String Width
- GetViewHolder As com.aghajari.rv.utils.ViewHolderData
Get RecyclerView ViewHolder.
Note that you can use this method just in onBindViewHolder event!
- IsFirstRow (Position As Int, Recycler As android.support.v7.widget.RecyclerView) As Boolean
Check Position In Grid Layout
- IsLastRow (Position As Int, Recycler As android.support.v7.widget.RecyclerView) As Boolean
Check Position In Grid Layout
- RippleToView (View As android.view.View) As com.aghajari.rv.Amir_RVUtils.RippleBuilder
Add View To Ripple Parent
Example :
'Add Ripple
Dim Label As Label
Label.Initialize("")
Parent.AddView(Label,0,0,Parent.Width,Parent.Height)
Utils.RippleToView(Label).Color(Colors.Gray).Build
'Get View
Dim Label As Label = Utils.GetRippleView(Parent.GetView(0))
- ViewIndexToAdapterPosition (rv As android.support.v7.widget.RecyclerView, Index As Int) As Int
Get Adapter Position From Visible View Index
- ViewIndexToItemObject (rv As android.support.v7.widget.RecyclerView, Index As Int) As android.view.View
Get Item Object From Visible View Index
- ViewIndexToViewHolder (rv As android.support.v7.widget.RecyclerView, Index As Int) As com.aghajari.rv.utils.ViewHolderData
Get View Holder From Visible View Index
Amir_RecyclerView
Events:
- GetItemOffsets (OutRect As Rect, Item As Object, Position As Int)
- onChildAttachedToWindow (Item As Object)
- onChildDetachedFromWindow (Item As Object)
- onScrolled (Dx As Int, Dy As Int)
- onScrolledToEnd
- onScrolledToStart
- onScrollStateChanged (NewState As Int)
Fields:
- LAYOUT_DIRECTION_INHERIT As Int
- LAYOUT_DIRECTION_LOCALE As Int
- LAYOUT_DIRECTION_LTR As Int
- LAYOUT_DIRECTION_RTL As Int
Manifest :
SetApplicationAttribute(android:supportsRtl, "true")
- LAYOUT_GRID As Int
- LAYOUT_LINEAR As Int
- LAYOUT_STAGGERED_GRID As Int
- LAYOUT_UNKNOW As Int
- NO_ID As Long
- NO_POSITION As Int
- SCROLL_AXIS_HORIZONTAL As Int
Indicates scrolling along the horizontal axis.
- SCROLL_AXIS_VERTICAL As Int
Indicates scrolling along the vertical axis.
- SCROLL_STATE_DRAGGING As Int
The RecyclerView is currently being dragged by outside input such as user touch input.
- SCROLL_STATE_IDLE As Int
The RecyclerView is not currently scrolling.
- SCROLL_STATE_SETTLING As Int
The RecyclerView is currently animating to a final position while not under
outside control.
- TOUCH_SLOP_DEFAULT As Int
Constant for use with ScrollingTouchSlop.
Indicates that the RecyclerView should use the standard
touch slop for smooth, continuous scrolling.
- TOUCH_SLOP_PAGING As Int
Constant for use with ScrollingTouchSlop.
Indicates that the RecyclerView should use the standard
touch slop for scrolling widgets that snap to a page or
other coarse-grained barrier.
Functions:
- BringToFront
- ComputeScrollExtent (Horizontal As Boolean) As Int
Compute the extent of the scrollbar's thumb within the range.
- ComputeScrollOffset (Horizontal As Boolean) As Int
Compute the offset of the scrollbar's thumb within the range.
- ComputeScrollRange (Horizontal As Boolean) As Int
Compute the range that the scrollbar represents.
- DefaultAdapter As Amir_RVAdapter
Initialize Default Adapter With RecyclerView EventName
Example :
RecyclerView.DefaultAdapter
Sub EventName_onCreateViewHolder (Parent As Panel,ViewType As Int)
End Sub
Sub EventName_onBindViewHolder (Parent As Panel,Position As int)
End Sub
Sub EventName_GetItemCount As int
Return 0
End Sub
- DefaultItemAnimator
Use Default RecyclerView Item Animator
- DesignerCreateView (base As Panel, lw As Label, props As Map)
Don't Call This Method !
- DividarHorizontal As com.aghajari.rv.utils.DividarH
For layout manager having vertical orientation to draw horizontal divider
Example :
RecyclerView.DividarHorizontal.Color(Colors.LightGray).Margin(4dip).Size(1dip)
- DividarVertical As com.aghajari.rv.utils.DividarV
For layout manager having horizontal orientation to draw vertical divider
Example :
RecyclerView.DividarVertical.Color(Colors.LightGray).Margin(4dip).Size(1dip)
- Fling (velocityX As Int, velocityY As Int) As Boolean
Begin a standard fling with an initial velocity along each axis in pixels per second.
velocityX: Initial horizontal velocity in pixels per second
velocityY: Initial vertical velocity in pixels per second
- FlingListener (StandardFlingIfMissingSub As Boolean)
Set a RecyclerView OnFlingListener for this RecyclerView.
Events :
EventName_onFling (velocityX As int, velocityY As int) As Boolean
Example :
RecyclerView.Initializer("Amir").ListView.Build
...
RecyclerView.FlingListener(True)
...
Sub Amir_onFling (velocityX As int, velocityY As int) As Boolean
Log("velocityX:" &velocityX&" | velocityY:"&velocityY)
Return RecyclerView.Fling(velocityX,velocityY) 'Standard Fling
End Sub
- GetVisibleItemCount As Int
- GetVisibleItemPosition (First As Boolean, Completely As Boolean) As Int
- Initializer (EventName As String) As com.aghajari.rv.Amir_RecyclerView.Layouts
Initialize RecyclerView
Don't Forgot to set RecyclerView Layout And RecyclerView Adapter !
Layout :
Linear Layout Example :
Dim RecyclerView As Amir_RecyclerView
RecyclerView.Initializer("Amir").ListView.ReverseLayout(True).Build
Grid Layout Example :
Dim RecyclerView As Amir_RecyclerView
RecyclerView.Initializer("Amir").GridView(3).Build
Adapters :
Show With Default Adapter :
RecyclerView.DefaultAdapter
Sub Amir_onCreateViewHolder (Parent As Panel,ViewType As Int)
End Sub
Sub Amir_onBindViewHolder (Parent As Panel,Position As int)
End Sub
Sub Amir_GetItemCount As int
Return 0
End Sub
Use Custom Adapter :
RecyclerView.Adapter=CustomAdapter
- Invalidate
- Invalidate2 (arg0 As android.graphics.Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- InvalidateItemDecorations
Invalidates all ItemDecorations.
- IsInitialized As Boolean
- ItemOffsetsListener (Enabled As Boolean)
Enable or disable item offsets listener
Event :
EventName_GetItemOffsets (OutRect As Rect,Item As Object,Position As Int)
Hidden Events :
EventName_onDraw (c As Canvas)
EventName_onDrawOver (c As Canvas)
_________________________________________________________________________
Example :
Space between items :
RecyclerView.ItemOffsetsListener(True)
Sub RecyclerView_GetItemOffsets (OutRect As Rect,Item As Object,Position As Int)
OutRect.Top=10dip
If Position = Recycler.Adapter2.ItemCount-1 Then
OutRect.Bottom=10dip
End If
OutRect.Left=10dip
OutRect.Right=10dip
End Sub
- LinearSnapHelper
- LinearSnapHelper2 (Gravity As Int, EnableSnapLastItem As Boolean)
Gravity :
SnapHelper Gravity : START | END | BOTTOM | TOP
EnableSnapLastItem :
Enable snapping of the last item that's snappable.
Note you can't see the last item completely if this is enabled.
Event :
RecyclerEventName_onSnap (Position As Int)
- OffsetChildrenHorizontal (dx As Int)
Offset the bounds of all child views by dx pixels.
- OffsetChildrenVertical (dy As Int)
Offset the bounds of all child views by dy pixels.
- PagerSnapHelper
- PagerSnapHelper2 (Gravity As Int, EnableSnapLastItem As Boolean)
Gravity :
PagerSnapHelper Gravity : START | END | BOTTOM | TOP
EnableSnapLastItem :
Enable snapping of the last item that's snappable.
Note you can't see the last item completely if this is enabled.
Event :
RecyclerEventName_onSnap (Position As Int)
- RemoveSpaceItemDecoration
- RemoveView
- RequestFocus As Boolean
- ScrollBy (X As Int, Y As Int)
- ScrollToEndListener (Enabled As Boolean)
- ScrollToPosition (position As Int)
- ScrollToStartListener (Enabled As Boolean)
- SendToBack
- SetBackgroundImage (arg0 As android.graphics.Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetRecyclerViewStyle (StyleName As String)
Set RecyclerView Theme
Note : you can use this method before initialize recyclerview
Example (Add ScrollBar):
Manifest :
CreateResource(values,recycler.xml,
)
set theme to recyclerView :
RecyclerView.SetRecyclerViewStyle("ScrollbarRecyclerView")
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- SmoothScrollBy (dx As Int, dy As Int)
Animate a scroll by the given amount of pixels along either axis.
dx: Pixels to scroll horizontally
dy: Pixels to scroll vertically
- SmoothScrollToPosition (Position As Int)
- SmoothScrollToPosition2 (Position As Int, Speed As Float) As Amir_RVSmoothScroller
Speed : Milliseconds per inch or -1 for set default speed
- SpaceItemDecoration As com.aghajari.rv.Amir_RecyclerView.SpaceBuilder
- StartNestedScroll (axes As Int)
- StopNestedScroll
- StopScroll
Stop any current scroll in progress, such as one started by
smoothScrollBy , fling or a touch-initiated fling.
- SwapAdapter (Adapter As android.support.v7.widget.RecyclerView.Adapter, RemoveAndRecycleExistingViews As Boolean)
Swaps the current adapter with the provided one.
Adapter: The new adapter to set, or null to set no adapter.
RemoveAndRecycleExistingViews: If set to true, RecyclerView will recycle all existing Views.
If adapters have stable ids and/or you want to animate the disappearing views, you may prefer to set this to false.
- SwitchLayout As com.aghajari.rv.Amir_RecyclerView.Layouts
Switch RecyclerView Layout
Example :
RecyclerView.Initializer("Amir").GridView(3).Vertical.Build
...
RecyclerView.SwitchLayout.ListView.Vertical.Build
- UpdateLayout As com.aghajari.rv.Amir_RecyclerView.ULayouts
Update RecyclerView Layout
Example :
RecyclerView.Initializer("Amir").GridView(3).Vertical.Build
...
RecyclerView.UpdateLayout.GridView.SpanCount(4)
Properties:
- About As String [read only]
Amir_RecyclerView © Amir Hossein Aghajari
- Adapter As android.support.v7.widget.RecyclerView.Adapter
set : Set a new adapter to provide child views on demand.
get : Retrieves the previously set adapter or null if no adapter is set.
- Adapter2 As com.aghajari.rv.AdapterData [read only]
Manage adapter and notifi adapter
Example :
RecyclerView.Adapter2.NotifiDataSetChanged
- Background As android.graphics.drawable.Drawable
- Baseline As Int [read only]
Return the offset of the RecyclerView's text baseline from the its top boundary.
- CanScrollHorizontally As Boolean [read only]
- CanScrollVertically As Boolean [read only]
- CenterItemPosition As Int [read only]
- CenterItemView As android.view.View [read only]
- Clickable As Boolean
- ClipToPadding As Boolean
Returns whether this RecyclerView will clip its children to its padding,
and resize (but not clip) any EdgeEffect to the padded region, if padding
is present.
- Color As Int [write only]
- Enabled As Boolean
- FlingVelocityMax As Int [read only]
get the maximum fling velocity used by this RecyclerView.
- FlingVelocityMin As Int [read only]
get the minimum velocity to start a fling.
- HasFixedSize As Boolean
RecyclerView can perform several optimizations if it can know in advance that changes in
adapter content cannot change the size of the RecyclerView itself.
If your use of RecyclerView falls into this category, set this to true.
- HasNestedScrollingParent As Boolean [read only]
- HasPendingAdapterUpdates As Boolean [read only]
Returns whether there are pending adapter updates which are not yet applied to the layout.
- Height As Int
- IsAnimating As Boolean [read only]
Returns true if RecyclerView is currently running some animations.
- IsAttachedToWindow As Boolean [read only]
Returns true if RecyclerView is attached to window.
- IsComputingLayout As Boolean [read only]
Returns whether RecyclerView is currently computing a layout.
- ItemAnimator As android.support.v7.widget.RecyclerView.ItemAnimator
gets the current ItemAnimator for this RecyclerView. or
Sets the RecyclerView ItemAnimator that will handle animations
involving changes to the items in this RecyclerView.
- ItemAnimatorManager As com.aghajari.rv.utils.ItemAnimatorManager [read only]
- ItemViewCacheSize As Int [write only]
Set the number of offscreen views to retain before adding them
to the potentially shared recycled view pool.
- LayoutDirection As Int
Support Rtl (Manifest) :
SetApplicationAttribute(android:supportsRtl, "true")
- LayoutFrozen As Boolean
Enable or disable layout and scroll.
- LayoutSpanCount As Int [read only]
Get Recycler Layout Span Count
-1 For Unknow And 1 For Linear Type
- LayoutType As Int [read only]
Get RecyclerView Layout Type
- Left As Int
- LongClickable As Boolean
Enables or disables long click events for this view.
- MotionEventSplitting As Boolean
- NestedScrollingEnabled As Boolean
- Padding As Int()
- Parent As Object [read only]
- PreserveFocusAfterLayout As Boolean
Set whether the RecyclerView should try to keep the same
Item focused after a layout calculation or not.
- ScrollingTouchSlop As Int [write only]
Configure the scrolling touch slop for a specific use case.
Set up the RecyclerView's scrolling motion threshold based on common usages.
Valid arguments are TOUCH_SLOP_DEFAULT and TOUCH_SLOP_PAGING.
- ScrollSettings As com.aghajari.rv.Amir_RecyclerView.ScrollBar [read only]
Scroll And ScrollBar Settings
Don't Forgot to Enable ScrollBars !
Add ScrollBar :
Manifest :
CreateResource(values,recycler.xml,
)
set theme to recyclerView :
RecyclerView.SetRecyclerViewStyle("ScrollbarRecyclerView")
- ScrollState As Int [read only]
Return the current scrolling state of the RecyclerView.
- Tag As Object
- Top As Int
- Utils As Amir_RVUtils [read only]
- Visible As Boolean
- Width As Int
Amir_RecyclerViewPager
Events:
- GetItemOffsets (OutRect As Rect, Item As Object, Position As Int)
- onPageChanged (PreviousPage As Int, NewPage As Int)
- onPageChanging (CurrentPage As Int, NewPage As Int)
- onScrolled (Dx As Int, Dy As Int)
- onScrollStateChanged (NewState As Int)
Fields:
- LAYOUT_DIRECTION_INHERIT As Int
- LAYOUT_DIRECTION_LOCALE As Int
- LAYOUT_DIRECTION_LTR As Int
- LAYOUT_DIRECTION_RTL As Int
Manifest :
SetApplicationAttribute(android:supportsRtl, "true")
- NO_ID As Long
- NO_POSITION As Int
- SCROLL_AXIS_HORIZONTAL As Int
Indicates scrolling along the horizontal axis.
- SCROLL_AXIS_VERTICAL As Int
Indicates scrolling along the vertical axis.
- SCROLL_STATE_DRAGGING As Int
The RecyclerView is currently being dragged by outside input such as user touch input.
- SCROLL_STATE_IDLE As Int
The RecyclerView is not currently scrolling.
- SCROLL_STATE_SETTLING As Int
The RecyclerView is currently animating to a final position while not under
outside control.
- TOUCH_SLOP_DEFAULT As Int
Constant for use with ScrollingTouchSlop.
Indicates that the RecyclerView should use the standard
touch slop for smooth, continuous scrolling.
- TOUCH_SLOP_PAGING As Int
Constant for use with ScrollingTouchSlop.
Indicates that the RecyclerView should use the standard
touch slop for scrolling widgets that snap to a page or
other coarse-grained barrier.
Functions:
- BringToFront
- ComputeScrollExtent (Horizontal As Boolean) As Int
Compute the extent of the scrollbar's thumb within the range.
- ComputeScrollOffset (Horizontal As Boolean) As Int
Compute the offset of the scrollbar's thumb within the range.
- ComputeScrollRange (Horizontal As Boolean) As Int
Compute the range that the scrollbar represents.
- DefaultAdapter As Amir_RVAdapter
Initialize Default Adapter With RecyclerView EventName
Example :
RecyclerView.DefaultAdapter
Sub EventName_onCreateViewHolder (Parent As Panel,ViewType As Int)
End Sub
Sub EventName_onBindViewHolder (Parent As Panel,Position As int)
End Sub
Sub EventName_GetItemCount As int
Return 0
End Sub
- DefaultItemAnimator
Use Default RecyclerView Item Animator
- DesignerCreateView (base As Panel, lw As Label, props As Map)
Don't Call This Method !
- Fling (velocityX As Int, velocityY As Int)
Begin a standard fling with an initial velocity along each axis in pixels per second.
velocityX: Initial horizontal velocity in pixels per second
velocityY: Initial vertical velocity in pixels per second
- FlingListener (StandardFlingIfMissingSub As Boolean)
Set a RecyclerView OnFlingListener for this RecyclerView.
Events :
EventName_onFling (velocityX As int, velocityY As int) As Boolean
Example :
RecyclerView.Initializer("Amir").ListView.Build
...
RecyclerView.FlingListener(True)
...
Sub Amir_onFling (velocityX As int, velocityY As int) As Boolean
Log("velocityX:" &velocityX&" | velocityY:"&velocityY)
Return RecyclerView.Fling(velocityX,velocityY) 'Standard Fling
End Sub
- GoToNext
- GoToPosition (Position As Int)
- GoToPrevious
- Indicator As com.aghajari.rv.utils.DividarP
- Initializer (EventName As String) As com.aghajari.rv.Amir_RecyclerViewPager.Builder
Initialize View Pager
Don't Forgot to set recyclerView Layout and recyclerView adapter !
- Invalidate
- Invalidate2 (arg0 As android.graphics.Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- InvalidateItemDecorations
Invalidates all ItemDecorations.
- IsInitialized As Boolean
- ItemOffsetsListener (Enabled As Boolean)
Enable or disable item offsets listener
Event :
EventName_GetItemOffsets (OutRect As Rect,Item As Object,Position As Int)
Hidden Events :
EventName_onDraw (c As Canvas)
EventName_onDrawOver (c As Canvas)
_________________________________________________________________________
Example :
Space between items :
RecyclerView.ItemOffsetsListener(True)
Sub RecyclerView_GetItemOffsets (OutRect As Rect,Item As Object,Position As Int)
OutRect.Top=10dip
If Position = Recycler.Adapter2.ItemCount-1 Then
OutRect.Bottom=10dip
End If
OutRect.Left=10dip
OutRect.Right=10dip
End Sub
- OffsetChildrenHorizontal (dx As Int)
Offset the bounds of all child views by dx pixels.
- OffsetChildrenVertical (dy As Int)
Offset the bounds of all child views by dy pixels.
- RemoveView
- RequestFocus As Boolean
- ScrollBy (X As Int, Y As Int)
- ScrollToPosition (position As Int)
- SendToBack
- SetBackgroundImage (arg0 As android.graphics.Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- SmoothScrollBy (dx As Int, dy As Int)
Animate a scroll by the given amount of pixels along either axis.
dx: Pixels to scroll horizontally
dy: Pixels to scroll vertically
- SmoothScrollToPosition (Position As Int)
- SmoothScrollToPosition2 (Position As Int, Speed As Float) As Amir_RVSmoothScroller
Speed : Milliseconds per inch or -1 for set default speed
- StartNestedScroll (axes As Int)
- StopNestedScroll
- StopScroll
Stop any current scroll in progress, such as one started by
smoothScrollBy , fling or a touch-initiated fling.
- SwapAdapter (Adapter As android.support.v7.widget.RecyclerView.Adapter, RemoveAndRecycleExistingViews As Boolean)
Swaps the current adapter with the provided one.
Adapter: The new adapter to set, or null to set no adapter.
RemoveAndRecycleExistingViews: If set to true, RecyclerView will recycle all existing Views.
If adapters have stable ids and/or you want to animate the disappearing views, you may prefer to set this to false.
- SwitchLayout As com.aghajari.rv.Amir_RecyclerViewPager.Builder
Set New Layout for this recyclerview
- UpdateLayout As com.aghajari.rv.Amir_RecyclerViewPager.Builder
update this recyclerview Layout
Properties:
- Adapter As android.support.v7.widget.RecyclerView.Adapter
set : Set a new adapter to provide child views on demand.
get : Retrieves the previously set adapter or null if no adapter is set.
- Adapter2 As com.aghajari.rv.AdapterData [read only]
Manage adapter and notifi adapter
Example :
RecyclerView.Adapter2.NotifiDataSetChanged
- Background As android.graphics.drawable.Drawable
- Baseline As Int [read only]
Return the offset of the RecyclerView's text baseline from the its top boundary.
- ClipToPadding As Boolean
Returns whether this RecyclerView will clip its children to its padding,
and resize (but not clip) any EdgeEffect to the padded region, if padding
is present.
- Color As Int [write only]
- CurrentPage As Int [read only]
- CurrentPageView As Panel [read only]
- Enabled As Boolean
- FlingVelocityMax As Int [read only]
get the maximum fling velocity used by this RecyclerView.
- FlingVelocityMin As Int [read only]
get the minimum velocity to start a fling.
- HasFixedSize As Boolean
RecyclerView can perform several optimizations if it can know in advance that changes in
adapter content cannot change the size of the RecyclerView itself.
If your use of RecyclerView falls into this category, set this to true.
- HasNestedScrollingParent As Boolean [read only]
- HasPendingAdapterUpdates As Boolean [read only]
Returns whether there are pending adapter updates which are not yet applied to the layout.
- Height As Int
- IsAnimating As Boolean [read only]
Returns true if RecyclerView is currently running some animations.
- IsAttachedToWindow As Boolean [read only]
Returns true if RecyclerView is attached to window.
- IsComputingLayout As Boolean [read only]
Returns whether RecyclerView is currently computing a layout.
- ItemAnimator As android.support.v7.widget.RecyclerView.ItemAnimator
gets the current ItemAnimator for this RecyclerView. or
Sets the RecyclerView ItemAnimator that will handle animations
involving changes to the items in this RecyclerView.
- ItemAnimatorManager As com.aghajari.rv.utils.ItemAnimatorManager [read only]
- ItemViewCacheSize As Int [write only]
Set the number of offscreen views to retain before adding them
to the potentially shared recycled view pool.
- LayoutDirection As Int
Support Rtl (Manifest) :
SetApplicationAttribute(android:supportsRtl, "true")
- LayoutFrozen As Boolean
Enable or disable layout and scroll.
- Left As Int
- NestedScrollingEnabled As Boolean
- Padding As Int()
- Parent As Object [read only]
- PreserveFocusAfterLayout As Boolean
Set whether the RecyclerView should try to keep the same
Item focused after a layout calculation or not.
- ScrollingTouchSlop As Int [write only]
Configure the scrolling touch slop for a specific use case.
Set up the RecyclerView's scrolling motion threshold based on common usages.
Valid arguments are TOUCH_SLOP_DEFAULT and TOUCH_SLOP_PAGING.
- ScrollState As Int [read only]
Return the current scrolling state of the RecyclerView.
- ShowOnlyOneItem As Boolean
- Tag As Object
- Top As Int
- TriggerOffset As Float
- Utils As Amir_RVUtils [read only]
- Visible As Boolean
- Width As Int
Author: AmirHosseinAghajari