How to set background of the default datetimepicker blackberry - 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.

Related

How would I customize an SDK's UIAlertController?

So, I already understand & can create my own custom UIAlertController (fonts, background color, text color, tint color, etc). So that is not the issue here.
The problem I'm running into is:
When I'm using an SDK file (ex. Facebook's SDK), I'm not able to find where inside of the SDK's Objective-C Headers, that the default UIAlertController is begin initiated (and presented). If I could, I'd like to replace the default with my own custom alert.
As of right now, I've already create my custom class with a static function that returns my custom UIAlertController for my VC to present. I've also already tested the implementation & it's works fine.
What I tried first was to manually search through Facebook's SDK Objective-C headers to find where the default UIAlertController is being initiated & then presented, but obviously with little luck...
Next thing I tried was using Xcode's Find Navigator to search for, "AlertController". Alas, nothing found inside the SDK's header files (maybe I should change the search scope?).
Last thing I tried was simply searching Google, but all I could find there was tutorials on how to create a custom UIAlertController (which I already know how to do).
Although in my current situation, I am using Facebook's SDK. Best answer would be one that's more general rather than specific (if possible). That way if I'm using a different/new SDK in the future, I can still apply your method. Thanks.
I do not recommend editing and forking FB's SDK, that would be a nightmare to maintain.
Instead you should look into objc method Swizzling, which allows you to dynamically replace the body of existing functions with your own implementation. I believe you could use this to change the behavior of all UIAlertControllers (not without risk).
https://nshipster.com/method-swizzling/

how to use accessibility in flutter

does anyone know how to make the voice over to read something that has no text using accessibility? for example, if you go on an image it reads a description, or if you go on a back button it would say back button.
I have tried the tooltip but that is not working and that is not what I'm looking for. thanks.
What you're looking for is the Semantics widget. For descriptions of the properties passed into the constructor of Semantics take a look at the SemanticsProperty class.

Change color-theme in whole iOS application

I am going to implement Alert feature in my application.
When user taps an alert button my application is about to change all orange (default) colors to red (Navigation bar, switches, Tab bar, Buttons, views and other stuff).
I want to implement it using "css" files also known as stylesheets.
I've found two libraries: Motif and NUI.
The most important problem is to dynamically change theme inside application. Motif can do this but I want to do it more simple.
Also I learned that NUI can change the app theme too but I can't to change it dynamically.
P.S. I am using storyboard and XIB-files. I need to add runtime attribute for object's key-path. This attribute will go to my stylesheet file and apply styles. It's the most simple way I think.
Can I do it simply and without any libraries?
P.S.S. NUI is more simple for me. Maybe you know how to change styles when application runs.
There are ways of making this work, but not very simply. So your options are either to construct your own solution, or use a library.
If you are looking for something that feels easier and more native than NUI or Motif, and which also lets you assign styles and see them rendered live inside your storyboards, take a look at my library for this: https://github.com/daniel-hall/Stylish
Here is a demonstration of changing the "stylesheet" (which can be created either in code, or in an external JSON file) at runtime:

What would be the most efficient way of implementing a dark mode in my application?

I have an application that I want to shift to night mode when a button is pressed. What would be the best way of doing that?
I was thinking of creating a class of light vs dark colors to use for certain labels as well as a notification firing when the button is pressed to notify all of the app to adopt the colors. Is there a better way of doing this?
So to set the color, you need to set the properties tintColor or barTintColor or something like this. But I think the real question of yours is, how you can effectifly switch between the two modes.
Your idea with the theme manager class that fires a notification is not that bad, another option would be to observe for theme changes. But firing a notification might be even better.
In this case you only need to listen for the theme-changed-notification inside you UI-subclasses and change their color if the notification fires. And don't forget to remove the NSNotificationCenter-observer in your dealloc :)
If you are building a web application you can use only CSS to implement a light- switch function.
This page looks exactly what you are looking for.
(It also has a CodePen demo.)

How to set background colors in run-time?

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.

Resources