I have been trying to customize the Hint color in TextInputLayout and it works fine. But the problem is that I have to define color when there is an error, normal/Activated which is working and disabled state of the field.
So I tried creating three different styles with color normal, color activated and so on. But this doesn't seem to change the colour. I have indicated the Appcombat theme as the parent theme as well in my custom styles. I have tried applying these styles through java file as well.
Also let me know on how to define the size of the Hint text through style.
A bit late to the party, but here goes my solution to this:
Set the same style in errorTextAppearance and hintTextAppearance, both with the same color for the item android:textColor. When showing an error, set the error using a spannable with a ForegroundColorSpan with the color you wish to display in the error field, while the hint will remain in the color defined by the style set in errorTextAppearance.
Related
Trying to understand how to make component sets and use variance to make designing more simplified. I have a tile that has an icon on the right that I want to be able to change both what type of icon it is as well as its colour. Is there a way to create the two-component properties using variance? Do all the icons need to be grouped by color and do I need to adjust their naming conventions (still not to sure how that works as well)h
There is a more efficient way to do this, by taking advantage of Color Styles. With this method, you only have to create your icons once, and no need for variants. Color Style swapping will handle that.
Create your icon components, but using a boring black color. Avoid creating variants of the icons, if it's only the fill color that's changing.
Instead create a standard set of Color Styles for your icons.
Your designers then, could place an instance of a black icon from your library. Then use the Selection Panel to replace the black color with one of your defined color styles.
I've made a simple shape editor. I can change colors (used to fill shapes) by click on buttons in a menu bar. The disadvangate of this solving is the fact that the numbers of colors are so restricted. I can't find a better solution for my program. Can somebody help me and give me an idea how can I improve it? I thought about color palette, but I have no idea how can I do this.
The image:
("Aktywny kolor" means active colors, and there is the list of colors below, which I can use)
You would need to use a color picker where the colors are distributed on many pixels and not on a very small set of color names. Since you are using applet, you might want to download an already made color picker compatible with your environment, or you might want to write your own, depending on whether the things you find meet your expectations.
When a chart is copied from Excel to PowerPoint, if the fonts on the Axis have been changed due to the style or theme applied in Excel, then they will normally change to be consistent with whichever theme is applied in PowerPoint (which is good). However, when the font (possibly formatting in general) has been overridden by a user, that the user specified font is the one used.
Writing code to detect what the default font is and apply it probably isn't that tricky, but I'd rather apply the theme font in a way that will match subsequent theme changes. Can anyone tell me how to do this?
I'm using C#, but am familiar with VBA and the object model is more or less identical in both, so approaches in either language should be fine.
After a little more digging, setting any font to a theme font looks like it can be accomplished by using the special font names comprised of:
+mj or +mn for heading or body fonts respectively
-lt, -ea, or -cs for latin, east asian, or complex script fonts respectively
So for my purposes, if I just assign all heading-like shapes' font properties to have font.name = "+mn-lt" then I accomplish what I need to, i.e. the font will match the theme and reflect subsequent theme changes.
NB that detecting whether this actually is already the case, since the font can be assigned either using the special font name or the actual font name, is a difficult problem (addressed elsewhere on SO). Thankfully, I don't have to worry too much about this...
I am new to jQuery and although I have got 90% of what I want to do sorted out I am not able to change the colour of the frame in ColorBox from gray. I have been through the code and have read through the settings section of http://www.jacklmoore.com/colorbox but cannot see where it is set. Help would be much appeciated.
There is no javascript option for you to change the color. You will have to do it via CSS. It will vary depending on which "theme" you are using, and you may have to edit or create new images for it.
I am currently working with gmf and I would like to change the colour of connections. I debug the code and I saw thatafter setting createConnectionFigure() method the foreground colour the refresh() method in the AbstractGraphicalEditPart class overrides this colour. Is there any special way that I can change the colour? Also I want to create a circle for source and target decoration of the link. I know that I have to extend the Polyline class but I don;t anything about the rest. Do you know any available example?
The preferred way to change the color of your figure is through the notation model(View).
While you create the edge view, you can set the line color for edge in the edge notation.
Connector edge = NotationFactory.eINSTANCE.createConnector();
ViewUtil.setStructuralFeatureValue(edge,NotationPackage.eINSTANCE.getLineStyle_LineColor(),new RGB(0,0,0));
If you have created your GMF editor plugin using GMF tools, there will be a class ViewProvider. There, they would have methods to create edge. You can change it there.
OR
Set the color in the PreferenceStore.
OR
worst case, you can override the refreshForegroundColor() in the ConnectionEditPart & set your own color. However the downside of this approach is, you cannot change the color through the UI.
As for decorations, in your connection figure, decoration can be set through setSourceDecoration & setTargetDecoration
eg: connection.setSourceDecoration(new org.eclipse.draw2d.PolylineDecoration());