Nougat RemoteInput: color of text field - android-notifications

I've implemented RemoteInput in my app, but text field area appears with gray background abd I want it blue like this:
Is there are any way to do this?
UPD: Looks like colorPrimary is used for this, but I don't want to change it in whole app, just in notification

Method setColor is what I was looking for. It also changes icon and title tint.
NotificationCompat.Builder(ctx)
//....
.setColor(ContextCompat.getColor(ctx, R.color.colorAccent))

Related

Is there anyway to add a icon in the Entry placeholder?

I can not use a Background Image because cannot fix the position of the start point.the placeholder text is centered.so it is not duplicated.
How to add an icon in the placeholder of an Entry beside using Grid or Layout. Just add it in the placeholder.
I want to make an Entry with placeholder containing an icon . Which is center in the Entry so that I can not use grid or layout to add a Image because this is not the best way.
I think I will have to make clicked event functions of the Image and the entry focus to hide the Image.
The expected result is like that:
Entry
The first way I can think of doing this:
If the icon you would like to use is a generic icon, FontAwesome is a fantastic fontkit that displays icons in the place of text. I have implemented it into Xamarin Forms many times. Here are some tutorials on how to do that:
https://www.wintellect.com/using-fontawesome5-xamarin-forms/
https://doumer.me/icons-with-font-awesome-5-xamarin-forms/
What you would do is set the FontFamily of the entry field to FontAwesome, and then add a textchanged event on text length > 0 change the fontfamily to your normal font, on text length = 0 (Place holder displayed) Change font family to FontAwesome.
The second way I can think of doing this:
Create a Xamarin Forms Custom Renderer for all of the platforms you are using. whereby you will on the native level alter how the Entry field functions to display an icon in its placeholder. To do this you will either need some native expierience on both platforms or some patience and learning about the native platforms.
If you need further help feel free to drop a comment :)

How to create a button with an image and text WatchKit

I want to create a tappable button with an icon and some text.. kind of like how the map app does it. See the attached picture below.
I've currently tried having a button that is set to the Group mode for content. However, this makes the background clear and I wasn't sure if there were any better options. Another option that came to my mind was creating a table view with one cell that took up half the width but that would be very hacky as well.
Just create two groups. Then you can change the background color, add an image and text label. To make it clickable simply add a tapGestureRecognizer to the group and it will function just like a button.

Set textfield backgroundcolor not work

I have a simple form with three fields. In it there is an email validation, which should change the text background color when the email to invalid.
However, the background color no change. The code changes the background color of the label, not the text background.
Is there any way to resolve this with just JavaScript?
Fiddle
You need to make 2 small changes to a single line
Ext.get('txtUsuEmail').setStyle('background-color','#DC143C'); //change this as per below
1) Target specifically the <input> textbox using Ext.get('txtUsuEmail-inputEl').
2) Change the background property not the background-color.
So the final would look like:
Ext.get('txtUsuEmail-inputEl').setStyle('background','#DC143C');
This should work.
You could give an id to the textfield and simply use the below setStyle:
Ext.get('YourTextFieldId').setStyle('background', '#ABCDEF');

Verifying the presence of an image inside of a textbox using SmartBear TestComplete with JScript

I am testing a web application using JScript in TestComplete and need to verify that a WordWheel TextBox includes an image of a magnifying glass inside of it. And that when text is entered, a red x appears over the magnifying glass. See the image below. I dont need to know what the image looks like, just need to maybe find a property I can use to verify that it exists. Or maybe more properties to verify that the red X appears, etc.
For design reference, this is how I verify the text font style of that text box below:
if (searchTextBox.currentStyle.fontStyle == "italic" && modulesTextBox.currentStyle.color == "gray")
{
Log.Checkpoint("The text box font is gray and italic");
}
else
{
Log.Error("The text box font is not gray and italic);
}
Is this possible?
EDIT: Well it looks like I need 10 reputations to post images. How do I get reputations? In the meantime, I can email the picture in question.
You could use TestComplete's QuerySelector method to find the needed object by its CSS attributes. For example:
//JScript
CSSSelector = "div#main-nav a[target=blank]";
res=TestedPage.QuerySelector(CSSSelector);
This article contains additional information you may need:
http://smartbear.com/viewarticle/55769/

Subclassing QMessageBox

I need to customize QMessageBox. I need to remove the frame and title bar and add my own title bar and close button. Also need to replace the standard buttons and probably redo the background color of the box.
Is it possible to subclass it and achieve the above? is there any example anywhere for this? Or, should I just subclass Dialog and create my own message box?
This tutorial on custom windows might help you. It's in French but the code examples are in English, it shows how to compose your own title bar, create a window and attach the new title bar on it. I've been through it before, it's pretty straightforward once you've done it.
There is no need to subclass QMessageBox or QDialog. You can pass a QMessageBox the parameter Qt::FramelessWindowHint to remove the frame and buttons. You can also use Qt Style Sheets to style the background of the QMessageBox as well as the buttons. Something like this should work:
msgBox->setStyleSheet("QDialog {background-color: red;}"
"QPushButton {background-color: blue;}")
I haven't tested this but it should work or be pretty close.

Resources