GithubHelp home page GithubHelp logo

mateuszmackowiak / nativedialogs Goto Github PK

View Code? Open in Web Editor NEW
147.0 147.0 62.0 72.66 MB

Adobe Air Native Extension for mobile native dialogs (IOS,Andoid) - Toast, Text Input dialog, Progress dialog, Alert dialog, multi single choice dialog + DatePicker dialog

Java 27.82% ActionScript 23.85% JavaScript 8.90% CSS 2.24% Objective-C 32.34% C 3.83% Shell 1.01%

nativedialogs's People

Contributors

leichtgewicht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativedialogs's Issues

NativeAlertDialog for Windows

The old "NativeAlert" library was compatible with Windows (at least the regular NativeAlert class).

It would be desirable to have that compatibility back in the NativeAlertDialog class of the "NativeDialogs" library (and ideally MacOS X too).

Feature request - Access which button was pressed when closing a dialog alert

It would be useful to know which button was triggered.

private function showSaveAlert():void
{
var saveNativeAler:NativeAlertDialogt = NativeAlertDialog.show(SAVE_MESSAGE, TITLE, "Save", "Cancel", saveHandler);

}

private function saveHandler(event:NativeDialogEvent):void
{
var selectedButtonLabel:String= event.currentTarget.label;//would suffice
switch(selectedButtonLabel)
{
case "Save":
saveImage();
break;
case "Cancel":
doSomethingElse();
break;
}

}

Pickers fail with AIR SDK 3.9.0.103

When compile my app using the AIR SDK 3.9.0.1030, I get a black square instead the datepickers and listDialogs, the pickers "work", but is no visible the content. I back to use AIR SDK 3.8.

NativeDatePickerDialog does not show correct date on startup

When instantiating a new NativeDatePicerDialog and setting the date, the Date is not shown correctly.

I want the DatePicker to show a specific date (default = today) when it opens. To me it looks as if the date is stored correctly internally, but displayed wrong. The start display is February 5 2013 when open() is called. After changing the date with the UI controls, the (previously correctly stored ) date is overwritten.

Here's my code

private var datePickerDialog:NativeDatePickerDialog = new NativeDatePickerDialog();
datePickerDialog.setDate(new Date());
trace(datePickerDialog.date.toLocaleDateString());
datePickerDialog.addEventListener(Event.CHANGE, function(event:Event):void {
    trace(datePickerDialog.date.toLocaleDateString());
});
datePickerDialog.show(true);

Here's the console output (first line = first trace(), all other lines = after date has been changed):

Fri Feb 22 2013
Wed Feb 6 2013
Thu Feb 7 2013
Fri Feb 8 2013
Sat Feb 9 2013

on IOS the Date is correctly displayed.

NativeListDialog single mode select;

When using a NativeListDialog in DISPLAY_MODE_SINGLE is it possible to close the list as soon as an item is selected? So you don't need to select an item and then hit OK?

NativeDatePickerDialog is displayed as a black rectangle

NativeDatePickerDialog starts to be displayed in the following way (see attach) on my iOS 7. I'm not sure it began after your recent fixes related to list dialog, but I've noticed the issue at the same time.
Can it be fixed by assigning some custom theme (I can see only the ones for Android) or does it need some changes in ANE?
My code has not been changed so a presume it's not my fault...

img_0254_cropped

Runtime error on android

Hello.
When I start my app on android with using NativeDatePickerDialog (ios is good), the runtime error occurs:
[Fault] exception, information=Error: [pl.mateuszmackowiak.nativeANE.dialogs.NativeDatePickerDialog] Error initiating contex of the NativeDatePickerDialog extension: Error #1009: Cannot access a property or method of a null object reference.
at pl.mateuszmackowiak.nativeANE.dialogs.support::AbstractNativeDialog/showError()[/Users/mmmackowiak/Documents/git/NativeDialogs/AS/src/pl/mateuszmackowiak/nativeANE/dialogs/support/AbstractNativeDialog.as:259]
at pl.mateuszmackowiak.nativeANE.dialogs::NativeDatePickerDialog/init()[/Users/mmmackowiak/Documents/git/NativeDialogs/AS/src/pl/mateuszmackowiak/nativeANE/dialogs/NativeDatePickerDialog.as:148]
at pl.mateuszmackowiak.nativeANE.dialogs::NativeDatePickerDialog()[/Users/mmmackowiak/Documents/git/NativeDialogs/AS/src/pl/mateuszmackowiak/nativeANE/dialogs/NativeDatePickerDialog.as:140]
at com.agamobile.ui.layouts::ConversationPageLayout/onAdded()[D:\GreenishFlow_Works\fuel\AGA\flash\AGA-mobile\Classes\com\agamobile\ui\layouts\ConversationPageLayout.as:80]

my code is just:
var d:NativeDatePickerDialog = new NativeDatePickerDialog();
d.addEventListener(NativeDialogEvent.CLOSED,onCloseDialog);
d.addEventListener(NativeDialogEvent.CANCELED,trace);
d.addEventListener(NativeDialogEvent.OPENED,trace);
d.addEventListener(Event.CHANGE,onTimePicked);
d.buttons = Vector.(["Cancle","OK"]);
d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_TIME;
d.title = "Pick the time for the Date";
d.message = "Select time:";
d.show(false);

Thanks

NativePicker iOS7 BG

HI, thanks for the awesome work!

there doesnt seem to be a BG on the picker list on iOS7, or maybe I'm doing something wrong?

cosito
var picker:NativePickerDialog = new NativePickerDialog();
var pickerlist1:PickerList = new PickerList(country_Array,index);
pickerlist1.addEventListener(NativeDialogListEvent.LIST_CHANGE,readSelectedValuesFromPickerList);
picker.dataProvider = Vector.([pickerlist1]);
picker.addEventListener(NativeDialogEvent.CLOSED,readAllSelectedValuesFromPickers);
picker.show();

Use with no buttons will Error

Can I just show one button? Why the close button always shown and I have to set buttons?

_context.call("showAlertWithTitleAndMessage", _title, _message, _closeLabel, _buttons.join(","), cancelable, _theme);

If no _buttons or _buttons have no item, will got the Error.

Thank you for the ANE, I want to help a little too, but when I run the build.xml, Got the Error:

[java] platform.xml is not supported for platform iPhone-x86

Have I miss something? I just changed the AIR SDK PATH to mine
AIR_SDK_PATH = /Applications/Adobe Flash Builder 4.7/sdks/4.6.0

NativeListDialog problem

NativeListDialog options are added in reversed order. Not only most people wouldn't expect it to behave that way, but when you set the selected item, code behind is finding the corresponding item index in the original order.

NativeDatePickerDialog, Event.CHANGE is not triggering all the times on HTC devices

Hi,

Thanks for this awesome native extension

The Event.CHANGE is not working all the times on HTC phones (I have tested on HTC sensation XE, & HTC sensation XL), on Samsung devices it's triggering perfectly.

Below is the lines of code i use, this is weird!

var d:NativeDatePickerDialog = new NativeDatePickerDialog();

d.addEventListener(NativeDialogEvent.CLOSED,onCloseDialog);
d.addEventListener(Event.CHANGE,function(event:Event):void{
var n:NativeDatePickerDialog = NativeDatePickerDialog(event.target);
_date = n.date;
userInfo_mc.btn_dob.label_txt.text = _date.getDate() + "/" + ( _date.getMonth() + 1 ) + "/" + _date.fullYear;
});

d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_DATE;
d.title = "Date Picker";
d.message = "Select date:";
d.date = _date;
d.show(true);

function onCloseDialog(event:NativeDialogEvent):void{
var m:iNativeDialog = iNativeDialog(event.target);
m.removeEventListener(NativeDialogEvent.CLOSED,onCloseDialog);
m.dispose();//Must be called if not used again
}

NativeListDialog on Android 2.3

Hi,

I'm having issues on using the native list dialog on Android 2.3.
I have it working on other (newer) Android versions, but on 2.3 it doesn't do anything.

It doesn't throw an error and it doesn't open the dialog either.
NativeListDialog.isSupported returns true though, so my code assumes it will work.

I have tried using different Themes, or not providing any theme at all, but that doens't make a difference

NativeProgressDialog: Dialog does not get focus

I tested the NativeDialogs-extension with your Test-App and there everything works fine.

However I have a problem in my app:
I have an app doing some initialization before/on startup. The problem is that the ProgressDialog does not show up, until the app is finished! I would like to use the ProgressDialog to show the initialization status, but this seems to be not possible.

I placed an EventListener on the ADDED_TO_STAGE-Event, which launches the initialization. For test purposes, I copy/pasted the code from your example (which worked in your Test-App) to show some dummy progress. I did this just to see if the Dialog opens correctly - it does not!

The ProgressDialog opens only after all the initialization has been done. However, the progress then is at '100%', which indicates that the progress has been launched in the background, but never got focus somehow and therefore was never shown

The code is roughly as follows:

<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" addedToStage="onAddedToStage(event)" >

            protected function onAddedToStage(event:Event):void{
                // this should launch the dialog, but it does only show up after all the initialization has been done   
                var p:NativeProgressDialog = new NativeProgressDialog();
                p.addEventListener(NativeDialogEvent.CANCELED,trace);
                p.secondaryProgress = 45;
                p.max = 50;
                p.title = "Title";
                p.message ="Message";

                progressPopup = p;

                myTimer.addEventListener(TimerEvent.TIMER, updateProgress);
                myTimer.start();

                p.showProgressbar();

                // do some initialization here involving other classes
                foo.bar(some:int, initialization:XML, arguments:String);
            }

            private function updateProgress(event:TimerEvent):void
            {
                var p:int = progressPopup.progress;
                p++;
                if(p>=50){
                    p = 0;
                    progressPopup.hide(1);
                    myTimer.removeEventListener(TimerEvent.TIMER,updateProgress);
                    (event.target as Timer).stop();
                }
                else{
                    if(p==25){
                        progressPopup.shake();
                        //progressPopup.setMessage("some message changed in between");
                        //progressPopup.setTitle("some title changed in between");
                    }
                    try{
                        progressPopup.setProgress(p);
                    }catch(e:Error){
                        trace(e);
                    }
                }
            }

If I leave the following line away, everything works as expected (the dummy-NativeProcess is shown and animated):
foo.bar(some:int, initialization:XML, arguments:String);
I tried to get a workaround by adding an EventListener on the NativeDialogEvent.OPENED-Event and then launching the initialization-method after the NativeDialog has been opened. However, the NativeDialog is still not opened, although the initialization launches. The code is as follows

            protected function onAddedToStage(event:Event):void{
                (...)
                 // rest same as above
                myTimer.start();

                // add event listener on NativeDialog-Opening to launch initialization-method after opening
                p.addEventListener(NativeDialogEvent.OPENED, addArguments(foo.bar, [some, additional, arguments]));
                p.showProgressbar();
                // rest same as above
                (...)
            }

            /**
             * Helper function to create a function which applies arguments to be passed to the initialization function
             */
            private function addArguments(method:Function, additionalArguments:Array):Function{
                return function(event:Event):void {method.apply(null, additionalArguments);}
            }

To me it seems as if the NativeProcess does not correctly request focus and is only displayed, after all other elements have been displayed and all other (initialization-)code has been executed...

Toasts Disappear Instantly on iOS

On iOS, Toasts will appear for a frame or 2 before being hidden. Changing the time they are to be shown does nothing.

Example:

var msg:String = "Profile successfully updated";
if ( Toast.isSupported ) {
    Toast.show( msg, 3 );
}
else {
    trace( msg );
}

That works perfectly on Android, but on iOS it will show up for a fraction of a second before disappearing, not even long enough to read the message.

Tested on iOS 7 with AIR 3.9 and AIR 4.0

NativeDialogAlert hide() freezes app on iOS

When showing a NativeAlert in iOS and then calling hide(), the alert does indeed hide, but it the app becomes unresponsive. Using code similar to this:

private var na:NativeAlertDialog;

function show() {
na = NativeAlertDialog.show("message", "My Title", "OK", "Cancel", closeHandler);
setTimeout(someOtherFunc, 2000);
}

function someOtherFunc() {
na.addEventListener(ErrorEvent.ERROR, onError);
if (na.isShowing())
na.hide();
}

// this error handler doesn't actually get fired, which makes sense because it did hide the popup
function onError(e:ErrorEvent) {

}

Tested in iOS 4, iOS 6.

This functionality seems to work fine in Android.

Toast don't working.

First, amazing update. ๐Ÿ‘
Second the Toast show "true" when Toast.isSupported
but dont show nothing. (Using iPad 2 with IOS 6.)

and another question.

will have ?:
NativeProgress.showNetworkActivityIndicator(true);

Null error in AS

Line 313 in NativeAlertDialog.as currently passes the _buttons vector into the call function. However it is possible that _buttons is null at this point and this breaks the extension.

I changed: '_buttons.join(","),' to '_buttons ? _buttons.join(",") : "" ' and it seems to have fixed it nicely..

Thanks for the great ANE.

NativePickerDialog - Could not find method android.app.AlertDialog$Builder

Hi! I have a problem with NativePickerDialog on Android 2.3.3 (Samsung Galaxy S GT-I9000). NativePickerDialog not displayed at all, AS3 does not report any errors but adb logcat shows the following:

adb logcat

D/NativeDialogs: Extension.initialize
D/NativeDialogs: Extension.createContext extId: PickerDialogContext
D/PickerDialogContext( 9673): Registering Extension Functions
I/dalvikvm( 9673): Could not find method android.app.AlertDialog$Builder., referenced from method pl.mateuszmackowiak.nativeANE.functoins.NativePickerDialogContext$PickerDialog.
W/dalvikvm( 9673): VFY: unable to resolve direct method 197: Landroid/app/AlertDialog$Builder;. (Landroid/content/Context;I)V
D/dalvikvm( 9673): VFY: replacing opcode 0x70 at 0x0006
D/dalvikvm( 9673): VFY: dead code 0x0009-001b in Lpl/mateuszmackowiak/nativeANE/functoins/NativePickerDialogContext$PickerDialog;. (Lpl/mateuszmackowiak/nativeANE/functoins/NativePickerDialogContext;Lcom/adobe/fre/FREContext;Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/adobe/fre/FREArray;[I[DI)V

AS3

import flash.display.Sprite;
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.MouseEvent;
import pl.mateuszmackowiak.nativeANE.dialogs.NativeAlertDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.NativePickerDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.support.PickerList;
import pl.mateuszmackowiak.nativeANE.events.NativeDialogEvent;
import pl.mateuszmackowiak.nativeANE.events.NativeDialogListEvent;

public class As3TestProject extends Sprite {

    private var picker:NativePickerDialog;
    private var frame:int = 0;

    public function As3TestProject() {
        super();
        createButtons();
    }

    public function createButtons():void {
        var circle:Sprite = new Sprite();
        circle.graphics.beginFill(0xFF794B);
        circle.graphics.drawCircle(150, 150, 30);
        circle.graphics.endFill();
        addChild(circle);

        var circle2:Sprite = new Sprite();
        circle2.graphics.beginFill(0x000000);
        circle2.graphics.drawCircle(150, 150, 30);
        circle2.graphics.endFill();
        circle2.x = 200;
        addChild(circle2);
        circle.addEventListener(MouseEvent.CLICK, onPickerButtonClicked);
        circle2.addEventListener(MouseEvent.CLICK, onsPickerButtonClicked);
    }

    public function mess(message:*):void {
        var s:String = String(message);
        trace(s + "\n");
    }

    protected function onPickerButtonClicked(event:MouseEvent):void {
        NativeAlertDialog.showAlert("Jagniecina", "Men", Vector.<String>(["Bekon", "Inne"]), trace);
    }

    protected function onsPickerButtonClicked(event:MouseEvent):void {
        createNativePickerDialog();
    }

    protected function createNativePickerDialog():void {
        if (!NativePickerDialog.isSupported) {
            trace("VF >>", this, ":: createNativePickerDialog: NOT SUPPORTED");
            return;
        }
        picker ||= new NativePickerDialog();
        var pickerlist1:PickerList = new PickerList(["HAHAHA", "ATATAT", "tatasd"], 1);
        pickerlist1.addEventListener(NativeDialogListEvent.LIST_CHANGE, mess);
        var pickerlist2:PickerList = new PickerList(["affasf", "sagasdg", "ah5we", "fdsad"], 2);
        pickerlist2.addEventListener(NativeDialogListEvent.LIST_CHANGE, mess);
        picker.dataProvider = Vector.<PickerList>([pickerlist1, pickerlist2]);
        picker.addEventListener(NativeDialogEvent.CLOSED, readAllSelectedValuesFromPickers);
        picker.addEventListener(NativeDialogEvent.OPENED, pickerOpenedHandler);
        picker.addEventListener(NativeDialogEvent.CANCELED, pickerCanceledHandler);
        picker.addEventListener(ErrorEvent.ERROR, pickerErrorHandler);
        picker.title = "test title";
        picker.show();
    }

    private function onPickerStatus(e:Event):void {
        trace("VF >>", this, ":: onPickerStatus:", e.type);
    }

    private function pickerErrorHandler(e:ErrorEvent):void {
        trace("VF >>", this, ":: pickerErrorHandler:", e.text);
    }

    private function pickerCanceledHandler(e:NativeDialogEvent):void {
        trace("VF >>", this, ":: pickerCanceledHandler:");
    }

    private function pickerOpenedHandler(e:NativeDialogEvent):void {
        trace("VF >>", this, ":: pickerOpenedHandler:");
    }

    private function readSelectedValuesFromPickerList(event:NativeDialogListEvent):void {
        mess("\n=====00000========000000");
        mess(event);
        mess("selectedIndex: " + pickerList.selectedIndex);
        mess("selectedItem: " + pickerList.selectedItem);
        mess("=====00000========000000\n");
    }

    private function readAllSelectedValuesFromPickers(event:NativeDialogEvent):void {
        var v:Vector.<PickerList> = picker.dataProvider;
        var pickerList:PickerList;
        mess("\n=====00000========000000");
        mess(event);
        for (var i:int = 0; i < v.length; i++) {
            pickerList = v[i];
            mess("pickerlist " + i);
            mess("selectedIndex: " + pickerList.selectedIndex);
            mess("selectedItem: " + pickerList.selectedItem);
        }
        mess("=====00000========000000\n");

        picker.dispose();
    }

}

NativeAlertDialog works without any problems in example above.
Could you please tell me what is wrong? Thank you

NativeAlertDialog freeze on iOS

My app freezes when calling NativeAlertDialog with extra labels.

I've tried debugging it, but I haven't managed to find a reason for the problem, only that it freezes when calling alert show...

iOS 7 - End Results Always Have Date and Time.

I'm currently trying to add a date only picker for an iOS 7 app. I've set the display mode as DATE. When I use it on the device only the date picker will show, which is good. However, when I click OK, the date I choose PLUS the current device's time is displayed in the text field.

var chosenDate:String;

protected function showDatePicker(e:MouseEvent):void
{
var d:NativeDatePickerDialog = new NativeDatePickerDialog();
d.addEventListener(NativeDialogEvent.CLOSED,onCloseDialog);
d.addEventListener(NativeDialogEvent.CANCELED,trace);
d.addEventListener(NativeDialogEvent.OPENED,trace);
d.addEventListener(Event.CHANGE,function(event:Event):void
{
var n:NativeDatePickerDialog = NativeDatePickerDialog(event.target);
chosenDate = String(n.date);
});
d.buttons = Vector. (["OK"]);
d.displayMode = NativeDatePickerDialog.DISPLAY_MODE_DATE;
d.title = "DatePicker";
d.message = "Select date:";
d.show(false);
}
private function onCloseDialog(event:NativeDialogEvent):void
{
var m:iNativeDialog = iNativeDialog(event.target);
m.removeEventListener(NativeDialogEvent.CLOSED,onCloseDialog);
trace(event);
m.dispose();//Must be called if not used again

        if (currentPage == 1 ){
            editPage.edit_date.text = chosenDate;
        }

}

Is there a parameter I'm missing? I've looked over the documents but I can not find anything that could make this happen.

Compile Error (Air for Android)

Hi all, I'm facing a problem when I'm trying to compile my project with NativeDialogs.ane

You can see error message below;
image

showAlert puts all entries into second button name

I have used showAlert for quite a while now, with the format of:

Vector.(["default","option1,option2,option3"])

Now, under iOS 7, all of the secondary options are placed into the second button name, instead of creating several buttons.

Is this something you know about?

error on ios 5.x version

I think that this ane has errors on ios 5.1.1 or under 6.0.
certainly, iOS 5.1.1

execute alert dialog -> it doesn't work.

Error Initiating Context of NativeAlergDialog extension: Error #1009 (Android 4.2.2)

We're trying to invoke a simple dialog:

if(NativeAlertDialog.isSupported) {
NativeAlertDialog.show("Welcome.", "Welcome Dialog", "Closing Dialog", "", onAdminDialogClose);
}

and get this error:

Error: [pl.mateuszmackowiak.nativeANE.dialogs.NativeAlertDialog] Error initiating contex of the NativeAlertDialog extension: Error #1009: Cannot access a property or method of a null object reference.
at AbstractNativeDialog.as:270
at pl.mateuszmackowiak.nativeANE.dialogs::NativeAlertDialog/init() [NativeAlertDialog.as:131]
at pl.mateuszmackowiak.nativeANE.dialogs::NativeAlertDialog()[NativeAlertDialog.as:120]
at pl.mateuszmackowiak.nativeANE.dialogs::NativeAlertDialog$/show()[NativeAlertDialog.as:330]

The error looks like it is being caught from line 128:

_context = ExtensionContext.createExtensionContext(EXTENSION_ID, "NativeAlertContext");

NativePickerDialog not displaying

Hi,

First of all thanks for your great work on these extensions.

I am trying to use the NativePickerDialog but nothing is displaying when i call the show() method. I'm successfully using the Toast and Progress classes though.

  • AIR 3.9
  • LG-P970
  • Andriod 2.2.2.

adb logcat:

D/[NativeDialogs]( 3256): Extension.createContext extId: PickerDialogContext
D/PickerDialogContext( 3256): Registering Extension Functions
I/dalvikvm( 3256): Could not find method android.app.AlertDialog$Builder.<init>,
 referenced from method pl.mateuszmackowiak.nativeANE.functoins.NativePickerDial
ogContext$PickerDialog.<init>
W/dalvikvm( 3256): VFY: unable to resolve direct method 192: Landroid/app/AlertD
ialog$Builder;.<init> (Landroid/content/Context;I)V
D/dalvikvm( 3256): VFY: replacing opcode 0x70 at 0x0006
D/dalvikvm( 3256): VFY: dead code 0x0009-001b in Lpl/mateuszmackowiak/nativeANE/
functoins/NativePickerDialogContext$PickerDialog;.<init> (Lpl/mateuszmackowiak/n
ativeANE/functoins/NativePickerDialogContext;Lcom/adobe/fre/FREContext;Landroid/
content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/adobe/fre/FREArray;[I[D
I)V

My code:

        public function show():void
        {
            const hours:PickerList = new PickerList(["1","2","3"], 1);
            const minutes:PickerList = new PickerList(["1", "2", "3"], 1);

            _picker = new NativePickerDialog();
            //_picker.title = "Select this!";
            //_picker.buttons
            _picker.dataProvider = Vector.<PickerList>([hours, minutes]);
            _picker.show(false);            

            Toast.show(NativePickerDialog.isSupported.toString());
        }

PickerList doesn't use labelField

Hello,
thanks for this awsome work !

In pickerList, the labelField isn't correctly handled, it's looking for the "labelField" String instead of the labelField property. (see dialogs/support/PickerList.as line 91).

Regards,
Alexis

AlertDialog isn't show Android 4.4

Sorry for my English.

I compiled ANE and use it in Flash PRO CC.

import pl.mateuszmackowiak.nativeANE.dialogs.NativeAlertDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.NativeDatePickerDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.NativeListDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.NativePickerDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.NativeProgressDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.NativeTextInputDialog;
import pl.mateuszmackowiak.nativeANE.dialogs.support.NativeTextField;
import pl.mateuszmackowiak.nativeANE.dialogs.support.PickerList;
import pl.mateuszmackowiak.nativeANE.dialogs.support.iNativeDialog;
import pl.mateuszmackowiak.nativeANE.events.NativeDialogEvent;
import pl.mateuszmackowiak.nativeANE.events.NativeDialogListEvent;
import pl.mateuszmackowiak.nativeANE.notifications.Toast;

NativeAlertDialog.showAlert("Test message", "Attention",Vector.(["OK","Cancel"]),closeAlert,false,-1);
function closeAlert(e:NativeDialogEvent):void{
var buttonPressed:String = e.index
}

and nothing..... no Errros... no Dialogs...

Android not built correctly

Hi,

I was looking into why your ANE context wasn't being found when working for android and I think it seems your ant script isn't building the jar files correctly.. When I unzipped and decompiled your NativeDialogsExtension class you can see:
"Unresolved compilation problems: String cannot be resolved to a type".

I have taken your source code and put it into my own ANE template, rebuilt it and it now seems to be working.

Good work on the ANE, but you might want to look over your build script.

Thanks
Matt

TextInput can't work.

input text => show NativeProgressDialog => hide NativeProgressDialog => next scene (there is a TextInput) => TextInput can't work. (keyboard does not work)

  • but, NativeAlertDialog.show() => TextInput can work.

Compilation problem

The ANE cannot be compiled, XCode tries to access some iOS/NativeDialogs/NativeDialogs/aneBuildBefore.sh file not present in the repository.

I see at the end it also tries to run aneBuildAfter.sh.

Compiling without running the scripts is successful although I don't know if this may cause problems, so are they really needed? the resulting ANE is around 500kb smaller.

NativeListDialog in IOS7

in ios7 doesn't show data (dataProvider).

var m:NativeListDialog = new NativeListDialog();
*m.title = "Title";
m.message = "Message";
m.buttons = Vector.<String>(["Cancel", "OK"]);
m.dataProvider = Vector.<Object>(["1","2","3","4"]);
m.displayMode = NativeListDialog.DISPLAY_MODE_SINGLE;
m.show();

Maybe I do something wrong?

NativeDialog limited to 2 buttons

Hi,

I moved from the old NativeAlert.show to NativeDialog.showAlert using AIR 3.8 on iOS. I'm putting 3 or 4 Strings in the buttons Vector, but the alert never shows more than 2. I've tested on iPad 2 and 3, iOS 5 and 6.

NativeAlertDialog.showAlert("myBody", "myTitle", new ["btn1", "btn2", "btn3", "btn4"], onLinkVariationDialogClick, false);

Thanks for your great extension and support!

Sander.

date and time setting only shows date

using the time and date code from the readme, displaymode is set to NativeDatePickerDialog.DISPLAY_MODE_DATE_AND_TIME, however I'm only seeing the date picker, no time (android 4.1.1)

I'm sure there must be something I'm missing...

NativePickerDialog selectedIndex not working? by multi set.

by iOS5.

selectedIndex working!

var _pickerDialog:NativePickerDialog = new NativePickerDialog();
var fruits:Vector.<String> = new Vector.<String>();
fruits[0] = "Apple";
fruits[1] = "Orange";
fruits[2] = "Strawberry";
var datas:Vector.<PickerList> = new Vector.<PickerList>();
datas[0] = new PickerList(fruits, 1);//selectedIndex = 1
_pickerDialog.dataProvider = datas;
_pickerDialog.show();

selectedIndex not working...

var pickerDialog:NativePickerDialog = new NativePickerDialog();
var fruits:Vector.<String> = new Vector.<String>();
fruits[0] = "Apple";
fruits[1] = "Orange";
fruits[2] = "Strawberry";
var datas:Vector.<PickerList> = new Vector.<PickerList>();
datas[0] = new PickerList(fruits, 1);//selectedIndex = 1
datas[1] = new PickerList(fruits, 0);//**
[ADDED 1 LINE]**_
_pickerDialog.dataProvider = datas;
_pickerDialog.show();

PickerList range error

Setting the selectedIndexes of a NativeListDialog causes the following error:

Exception fault: RangeError: Error #1125: The index xx is out of range xx.

The index that the error occurs on is always the exact length of the dataprovider which would be one too many if we're using zero based arrays.

var list : NativeListDialog = new NativeListDialog(1);
list.buttons = Vector. (["Done"]);
list.dataProvider = Vector.([{label:One"}, {label:Two"}, {label:Three"}]);
list.labelField = "label";
list.displayMode = NativeListDialog.DISPLAY_MODE_MULTIPLE;
list.selectedIndexes = Vector.([1, 2, 3]);
list.show();

E.g the above code would throw the following error:
Exception fault: RangeError: Error #1125: The index 3 is out of range 3.

I think the bug is possibly around line 377 of NativeListDialog.as:
_selectedIndex = value[0];
for (var j:int = 0; j < len; j++)
{
_selectedValues[j] = false;
}
for each (var val:int in value)
{
if(!isNaN(val) && val>0 && val<len){
_selectedValues[j] = true;
}
}

Shouldn't the second for loop be nested in the first one so that the j index is in scope?

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.