Class BaseAdapter
public class BaseAdapter : JVMBridgeListener, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBaseInstance>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeBaseInstance, IJVMBridgeDefinition, IListAdapter, ISpinnerAdapter, IAdapter
- Inheritance
-
BaseAdapter
- Implements
- Derived
- Extension Methods
Constructors
BaseAdapter()
public BaseAdapter()
BaseAdapter(IJVMBridgeBaseInitializer)
Initializer used internally by JCOBridge. Do not use directly.
[Obsolete("This public initializer is needed for JCOBridge internal use, other uses can produce unidentifiable behaviors.")]
public BaseAdapter(IJVMBridgeBaseInitializer initializer)
Parameters
initializerIJVMBridgeBaseInitializer
BaseAdapter(params object[])
Generic constructor used by JCOBridge when a derived class needs to forward arguments to the base JVMBridgeBase class.
public BaseAdapter(params object[] args)
Parameters
argsobject[]
Properties
BridgeClassName
Java class name to be instantiated
public override string BridgeClassName { get; }
Property Value
OnAreAllItemsEnabled
Handler for https://developer.android.com/reference/android/widget/BaseAdapter.html#areAllItemsEnabled()
public Func<bool> OnAreAllItemsEnabled { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnAreAllItemsEnabledDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<bool> OnAreAllItemsEnabledDispose { get; set; }
Property Value
Remarks
Set OnAreAllItemsEnabledDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetAutofillOptions
Handler for https://developer.android.com/reference/android/widget/BaseAdapter.html#getAutofillOptions()
public Func<CharSequence[]> OnGetAutofillOptions { get; set; }
Property Value
- Func<CharSequence[]>
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetAutofillOptionsDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<CharSequence[]> OnGetAutofillOptionsDispose { get; set; }
Property Value
Remarks
Set OnGetAutofillOptionsDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetCount
public Func<int> OnGetCount { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetCountDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<int> OnGetCountDispose { get; set; }
Property Value
Remarks
Set OnGetCountDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetDropDownView
public Func<int, View, ViewGroup, View> OnGetDropDownView { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetDropDownViewDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<View> OnGetDropDownViewDispose { get; set; }
Property Value
Remarks
Set OnGetDropDownViewDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetItem
public Func<int, object> OnGetItem { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetItemDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<object> OnGetItemDispose { get; set; }
Property Value
Remarks
Set OnGetItemDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetItemId
public Func<int, long> OnGetItemId { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetItemIdDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<long> OnGetItemIdDispose { get; set; }
Property Value
Remarks
Set OnGetItemIdDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetItemViewType
Handler for https://developer.android.com/reference/android/widget/BaseAdapter.html#getItemViewType(int)
public Func<int, int> OnGetItemViewType { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetItemViewTypeDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<int> OnGetItemViewTypeDispose { get; set; }
Property Value
Remarks
Set OnGetItemViewTypeDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetView
public Func<int, View, ViewGroup, View> OnGetView { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetViewDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<View> OnGetViewDispose { get; set; }
Property Value
Remarks
Set OnGetViewDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetViewTypeCount
Handler for https://developer.android.com/reference/android/widget/BaseAdapter.html#getViewTypeCount()
public Func<int> OnGetViewTypeCount { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetViewTypeCountDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<int> OnGetViewTypeCountDispose { get; set; }
Property Value
Remarks
Set OnGetViewTypeCountDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnHasStableIds
public Func<bool> OnHasStableIds { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnHasStableIdsDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<bool> OnHasStableIdsDispose { get; set; }
Property Value
Remarks
Set OnHasStableIdsDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnIsEmpty
public Func<bool> OnIsEmpty { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnIsEmptyDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<bool> OnIsEmptyDispose { get; set; }
Property Value
Remarks
Set OnIsEmptyDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnIsEnabled
public Func<int, bool> OnIsEnabled { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnIsEnabledDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<bool> OnIsEnabledDispose { get; set; }
Property Value
Remarks
Set OnIsEnabledDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling Dispose() on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnNotifyDataSetChanged
Handler for https://developer.android.com/reference/android/widget/BaseAdapter.html#notifyDataSetChanged()
public Action OnNotifyDataSetChanged { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnNotifyDataSetInvalidated
Handler for https://developer.android.com/reference/android/widget/BaseAdapter.html#notifyDataSetInvalidated()
public Action OnNotifyDataSetInvalidated { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnRegisterDataSetObserver
public Action<DataSetObserver> OnRegisterDataSetObserver { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetAutofillOptions
public Action<CharSequence[]> OnSetAutofillOptions { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnUnregisterDataSetObserver
public Action<DataSetObserver> OnUnregisterDataSetObserver { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
Methods
AreAllItemsEnabled()
public virtual bool AreAllItemsEnabled()
Returns
GetAutofillOptions()
public virtual CharSequence[] GetAutofillOptions()
Returns
GetCount()
public virtual int GetCount()
Returns
GetDropDownView(int, View, ViewGroup)
public virtual View GetDropDownView(int arg0, View arg1, ViewGroup arg2)
Parameters
Returns
GetItem(int)
public virtual object GetItem(int arg0)
Parameters
Returns
GetItemId(int)
public virtual long GetItemId(int arg0)
Parameters
Returns
GetItemViewType(int)
public virtual int GetItemViewType(int arg0)
Parameters
Returns
GetView(int, View, ViewGroup)
public virtual View GetView(int arg0, View arg1, ViewGroup arg2)
Parameters
Returns
GetViewTypeCount()
public virtual int GetViewTypeCount()
Returns
HasStableIds()
public virtual bool HasStableIds()
Returns
InitializeHandlers(Type)
Handlers initializer for BaseAdapter
protected virtual void InitializeHandlers(Type listenerRuntimeType)
Parameters
listenerRuntimeTypeType
IsEmpty()
public virtual bool IsEmpty()
Returns
IsEnabled(int)
public virtual bool IsEnabled(int arg0)
Parameters
Returns
ListenerShallManageEvent(int)
Invoked from the JVMBridgeListener on each received event to notify the user which can decide to abort the execution for the specific event returning false
protected override bool ListenerShallManageEvent(int eventIndex)
Parameters
eventIndexintThe index of the event triggered as returned from AddEventHandler(string, EventHandler) or AddEventHandler<TDataClass>(string, EventHandler<CLRListenerEventArgs<TDataClass>>)
Returns
Remarks
By default every event continues the execution and reads the data from JVM; this implies an extra cost which can be limited using ListenerShallManageEvent(int) or the ListenerShallManageEventIndex/ListenerShallManageEventName handlers. Returning false the control is immediately returned to the JVM, anyway the user has received the notification. It can be useful in scenarios where the user is interested in few events and the other are simply discarded to optimize the execution speed. By default, this function invokes ListenerShallManageEventIndex, then try ListenerShallManageEventName if they are set or return true
ListenerShallManageEventHandlers(int)
protected virtual bool ListenerShallManageEventHandlers(int eventIndex)
Parameters
eventIndexint
Returns
NotifyDataSetChanged()
public virtual void NotifyDataSetChanged()
NotifyDataSetInvalidated()
public virtual void NotifyDataSetInvalidated()
RegisterDataSetObserver(DataSetObserver)
public virtual void RegisterDataSetObserver(DataSetObserver arg0)
Parameters
SetAutofillOptions(params CharSequence[])
public virtual void SetAutofillOptions(params CharSequence[] arg0)
Parameters
arg0CharSequence[]
UnregisterDataSetObserver(DataSetObserver)
public virtual void UnregisterDataSetObserver(DataSetObserver arg0)