How to make loadingscreen in center in kony - temenos-quantum

I am developing desktop application using kony framework. while login my loader is not appearing in center. its just loading in right side. please help me.

You can set your loading screen by following :
kony.application.showLoadingScreen(skin, text, position, isBlocked, showProgressIndicator, properties)
where the position is given as constants.LOADING_SCREEN_POSITION_ONLY_CENTER which will display the loading screen only at the center. By default it would be full screen constants.LOADING_SCREEN_POSITION_FULL_SCREEN

Use the below method to show loadingscreen in center:
function showLoadingScreen(){
kony.application.showLoadingScreen(null, "Please wait...",
constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true, {
shouldShowLabelInBottom: "true", separatorHeight: 30} )
}

kony.application.showLoadingScreen("", "", constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true, null);

Related

Titanium iOS App crashes after taking 25+ images with the camera

I am working on titanium app that is using camera for taking pictures. After taking around 15+ pictures the app will crash. I found the same problem reported on Appcelerator Titanium side https://jira.appcelerator.org/browse/TIMOB-24389, https://jira.appcelerator.org/browse/AC-6225 but I cannot see a solution there. I tried what is suggested there but that is not fixing the problem.
Here is also some simple app.
Steps:
1.Click "Add photo" button
2.Take picture
3.Click "Use Photo"
4.Repeat steps 15+ times.
App crashes during the process of taking picture.
Tested with different devices and different Titanium SDKs, it can be reproduced every time.
var win = Ti.UI.createWindow({});
var view = Ti.UI.createView({});
var button = Ti.UI.createButton({
color : '#000000',
title : "Add photo",
height : 'auto',
width : 'auto'
});
view.add(button);
button.addEventListener('click', function(e) {
showCamera();
});
function showCamera() {
Titanium.Media.showCamera({
showControls : true,
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
autorotate : true,
success : function(event) {
},
error : function(error) {
},
cancel : function() {
}
});
}
win.add(view);
win.open();
Does anyone know some workaround how can I avoid this crashing?
Thanks.
I used to have this SAME issue for a long time.
For iOS, you’ll need to set the <use-jscore-framework> flag to true in the tiapp.xml file.
This flag is enabled by default in Titanium SDK 7.0.0 and later.
https://jira.appcelerator.org/browse/TIMOB-24206

electron app always placed at the top with full-width and other windows should be placed under it

I am facing an issue.
I need my electron app always placed at the top with full-width and other windows should be placed under it.
How can I do this?
anyone can help me to solve this issue?
You should use mainWindow.maximize() to display full width screen.
function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1366,
height: 783,
alwaysOnTop:true //display show on top
})
// and load the index.html of the app.
mainWindow.loadFile('index.html');
// Emitted when the window is closed.
mainWindow.on('closed', function () {
mainWindow = null
})
mainWindow.maximize() //call like this way
}
You can get more reference from here

Adding a new view on top in NativeScript

Anyone got a tip how to add a View over the current view (modal)? I'm creating an app with a video recorder, and the video screen is presented modally on the screen. I want some text to show up above the video modal, and I think I've tried any approach I can think of atm.
Currently im stuck with something like:
var topMost = frameModule.topmost();
var View = new ViewModule.View(questionHolder);
topMost.currentPage._addView(View, 0);
But with no success. questionHolder is a view I fetch with
currentpage.getViewById
Edit:
From the answer of #davecoffin where I understood you could not mix native views and nativescripts views, I was able to solve this in my case by accessing the native view directly and adding a subview to it. In my case:
var sharedApplication = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
var overlay = UIView.alloc().initWithFrame({
origin : {
x: 0,
y: 44,
},
size: {
height: 100,
width: platform.screen.mainScreen.widthPixels
}
});
overlay.backgroundColor = UIColor.blackColor;
overlay.alpha = .6;
sharedApplication.keyWindow.rootViewController.presentedViewController.cameraOverlayView = overlay;
You can directly create and use modal pages as described in this article.
If I am understanding your approach correctly...
You cant add Nativescript views on top of native views.
Check out this forum question: https://discourse.nativescript.org/t/appending-nativescript-views-to-a-native-ui-view/1412
Basically once you have appended a native view (not a nativescript layout or ui view), then every view you append after that must be a native view. For iOS you use addSubview, not sure about android atm.

mmenu open in desktop, closed in mobile, just like demo site

I would like the mmenu panel to be automatically opened in desktop mode, but only the menu icon to show in phone mode just like in the demo site http://mmenu.frebsite.nl/
I know I am not too bright but I can't find the answer in the documentation or in stack overflow. Please help
This is what I am doing.
$(document).ready(function() {
var mq = window.matchMedia( "(min-width: 800px)" );
if (mq.matches) {
$("#menu").mmenu({
offCanvas: false
});
} else {
// window width is less than 800px
}
});
But it feels a little clumsy and it doesn't resize dynamically, just with a refresh.

How to change the message box button content according to the language selected by user in windows phone 8

I'm developing windows phone 8 application and this application should work in two languages English and Arabic.
In some screens I'm showing the message box with some message and buttons(OK, CANCEL).
When the application is in English the buttons content (OK and CANCEL) is displaying in English. It is fine.
But when the application is running in Arabic language, then the Buttons content is not displaying in Arabic.It is showing in English only
How should I change the buttons content based on the language.
Thanks
You should use Windows Phone toolkit CustomMessageBox control.
It can be easily localized:
CustomMessageBox messageBox = new CustomMessageBox()
{
Caption = "Do you like this sample?",
Message = "There are tons of things you can do using custom message boxes. To learn more, be sure to check out the source code at Codeplex.",
LeftButtonContent = "yes",
RightButtonContent = "no",
IsFullScreen = (bool)FullScreenCheckBox.IsChecked
};
In Windows Phone 8, you have access to Microsoft.Xna.Framework.GameServices which has a much more versatile message box you can use and no need to download a separate library.
IAsyncResult result = Microsoft.Xna.Framework.GamerServices.Guide.BeginShowMessageBox(
AppResources.SmsConfirmText,
"",
new string[] { AppResources.OkText, AppResources.CancelText },
0,
Microsoft.Xna.Framework.GamerServices.MessageBoxIcon.None,
null,
null);
// Include following line if you want it to be synchronous
result.AsyncWaitHandle.WaitOne();
int? choice = Microsoft.Xna.Framework.GamerServices.Guide.EndShowMessageBox(result);
if(choice.HasValue)
{
if(choice.Value==0)
{
// User clicked on the first button: AppResources.OkText
}
else if(choice.Value==1)
{
// User clicked on the second button: AppResources.CancelText
}
}
Source: http://developer.nokia.com/community/wiki/Advanced_MessageBox_for_Windows_Phone

Resources