Skip to content

alexandrratush/Toast-ANE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toast ANE

Build Status GitHub version Platform

Native Extension for Adobe AIR

Using the ANE:

  • Add Toast.ane file to your air project.

  • Add com.aratush.ane.Toast extension id to your application descriptor file. For example:

<!-- Identifies the ActionScript extensions used by an application. -->
<extensions>
	<extensionID>com.aratush.ane.Toast</extensionID>
</extensions>

Code example:

import com.aratush.ane.toast.DurationEnum;
import com.aratush.ane.toast.GravityEnum;
import com.aratush.ane.toast.ToastExtension;

if (ToastExtension.isSupported)
{
    var toast:ToastExtension = new ToastExtension();
    toast.setText("Hello");
    toast.setDuration(DurationEnum.LENGTH_LONG);
    toast.setGravity(GravityEnum.CENTER, 100, 50);
    toast.show();
    // close the toast 
    toast.cancel();
}

API

  • ToastExtension.isSupported - check whether Toast extension is supported on your platform.
  • setText() - set the text in a Toast.
  • setDuration() - set how long to show the view for it.
  • setGravity() - set the location at which the notification should appear on the screen.
  • show() - show the Toast for the specified parameters.
  • cancel() - close the view if it's showing.

NOTE: For setDuration() and setGravity() methods use DurationEnum and GravityEnum classes respectively.

About

Toast ANE for Android (Air Native Extension)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published