Android xml basic unit of ui is View.
Flutter basic unit of ui is Widget.
Then, What is basic unit of Jetpack Compose?
I'm thinking about what to end compose ui function name with.
Like. SearchView, SearchWidget, SearchCompose, SearchUI, SearchComponent etc...
What do you all think?
It depends on what you're trying to accomplish. If you need a basic view to display background for instance, Surface will do the job. If you'd like an empty view to space your items – although padding would do the same – then you could use Spacer
Related
SpringBoot 2 Vaadin 12.0.3
I've spent some time watching video tutorials and studying online examples of Vaadin. Unfortunately, so much has changed that options that I was hoping to try are no longer there.
CssLayout is no longer there - replaced by Div which does not expose expand(Component).
component.setWidth("300") has no effect.
component.setWidth("300", UNIT.*) does not work because UNIT is not in class path.
component.setWidth("300px") works but it's far from elegant and setting explicit width on a component which displays text is far from ideal.
I have three pseudo horizontal menu items. On a large screen, they'd be truly horizontal. On smaller screen, I'd like them to go into vertical mode.
Combo Box should expand to the width of the longest label.
Text Box should expand to available real estate. (Available width - Combo Box width - Search Button width)
Search Button should expand to the width of the Icon and Label without any wrapping.
Is this possible to achieve using Vaadin 12 Layout/Component contract or do I have to spend time defining such control in CSS file?
Your question implies that there would have been a trivial way of achieving your use case with the built-in layouts in Vaadin 7 or Vaadin 8 without using CSS. What you're describing about automatically switching between horizontal and vertical modes depending on the screen size sounds like something that would require some degree of responsive layouting, which typically implies directly using CSS.
What you could have done in older versions is to have Java logic that either uses a VerticalLayout or a HorizontalLayout depending on the situation. Those two classes are still available for the same kind of use cases. The APIs have changed to better align with the underlying flexbox functionality, but the overall functionality is still the same.
You could also look in to FormLayout (part of the core framework) or the Board layout (separate add-on) which both provide some responsive functionality. They are, however, originally intended for slightly different use cases (forms and dashboards respectively), so it might be slightly challenging to make them fit your exact requirements.
According to this page, https://docs.unity3d.com/Manual/iphone-basic.html, too many UnityGUI elements is considered bad, but what is too many if my game runs entirely on the canvas? At the moment, my UI will contain about 100 objects, most are buttons and 80 of the objects, use full or portions of 3 textures to display the objects.
Does this mean that uGUI cannot or should not be used for iOS games?
That post is talking about something totally different and you are confusing yourself with uGUI and UnityGUI/IMGUI.
UnityGUI/IMGUI is an old UI System. That's what the article is talking about. Don't use it. I've been warning new users about that too due and they use it due to old tutorials they are following.
The only time you should use this is when you are writing an Editor script to test your game in the Editor but this should never be deployed to your mobile device or used as a standalone build.
How to know when you are using UnityGUI/IMGUI or which tutorials to avoid? When you see OnGUI() anywhere in the code, then stop.
The latest UI System in Unity is simply called uGUI. I don't know if the name has changed but this was the original name when it came out. It is only available from Unity 4.6 and above. You can find this from the UnityEngine.UI; namespace.
This is the link you should be reading for the new UI and here for UI tutorials.
Does this mean that uGUI cannot or should not be used for iOS games?
uGUI should be used for all your UI work.Again, I am not talking about the UI from the article. I am talking about the UI from the UnityEngine.UI; namespace.
my UI will contain about 100 objects, most are buttons and 80 of the
objects
uGUI uses Canvas to drive the UI and they are parent GameObject of UI components.. You may want to separate them into different Canvas. For example, MainMenu Canvas, PauseMenu Canvas, GamePlay Canvas.... Under each Canvas, you can then have your components such as Buttons and Texts.
When you are on the main menu, you enable the MainMenu Canvas and disable the rest. You can do this for your other Canvas in your scene depending on the mode of your game. I can't think of any scenario where you need 80 UI components at the-same time, on the scene. You must separate them.
I'm porting a PhoneGap application to native iOS targeting iOS 7. One of the elements is a rectangular <div> with another <div> layered on top that has a variable height and produces a meter effect. The best visual I can think of is a thermometer.
Is there a recommended UI element that would simulate this in iOS?
UIView is the closest thing to a general div in HTML. If you override its drawRect: method, you can perform whatever drawing code you'd like using NSGraphicsContext (including just painting the background a certain color). If you want something more elaborate, you can use a UIImageView and display an image for the various parts of your control.
Cocoapods.org has a lot of great reusable iOS components. One that sounds like it may meet your needs is MSSimpleGauge:
https://github.com/sabymike/MSSimpleGauge
How do I create a tab bar like WhatsApp on BlackBerry in my BlackBerry app? I want that feature in BlackBerry OS 7.0. I have used managers -- HorizontalFieldManager and VerticalFieldManager -- to achieve it. But it doesn't look as attractive as WhatsApp. Can FieldTabController help me do this?
It's not going to look attractive if you are just making tweaks to the code, and then seeing what that looks like. You need to start with a design you find attractive. Once you have that goal put together as an image, you start writing code to make the UI look like the design image.
The WhatsApp tab bar is not a straightforward combination of built-in UI managers from RIM. It has a fair amount of customization - each tab has three visual states, and there is a tooltip that follows the focus, as well as a context tab on the right that changes depending on the currently selected main tab. This means there are several interacting UI components here, not just a single magic manager.
Essentially, you will probably want to start building your own custom Field objects.
Basically, subclass the Field class (or one of the other subclasses), and learn to love the paint(..) method and the Graphics API.
I see that I can create the the UI controls like buttons, labels and textboxes by writing code in the class, and drawing them through the "pushScreen" method.
My question is: can we draw UI design by drag & drop from a toolbox?
I have been working in iPhone development, and expecting that Eclipse would have a similar approach for UI design.
As much as what I know there is no alternate approach for UI design in blackberry except coding. The only approach for UI design in blackberry is through coding.