Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all 8068 articles
Browse latest View live

Application slow in devices

$
0
0

Hi all i had developed an application using titanium. well i face 2 major problems.

1.When i actually run it on device my application gets hang and it restarts automatically. sometime even the device restarts too. I had tested it on HTC M8, LG G3,Samsung S3,Samsung duos,Moto E,Micromax etc...

2.Font Size is killing me. this is what i wrote

if (Alloy.Globals.dpi > 100 && Alloy.Globals.dpi <= 160) {
        Ti.API.info("in 100dp and 160dp");
        Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 5) / 100);
        Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 3.5 ) / 100);
        Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 3.2) / 100);
        Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 2.8) / 100);
        Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 6 ) / 100);
    } else if (Alloy.Globals.dpi > 160 && Alloy.Globals.dpi <= 240) {
        Ti.API.info("in 160 and 240dp");
        Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 3) / 100);
        Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 2.5 ) / 100);
        Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 2) / 100);
        Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 1.5) / 100);
        Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 3.5 ) / 100);
    } else if (Alloy.Globals.dpi > 240 && Alloy.Globals.dpi < 480) {
        Ti.API.info("in grater 240dp");
        Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 2.3) / 100);
        Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 2 ) / 100);
        Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 1.5) / 100);
        Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 1.2) / 100);
        Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 2.8 ) / 100);
    } else if (Alloy.Globals.dpi >= 480 && Alloy.Globals.dpi < 550) {
        Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 1.8) / 100);
        Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 1.3 ) / 100);
        Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 0.9) / 100);
        Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 0.6) / 100);
        Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 2 ) / 100);
    } else if (Alloy.Globals.dpi >= 550) {
        Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 1) / 100);
        Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 0.9 ) / 100);
        Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 0.75) / 100);
        Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 0.5) / 100);
        Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 1.2 ) / 100);
    }
and the thing is it show tiny text in 4 inch and kind of medium text in 5 inch and so on.I mean to say is its not adjusting according to the screen size ahh... the font size is like tiny or huge devicess..

Getting this type of error Requested module not found

$
0
0

I have an error when I run my app in my android device (google nexus with Android 4.4), it shows me the following: [280,9] ti:/module.js Uncaught Error: Requested module not found: com.myvideoconvertor throw new Error(&quot;Requested module not found: " + request);

Titainim installation issue

$
0
0

1.Application type: mobile

2.Titanium:3.4.1.GA

3.Platform & version: Android x.x,

4.Device:Android emulator or Samsung Galaxy s3

5.Host Operating System: Windows 8.1

6.Titanium Studio: Titanium Studio, build: 3.4.1.201410281727 (c) Copyright 2012-2014 by Appcelerator, Inc. All rights reserved. Build: jenkins-titanium-rcp-master-202 (origin/master) Date: 28 October 2014, 17:28:23

Hey guys ive installed Titainum and i finaly got used to it, my question is when ever i compile a app via my s3 it installs, loads up.I believe it may be and issue with the way my Titainium is installed, however when ever i try to login from the app to the Api installed via my server. I keep geting the following error, (now i dont know how to paste these codes right like everyone else does so plz bear with me)

I believe ive provided accurate info

>[ERROR] : V8Exception: Exception occurred at ui/core/services/servicebase.js:1: Uncaught TypeError: Cannot read property 'ErrorMessage' of undefined [ERROR] : XMLModule: (KrollRuntimeThread) [52504,52504] Error parsing XML [ERROR] : XMLModule: org.xml.sax.SAXParseException: Unexpected token (position:TEXT []@1:3 in java.io.InputStreamReader@426131b0) [ERROR] : XMLModule: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) [ERROR] : XMLModule: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) [ERROR] : XMLModule: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) [ERROR] : XMLModule: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:68) [ERROR] : XMLModule: at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:700) [ERROR] : XMLModule: at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:107) [ERROR] : XMLModule: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] : XMLModule: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] : XMLModule: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1121) [ERROR] : XMLModule: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : XMLModule: at android.os.Looper.loop(Looper.java:137) [ERROR] : XMLModule: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TiHttpClient: (KrollRuntimeThread) [8,52512] Error parsing XML [ERROR] : TiHttpClient: org.xml.sax.SAXParseException: Unexpected token (position:TEXT []@1:3 in java.io.InputStreamReader@426131b0) [ERROR] : TiHttpClient: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) [ERROR] : TiHttpClient: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) [ERROR] : TiHttpClient: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) [ERROR] : TiHttpClient: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:68) [ERROR] : TiHttpClient: at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:700) [ERROR] : TiHttpClient: at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:107) [ERROR] : TiHttpClient: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] : TiHttpClient: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] : TiHttpClient: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1121) [ERROR] : TiHttpClient: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : TiHttpClient: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiHttpClient: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)>

View Height / Using Ti.UI.FILL without overly enlarging containing view

$
0
0

I have a scenario like this:

<View id="containingView" height="Ti.UI.SIZE" width="Ti.UI.FILL>
    <View id="thinLine" height="Ti.UI.FILL"  width="1px" left="20" />
    <View id="miscOtherContent" height="Ti.UI.SIZE" left="40" />
</View>
I wish for the height of the "containingView" to be determined by "miscOtherContent". But instead "thinLine" is making the "containingView" much larger than it has to be. Any ideas?

Get surrounding street name by google api json. Is it possible ?

$
0
0

Hi Guys,

Besides using google api to get own formatted address by using lat and lon. Did anyone try to get other street name/address which is nearby your current location ?

Thank you.

How to get nearby street address as well by using google api json

$
0
0

Hi Guys,

Besides using google api to get own formatted address by using lat and lon. Did anyone try to get other street name/address which is nearby your current location ?

Thank you

Tableview click event not firing if table is edited and scrollable is false

$
0
0

I'm having problems with a tableview click event not firing if the table is edited, for example by adding a row, and if scrollable=false.

The following code is a simple example. If the user makes a longpress on a row, then a new row is added. After the row has been added, the first click event (on any row) will not work. A second click will work.

Does anyone have any ideas if I'm doing something wrong, or if there is a workaround?

var win = Ti.UI.createWindow({backgroundColor:'white'});
var table = Ti.UI.createTableView({top:20,scrollable:false});
var tableData = [];
 
// Create some rows
for (var i=0; i<5; i++) {
    var row = Ti.UI.createTableViewRow({title:'Row '+i,myName:'Row '+i});
    tableData.push(row);
}
 
// Add the rows to the table
table.setData(tableData);
 
// Duplicate a row when the user makes a long press, and add the new row to the bottom of the table
table.addEventListener('longpress',function(e){
    var rowData = table.data[0].rows;        
    rowData.splice(rowData.length,0,rowData[e.index]);
    table.setData(rowData);     
});
 
// Test the click event
table.addEventListener('click',function(e) {
    alert(e.source.myName+' clicked');
});
 
 
win.add(table);
win.open();

Can I use AngularJs for implementing Dependency Injection in my application?

$
0
0
  1. Is this possible at all? Has this been tried before? Are there any other ways to implement DI in Titanium?
  2. What is the application seem in a Titanium Application which is the most appropriate place to bootstrap IOC and how? (I'm thinking the composition root should be in app.js)
  3. What are the implications of having DI implemented in a Ti App considering dependency lifetime management? i.e. possible performance/memory concerns, etc.

What I'd really like to do is to register platform specific implementations of a dependency in the composition root rather than having "if platform == android / ios" checks everywhere in code. This would ideally limit the platform checks to the composition root. Rather than DI, is there any other way to do it?


WebView: detect close event (Facebook login stucks app on blank page)

$
0
0

Hi,

I'm trying to build a very basic app (Android) and I need to include a (remote) mobile website with Facebook login. I do it with a WebView, and my website uses the FB JS SDK.

The user is indeed prompted for his credentials when hitting the FB button. Yet, this creates a new window (a popup on desktop), that closes itself once the user has authorized the app. But "closing" the popup in a webview actually means that the screen goes blank and nothing happens (except a weird warning in loop: Unsafe JavaScript attempt to access frame with URL http://my.website.me/ from frame with URL https://m.facebook.com/dialog/oauth?access_token=PTEE...&amp;app_id=XXX&amp;client_id=XXX&amp;display=touch&amp;domain=my.website.me&amp;e2e=%7B%7D&amp;origin=2&amp;redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2Fxx.js%3Fversion%3D41%23cb%3Dfxxx%26domain%3Dmy.website.me%26origin%3Dhttp%253A%252F%252Fsmy.website.me%2Fxxx%26relation%3Dopener%26frame%3Dxxx&amp;response_type=token%2Csigned_request&amp;scope=public_profile%2Cemail&amp;sdk=joey. Domains, protocols and ports must match.).

From there, I can hit the back button to return to my website but this is obviously an UX no-go.

So, I need either:

  • to detect the window.close event to redirect the user once he's logged in,
  • to find a better way to do this.

For the first option I can inject some JS in the FB login page with evalJS but I'm not sure how to transmit back the "I'm gonna close myself" event to Titanium. Docs say it's not possible but Titanium sees stuff happening on the webpage since my debug log shows the console.log output. So there is some kind of communication, how could I use it?

For the second option I'm open to any suggestion, of course!

The real goal here just being to log in with Facebook. (I don't want to use Titanium's Facebook API to pass some auth token to the website because if my user needs to share something later, the problem will be the same with the ShareDialog)

Thank you!

Textfield Magnifying Glass

$
0
0

magnify glass appears black , not all device in ios .

indian ?scort in dubai 971S28977676

$
0
0

indian ?scort in dubai 971S28977676

service based error

$
0
0

1.Application type: mobile

2.Titanium:3.4.1.GA

3.Platform & version: Android x.x,

4.Device:Android emulator or Samsung Galaxy s3

5.Host Operating System: Windows 8.1

6.Titanium Studio: Titanium Studio, build: 3.4.1.201410281727 (c) Copyright 2012-2014 by Appcelerator, Inc. All rights reserved. Build: jenkins-titanium-rcp-master-202 (origin/master) Date: 28 October 2014, 17:28:23

hey guys ive compiled and app and its ruunnig great however i have been having an issue with logining from my titanium based app, to the api on my sever. when ever i attempt to login with my credentials i get errors such as

[ERROR] : V8Exception: Exception occurred at ui/core/services/servicebase.js:1: Uncaught TypeError: Cannot read property 'ErrorMessage' of undefined
 
[ERROR] : XMLModule: (KrollRuntimeThread) [52504,52504] Error parsing XML 
 
[ERROR] : XMLModule: org.xml.sax.SAXParseException: Unexpected token (position:TEXT []@1:3 in java.io.InputStreamReader@426131b0)
 
[ERROR] : XMLModule: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) 
 
 
[ERROR] : XMLModule: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107)
and like a billion other errors including TiHTTPClient.java:700), more xml errors. So i ran a debug on titainium and according to the report, they are all tied and are related with my servicebased.js

ServiceBase.Request.POST.Ti.Network.createHTTPClient.onload() [servicebase.js:1]
ServiceBase.ErrorHandle.throwErrorMessage() [servicebase.js:1]
ServiceBase.Request.validateJsonError() [servicebase.js:1

I am new at this and am requesting help finding out how to go about fixing this.

Insert & update records using com.winwire.azuremobileservices

$
0
0

Hi,

I'm trying the Azure out with Titanium and found this tutorial. http://azure.microsoft.com/en-us/documentation/articles/partner-appcelerator-mobile-services-javascript-backend-appcelerator-get-started/

The tutorial is very badly documented by the way, but finally got it working for Android. For iOs not so much. I can retrieve records en delete them also, but Insert and Update calls go wrong.

The code below works perfectly for Android, but I get a HTTP error when using iOs.

var request = {
                    'text' : 'testvalue',
                    'complete' : true
                };
    Alloy.Globals.azureMobileServices.InsertTable(tableName, request, function(jsonResponse) {
 
        getData(function(ee) {
            //callback removed
        });
    }, function(errorMessage) {
        var errorJson = JSON.parse(JSON.stringify(errorMessage));
        alert(errorJson.error);
    });
Again I'm using this module : com.winwire.azuremobileservices

Did anyone see this before?

Thanks in advance!

Just made an chat app for Titanium!

Android Activity Lifecycle Callbacks: How to unset / clear them?

$
0
0

I read in the Titanium 3.4.0 changelog that activitiy lifecycle events are deprecated and callbacks should be used instead see changelog.

I was wondering if it is possible to remove a callback? I used to do the following:

activity.addEventListener('pause', stopRefresh);
// ... then at some point
activity.removeEventListener('pause', stopRefresh);
But so far I only have this:
activity.onPause(stopRefresh);
Is there any way to clear / remove a previously set callback?

isGooglePlayServicesAvailable NoClassDefFoundError

$
0
0

I'm building an app that previously worked on Android, showing maps on most devices. But now it crashes on this line:

var rc = require('ti.map').isGooglePlayServicesAvailable();

This gives the error below. I have tried a number of recommendations from this forum, without success. My setup is as follows:

  • Ti Studio 3.4.1.201410281727 on Mac OS 10.10
  • Ti SDK from 3.3.0 to 3.4.1 gives the same result
  • I have updated all my Android SDKs to the latest versions
  • I have a valid Google Maps API Key (unchanged since the last version, which is on Google Play)
  • I don't know the difference between a development API key and production, I only have the one key, but this problem happens when installed via USB or from HockeyApp
  • the devices I'm testing have the latest Google Play Services installed, and are all running Android 2.x or 3.x
  • ti.map is version 2.1.4 (the latest for Android)
  • I am creating the map view in code, not in the Alloy view:

var mapview = Map.createView({mapType:Map.NORMAL_TYPE});

Any ideas?

[INFO] :   dalvikvm: Could not find method com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable, referenced from method ti.map.MapModule.isGooglePlayServicesAvailable
[WARN] :   dalvikvm: VFY: unable to resolve static method 9651: Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
[INFO] :   about to test Alloy.Globals.Map.isGooglePlayServicesAvailable = function isGooglePlayServicesAvailable() { [native code] }
[WARN] :   W/System.err: java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil
[WARN] :   W/System.err:    at ti.map.MapModule.isGooglePlayServicesAvailable(MapModule.java:74)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107)
[WARN] :   W/System.err:    at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347)
[WARN] :   W/System.err:    at android.os.Handler.dispatchMessage(Handler.java:95)
[WARN] :   W/System.err:    at android.os.Looper.loop(Looper.java:132)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[ERROR] :  isGooglePlayServicesAvailable error: Error: com.google.android.gms.common.GooglePlayServicesUtil

Push notification unable to send Extra Intent ( Android )

$
0
0

Hello

I've problem with send/receive Extra intent , when i send push notification and use click on it application should open with alert dialog ( notification text content )

this is push notification code

var intent = Ti.Android.createIntent({ flags : Ti.Android.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP, // className:'com.dowgroup.pushapps.PushAppsActivity', action : Ti.Android.ACTION_MAIN, url : 'app.js', }); intent.addCategory(Ti.Android.CATEGORY_LAUNCHER); //intent.putExtra(Ti.Android.EXTRA_TEXT, "notification"); intent.putExtra("test", "test"); intent.putExtra('interval', 5000); intent.putExtra('timestamp', new Date(new Date().getTime() + 30 * 1000));

        var activity = Ti.Android.currentActivity;

        // Create a PendingIntent to tie together the Activity and Intent
        var pending = Titanium.Android.createPendingIntent({
                      intent : intent,
                      activity:activity,
                      flags : Titanium.Android.FLAG_UPDATE_CURRENT
                      });
        // Create the notification
        var notification = Titanium.Android.createNotification({
            // icon is passed as an Android resource ID -- see Ti.App.Android.R.
            icon: Ti.App.Android.R.drawable.appicon,
            flags : Titanium.Android.ACTION_DEFAULT | Titanium.Android.FLAG_AUTO_CANCEL | Titanium.Android.FLAG_SHOW_LIGHTS,
            contentTitle: e.data.title,
            contentText:e.data.message,
            contentIntent : pending,
            tickerText : e.data.ticker,
            defaults:Ti.Android.NotificationManager.DEFAULT_SOUND
        });
        // Send the notification.
        Titanium.Android.NotificationManager.notify(e.data.pushid, notification);
        alert(e.data.message); 

and this is app.js

var act = Titanium.Android.currentActivity;

alert("-- ---= "+JSON.stringify(act));

the problem is data become Null , i can't catch ( test ) or any extra object key send

any advice ?

TableView with equally spaced cells

$
0
0

Hi, I want to add equally spaced labels to a tableview for header and content like an excel list. But somehow the header seems to behave different than the content. The header starts left, but the content is shifted to the right. What is the correct code to do this?

app.tss

".LabelCell" : {
    top : Alloy.Globals.Style.p2,
    font: {
        fontSize: Alloy.Globals.Style.FontSize,
    },  
    bottom : Alloy.Globals.Style.p2,
    textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
    left:Alloy.Globals.Style.p5,
    width : Alloy.Globals.Style.p25,
    height: Ti.UI.SIZE,
}
".rowView" : {
    width: Ti.UI.SIZE,
    height: Ti.UI.SIZE, 
    layout : "horizontal",
} 
 
".headerView" : {
    width: Ti.UI.SIZE,
    height: Alloy.Globals.Style.p9, 
    layout : "horizontal",
    backgroundColor:"#86bad9",
} 
".tableViewGames" : {
    width: Alloy.Globals.Style.TableViewWidth,
    height: Ti.UI.SIZE,
    scrollable : false,
}
addPlayers.xml
<Alloy>
    <Window>    
        <ScrollView>
            <View>
                <View id="playersView" class="groupView">
                    <TableView id="players" class="tableViewGames"/>
                </View>
            </View>
        </ScrollView>
    </Window>
</Alloy>
addPlayer.js
var addRow=function(name,join) {
    var row = Ti.UI.createTableViewRow();
    row.hor = $.UI.create('View',{
        classes: 'rowView',
    });
    row.add(row.hor);
    row.nameLabel= $.UI.create('Label',{    
        classes: "LabelCell",
        text : name,
    });
    row.hor.add(row.nameLabel);
    row.statusLabel= $.UI.create('Label',{  
        classes: "LabelCell",
        text : join,
    });
    row.hor.add(row.statusLabel);
 
    return row; 
};
 
        var section = Ti.UI.createTableViewSection();
        var hor=$.UI.create('View',{
        classes: 'headerView',
        });
        var nameLabel= $.UI.create('Label',{    
            classes: "LabelCell",
            text : 'Name',
        });
        hor.add(nameLabel);
        var statusLabel= $.UI.create('Label',{  
            classes: "LabelCell",
            text : 'Status',
        });
        hor.add(statusLabel);
 
        section.headerView=hor;
        dataPlayers.push(section);
 
        var i=0;
        for (var user_id in status.users) {
            var user=status.users[user_id];
 
            var row=addRow(user.name,status.users[user_id].join);
            dataPlayers.push(row);
 
            i++;
        } 
        for (var r=0;r<status.random;r++) {
            var row=addRow('random','waiting');
            dataPlayers.push(row);
 
            i++;
        }
 
        $.players.setData(dataPlayers);

Issue in calling onfocus method from tab after opening child window of any other tab

$
0
0

I have upgraded my titanium from 3.1.3 to 3.4.1 earlier I was using Navigation Group but since its deprecated so I changed it to Navigation Window.

I have four tabs in my application and every tab has child windows, which I am opening from tab itself since tab has navigation controller.

My fourth tab is login tab and on that tab I check that user is currently logged in or not. After checking I am showing either of the two navigation windows

1) Login_Form 2) Mobile Services

So my query is when I am trying to go on login tab without opening window from any of the tab it’s showing the navigation window. But I when try to open Navigation Window after opening any of the window its not opening.

I think on focus event is not calling after one of the tab open its child window

Index.xml

<Alloy>
    <TabGroup id="TabGroup"  > 
        <Tab title="Home" id="homeTab" icon="Images/home.png"    >
            <Window>
                ..........
            </Window>
        </Tab>
 
        <Tab title="Contact Us" id="AboutUsTab"  icon="Images/contactus.png" >
                <Window>
                ..........
            </Window>
        </Tab>
 
        <Tab title="Currency Converter" id="ProductsTab" icon="Images/currencyconverter.png"  onFocus="initiateCC" >
            <Window>
        </Window>
 
    </Tab>
 
    <Tab title="Services" id="LoginTab" onFocus="checkSession"  onSingletap="checkSession" icon="Images/services.png" statusBarStyle="Ti.UI.iPhone.StatusBar.LIGHT_CONTENT">
            <Window id="logWin" title="Offers" barImage="Images/IPhone-retina_Header01.png" backgroundImage="Images/LoginScreen.png" backgroundRepeat="false">
            <TitleControl>
                    <Label id="titleControl" color="white">LOGIN</Label>
                </TitleControl>
 
                       -------
            /*
            THE ISSUE IS IN THIS WINDOW. WHEN I TRY TO CALL ONFOCUS METHOD OF THIS TAB AFTER GOING TO THE CHILD WINDOW OF ANY OTHER TAB, IT IS SHOWING THE ABOVE WINDOW INSIDE THE TAB WHICH HAS ONLY TITLE CONTROL.
 
IF I COME DIRECTLY TO THIS TAB ITS CALLING THE ONFOCUS "CHECKSESSION" METHOD AND OPEN THE NAVIGATION WINDOW AS PER MY REQUIREMENT. 
 
ITS ALSO WORKING WHEN I SWITCH BETWEEN THE TABS WITHOUT GOING TO THE CHILD WINDOW OF ANY TAB.
 
            */
            </Window>
        </Tab>
 
    </TabGroup>
</Alloy>
index.js
function checkSession(){
 
    $.TabGroup.setActiveTab(0);
    if (AppData.isLoggedIn()) {
        var serviceController = Alloy.createController("mobileServices");
        serviceController.getView().open();
    }
    else 
    {
        var loginController = Alloy.createController('login_form');
        loginController.getView().open();
    }
}
login_form.js
<Alloy>
 
    <NavigationWindow id="navgroupLogin" platform="ios" > 
 
    <Window id="loginForm" title="" navTintColor="white" fullscreen="false" barImage="Images/IPhone-retina_Header01.png" backgroundImage="Images/LoginScreen.png" backgroundRepeat="false" onFocus="initiateUserName" statusBarStyle="Ti.UI.iPhone.StatusBar.LIGHT_CONTENT"> <!--modal="true"-->
 
    <TitleControl>
            <Label id="titleControl" color="white">LOGIN</Label>
    </TitleControl>
 
 
  </Window>
  </NavigationWindow>
 
</Alloy>
mobileservices.js
<Alloy>
    <NavigationWindow id="navgroup" platform="ios">  
    <Window id="ServicesWin" title="" navTintColor="white"  onFocus="Authenticate"   modal="true" barImage="Images/IPhone-retina_Header01.png" backgroundImage="Images/LoginScreen.png" backgroundRepeat="false" statusBarStyle="Ti.UI.iPhone.StatusBar.LIGHT_CONTENT" >
 
         <TitleControl>
            <Label id="titleControl" >SERVICES</Label>
        </TitleControl>
    </Window>
    </NavigationWindow>
 
</Alloy>

TabGroup's Ti.UI.currentTab.open visual glitch on iOS

$
0
0

We have a TabGroup component that has navBarHidden = &quot;true&quot;. On particular action a Window is open via Ti.UI.currentTab.open. When this happens (as well as the window is closed) a visual glitch appear on top; see screenshots (it was bit difficult to capture it).

Viewing all 8068 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>