xamarin.android

How can I get a list of network files from my mono for android application?

若如初见. 提交于 2019-12-11 10:31:56
问题 I've been messing around with Mono for Android for a little while now. I am wondering how (or if it's possible) to access network files located on my NAS. I was really hoping it was going to be as easy as var files = System.IO.Directory.GetFiles("\\NAS-NAME\SomeDirectory\", "*"); Unfortunately, I'm getting this error message, so I'm guessing it's not quite as straight forward as a standard .NET application: Unhandled Exception: System.IO.DirectoryNotFoundException: Directory '\\NAS-NAME

Tabs with MVVMCross 6.2+

耗尽温柔 提交于 2019-12-11 10:22:11
问题 I have created simple Xamarin Android app with MVVMCross 6.2+ and trying to create tab layout properly. Right now I get only one (the last registered tab) on screen, but after rotation (recreation) there are all three of them (as it should be). What's wrong? What have I missed? How to fix it? Thanks in advance for your help. MvvmCrossTabs.Core HomeViewModel.cs using System.Collections.Generic; using System.Threading.Tasks; using MvvmCross.Commands; using MvvmCross.Logging; using MvvmCross

Monodroid screen dimensions

孤街浪徒 提交于 2019-12-11 10:20:18
问题 I'm trying to reference WindowManger so I can get the default screen's dimensions but I can't seem to find reference to it. (this is API 8, froyo 2.2). I even tried: dynamic wm = Android.App.Application.Context.GetSystemService(Android.Content.Context.WindowService); Display display = wm.getDefaultDisplay(); But got an error indicating that Object doesn't respond to getDefaultDisplay . Also I tried: var wm = (IWindowManager)Android.App.Application.Context.GetSystemService(Android.Content

How can I display ListView in Xamarin.Android Alert Dialog?

半世苍凉 提交于 2019-12-11 10:08:18
问题 I want display Listview inside the Android Alert Dialog. Please help me any one void SetDialog(IList<OrderInfo> orders, string contactGuid){ var dialogView = this.BindingInflate(Resource.Layout.guest_name_list, null); var dialog = new AlertDialog.Builder(this.Context); dialog.SetView(dialogView); dialog.SetNegativeButton("Cancel", (s, a) => { }); AlertDialog alertDialog = dialog.Create(); alertDialog.Show(); dialogView.FindViewById<TextView>(Resource.Id.AlertTitle).SetText

Xamarin: Unable to retrieve URLSpans from a TextView with links

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 10:05:01
问题 I'm trying to remove link underlines from textView in a Xamarin projects. The following snippet works well in a java project: textView.setText("You must agree to our terms and conditions"); Pattern pattern1 = Pattern.compile("terms and conditions"); Linkify.addLinks(textView, pattern1, "http://www.someLink.com", null, new Linkify.TransformFilter() { @Override public String transformUrl(Matcher match, String url) { return ""; } }); Spannable s = new SpannableString(textView.getText()); URLSpan

Adding long press gesture recognizer in Xamarin forms

给你一囗甜甜゛ 提交于 2019-12-11 09:54:09
问题 Could you please let me know how can I recognize long press gesture in Xamarin Forms application? This is my xaml page which i created referring to this thread: Xamarin.forms.DataGrid <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:DataGridSample_01" xmlns:dg="clr-namespace:Xamarin.Forms.DataGrid;assembly=Xamarin.Forms.DataGrid" x:Class="DataGridSample_01.MainPage"> <ContentView BackgroundColor="White

Xamarin.Forms List App with Icon (Android Only)

ε祈祈猫儿з 提交于 2019-12-11 09:29:27
问题 I have an Xamarin Forms project and i try to have a list of Installed applications with the icon. For now i have the Label, but i dont get the image. I use the Dependency Service to get the list of applications. : public IEnumerable<IAppListServiceApplication> GetApplications() { var apps = Android.App.Application.Context.PackageManager.GetInstalledApplications(PackageInfoFlags.MatchAll); foreach (var app in apps) { var label = app.LoadLabel(Android.App.Application.Context.PackageManager); if

ReplacementSpan in multiautocomplete textview overlap

我与影子孤独终老i 提交于 2019-12-11 09:27:33
问题 Hi i have multiple autocomplete text view with space tokenizer and use ReplacementSpan for background color change in each contacts my custom replacement code is public class MyForgroudSpan : ReplacementSpan { public override void Draw(Canvas canvas, ICharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint) { var rect = new RectF(x , top, x + paint.MeasureText(text, start, end)+8, bottom); paint.Color = Android.Graphics.Color.ParseColor("#E5E5E6"); canvas

How to indicate currently selected control in Xamarin?

ぃ、小莉子 提交于 2019-12-11 09:23:42
问题 The Android device I am using does not have any touchscreen. All it has is a touch pad that can generate KEYCODE_DPAD_UP, KEYCODE_DPAD_DOWN, etc. However, I am not sure if my Xamarin app is responding to these events. Is there any setting that one can enable to identify current selection among a group of controls. When I go the device's home screen and use the DPad keys to move around, I see a thin square around the icon that is currently selected. I am hoping there is a similar setting

What is the simplest way to use Java code in Mono for Android?

浪子不回头ぞ 提交于 2019-12-11 09:22:00
问题 I am trying to use popup balloons over custom overlay items in Mono for Android. I found this project https://github.com/jgilfelt/android-mapviewballoons, however it's written in Java. I've started manually converting it to C#, but it's a bit over my head. I've read that you can import java files to Mono, but I'm not sure which path is easier at this point. If someone has the projected I linked to in C# that would be even better. Thanks for any help! 回答1: I've taken the liberty to rewrite the