I have a Xamarin Forms TabbedPage which contains a NavigationPage and I'm setting a ToolbarItem with two white icons. For some reason they appear black when my icons are white:
Here is my Xaml code:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Pick.Views"
x:Class="Pick.Views.MainView"
xmlns:utility="clr-namespace:Pick.Utility"
utility:ViewModelLocator.AutoWireViewModel="False">
<NavigationPage Title="{Binding Strings[Menu_MyPools]}">
<x:Arguments>
<views:PoolsView BindingContext="{Binding PoolsViewModel}"/>
</x:Arguments>
<NavigationPage.ToolbarItems>
<ToolbarItem Command="{Binding CreatePoolCommand}" Order="Primary" IconImageSource="ic_add_white_36dp.png">
</ToolbarItem>
<ToolbarItem Command="{Binding JoinPoolCommand}" Order="Primary" IconImageSource="ic_login_white_36dp.png">
</ToolbarItem>
</NavigationPage.ToolbarItems>
</NavigationPage>
I have tried setting AppThemeBinding and changing Styles.xml but nothing seems to work:
<ToolbarItem Command="{Binding CreatePoolCommand}" Order="Primary">
<ToolbarItem.IconImageSource>
<OnPlatform x:TypeArguments="ImageSource">
<On Platform="Android" Value="{AppThemeBinding Light=ic_add_white_36dp,Dark=ic_add_white_36dp}"/>
<On Platform="iOS" Value="{AppThemeBinding Light=ic_add_white_36pt,Dark=ic_add_white_36dp}"/>
</OnPlatform>
</ToolbarItem.IconImageSource>
</ToolbarItem>
Any ideas?
Here my styles.xml:
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#188223</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#1976D2</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#FF4081</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#FF4081</item>
</style>
</resources>
Tabbar.axml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabIndicatorColor="#android:color/white"
app:tabGravity="fill"
app:tabMode="fixed" />
Toolbar.axml:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
I just figured out my issue. Turns out that I had XML files corresponding to my images which had a vector definition inside. Not sure if those were automatically created by one of my material design icons VS extension. Once I remove, I see my icons in the right color.
I'd like to use fullCalendar in my xpage. It works with fullCalendar 1.6.7, not with 2.2.5 (nothing is displayed).
The sources are copied in package Explorer. This code works with the 1.6.7 sources:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.resources>
<xp:styleSheet href="fullcalendar/fullcalendar.css"></xp:styleSheet>
<xp:script src="js/jquery.min.js" clientSide="true"
type="text/javascript"></xp:script>
<xp:script src="fullcalendar/fullcalendar.min.js"
clientSide="true" type="text/javascript"></xp:script>
</xp:this.resources>
<xp:panel id="CalendarContainer"></xp:panel>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[var calCon = $("[id$=CalendarContainer]");
calCon.fullCalendar({});]]></xp:this.value>
</xp:scriptBlock>
The following code doesn't work with the 2.2.5 sources:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.resources>
<xp:styleSheet href="fullcalendar/fullcalendar.min.css"></xp:styleSheet>
<xp:script src="js/moment.min.js" clientSide="true"
type="text/javascript"></xp:script>
<xp:script src="js/jquery.min.js" clientSide="true"
type="text/javascript"></xp:script>
<xp:script src="fullcalendar/fullcalendar.min.js"
clientSide="true" type="text/javascript"></xp:script>
</xp:this.resources>
<xp:panel id="CalendarContainer"></xp:panel>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[var calCon = $("[id$=CalendarContainer]");
calCon.fullCalendar({});]]></xp:this.value>
</xp:scriptBlock>
</xp:view>
Any ideas?
Mark is right, You need to load the libraries before dojo
Here is the working code
<div class="cal"></div>
<xp:this.resources>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="jquery-2.1.3.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="moment.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="fullcalendar.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:styleSheet href="fullcalendar.min.css"></xp:styleSheet>
</xp:this.resources>
<xp:panel id="CalendarContainer"></xp:panel>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[var calCon = $(".cal");
calCon.fullCalendar({});]]></xp:this.value>
</xp:scriptBlock>
</xp:view>
I think that FullCalender started using an AMD loader for their JavaScript in v2. That doesn't play well with Dojo in XPages. See my answer here for more details and a possible solution.
The problem is - like Mark mentioned - that the current version uses AMD to load another library called "moment". This can be examined in the uncrompressed version of the fullcalendar.js file at the beginning. I made it working like this:
Create a theme and load all the resources there like
<theme
extends="yeti"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="platform:/plugin/com.ibm.designer.domino.stylekits/schema/stylekit.xsd">
<resource>
<content-type>application/x-javascript</content-type>
<href>bower_components/moment/moment.js</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>bower_components/fullcalendar/dist/fullcalendar.js</href>
</resource>
<resource>
<content-type>text/css</content-type>
<href>bower_components/fullcalendar/dist/fullcalendar.min.css</href>
</resource>
OR
load the moment.js also in your page resources separately.
Then open the fullcalendar.js file and edit the top of the code as follows (check the comments I made):
/*!
* FullCalendar v2.2.5
* Docs & License: http://arshaw.com/fullcalendar/
* (c) 2013 Adam Shaw
*/
(function(factory) {
/*
if (typeof define === 'function' && define.amd) {
define([ 'jquery', 'moment' ], factory);
}
else {
*/
factory(jQuery, moment);
//}
})(function($, moment) {
;;
I used the uncompressed version here to find the code but the compressed one is not such as obfuscated, so you should be able to add those comments there, too.
EDIT
I just saw Thomas' answer - that's the most elegant way to do it :-)
<Button
android:id="#+id/button_send"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#drawable/buttons"
android:drawablePadding="10dp"
android:gravity="left"
android:padding="15dp"
android:text="Button"
android:textColor="#fff"
android:textSize="15sp" />
Above is my code for Button in My xml file.
My button.xml code is
<item android:drawable="#drawable/btn_bg_hover"
android:state_pressed="true" />
<item android:drawable="#drawable/btn_bg_default"
android:state_focused="true" />
<item android:drawable="#drawable/btn_bg_default"/>
kindly help me how to add border to that button.
Note: #drawable/btn_bg_hover is image
User stroke tag Android - border for button
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:startColor="#FFFFFF" android:endColor="#00FF00" android:angle="270" />
<corners android:radius="3dp" />
<stroke android:width="5px" android:color="#000000" />
You have to make your custom background drawable file and use it, the stroke property is the one you have to use for making border.
Steps :
Go to res -> drawable -> by right click -> new -> android drawable resource
copy paste this code
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#FFFFFF"
android:endColor="#00FF00"
android:angle="270" />
<stroke android:width="5px" android:color="#000000" />
</shape>
Here you see the stroke you can change values to make it in your way.
and use it as any components background by
<android:Background ="#drawable/yourCustomBorder.xml"> for example.
I have gone over this code for the last couple of hours and I can not figure out why it is not working. It was working until i started adding more place markers. When I run it though a KML validator i get the following error "Unable to read content from xxxx.kml. Are the file format and character encoding correct?"
Does anyone know what I am doing wrong?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<document>
<Placemark>
<name>The Stables Bar</name>
<description>888 Hay St, Perth WA 6000</description>
<Point>
<coordinates>115.853097,-31.952223,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Laneway Lounge</name>
<description>414A Murray Street Perth WA 6000</description>
<Point>
<coordinates>115.853839,-31.951099,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Choo Choo's</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.854628,-31.954883,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Apple Daily</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.854738,-31.954855,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar de Halcyon</name>
<description>Wolf Lane Perth, WA 6000</description>
<Point>
<coordinates>115.855933,-31.952619,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bob's Bar at Print Hall</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.855170,-31.954918,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar Lafayette</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.854679,-31.954819,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>1907 Restaurant and Cocktail Bar</name>
<description>26 Queen St, Perth</description>
<Point>
<coordinates>115.856590,-31.951334,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Lalla Rookh</name>
<description>77 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.858371,-31.955540,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar One</name>
<description>250 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.850572,-31.952616,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Cheeky Sparrow</name>
<description>Shop 1/317 Murray St Perth WA 6000</description>
<Point>
<coordinates>115.855964,-31.952298,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Sasellas Bar & Bistro</name>
<description>Upper Hay Street Level, Carillon City Arcade, Perth WA 6000</description>
<Point>
<coordinates>115.858865,-31.953137,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Sentinel Bar & Grill Restaurant</name>
<description>111 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.855805,-31.954909,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Boheme</name>
<description>300 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.857400,-31.952189,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Conservatory Rooftop Bar</name>
<description>365 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.854993,-31.951568,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Greenhouse</name>
<description>100 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.857670,-31.954887,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Trustee Bar and Bistro</name>
<description>133 St Georges Tce, Perth WA 6000</description>
<Point>
<coordinates>115.855176,-31.954423,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Tiger,Tiger</name>
<description>329 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.855975,-31.952062,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Venn Bar + Cafe</name>
<description>16 Queen St, Perth WA 6000</description>
<Point>
<coordinates>115.856495,-31.951748,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Wolf Lane Bar</name>
<description>Wolf Lane 321 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.855748,-31.952510,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Butterworth Bar & Kitchen</name>
<description>Ground Floor, Exchange Plaza, Perth WA 6000</description>
<Point>
<coordinates>115.858659,-31.956595,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Canton Lounge Bar</name>
<description>532 Hay St, Perth WA 6000</description>
<Point>
<coordinates>115.862666,-31.955345,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Etro Bar</name>
<description>49 King St, Perth WA 6000</description>
<Point>
<coordinates>115.855095,-31.951920,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Varnish on King</name>
<description>75 King St, Perth WA 6000</description>
<Point>
<coordinates>115.855543,-31.950993,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Lost Society</name>
<description>918 Hay St, Perth WA 6000</description>
<Point>
<coordinates>115.852335,-31.951861,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Mechanic Institute</name>
<description>222 William St, Northbridge WA 6000</description>
<Point>
<coordinates>115.859842,-31.948820,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Universal Bar</name>
<description>221 William St, Perth WA 6003</description>
<Point>
<coordinates>115.859543,-31.948670,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Frisk Small Bar</name>
<description>31/103-105 Francis St, Perth WA 6003</description>
<Point>
<coordinates>115.856724,-31.946700,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Pica Bar and Cafe</name>
<description>Perth Cultural Centre, James St, Northbridge WA 6000</description>
<Point>
<coordinates>115.860328,-31.949734,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Ellington Jazz Club</name>
<description>191 Beaufort St, Perth WA 6000</description>
<Point>
<coordinates>115.864292,-31.946683,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Moon Cafe</name>
<description>Shop 2/323 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.861155,-31.946033,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Brown Fox</name>
<description>72 Outram St, West Perth WA 6005</description>
<Point>
<coordinates>115.840356,-31.947353,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Hula Bula Bar</name>
<description>12 Victoria Ave, Perth WA 6000</description>
<Point>
<coordinates>115.865790,-31.956914,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Andaluz Bar & Tapas</name>
<description>321 Howard St, Perth WA 6000</description>
<Point>
<coordinates>115.857228,-31.955534,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Ezra Pound</name>
<description>189 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.858998,-31.949364,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Bird</name>
<description>181 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.858844,-31.949706,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The George</name>
<description>216 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.852535,-31.953275,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Amphoras Bar</name>
<description>1303 Hay St, West Perth WA 6005</description>
<Point>
<coordinates>115.839396,-31.947948,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Ya-Ya's</name>
<description>147 James St, Northbridge WA 6003</description>
<Point>
<coordinates>115.856888,-31.948061,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bivouac Canteen & Bar</name>
<description>198 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.859211,-31.949395,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bobeche</name>
<description>131 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.855194,-31.954401,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Aviary</name>
<description>1/140 William St, Perth, WA 6000</description>
<Point>
<coordinates>115.857878,-31.952255,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>399 Bar</name>
<description>399 William St, Perth WA 6000</description>
<Point>
<coordinates>115.862158,-31.944359,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Helvetica Bar</name>
<description>101 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.856947,-31.955478,0</coordinates>
</Point>
</Placemark>
</document>
</kml>
Basically KML is XML. In XML the & may only be used to define a character entity reference. When you want to use the & as character you must encode it as &
Your KML contains multiple non-encoded &
You may easy validate the KML as XML by giving it the extension .xml and opening it in any browser. When there are XML-errors the browser will give you a message.