SearchView UI component in Android 2.2 - android-2.2-froyo

I want to know that if I can have a SearchView UI component in my app(that is in API level 8). The SearchView, in my knowledge was included from API level 11. Is there any component other that EditText with drawable of a search icon that I could possibly use in this context. I dont want any search api, Im planning to integrate my own functionality with this SearchView UI component.
Thanks in advance
Happy coding.

You can use the SearchView provided by AppCompat: android.support.v7.widget.SearchView
Check this link on how to integrate the Support Library into your project:

Related

Can I share UWP viewmodels with xamarin iOS?

What is realistic amount of code share between Xamarin and UWP?
I have app which has following layers:
1. UWP platform specific apis
2. Messaging protocol based on these apis
3. Services
4. ViewModels
5. Xaml Views communicating with INotifyPropertyChanged and ICommand
I understand that obviously 1 (platform specific apis) an 5 (xaml views) cannot be shared. Layers 2 and 3 should be ok. What about ViewModels? I think it should be possible to achieve this using thin layer of viewModel adapter, is this realistic?
Also I am not planning to use xamarin.forms.
The answer depends on your application.
UWP has many specific APIs that as such don't work on Xamarin. They are not necessary related to views only but can be also related to viewmodel code. If your viewmodel is a separate .Net standard project then you can reuse it completely, but as it is not always the case with UWP apps you can probably reuse just most of the code.
The second part comes down to actually using this viewmodel in iOS/macOS project. As you don't want to use XAML (Xamarin.Forms), there is no data binding provided. Basically you have to do whole data binding manually. Some MVVM frameworks may help you in that, but if you ask me they should be called 'helpers', not frameworks.

Xamarin.Forms 4.0 CollectionView Pull-To-Refresh

I'm trying out the pre-release CollectionView control for Xamarin.Forms 4.0 and I've run into a small hickup.
I've ben able to get binding, styling, etc. working perfectly, but I'm unable to figure out how to implement Pull-To-Refresh. This is in the shared code project and final product targets iOS and Android only.
I've been over Microsoft's documentation and haven't been able to find a clear solution for this.
The only reference I've seen to anything remotely related to this issue comes from a GitHub discussion on the XF page (Xamarin.Forms.CollectionView Spec Discussion) where they mention that the IsPUllToRefreshEnabled functionality has been moved from the ListView API to a new RefreshView control.
Can anyone shine any light on this issue and if this is even possible to implement? (Data for collection view is fed by Refit API call)
The RefreshView is still in spec, not yet implemented (see the Github page)
However, from the comments, you can try and use PullToRefresh Nuget, that allows pull to refresh on a scrollview or a listview.

xamarin forms start nativ uwp page

any idea how I can start a native UWP page from a Xamarin Forms page?
The reason why I'm asking:
I have a XF application that needs to start a UWP library after a click event.
This library provides a special ORC reader.
Therefore I created a dependency service to run the platform specific function.
What I need now, is to open that UWP page, that contains the "Camera stream" to show the user what he is currently scanning.
And this is where I am hanging at the moment.
In my class that is called from the dep. service, I
myPage mp = new myPage();
But how can I show the new page?
Frame fr = Window.Current.Content as Frame gives me the error, that this page cannot be converted from a XF Frame to a Window Frame.
Or is there generally another way to handle this? Some advice would be great.
This sounds like a custom renderer.
Create a new OcrView class in your shared project inherited from View.
Place it on your Xamarin Forms XAML page.
Handle the OCR component in the UWP renderer.
Have a look at the Implementing a View section on this custom renderer overview

Xamarin Forms - Map CustomImagePin with text label right below

Hi StackOverflow Community.
I am struggling to add a text label along with a custom image pin in Xamarin forms custom map project.
Currently, i followed up the official Xamarin forms the documentation of how to implement custom pins on the map.
But want to extend a little more this functionality as showing also a label right below the pin is Critical for the application.
I wasn't lucky to find any custom solution for this
Could you please assist?
Below you can find the website solution I am using with google maps. Something like that needs to be created also for the Xamarin app

How to use MVVM Light DispatcherHelper with Xamarin.Forms

I have a Xamarin Forms application that was created using the standard Xamarin.Forms Shared solution template for Visual Studio.
The Android project uses a MainActivity class that derives from Xamarin.Forms.Platform.Android.FormsApplicationActivity.
Within this solution, I am hoping to use the DispatcherHelper component from the MVVM Light Toolkit.
However, whenever I attempt to use DispatcherHelper.CheckBeginInvokeOnUI() to marshall to the UI thread, the app throws an InvalidOperationException, as follows:
The DispatcherHelper cannot be called.
Make sure that your main Activity derives from ActivityBase.
Looking at the inheritance hierarchy of FormsApplicationActivity, I can see that it does not derive from ActivityBase, so this clearly explains the problem.
However, I wonder if there is an alternative way of using this DispatcherHelper that is compatible with Xamarin Forms or, alternatively, an alternative base class from which I can derive my MainActivity.
Many thanks for your suggestions,
Tim

Resources