I am creating a gmail add-on using app script. According to design requirement I want to create a TextButton which is full width i.e. It covers the entire width of the add on.
I am using TextButton class for this as below -
var textButton = CardService.newTextButton()
.setText(btnName)
.setOnClickAction(action)
.setTextButtonStyle(CardService.TextButtonStyle.FILLED);
Can anyone please confirm how can I make this button full width?
TIA.
Unfortunately you can't change the width - the button always wraps the containing text and ignores leading and trailing whitespace.
The button has to be added either to the header or footer and then it'll automatically be full-width.
Otherwise I would suggest filing this as a feature request directly to Google here.
Related
I want users entering data across multiple tabs to be able to see at a glance whether and where they have validation errors / fields not populated. I can indicate errors for the selected form in the form body, but for unselected tabs I want to use red color and/or a red icon in the tab to indicate if it is failing validation.
I see various posts explaining how to use a custom renderer or effect to set tab text color for all tabs or selected/unselected tabs (e.g. here, here, here modifying the framework itself and here). However, the posts I've seen do not show a way to change the color of a SPECIFIC tab. In this case I want to either change the color or add/remove an error icon that would show beside the Title in the tab header based on the validation results for the page accessed via the tab. Is that possible?
Update:
I also found this - seemed more promising because it does seem to change tabs based on their positions or title rather than just on whether they were selected or not, but it seems to be dependent on using bottom tabs, which I'm not doing.
I also have found this, and element.Children[i] does get me the ContentPage from which I can determine what color I want the tab's test to be, and it's possible that the tab variable that's returned by activity.ActionBar.GetTabAt(i) somehow gives me access to update the tab's text color, but I'm not seeing any method or property that seems promising - basically I still don't see how to get access to the UITabBarItem so I can call SetTitleAndAttributes on it to set its text color. (Also, if I declare the tab variable by its type of Android.App.ActionBar.Tab instead of using var, I get a note saying that type has been deprecated. It seems upon investigation that the whole ActionBar class has been deprecated. But how can that be when it still exists as a property of Android.App.Activity, which is not deprecated?)
Many thanks for your assistance!
In UIAutomator Viewer can see that the markers do not have anything unique except the index.
I tried to simulate a click on a specific marker in the following way:
UiObject gMap = mDevice.findObject(new UiSelector().descriptionContains("Google Map"));
UiObject marker = mDevice.findObject(gMap.getSelector().index(1));
marker.clickAndWaitForNewWindow();
But the click did not happen. How can I simulate clicking on the markers?
Don't use gMap.getSelector(). You should use childSelector to search markers inside map view
UiObject marker = mDevice.findObject(UiSelector()
.descriptionContains("Google Map")
.childSelector(UiSelector().instance(1))
)
And try to use marker.waitForExists(5000) before clicking. Usually they appear not immediately on map
Using CulebraTester and a sample map application (as shown)
which has 3 markers: the 2 red have title and snippet and the blue doesn't, you can see how the generated code differ.
mDevice.findObject(By.desc("title_of_marker1. snippet_of_marker1.").clazz("android.view.View").text(Pattern.compile("")).pkg("com.example.diego.mymapapplication")).clickAndWait(Until.newWindow(), DEFAULT_TIMEOUT);
mDevice.findObject(By.desc("title_of_marker2. snippet_of_marker2.").clazz("android.view.View").text(Pattern.compile("")).pkg("com.example.diego.mymapapplication")).clickAndWait(Until.newWindow(), DEFAULT_TIMEOUT);
mDevice.findObject(By.desc("Google Map").clazz("android.view.View").text(Pattern.compile("")).pkg("com.example.diego.mymapapplication")).clickAndWait(Until.newWindow(), DEFAULT_TIMEOUT);
the 3rd selector is too broad and ambiguous.
I guess if you add title and/or snippet you'll have no problem clicking on them.
I have a problem to show my object field Description on Cross Platform Label . Description has many hashtag, that need to be clicked and open another page. Here is my example :
"I have some #issues that need to be #solved maybe Xamarin#Support can help me."
That is my description, and i want to put it on Label. How can i set those hashtag (#issues, #solved, #Support) to be clickable?
One option is to use a WebView and use simple HTML / CSS. This would give you the most flexibility and in some cases is the simplest.
Another option would be to write custom renderers. There are plenty of answers out there on how to do this natively but as a starting point.
On Android you need to use a TextView with autoLink="web".
On iOS, a UILabel should allow you to do this.
You can change color, ForegroundColor, FontAttributes of the hashtags by using Span in the label. Sadly, Span doesn't have GestureRecognizers.
I suggest you to stack multiple labels and add TapGestureRecognizer on the label with hashtags.
I recently noticed the following popup message ("6 occurrences replaced") in Qt Creator (3.4.2).
I like its style and want to use it in my own application. But how is it done? Is this a particular widget or what else? Can someone point me in the right direction.
You could create your own window with round corners like that with text in the middle paid show it when you want too make the window so it takes a parameter text and you can add different text each time and show
Got this basic issue..
I have two tab navigation bar in Oracle APEX 4.0. The parent tab and the standard tab.
The standard tab which is below parent tab starting from left, I would like to put a text or image made of text on the right side which describes the overall application.
The Text or Image of made of text will be "BASIC PROGRAM" in a Green color with big font size.
Can anybody guide me how to proceed..
I was thinking using substitution strings such as #tab_cells# may work, but not sure where to put and how to do it?
appreciate your help..
Tabs are long due an overhaul, the customisation you can do on them is extremely limited. Short of completely overhauling your menu system, i'd alter this one tab through javascript/jquery.
Please take care with selectors for tabs. I have no idea which theme you are using, i did this for theme 21 with 2 level tabs, selecting a 2nd level tab. Inspect your HTML and adapt this to your requirement.
$("ul#tabs li").each(function(){
if($(this).text().indexOf('Maatregelen')!=-1){
$(this).children('a.tab_link').css(
{"background":'url()', "background-color":"green", "text-shadow":"none"}
);
};
});
I wouldn't change the template per se. There is not much you can do there to the tab generation, since you can not use plsql code. Rather, you could put the tab label in an attribute on a higher level than the a-tag, to have an easier jquery selector. Or you can put the javascript code in to run on-load. Or have a dynamic action on page zero to run on-load, and this will affect every tab in each page.