How to change Xamarin DatePicker popup header and Background to White and also Font Color to Gray - xamarin

I am trying to give custom look and feel to the datePicker popup. But I could not find any direct fields to change the header Background and Font Color of text shown in popup
enter image description here

You can try using below code inside styles.xml in Android Project.
<resources>
<style name="MainTheme" parent="MainTheme.Base">
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<!--header background-->
<item name="colorAccent">#fff</item>
<!--header textcolor-->
<item name="android:textColorPrimaryInverse">#808080</item>
<!--body background-->
<item name="android:windowBackground">#fff</item>
<!--selected day-->
<item name="android:colorControlActivated">#4B6043</item>
<!--days of the month-->
<item name="android:textColorPrimary">#808080</item>
<!--days of the week-->
<item name="android:textColorSecondary">#808080</item>
<!--cancel&ok-->
<item name="android:textColor">#808080</item>
</style>

Related

Set Notification Bar same color than Navigation Bar Xamarin

I'm working on a project with Xamarin Forms.
I followed the James Montemagno's guide https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/
but I can't get the same color in the Notification bar and Navigation Bar
I'm setting the Navigation bar color in App XAML like this
<ResourceDictionary>
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="#3b5998"/>
<Setter Property="BarTextColor" Value="White"/>
</Style>
</ResourceDictionary>
The style.xml and the values-v21/style.xml are the same that in the guide
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#color/primary</item>
<item name="colorPrimaryDark">#color/primaryDark</item>
<item name="colorAccent">#color/accent</item>
<item name="android:windowBackground">#color/window_background</item>
<item name="windowActionModeOverlay">true</item>
</style>
</resources>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#3b5998</item>
</style>
</resources>
I set the statusBarColor in the values-v21/style.xml, and a rare thing is that when I start to debug the application the Notifications bar get the color I set, but then when the application finish starting, it get back to the original color.
Here is a screenshot
I want to set the color of the Notifications Bar the same as Navigation Bar.
Thanks for your help guys!
I have to override the colorPrimaryDark style to achieve what I want.
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#3b5998</item>
<item name="colorPrimaryDark">#3b5998</item>
</style>
Thanks!
The status bar and the action bar can be set to the same colour by using the following xml in the values/Styles.xml file.
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="myTheme" parent="android:Theme.Material.Light.DarkActionBar">
<!-- Override the android colour scheme -->
<item name="android:colorPrimary">#color/my_primary</item>
<item name="android:statusBarColor">#color/my_primary</item>
</style>
</resources>
Do also make sure that you have the style included in the androidManifest.xml and you have custom colours set in the values/Colours.xml file.
<application android:label="Settings" android:icon="#drawable/Icon" android:theme="#style/myTheme"></application>

Magento 2 Component Showing on checkout but in wrong place

Background: Magento 2.1.7. Custom theme overriding default Luma theme.
I've got a custom component working and displaying on the checkout page but I'm struggling to get it to show where I want it.
I've called it 'my-component' and replaced the actual vendor with 'Vendor' below but I've written the associated js and html and the component works exactly as expected. The only issue is I'm trying to get it to render directly underneath the shipping form, so I think this is a layout issue?
My module currently just outputs the text 'Test' in a div and I'm trying to add my component to the children of 'item name="address-list-additional-addresses"'. I don't know if this is the right place but I'm just trying to get it after the form.
Currently it outputs directly above the shipping address form in an li with an id of "custom-field" which is not part of my .html template and I'm not knowingly adding. I can't find any way to add it after this shipping address form which is what I want.
I know my changes to checkout_index_index.xml are working as I can move my component to 'item name="before-shipping-method-form"' and it ends up above the shipping method form as you'd expect.
my-component.html (gets pulled in above shipping form inside li id="custom-field")
<div class="cart-tc-notice">
Test
</div>
checkout_index_index.xml (my theme's version and works - I can target other things in the default checkout_index_index.xml and it takes effect and moves my component around)
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="children" xsi:type="array">
<item name="address-list-additional-addresses" xsi:type="array">
<item name="children" xsi:type="array">
<item name="my-component" xsi:type="array">
<item name="component" xsi:type="string">Vendor/js/view/checkout/my-component</item>
</item>
I guess if I was dealing with containers or blocks, I'd just do a cheeky after="-"... Any suggestions?

Using Android Picker without useSpinner in Appcelerator

Here it reads http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Picker that the useSpinner property is deprecated. How do I use the picker properly then?
When I use the picker in Android without the useSpinner property it does not show up (left picker). When I click on the picker (green border) the values are showing up and it works properly.
With useSpinner set to true, it shows up properly (right). see screenshot.
Visibility of the picker is initially in the .xml set to false. When the user clicks on corresponding labels, the picker becomes visible. This works fine in iOS.
Actually, this is not any wrong behaviour. The red-border picker is outdated and you will hardly see it in any app, even native ones.
The standard picker is the left one which initially shows the selected value or the first value as default. As far as I know, you cannot directly change the text-color of left picker through .tss files.
Instead you can use custom themes and use it for that window which contains pickers.
Here is a quick example of how you can apply themes to pickers and other elements.
Save this xml code in a file (name it anything, let's say theme.xml).
Put this file at below location (create folders if doesn't exist).
Your_Project_Folder -> app -> platform -> android -> res -> values -> theme.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="PickerTheme" parent="#style/Theme.AppCompat.Light">
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<!-- Activate this for Spinners/Plain Pickers in selected/popup state -->
<!-- <item name="android:spinnerDropDownItemStyle">#style/SpinnerDropDownItem</item> -->
<!-- Override Date Dialog -->
<item name="android:datePickerDialogTheme">#style/MyDatePickerDialogTheme</item>
<!-- Override Time Dialog -->
<item name="android:timePickerDialogTheme">#style/MyTimePickerDialogTheme</item>
</style>
<!-- Use this style for Spinners/Plain Pickers in default state -->
<style name="SpinnerItem">
<item name="android:textColor">#000000</item>
</style>
<style name="SpinnerDropDownItem">
<item name="android:textColor">#color/primary_dark</item>
<item name="android:background">#color/accent</item>
</style>
<style name="MyDatePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
<item name="colorAccent">#color/primary</item>
<item name="android:textColorSecondary">#000000</item>
</style>
<style name="MyTimePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
<item name="colorAccent">#color/primary</item>
<item name="android:textColorSecondary">#000000</item>
</style>
</resources>
Now, you can use this theme either globally for all windows, or for particular window.
1 - Using theme for whole app, use this in tiapp.xml file.
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="#style/PickerTheme">
....
</application>
</manifest>
</android>
2 - Using theme in .tss file
"Window[platform=android]": {
theme : 'PickerTheme',
backgroundColor : 'white',
windowSoftInputMode : Ti.UI.Android.SOFT_INPUT_STATE_ALWAYS_HIDDEN | Titanium.UI.Android.SOFT_INPUT_ADJUST_RESIZE
}

Maven-pdf-plugin: How to include nested items in pdf?

I'm generating a pdf document from my maven site documentation using the maven-pdf-plugin. The documentation is written in Markdown.
Unfortunately the generated document does not include nested <item> tags.
For example, I have the the following content in my site.xml:
<menu name="Documentation">
<item name="Sweets" href="sweets/sweets.html" collapse="true">
<item name="Chocolate" href="sweets/chocolate.html"/>
<item name="Bublegum" href="sweets/bublegum.html"/>
<item name="Marzipan" href="sweets/marzipan.html"/>
</item>
</menu>
In the resulting pdf I have the contents of sweets.html, but not the content of all the sub items.
I also tried using a pdf.xml file with the following content included:
<toc name="Table of Contents" depth="4">
<item name="Sweets" ref="sweets/sweets.md">
<item name="Chocolate" ref="sweets/chocolate.md"/>
<item name="Bublegum" ref="sweets/bublegum.md"/>
<item name="Marzipan" ref="sweets/marzipan.md"/>
</item>
</toc>
Which gave me the same result.
Looking at the document model reference, it should be possible to nest <item> tags.
What am I doing wrong?
Here is some additional information:
Maven: 3.3.1
maven-pdf-plugin: 1.2
doxia-module-markdown: 1.6
Using maven-pdf-plugin Version 1.3 fixed the problem.

How to set colors for DatePicker dialog in Xamarin?

I'm trying to figure out how to change the background and text colors of the dialog box that shows when you tap a date or time picker. This is in a Xamarin forms project, specifically the android app. Those properties are not exposed anywhere in the DatePicker control or the renderer that I can find... currently it shows up as this bright pink... thanks!
Add item : "android:datePickerDialogTheme" in your style.xml
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#2196F3</item>
</style>
Complete style.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MyTheme.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">#2196F3</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#2196F3</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#2196F3</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">#2196F3</item>
</style>
<style name="MyDatePickerStyle" parent="#android:style/Widget.Material.Light.DatePicker">
<item name="android:headerBackground">#2196F3</item>
</style>
<style name="MyDatePickerDialogTheme" parent="android:Theme.Material.Light.Dialog">
<item name="android:datePickerStyle">#style/MyDatePickerStyle</item>
</style>
</resources>

Resources