Editor Integration Image Landscape - Portrait - shutterstock

Hello I've an image that is portrait, but when i open it the editor shows it in landscape, how to tell the editor to leave portrait or landscape untouched?
My current config:
var visualImageEditorConfig = {
logo: true,
logoUrl: urlPrefix + '/img/LogoEBSfondoGrigino.png',
language: 'it’,
primaryActionText: commonMessages.lblImageVisualEditorSaveButton,
env: 'prod',
};

Related

titanium ti.paint toimage() is returning {} after drawing on ios

the following code is resulting in to different outputs different android and ios. myBlob below is {} on ios - the image is empty even after drawing on the screen. in Android it an object with properties and is working fine, but iOS the image is always blank.
This was working before in past ios versions and builds so am I not building it right? We are using 5.3.0 GA for titanium SDK. I have the module checked for iOS in the TiApp Editor.
function uploadImage(signed) {
if (signed) {
var myBlob;
try {
myBlob = $.viewPaint.toImage();
var myImage = Titanium.Utils.base64encode(myBlob).toString();
$.nextAction.image = myImage;
} catch (ex) {
Titanium.API.error('FAILURE HANDLING SIGNATURE DOCUMENT: ' + ex);
return;
}
}
$.nextAction.perform(Alloy.Globals.requests);
}
Ti Paint Module for iPhone
#
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 1.4.0
apiversion: 2
architectures: armv7 i386 x86_64 arm64
description: Provides a paint surface user interface view.
author: Jeff Haynie
license: Appcelerator Commercial License
copyright: Copyright (c) 2010-2014 by Appcelerator, Inc.
# these should not be edited
name: paint
moduleid: ti.paint
guid: 43f13063-d426-4e9c-8a7a-72dc5e4aec57
platform: iphone
minsdk: 3.4.1.GA
prior code that adds execute to action object
var route = action.action.uri;
Ti.API.info('route = ' + route);
newAction.execute = function(requestManager) {
Titanium.App.fireEvent('app:index:view:requested',
controller : 'signscreen',
uri : route
});
};
code that fires the event to open:
Titanium.App.fireEvent('app:index:view:requested', {
controller : 'signature'
});
if you have anything in your view hierarchy that overlays your paintview such as a confirmation dialog or closing the view in a navigation controller and not grabbing your paintview prior to the window closing the paintview will always return empty. android will continue to work fine but ios will not as the view is not present in the view hierarchy.
Your console log value of {} is a red herring.
Tested on:
TiSDK 5.2.2.GA, 5.3.0.GA
ti.paint: 1.4.0, 1.4.1 (our version with fixes that have been ignored by appc)
With <run-on-main-thread>false</run-on-main-thread> in tiapp.xml
Using the example app.js from the module and adding the following:
var buttonSave = Ti.UI.createButton({ bottom:100, right:10, width:75, height:30, title:'Save' });
buttonSave.addEventListener('click', function(e){
var test = paintView.toImage();
console.log(test.length);
console.log(paintView.toImage());
var imageFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,"testing.png");
imageFile.write(paintView.toImage());
});
win.add(buttonSave)
You will find that
The logged value always will be {}
The length of the object you assigned toImage() to increases as you add pixels to your paintView
The image DOES get written to a file.

Disable branch.io smart banner for non-ios and non-android platforms?

Is there a way to disable branch.io smart banner for all non-ios and non-android platforms?
For eg. disabling smart banner for windows, blackberry etc.
Alex from Branch.io here: sure is! Take a look at the parameters here.
branch.banner({
icon: 'http://icons.iconarchive.com/icons/wineass/ios7-redesign/512/Appstore-icon.png',
title: 'Branch Demo App',
description: 'The Branch demo app!',
rating: 5, // Displays a star rating out of 5. Supports half stars through increments of .5
reviewCount: 1500, // Amount of reviews your app has received next to the star rating
openAppButtonText: 'Open', // Text to show on button if the user has the app installed
downloadAppButtonText: 'Download', // Text to show on button if the user does not have the app installed
sendLinkText: 'Send Link', // Text to show on desktop button to allow users to text themselves the app
phonePreviewText: '+44 9999-9999', // The default phone placeholder is a US format number, localize the placeholder number with a custom placeholder with this option
showiOS: true, // Should the banner be shown on iOS devices (both iPhones and iPads)?
showiPad: true, // Should the banner be shown on iPads (this overrides showiOS)?
showAndroid: true, // Should the banner be shown on Android devices?
showBlackberry: true, // Should the banner be shown on Blackberry devices?
showWindowsPhone: true, // Should the banner be shown on Windows Phone devices?
showKindle: true, // Should the banner be shown on Kindle devices?
showDesktop: true, // Should the banner be shown on desktop devices?
iframe: true, // Show banner in an iframe, recomended to isolate Branch banner CSS
disableHide: false, // Should the user have the ability to hide the banner? (show's X on left side)
forgetHide: false, // Should we show the banner after the user closes it? Can be set to true, or an integer to show again after X days
respectDNT: false, // Should we skip showing the banner when a user's settings show 'Do Not Track'?
mobileSticky: false, // Determines whether the mobile banner will be set `position: fixed;` (sticky) or `position: absolute;`, defaults to false *this property only applies when the banner position is 'top'
desktopSticky: true, // Determines whether the desktop banner will be set `position: fixed;` (sticky) or `position: absolute;`, defaults to true *this property only applies when the banner position is 'top'
make_new_link: false, // Should the banner create a new link, even if a link already exists?
open_app: false, // Should the banner try to open the app passively (without the user actively clicking) on load?
}, {
tags: ['tag1', 'tag2'],
feature: 'dashboard',
stage: 'new user',
data: {
mydata: 'something',
foo: 'bar',
'$deeplink_path': 'open/item/1234'
}
});

Do we really need to explicitly add Sencha View to Viewport?

In all the examples on Sencha Touch 2 I see code samples like:-
//contents of app.js
Ext.application({
name: 'MyApp',
views: ['MyView'],
launch: function() {
Ext.create('MyApp.view.MyView');
}
});
However, the code generated by Sencha Cmd is like:-
//contents of app.js
Ext.application({
name: 'MyApp',
views: ['MyView'],
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
Ext.Viewport.add(Ext.create('MyApp.view.MyView')); // <--- NOTICE THIS LINE
}
});
Notice that the example code did not add the newly instantiated View to Viewport but the actual code did. Are both codes equivalent? In the example code, how will the View add itself to the Viewport or that is optional?
Ext.Viewport is basically a container with the layout set as 'card'.
In your first sample, the class should have the config option 'fullscreen' set to true.
Setting fullscreen:true will automatically add the comoponent to the viewport when an instance is created.
Ext.define('MyApp.view.test', {
extend: 'Ext.Container',
config: {
fullscreen:true,
html: ['screen2'].join("")
}
});
Ext.create('MyApp.view.test');
From the doc for fullscreen
Force the component to take up 100% width and height available, by
adding it to Ext.Viewport.
In the second sample, a component is added to the viewport. (Don't need the fullscreen option). Like adding a panel into a container.
Ext.define('MyApp.view.home', {
extend: 'Ext.Container',
xtype: 'homecontainer',
config: {
html: ['test'].join("")
}
});
Ext.Viewport.add(Ext.create('MyApp.view.home'));
From the doc for viewport
Because Ext.Viewport extends from Ext.Container, it has as layout
(which defaults to Ext.layout.Card). This means you can add items to
it at any time, from anywhere in your code. The Ext.Viewport
fullscreen configuration is true by default, so it will take up your
whole screen.

Sencha Touch: dialing phone number from sencha application

We created a telephone directory Sencha touch mobile application for our company. We have a requirement to dial a employee by tapping the phone number in the employee details screen which should trigger dialing the phone. To achieve the same we used the code highlighted in green color which works in iOS and Andorid Icecream (Tested in older version of Samsung) but failing in Jellybean OS.
Can someone help us how to overcome this or what is the best way to make it work in all the devices.
Ext.Viewport.setActiveItem({ xtype: 'adminstaffdetailview', styleHtmlContent: true, html: adminStaffDetailsTemplate,
listeners: {
tap: function( tap, element ){
if(tap.delegatedTarget.id == 'rowPhoneTap'){
window.location = "wtai://wp/mc;[" + tap.delegatedTarget.innerText.trim() + "]";
}
},
element: 'element',
delegate: 'tr'
}});
Ext.Viewport.unmask();
}
Why not using a link with tel protocol instead of a window location to call ?
You need to set data to your tpl (phone_number)
Ext.Viewport.setActiveItem({
xtype: 'adminstaffdetailview',
styleHtmlContent: true,
tpl: ['call'], // your template adminStaffDetailsTemplate,
});

sencha Touch Card layout not working properly

Iam using sencha touch for building mobile application, Ia m using card layout switch in my tab panel. sometimes the card layout is not working properly. Please help me regarding this.
App.views.TabPanelView = Ext.extend(Ext.TabPanel, {
cardSwitchAnimation: {
type: 'slide',
cover: true
},
defaults: {
scroll: 'horizontal'
},
items: [item1, item2,item3,item4,item5]
}
}
First you should change horizantal to horizontal
simple Just Put cover: false in your cardSwitchAnimation. Hope it works