How to separately style HTML5 apps using the Sencha framework for iOS and Android? - sencha-architect

App development in native Apps happens separately for iPhone and Android. But in HTML5 Sencha framework apps, the same HTML5 code is used. Should we use same visual styling for alert boxes or buttons for both platforms or should they look different depending on the platform?
Since the same HTML5 code is used, how do you to take care of different look and feel for both platforms? For example, the menu bar is at bottom for iPhone and for android it is at the top. Or for Android we need to hide the top back button Or how to style the alert boxes or buttons differently for both platforms?
Do we need to use different set of CSS files for iOS and for An?
I was going thru the kitchen sync Sencha application and it shows a very basic styling for alert boxes.

You can use the iOS/Android classes that Sencha Touch will add when detecting user agent. For example, if the device is running iOS the body element has the class "x-ios". For android it will be "x-android". This also applies for specific OS versions (ex: "x-ios-4"). Try overriding your user agent in Chrome and inspect the elements under different agents to get an understanding of the classes. Using these classes you can avoid multiple stylesheets and just set up the CSS accordingly depending on the class.
As for specific layout tweaks that cannot be performed with simple CSS - this is where profiles come into play (http://docs.sencha.com/touch/2-1/#!/api/Ext.app.Profile). Set up a profile for Android and iOS, and use the launch function to manipulate specific components as needed.
Using these methods you should be able to keep things organized and minimize the number of separate files needed.

Related

Display pdf document in flutter windows

I have been finding it difficult to display a pdf on flutter windows and other desktop applications. Can someone help me out
This is the same as this question, but for Windows, so the answer is the same at a high level. As with Linux, PlatformView is not yet supported for Windows.
Two options that could work without PlatformView support:
Swap the window between displaying the Flutter view and a PDF view (if you want the PDF to fill the window while displayed).
Place the Flutter view and the PDF view side by side in the window (if you want both Flutter content and PDF content visible at the same time).
Both would require the work to be done in the native code, so you would need to either write a plugin, or implement it directly in your runner, and use a method channel to coordinate between Dart and native code.

Rotate screen orientation on Web App Tizen [TV]

I'm developing a Web Application on Tizen. My application was first developed on other platforms like iOS and Android.
Basically it starts on Landscape mode and plays remote content such as image, video or opens a web page. It has a menu inside the app to offer people the ability to change the screen orientation inside the app manually.
This approach is quite easy on iOS and Android but on Tizen seems it doesn't work that easy.
I'm following Tizen's official documentation which send's us to : https://w3c.github.io/screen-orientation/
But, can't make it work even though I followed steps written on the link above.
This is what I got when I try to rotate:
Trying with :
screen.orientation.lock('portrait-primary')
Error :
Promise {}
index.html:1 Uncaught (in promise) DOMException: The page needs to be fullscreen in order to call screen.orientation.lock().
P.S. The app is already in fullscreen. The error is not relevant.
Do you have any ideas ?
Thank you
For all to those who are still trying to achieve this:
After having a long discussion with Samsung, they claimed that supporting the TV orientation via code is not possible right now (Not sure if it's gonna be implemented in the future).
These restrictions come due to different operability of the hardware components on different orientation.
The only way to rotate your screen is to do it via Samsung's TV Settings so that it can prepare its hardware for the chosen orientation.
There are a special Samsung TVs for Advertising market (Digital Signage series) that are ready to set the orientation of the screen.
I comercial Samsung TV sets Tizen is not able to rotate some kind of elements (as far I know the video object are one of the HTML elements that cannot be rotated)
I've developed some apps for Tizen and for one customer I tried to make a video wall but it was impossible due the firmware limitation of Tizen (it's a marketing strategy in order to avoid having hotel and digital signage capabilities in commercial TV sets)

How to disable resize button in winjs

I'm developing windows 10 cordova application and for native integration we should use WinJS. I would like to know below things in Winjs app.
How to disable resize button in app control bar?
How to set maximum windows during application load?
There is no way in UWP to manipulate with windowing buttons (e.g. disable them). To control window size you can use the following three methods:
setPrefferedMinSize to define minimum window size (up to 500x500px).
tryResizeView to manually attempt to resize windows to desired size.
tryEnterFullScreenMode to place app in full-screen mode.
There is a code sample on GitHub for these methods, including JS.

Access system icons with NodeJS

I'm developing a HTML5 app with node-webkit.
I want my application to follow the icon theme of the host computer that runs it (primarly Linux hosts).
Frameworks such as GTK+ or QT successfully find the corresponding icon of a standard stock (such as NEW_FILE) based on the user's theme.
GTK icons theme are installed at $HOME/.icons or /usr/share/icons and icons theme share a common directory structure.
But is it any rule or algorithm to get an exact icon?
How can I look up a (NEW_FILE, SAVE_FILE or whatever) stock icon within the users theme?
I'm quite lost with this.
You could look in the source code for GTK+ or QT and see how they determine the right icons?

Embed browsers components

Is there an application that lets you pack it with a bunch of html files and it will render them? Basically, I want an app that all it does is that it has an embedded browser, and I can pack it with my files. Is there such thing?
It would be nice if it was cross-platform or offered additional APIs.
My end goal is I wanna build an app that produces html and then compiles it and gives it to the user.
One solution is to use Opera Widgets, my app can build the html files, and then pack it as a desktop widget. But that requires user to have Opera installed. It would be nice if there was an embedded browser solution.
Try Adobe Air. It is basically a JS-heavy application packed in a platfrom-independent package. Also includes a WebKit-compatible browser.
May be less or more than what you need.

Resources