SapUI5 UI Controls Size Issue - sapui5

I would like to make responsive (combobox,input etc.) ui controls in sapui5. But on the web environment some of components such as combobox and input are looking so large. I've uploaded an image regarding to this problem. How can I change view sizes of these ui controls ? Is there a simple way to do this like using sap.m.size ? I hope I made make myself clear.
Here is the link of image;
https://ibb.co/dJBdVx

It's event simplier than resizing each control to a given size...
SAPUI5 has a feature called 'content density' mode. Which stablishes the controls/paddings/margins sizes depending on the selected mode.
There are 2 main modes. 'Cozy' which is the large one, and it is meant for touchable devices (your finger is a thick pointer) and 'compact' for desktop devices (with a mouse you can point accurately).
So all you need to do is setting one of this modes based on the device.
Here the tutorial to know how to do it.
And here the documentation about the 'content density'

Related

Canvas not scaling properly regardless to the set scalability

I'm trying to make my Canvas scalable regardless of screen size. I made it to be scalable across the screen but when it is hidden and called it is not scaled for some reason. I actually call it in code and it shows up when needed but it is not scalable but when I display it right away it is scalable.
Expected position (is displayed normally when I do not hide the display):
Actual position (when my display is hidden and is displayed at the button pressing):
How to make it scalable? I've searched for all possible solutions but I could not find an answer.
These are the settings and hierarchy:
These are parent settings (main canvas):
I am not sure why CanvasScaller is not enough for you. I've never faced a case where I had to implement my own scalling, you should probably check CanvasScaller and use that, but anyway if your layout is not getting recalculated instantly you can force that by using
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);

Where do i store images and how do i get them in codename one new gui

I don't know where to store images and how to get the images by their id and this new gui is good but there are no tutorials on how to use it.
The images are stored in the resource file (theme.res) which lets you use features such as multi-image (an image that adapts to DPI.
You can edit the resource file via CSS or the designer (depending on your configuration). Assuming you didn't enable CSS you can use the following toolbar option to add an images directly from the GUI builder.
Notice these 3 icons on the top right area:
When you hover over them you should see the following tooltips:
Add Image
Add Multi Image
Set Multi Image Import DPI
They all do what you expect. The last one shows you this dialog:
Here you can define the density to which you designed the image you're importing. That way it will be logically scaled to all the other densities so an image designed for a 600ppi device will look similar on a 300ppi device (ppi == Pixels Per Inch).
I agree the UX should be improved here so I added an RFE for fixing this in a future update.

Scrolling in "RepeatBox" control is not smooth

I have two pages, first page I have a ScrollView control and the other page I used RepeatBox control.
My problem is the ScrollView page scroll is smooth, But the RepeatBox page scrolling is not smooth (i.e. flickering while scrolling).
Could any one help on this? Thanks in advance.
Performance of repeatbox can change according to the objects you used in it. Because it is drawn with rowRender event, it can take more time with different objects. Also, in some old devices, especially for Android, you can see these kind of performance differences in applications.
Maybe you can test with other devices, or you can test with more simple project in order to see if it is always flickering or not.
The problem comes with all images on the visible screen are opening again from the local storage by rowRender method. In the native RepeatBox after image comes on visible area are stored and not again opening from local storage and creates performance problem.

iphone custom datepicker

Is there any datepicker UI elements that I can use on my iphone application? Native one is found to be too big.
Maybe the right question is why is it too big? Apple has done a pretty good job of making a set of controls that apply for most circumstances, look stylish, and are usable by the user.
The default control is the size of the iPhone keyboard, and it was made this way for a very good reason: all elements are easily viewable and selectable by touch. If you have a lot of UI elements making life difficult, consider displaying the selected date/time in a label and edit it in a modal dialog.

should one customize default iphone controls?

my app asks the user yes-no questions, user replies using a uiswitch on screen. i've been thinking about creating a custom version of the switch that would display yes/no instead of on/off and would use a green/red background as an indicator of the value. after creating a mock up i'm not so sure this is the way to go. using the default switch doesn't feel right but so does changing it too much. what do you think?
It really depends; some custom applications have extremely custom UIs (such as ConvertBot, for example) and it works great for them. The risk is sometimes worth the effort. In other scenarios, custom widgets result in breaking usability. I don't think that changing 'ON/OFF' to 'YES/NO' is groundbreaking, if you do it right you can pull it off no problem.
I think if your mockup was better done (the slider should be divided into two to have YES AND NO of equal length with equal padding on both sides) it would look a little better.
From a user interface perspective, this is a bad idea. People have already learned the default switch, so why change it now?
Additionally, you run the risk of adding another source of bugs to your application that was not present before.
Depending on the app, this can be very valid. Sure people are used to the default controls, but changing the text or colors is not going to break the user's understanding of these controls. Its still the same switch underneath.
In your example you color both the Yes/No. That is the only concern I would have that you did change how the core switch works. Typically, it works with a highlighted color and a grey color. So, having it stay colored on both options could potentially be confusing.
Regardless, if you want to build your app this way, you should. Just because the iPhone offers great default controls doesn't mean developers shouldn't innovate and add their own or take the default controls to the next level.
Take a look at the custom UISwitch control that I built to allow me to change the background color of the control. You could use the same method to change the text, the font, or the text color very easily.
http://www.homick.com/posts/custom-uiswitch-control
The code is available on Github and includes a PSD that is used to build three different png files that the control uses. You can modify the contents of the psd to recreate the png files in whatever format you like. Swap those into the control and away you go.