All Projects → jzeferino → Xamarin.Android.Tooltips

jzeferino / Xamarin.Android.Tooltips

Licence: MIT license
Xamarin.Android binding of android tooltips, a simple to use library for android, enabling to add a tooltip near any view with ease

Programming Languages

C#
18002 projects
powershell
5483 projects
shell
77523 projects

Build Status NuGet

Xamarin.Android.Tooltips

This is a Xamarin Android Binding for the tooltips.

This project provides you a convenient way and simple to use library for android, enabling to add a tooltip near any view with ease.

Usage

Step 1

Install NuGet package.

Step 2

Create a ToolTipsManager.

_toolTipsManager = new ToolTipsManager(this);

Step 3

Use the ToolTip.Builder to create and position your Tooltip.

builder = new ToolTip.Builder(
    this,
    _textView,              /* anchor view */
    _rootLayout,            /* root view of entire layout, must be a RelativeLayout or FrameLayout. */
    text,                   /* tooltip text */
    ToolTip.PositionAbove); /* Position related to achor view */

builder.SetAlign(_align);   /* arrow align */

_toolTipsManager.Show(builder.Build());

IMPORTANT NOTE:

If you want to how the tooltip immediately when the Activity is created you should Build and show the tooltip in the OnWindowsFocusChanged method, example:

public override void OnWindowFocusChanged(bool hasFocus)
{
    base.OnWindowFocusChanged(hasFocus);
    builder = new ToolTip.Builder(
        this,
        _textView,              /* anchor view */
        _rootLayout,            /* root view of entire layout, must be a RelativeLayout or FrameLayout. */
        text,                   /* tooltip text */
        ToolTip.PositionAbove); /* Position related to achor view */

    builder.SetAlign(_align);   /* arrow align */

    _toolTipsManager.Show(builder.Build());
}

In alternative you could use View.Post or View.PostDelayed in OnCreate.

Sample

Run and play with the sample.

More documentation

Read more detailed documention original library project.

License

MIT Licence

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].