Table of Contents

Class Adapter

Namespace
Android.Widget
Assembly
MASES.Netdroid.dll
public class Adapter : JVMBridgeListener, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBaseInstance>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeBaseInstance, IJVMBridgeDefinition, IAdapter
Inheritance
Adapter
Implements
Derived
Extension Methods

Constructors

Adapter(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 Adapter(IJVMBridgeBaseInitializer initializer)

Parameters

initializer IJVMBridgeBaseInitializer

Adapter(params object[])

Generic constructor used by JCOBridge when a derived class needs to forward arguments to the base JVMBridgeBase class.

public Adapter(params object[] args)

Parameters

args object[]

Properties

BridgeClassName

Java class name to be instantiated

public override string BridgeClassName { get; }

Property Value

string

IGNORE_ITEM_VIEW_TYPE

public static int IGNORE_ITEM_VIEW_TYPE { get; set; }

Property Value

int

NO_SELECTION

public static int NO_SELECTION { get; set; }

Property Value

int

OnGetAutofillOptions

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

Action<CharSequence[]>

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

Func<int>

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

Action<int>

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.

OnGetItem

public Func<int, object> OnGetItem { get; set; }

Property Value

Func<int, object>

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

Action<object>

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

Func<int, long>

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

Action<long>

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

public Func<int, int> OnGetItemViewType { get; set; }

Property Value

Func<int, int>

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

Action<int>

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

Func<int, View, ViewGroup, View>

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

Action<View>

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

public Func<int> OnGetViewTypeCount { get; set; }

Property Value

Func<int>

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

Action<int>

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

Func<bool>

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

Action<bool>

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

Func<bool>

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

Action<bool>

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.

OnRegisterDataSetObserver

public Action<DataSetObserver> OnRegisterDataSetObserver { get; set; }

Property Value

Action<DataSetObserver>

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

Action<DataSetObserver>

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

GetAutofillOptions()

public virtual CharSequence[] GetAutofillOptions()

Returns

CharSequence[]

CharSequence

Remarks

The method invokes the default implementation in the JVM interface using GetAutofillOptionsDefault(); override the method to implement a different behavior

GetAutofillOptionsDefault()

public CharSequence[] GetAutofillOptionsDefault()

Returns

CharSequence[]

CharSequence

Remarks

The method invokes the default implementation in the JVM interface

GetCount()

public virtual int GetCount()

Returns

int

int

GetItem(int)

public virtual object GetItem(int arg0)

Parameters

arg0 int

int

Returns

object

object

GetItemId(int)

public virtual long GetItemId(int arg0)

Parameters

arg0 int

int

Returns

long

long

GetItemViewType(int)

public virtual int GetItemViewType(int arg0)

Parameters

arg0 int

int

Returns

int

int

GetView(int, View, ViewGroup)

public virtual View GetView(int arg0, View arg1, ViewGroup arg2)

Parameters

arg0 int

int

arg1 View

View

arg2 ViewGroup

ViewGroup

Returns

View

View

GetViewTypeCount()

public virtual int GetViewTypeCount()

Returns

int

int

HasStableIds()

public virtual bool HasStableIds()

Returns

bool

bool

InitializeHandlers(Type)

Handlers initializer for Adapter

protected virtual void InitializeHandlers(Type listenerRuntimeType)

Parameters

listenerRuntimeType Type

IsEmpty()

public virtual bool IsEmpty()

Returns

bool

bool

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

eventIndex int

The index of the event triggered as returned from AddEventHandler(string, EventHandler) or AddEventHandler<TDataClass>(string, EventHandler<CLRListenerEventArgs<TDataClass>>)

Returns

bool

Returns true to continue event evaluation, false to return the control to the JVM

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

eventIndex int

Returns

bool

RegisterDataSetObserver(DataSetObserver)

public virtual void RegisterDataSetObserver(DataSetObserver arg0)

Parameters

arg0 DataSetObserver

DataSetObserver

UnregisterDataSetObserver(DataSetObserver)

public virtual void UnregisterDataSetObserver(DataSetObserver arg0)

Parameters

arg0 DataSetObserver

DataSetObserver