Monodroid Layout Folder support - visual-studio

I'd like to use qualifiers on my layout folders as per the android documentation, but the designer in VS doesn't seem to support them. For example layout-w600dp doesn't get sent to the emulator; the default axml file from the layout folder is used.
Does anyone know if these settings are supported in Monodroid? If so, how do you make them take effect?

I think w600dp requires a certain api level to work - maybe 3.2 - see http://android-developers.blogspot.co.uk/2011/07/new-tools-for-managing-screen-sizes.html

Related

How to handle Namespace collisions when using TreeView in UWP apps

An exception is thrown when setting "ItemContainerStyle" to "StaticResource TreeViewItemStyle" which is defined in generic.xaml. The message indicates the style is using "Windows.UI.Xaml.Controls.TreeViewItem" rather than "Microsoft.UI.Xaml.Controls.TreeViewItem".
I removed ItemContainerStyle assignment to confirm that it is the line causing the exception.
<ControlTemplate TargetType="muxcontrols:TreeView">
<muxcontrols:TreeViewList x:Name="ListControl"
ItemTemplate="{StaticResource TreeViewItemDataTemplate}"
ItemContainerStyle="{StaticResource TreeViewItemStyle}">
The problem seems obvious, but a proper solution evades me. To leverage the style, do I start prepending "muxcontrols:" in the generic.xaml file? This seems like a bad idea. Do I need to recreate the style and behaviors separately?
I tried (min build 17763 and target build 17134) to eliminate version problems, but it seems I need 17763 for both. Even though, I am not setting ItemsSource. I'm trying the technique used in the docs: "learn.microsoft.com/en-us/windows/uwp/design/…" for the Music Library TreeView sample. My real project's min version is 16299.
So, the issue was clear. The TreeView control is introduced from build 17134. If you're using the platform APIs, you need to make sure that your project's target version is 17134 or higher. Since you said you want to set ItemsSource. ItemsSource and its related APIs require Windows 10, version 1809 (SDK 17763) or later, so you need to make your project's target version is 17763.
Then, you could directly use the TreeView control like the following:
<TreeView></TreeView>
If you're using Windows UI Library APIs, you need to follow the Getting started with the Windows UI Library
document to download and install the Windows UI Library. Please note:
Important: To use WinUI 2.1, your project’s Min version must be 14393 or higher and the Target version must be 17763 or higher.
Then, if you want to use the TreeView control in WinUI library, in your XAML page, add a reference at the top of your page
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
On the XAML page, you could directly input the following:
<controls:TreeView></controls:TreeView>

Accessing resources XML from another library project in Xamarin.Android

I am trying to create a Xamarin.Android Component to send to the Xamarin Component Store, and I need to bundle my Colors.xml with it, so it is accessible to everyone using my component. I am setting the build action for the Colors.xml tp "AndroidResource".
So I created an Android sample application, when I add a reference to my library project's dll, I am able to use the colors defined, my project compiles and it runs, but I get no intellisense on Xamarin Studio. So that would be a bad thing for anyone using my library, as they would not be able to even see that the colors are available to use. You can see in this picture the colors defined are not available in the suggestions box.
If I add the Colors.xml directly into my project, I get Intellisense support, like this:
Is there a way to achieve the same result above when adding just the dll reference? Did I do something wrong or Xamarin.Android/Xamarin Studio doesn't support this kind of scenario?
EDIT: To be clear, I know this is a problem with Intellisense not being able to pick up the values, but is there anything I can do to make it work?

Events are disabled in codenameone

I have problem when I want to access events. I already copied the resource files (nativej2me.res) under src directory but still the events are disabled within my project.
Can anyone help me how to arrange the resources so it enables the vents..?
Thanks
Don't move that resource file. Its not the place for it.
I'm guessing you created a handcoded application where GUI builder events aren't supported. You need to create a GUI builder project when creating a new project.
That's a GUI builder project (notice the visual not manual in the brackets)
Just for the googlers out there:
Have a look in the file codenameone_settings.properties - in there you'll find the property userClassAbs=something/StateMachine.java
Its an absolute path and it was showing the wrong directory. After fixing this I was able to add Events in the Designer again.

Use ApplicationBar Icons from other assemblies?

I have a Page in a Windows Phone class library. This page has an appbar. I would prefer everything this page needs to be included within the class library so the setup list for consumers of this page / assembly is minimal.
However, When I set ApplicationBar icons, they get added to the class library project under the folder 'icons' just like normal, they show up fine in Blend, but at runtime they are no where to be found!
When I put the icons in the Windows Phone Application project all is well. However this is not my desired scenario as it is additional configuration / setup by the application author to use my pages.
I tried using the resource pathing using /{AssemblyName};component/icons/{IconName} but of course the AppBar needs them to be of type "Content" not "Resource". So I am thinking this is impossible but I wanted to know if anybody out there figured out how to do this.
Sorry guys. I just figured it out. I changed the newly added icons from "Resource" to "Content" but I forgot to set "Copy if newer" so they weren't getting outputted to the Bin\Debug\icons folder of the windows Phone Application. something to keep an eye on I guess.

Monodroid Custom UI controls

I want to know where I can get access to the NinePatch images specifically for Monodroid. I want to change the default coloring from blue to orange (if I was doing this in Java it would already be orange).
All I need is to change an edittext so that it's default colors are different. I have seen
http://www.androidworks.com/changing-the-android-edittext-ui-widget
which is really helpful but only as far as vanilla Android is concerned. I tried following the instructions, but I found the standard orange java images, not the Mono ones, which are blue.
Minimum framework is 2.2. I know that I am getting the java images because when I go to C:\Android\android-sdk\platforms there is no android-2.2 folder.
I'm not really sure what you are referring to. Mono for Android does not ship any NinePatch images. Mono for Android simply provides a thin binding over the Java API, it does not do anything custom.
Maybe it is triggered by changing your Android target framework?
I found my answer - and thank goodnesss it did not involve changing the 9Patches!
You can make an xml in the drawable folder which describes your button, textbox, etc. and make a selector with a solid tag, pressed event, etc. (http://developer.android.com/guide/topics/resources/drawable-resource.html)
Then you can set up the colors as a constant set in the Values folder and boom! Solution!

Resources