Transforming devices or “2 in 1” (tablet + ultrabook) have not yet become mainstream, but are already popular with users who want to get the most universal solution for the widest possible range of tasks. However, from the point of view of software developers, this class of gadgets had one unpleasant feature: if the touch interface was already well studied and tested, then adaptability, that is, the ability to determine the current state of the transformer and adjust the application interface accordingly, was not implemented before and therefore needed an independent invention.
In this post we will describe how the creators of the graphical editor Krita Gemini handled the solution of this problem.
And at its end - Intel's tempting offer for all software developers for 2 in 1 devices. You have the opportunity to get the latest transformer for business needs for free!
The 2 in 1 devices can switch between tablet and laptop modes in different ways; Similarly, you can create a program so that it responds in different ways to switching modes. In some cases, in tablet mode, you should keep the user interface as close as possible to the laptop mode; in other cases, you can make quite significant changes. Intel cooperates with many suppliers to help them implement different modes of operation of transformers in their applications.
Gemini developers have tried to maximize the use of all interface features in both modes of operation. The figures below show that the user interface in two modes is very different. This allows the user to smoothly move from drawing “in the field” in tablet mode to retouching and working out more subtle details in laptop mode.
Krita Gemini user interface in tablet mode
')
Krita Gemini user interface in laptop mode
For automatic switching, it is required to determine the state of the sensor, monitor it and perform the appropriate actions under a known state. In addition, for the convenience of users, you should add the ability to switch modes of the application manually.
Not all computers with touch controls support automatic switching, so we recommend adding a button to the application that allows users to manually switch the application's operating modes. The Gemini button is shown. Changing the user interface at the touch of a button is the same as when a mechanical sensor is triggered. Information on the screen and the default input device will change from the touch screen and large icons in tablet mode to keyboard, mouse, and small icons in laptop mode. However, since the sensor did not work, the method using the button should change the default settings for the screen, icons and input device without obtaining data on the sensor status.
Switch to Sketch switch button - switching to tablet mode is initiated by the user
The definition of the Kaction () button, its states and actions are shown in the code below:
Then the developers started processing the events that were switched by the button. First you need to check the last known state of the system, then the mode changes:
The Krita application code for controlling the switching between modes can be found in the source code of this application by searching for the word SlateMode. The Krita program is distributed under the terms of the GNU Public License. For the latest information, see
the source code repository .
You can read the full article about the Krita Gemini app on
the IDZ website .
Now the promised tempting offer. If you are developing software for 2 in 1 devices, performance is important for you and you care about user convenience and, accordingly, the interface, then Intel has a few super modern PCs based on the latest Haswell processors in store for you. You can get one of them for testing and debugging, and perhaps this device will become your permanent device for development.
Write to us , tell
us about your program and we will consider your application.
And one more announcement. On May 28-29, the
DevCon conference will take place in Moscow, in which, of course, Intel will also participate. During the event, we will go through other illustrative examples of how to adapt the interface of applications for transformers. We invite everyone!