customize the background of ControlsFX Notification - javafx

How can I change the white background to green background in java or css?
The Notification class does not have getStylesheet() method.
enter image description here

You may want to consider using a JavaFX Alert instead of a ControlsFX Notification. An Alert has a DialogPane which implements the Styleable interface, and has a getStylesheets method.
So to use it you would have something like
Alert myAlert = new Alert(AlertType.NONE);
myAlert.getDialogPane().getStylesheets().add("myStylesheet.css");

Related

Make WKInterfaceButton keypress clearer in watchOS 2

I find the graphical feedback when pressing buttons (WKInterfaceButton) in watchOS2 is very weak. It is hard to see and even Apple seems to thinks this is the case as they e.g. in the unlock screen change the background to white on active buttons. The default behaviour is to dim the whole button.
How can I make a button press cleared in watchOS 2? I can e.g. change the button text color on activity but how do I easily change it back when it is no longer active?
There is currently no way to detect touch-down, or other events, on WKInterfaceButtons like you can on UIButtons on iOS. The only touch event you can detect is touch-up-inside, which calls the IBAction method.
Therefore what you wish to accomplish cannot be accomplished. Something you might consider is animating the button appearance once the action has been triggered. For example in my app upon button tap I animate the button's background color, then animate it back to the original color. That provides more visual confirmation to the user so they are certain the button was tapped.
I'd encourage you to file an enhancement request at bugreport.apple.com if you'd like to have more control with touch events.

Can we give different colors to buttons shown on alert box through DisplayAlert() method, in xamarin?

Can we give different colors to buttons shown on alert box through DisplayAlert() method, in Xamarin.Forms?
I can find its solution in android but I am unable to get in Xamarin.Forms.
It isn't possible. With DisplayActionSheet, you could only use one "Destructive" action which will be red on most of OSes.
You could write a custom version of alert box though. Here it's nice codebase for this: https://github.com/aritchie/userdialogs

iOS7 Custom Button Fading with UIActionSheet

I'm running into an issue where for navigation, we have to use a custom back button, which we are matching to iOS7. So we're creating a UIButton with a background image and then setting it as a custom view of a UIBarButtonItem.
The issue is that when an Action sheet is presented by iOS7, the background is faded. However, the custom button does not and it looks mismatched. Question is - is there a property that can be set to provide the image for the faded state? (though this can be done with delegation, I wanted to see if there was a simpler solution before going that route).
I have tried to set a faded image for UIControlStateDisabled, UIControlStateSystem, UIControlStateReserved with no avail.
Screen shot below:
I ended up using delegation. When the action sheet is presented, my controller received a message and switched the button to faded. When action sheet was dismissed, my controller again received a messaged and switched button to normal.
Actionsheet was subclassed here, which is why I had to do this dance.
I have actually resolved this issue without delegation. The solution is to have a png with clear background. So just the blue of the back arrow. In that case, iOS handles the fading and desaturating. If you add background, it will not.

How to set a UINavigationController's UINavigationBar class programmatically?

I want to add a Custom UINavigationBar Background.
Is there anyway I can do this completely in code? _navigationBarClass seems to be a private property on UINavigationController.
Objective-C: How to change the class of an object at runtime?
While not programmatic it can be done via Storyboards by setting the Navigation Bar class. See https://stackoverflow.com/a/42989418/47281.

GWT designing a Button

I would like to do some notification stuff for my website.
I am done with the backend coding but i would like to display properly in the VIEW.
So exactly what i need to do is when ever there is a message i would like my button to change its color.I mean i want to do something which indicates that there is a message waiting for the user.
So basically i need to make my button blinking or change color so that it indicates the user that he has some message waiting for him
So can you please suggest me any button which can have an image as a display and a corresponding css file which i need to use which can blink when ever there is a message.
Both PushButton and ToggleButton allow setting an image as the face of the button. However, you should be able to make a normal Button "blink" just by using CSS and a Timer. Use addStyleName() and removeStyleName() in combination with the Timer - on new message, add your "blink" style (it's up to you to come up with it ;)), add a Timer and in its run() method removeStyleName() the "blink" style.
PS: See this blog post, to see how the Google team created the cross-browser, customizable buttons in GMail - but that's an overkill in this situation, IMHO ;)

Resources