How to set background colors in run-time? - smart-device

I am using GeneXus for a Smart Devices project.
I have to create a grid that will present data from a webService.
This webService will also return the RGB code that represents the background color in which the returned record should be shown.
The only way that I know of setting the background color (on the GridTable) is via the Theme class.
Is it possible to do this in execution time?

There is currently no way to change the background color in runtime, you can only change the theme class.
If the set of colors that will be used is known at design time, you could create a theme class for each one of them, and apply the corresponding class in runtime.
Otherwise, the only solution I can think of is creating a user control to extend the current grid functionality.

Related

Change UISwitch Image

I'm creating a toggle feature. Everything is working exactly how I would like it to. My ONLY issue is changing the image to one that's more fitting for my app.
Here's what I have:
https://res.cloudinary.com/dfd4ae1lw/image/upload/v1530126510/Stackoverflow/off_switch.png"
https://res.cloudinary.com/dfd4ae1lw/image/upload/v1530126510/Stackoverflow/On_Switch.png
THIS is what I want:
https://res.cloudinary.com/dfd4ae1lw/image/upload/v1530126510/Stackoverflow/On_Toggle.png
https://res.cloudinary.com/dfd4ae1lw/image/upload/v1530126510/Stackoverflow/Off_Toggle.png
How do change the image of the UISwitch? There must be a way... right?
Apple removed the ability for users to specify a custom UISwitch image in iOS 7, implicitly for policy reasons. So there is no direct way to achieve what you want.
You can simulate it with an NSButton by toggling the isSelected state; this is entirely distinct from the isHighlighted state that relates to user interactions and the interface designer allows you to specify different images for different states.

Are there any convenient ways for managing color schemes in an iOS app?

I was wondering if there are any standard or convenient ways for managing color schemes with storyboards in an iOS app, instead of having to manually change the colors of many different UI objects.
Thanks!
There is a tintColor that a few interface elements will pick up by default. You can configure the storyboard (right side menu) on the Global Tint setting.
If you want more costumization, there is a cool recent feature called UIAppearance. It lets you costumize interface elements by code, and that is applied in all such elements across the app.
Here is more info:
http://nshipster.com/uiappearance/
This is a fine question. We once had to do a complete color palette adjustment in a very large (> 100 view controller) app, and it was a suboptimal experience. For colors that are defined in code, the changes were easy enough. For colors specified in xibs or storyboards, though, it sucked. Because IB stores colors as raw double RGB values, there's no easy way to grep through the xib and storyboard xml files to do a simple search and replace. I wound up having to write a Ruby script that would find RGB values in the XML files, convert the doubles to integers in the (0..255) range, and then prompt the user to enter new values. The script cached the user's answers so that the user wasn't prompted multiple times for the same color values.
In hindsight, I still would prefer to specify colors in the storyboards & xibs so that it's as WYSIWYG as possible, and instead insist that the designers can make the changes themselves if they ever decide to modify the palette. :)

How does Uber achieve this UI in WatchKit?

How does it superimpose elements (the timer is above the map) ?
To my understanding, you can only use background images on groups, no other kind of custom views...
Any idea ?
My initial guess is that they're using a dynamically-generated image of a map as the background image in the group. The giveaway is that, while WKInterfaceMap allows you to add custom annotations, you can't draw custom shapes like the blue route line.
I could be way off.
The way Uber (and most of the big companies custom's UI) is done is that they're just generating an image in the iOS which is the sent back to the WatchKit extensions and simply displayed as an image.
If you want to create your custom UI with hte current version of the SDK, this is the only way to achieve exactly what you want. You will need some hacks to achieve interactivity but you should be able to do that on your own :)

Means to use Color Swatch in settings?

I'd hoped to find that someone's worked out a means to provide a choice of colors from the application settings (even with InAppSettings) with some kind of view of the (graphical) color swatch itself. My fallback implementation is a settings child pane of text multi-values of a small set of colors obviously without any swatch (unless there's a way of using icon.pngs therein).
Is someone aware such an implementation?
There is currently no approved way to do what you ask besides RGB values, and even then it's not user friendly. I can recommend two projects if you would like to provide a pallet in-app though:
IL Color Picker is simply excellent. I cannot recommend it highly enough. It's intuitive, and unique, and it looks like photoshop's implementation.
Color Picker a control styled like a nib's default color pallet.

How to set background of the default datetimepicker blackberry

The default background color of DateTimePicker provided by blackberry is Black. I want to change this background color to the theme of my app, which is Light blue.
How can i achieve this? I am developing for OS 5.0 and above. Please help.
As far as I know about this, you can't change the background of a datetimepicker. You cannot make a class that extends DateTimePicker and override its classes because it is an abstract class. So I guess u'll have to accept the background offered by RIM for this component.
If you check the API:
http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/picker/DateTimePicker.html
you will see clearly that there is no Paint method or paintBackground method to override.
So for me there is no way to do that. You can use a work around method that will consist of creating a popup screen representing the object in question. Check the following two links for more help:
http://supportforums.blackberry.com/t5/Java-Development/overlapping-field-issue-on-9500/td-p/419200
Or
BlackBerry - Creating custom Date Field
There is no way that you can change the default view, if you want to change that then u have to make some stub classes where you wil manually describe the classes and the functions, for the date event and import that. like importing a jar file.

Resources