GithubHelp home page GithubHelp logo

hansemannn / titanium-tooltip Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 9.82 MB

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

License: MIT License

Java 7.40% JavaScript 2.32% Objective-C 84.19% Swift 6.09%
javascript native tidev titanium tooltips

titanium-tooltip's Introduction

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

titanium-tooltip's People

Contributors

hansemannn avatar mitulbhalia avatar prashantsaini1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mitulbhalia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.