I'm developing an interactive full-screen application using qooxdoo Desktop. The application should deliver consistent user experience on multiple devices, from 1024x600 netbooks to modern 2560x1600 "retina" displays.
The application uses custom widget theme. The problem is, to provide consistent look'n'feel across multiple resolutions we have to adjust parameters like border radius (for buttons) and font size. Do I have to maintain individual themes for each major resolution, or is there more elegant way to do the same?
If you want to have a couple of predefined steps your theme should have, you can use states for that.
Patch qx.ui.core.Widget and add the desired states for every widget in the constructor
You can access these states in the appearance theme and react set the desired values based on the given state.
Related
I am working on an WPF application. WPF allows me to style everything but I just want my app to have the same theme as the other Windows applications. I want it to use the current Windows theme. Is this possible?
Whilst you're doing your styling you will be using brushes and colors.
If you want your styling to conform to the windows theme then you should ensure all your brushes and colors used are based on SystemColors.
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/how-to-paint-an-area-with-a-system-brush?view=netframeworkdesktop-4.8
https://learn.microsoft.com/en-us/dotnet/api/system.windows.systemcolors?view=netcore-3.1
You will find that a number of the default templates do not do this and instead have "hard coded" colors. Hence you will have to provide your own replacement templates for all these.
Unless you have extensive experience of wpf templating you are likely under estimating the amount of work which will be involved.
This is a lot of work.
If you look at custom themes which are available you'll often find the author missed some subtle aspects of controls here and there.
I have designed and released a mobile app for Android and iOS which is often depicted by the users as poorly designed. Indeed the app only features buttons scattered around the main Form that each opens a different form to show pieces of information or do an action. The app uses CN1 flat blue theme along with material icons but it does not look enough to make it material designed.
Thus I am planning to redesign the app and make it a material design one. While reading the material design specifications the tasks appears huge because there are many parameters to take into account to stick to the specifications although there is no obligation to apply them all.
However according to Android developers site and this SO question it seems that Android (version 5.0 onwards) provides helpers (eg a material design theme) to help follow the material design specifications. Are there such helpers in Codename One, or do I have to do it manualy (ie creating shadows, animations linked to actions, component styles, typo, dialogs ...) ? Or put another way, is there a way to give CN1 some hints about the app (primary color is xyz, this piece of information is a subheading, ...) and let CN1 apply the material design rules (animations between forms, shadows, ...) ?
Hope my question makes sense and can receive some help different (if possible) from what is provided in this SO question about Codename One support of Material Design as my app is already using material icons and native typos.
Thanks in advance for the help provided,
Cheers,
If you check out apps such as JAT or buua you will notice they apply the material design principals very well.
The Toolbar class should already comply with most material design principals by default and the FontImage class includes the standard material design icons.
We have task specific classes such as BubbleTransition to implement effects such as the floating button turning into a dialog etc.
What I find most important in material design and design in general is:
Typography - use a proper native: font that matches the occasion and looks good on the device.
Spacing - use spacing intelligently and use millimeters to keep it consistent between devices.
Colors - pick a palette and stick to it consistently, material design has some great color palettes that really make the app shine.
Simplicity - don't try to much. Simple is gorgeous. Yes you can add more shadows, animations etc. but you don't really need those and very few users would really notice that work. Everyone will notice if the app is minimalistic (in a good way).
Screenshots of the app might not be good form on stackoverflow but if you post screenshots/link to your app in the discussion forum I'd be happy to give you specific tips. Notice that hiring a designer to do some work or using a design template would be very helpful too.
My problem is that layout of my application does not behave in a same manner on different platforms. etc. On Windows platform fonts are larger than on Android or iOS so I'm trying to fix this programmatically.
In case of MultiButton I used:
if (platformOS.equals("win")) {
findMultiButtonMainMenu1(f).setUIIDLine1("MultiButtonCustom");
}
I dont see that MultiList has method for changing specific line UIID.
Is there a way to change UIID of the specific MultiList line programmatically?
Is this the right way to go or I should try to use a different theme when application is running on Windows platform?
Personally I think its very wrong to use code like:
if (platformOS.equals("win"))
This will litter your code with such hacks. If you want all the OS's to look the same just remove the includeNativeBool from the theme or copy one of the native themes (e.g. the iPhone theme) to get a single look for all platforms.
As to your answer this isn't exposed as an API since the class was mostly designed for the GUI builder but you can call:
list.setPropertyValue("uiid1", "YourUIID");
To do it.
I have a mobile game developed by U3D and NGUI and targeted to platforms such as android and IOS, but there are so many mobile resolutions and aspect ratios change from 1.3 to event 2. My UI are designed under resolution 1136x640, and UIRoot Scaling style is FixedSize, Manual Height is 640.
I am not going to use anchors in NGUI widgets because distance is defined in pixels but not in percentages, when resolutions are changed, relative position of widgets are also changed, this is not what I want.
I refer this but still have no idea to handle this tricky problem perfectly, I need some suggestions on how to use NGUI in right way to handle different mobile resolutions.
The newest (3.x.x) NGUI allows you to use their new anchoring system. As you said, it is specified in pixels, however you can specify different targets and distances to different edges, and it will behave similarly to percentages.
Are you familiar with NGUI team videos explaining their new releases?
https://www.youtube.com/watch?v=6k5iIzKTEBQ
Some of the information there could be helpful, and playing with Custom settings of anchors either.
Another useful things is to create scaling script attached to root, which scales all elements down, basing on the detected dpi. If your UI is prepared for phones, you probably won't need all the buttons to take the same percent of the screen on tablets.
I've got several instances in my app where I'm using a png icon from the standard wp7 icon library. I need to be able to alternate between light and dark versions of this png depending on the theme that the handset device is set to.
Now, I know how to detect the theme. However, how should I handle alternating between two versions of my images?
Do I create 2 different resource dictionaries and programatically switch between them in code? (honestly I have no clue how to do this)
Do I set some static resource "flag" somewhere based on what theme is detected?
I'm having some difficulty with my approach here, and would appreciate some guidance.
Here are some solutions:
Option 1)
You could use one image and OpacityMask so that your icons will remain consistent in both light/dark themes.
Option 2) You can take a look at this discussion:
LockedHow to change Metro icons based on selected theme
If you are using the standard wp7 icons for the appbar then you only need to add the icons from the dark theme -- the phone will automatically switch them to the light theme without any additional programming.
However, if you are using custom icons you will have to do something along the lines of what BMiloshevska said and use the OpacityMask.