xamarin.android

Show Acr User Dialogs loader until end of method xamarin forms (android)

南楼画角 提交于 2020-07-08 09:40:33
问题 I use ShowLoading() Acr UserDialogs (v5.2.2) on my xamarin forms project (android and ios) but i wont start loader before start await method and Hide Loader with the end. My code working on ios but on android nothing happened. example async Task MyMethod() { UserDialogs.Instance.ShowLoading("Loading",MaskType.Black); await ViewModel.LoadData(); UserDialogs.Instance.HideLoading(); } //InsideViewModel public async Task LoadData(); { await Task.Yield(); //without this code and ios doesnt work /

Show Acr User Dialogs loader until end of method xamarin forms (android)

六月ゝ 毕业季﹏ 提交于 2020-07-08 09:39:10
问题 I use ShowLoading() Acr UserDialogs (v5.2.2) on my xamarin forms project (android and ios) but i wont start loader before start await method and Hide Loader with the end. My code working on ios but on android nothing happened. example async Task MyMethod() { UserDialogs.Instance.ShowLoading("Loading",MaskType.Black); await ViewModel.LoadData(); UserDialogs.Instance.HideLoading(); } //InsideViewModel public async Task LoadData(); { await Task.Yield(); //without this code and ios doesnt work /

Xamarin.Android how to save textview values inside of a recyclerview item

£可爱£侵袭症+ 提交于 2020-06-29 04:08:09
问题 I have implemented a reorder recyclerview in my app as per the following link: https://www.appliedcodelog.com/2019/08/reorder-list-items-by-drag-and-drop-in.html The user can add and click on any of the items to change the qty and unit type and also add the price of the item via a custom dialog (see attached screen shots). Currently the item names are saved by converting the list to Json. So when the app is reopened the items are loaded back into the list. My question is, how can I also save

Alternative to LayerDrawable.SetPadding on android 5

╄→гoц情女王★ 提交于 2020-06-29 03:59:07
问题 I've been using this code to create a custom picker in Xamarin.Forms running on Android. But it fails at runtime on devices with Android 5.1 on the call to SetPadding. NoSuchMethodError: no non-static method "Landroid/graphics/drawable/LayerDrawable;.setPadding Is there an alternative for what seems to have been introduced in Android 6 (API 23)? EDIT: Fixed the link to the failing code. 回答1: You could create a subclass inherit from LayerDrawable , override the getter method of BottomPadding ,

Xamaring.Forms Android 8.0 - Visual Studio 2019

时光总嘲笑我的痴心妄想 提交于 2020-06-28 05:25:56
问题 I'm becoming crazy. I want to compile Xamarin.Forms for Android 8.0 with Visual Studio 2019 I setup all correct, I think, but I always get: Error The $(TargetFrameworkVersion) for App_test32.Android (v8.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (8.1). You need to increase the $(TargetFrameworkVersion) for App_test32.Android. App_test32.Android 回答1: You cannot target 8.0 and that's for a reason. Starting from August 1, 2019 Google doesn't accept new apps

Android Emulator not working with Xamarin / Visual Studio Mac

一曲冷凌霜 提交于 2020-06-28 05:01:25
问题 Hi i'm really struggling to get the Android emulator running on my Mac. What are the steps I need to take to get this working? I've got Visual Studio 2019 on MacOS Catalina This is on a new blank Xamarin Forms project I've tried to go Tools > Device Manager > New Device. Pixel 3 XL , x86_64, Q 10. I keep getting this message: Android emulator component is incomplete therefore the device Pixel 3 XL Q 10.0 - API 29 could not be created. Do you want us to reinstall the Android Emulator? I've

OidcClient2 - Closing IBrowser while waiting for LoginAsync

混江龙づ霸主 提交于 2020-06-27 15:55:07
问题 Currently I am developing a Xamarin App which is using IdentityModel.OidcClient to authenticate against my server, and it is being done using the automatic mode presented on the documentation (https://github.com/IdentityModel/IdentityModel.OidcClient2). Everything is working just fine as var result = await client.LoginAsync(); is returning the LoginResult with the AccessToken, etc. What I am trying to figure out is how the backbutton, the recent apps button (both on android) and the close

Navigation back from LockScreen

这一生的挚爱 提交于 2020-06-27 05:57:09
问题 i have a carousel page and on each of them i have a button and the user is able to lock the page. For that i am using dependency service and that works fine, however if i want to come back from the second page i am redirected to the first page and the page sort of "freezes". I need to be able to return to the second page of the carousel page. Can you help please? I have tried INavigation but i am getting a null exception. 2.I have also tried just override OnBackButton but that gets me back to

Problem with LayoutInDisplayCutoutMode in Xamarin

守給你的承諾、 提交于 2020-06-26 11:32:14
问题 I have a weird issue with setting an attribute for cutout mode in Xamarin.Android. I want to add support in my app for cutout mode, hence I updated the project to use SDK 9.0 and I added this single line to my Activity: Window.Attributes.LayoutInDisplayCutoutMode = LayoutInDisplayCutoutMode.ShortEdges; My project compiles but when it runs I get this exception on the line above: Java.Lang.NoSuchFieldError: no "I" field "layoutInDisplayCutoutMode" in class "Landroid/view/WindowManager

Setting android theme to follow system does not change to current system theme

最后都变了- 提交于 2020-06-17 10:09:42
问题 In the settings of my app i have it so that you are able to switch the theme off the app between Light, Dark and following the system. Switching between them is fine and i have that all setup however when switching to follow system from one of the other themes it does not change to the systems theme if the theme before was different to the system. I am using this code to switch the theme: { Spinner spinner = (Spinner)sender; string selectedSpinnerItem = spinner.GetItemAtPosition(e.Position)