hansemannn / titanium-tooltip

Use the native AMPopTip (iOS) and ViewTooltip (Android) library to display tooltips above any view and window in Titanium!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tooltips in Titanium

Use the native AMPopTip (iOS) and ViewTooltip (Android) library to display tooltips above any view and window in Titanium!

Requirements

  • Titanium SDK 9.2.0+
  • Android: Add the following to your [app]/platform/android/build.gradle:
allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}

APIs

Methods

  • show(params) - Shows a new tooltip. See the example below for all options!
  • hideActiveTooltip - Hide an active tooltip in the current window.

Constants

The following constants are used for the direction property:

  • TOOLTIP_DIRECTION_UP
  • TOOLTIP_DIRECTION_DOWN
  • TOOLTIP_DIRECTION_LEFT
  • TOOLTIP_DIRECTION_RIGHT

Example

import Tooltips from 'ti.tooltip';

const params = {
    container: $.win,
    sourceView: $.view,
    direction: Tooltips.TOOLTIP_DIRECTION_UP,
    title: 'Hello world',
    backgroundColor: '#ffffff',
    textColor: '#000000',
    borderRadius: 15,
    borderColor: '#ff0000',
    borderWidth: 2,
    padding: 10,
    arrowMargin: 0,
    arrowWidth: 20,
    arrowHeight: 24,
    onClick: () => {
        alert('Tooltip tapped!');
    }
};

Tooltips.show(params);

Authors

  • Prashant Saini (Android)
  • Hans Knöchel (iOS)

License

MIT

About

Use the native AMPopTip (iOS) and ViewTooltip (Android) library to display tooltips above any view and window in Titanium!

License:MIT License


Languages

Language:Objective-C 84.2%Language:Java 7.4%Language:Swift 6.1%Language:JavaScript 2.3%