Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egorozh/mobiletoolkit
Source generators for C# Mobile Developing
https://github.com/egorozh/mobiletoolkit
android source-generators xamarin xamarin-android xamarin-android-binding
Last synced: 13 days ago
JSON representation
Source generators for C# Mobile Developing
- Host: GitHub
- URL: https://github.com/egorozh/mobiletoolkit
- Owner: egorozh
- Created: 2023-03-04T12:24:04.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T20:09:52.000Z (over 1 year ago)
- Last Synced: 2024-04-27T05:03:38.597Z (9 months ago)
- Topics: android, source-generators, xamarin, xamarin-android, xamarin-android-binding
- Language: C#
- Homepage:
- Size: 256 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Nuget](https://img.shields.io/nuget/v/MobileToolkit.Android?label=MobileToolkit.Android)](https://www.nuget.org/packages/MobileToolkit.Android)
# .NET Mobile Toolkit
## 1. Source generator for getting android controls from xml layout
Get started:
Install the library as a NuGet package:
```powershell
Install-Package MobileToolkit.Android
# Or 'dotnet add package MobileToolkit.Android'```
And usage:
``` csharp[Activity]
[AndroidLayout(LayoutResource = nameof(Resource.Layout.activity_main))]
public partial class MainActivity : Activity
{
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);SetContentView(Resource.Layout.activity_main);
}
}```
The generated file looks like this:
``` csharp
using Android.Widget;
using Android.Views;namespace SGM.Sample.Android
{
partial class MainActivity
{
public TextView TextView => this.FindViewById(Resource.Id.TextView);public Button Button => this.FindViewById(Resource.Id.Button);
public EditText EditText => this.FindViewById(Resource.Id.EditText);
public View RecyclerView => this.FindViewById(Resource.Id.RecyclerView);
}
}
```Plans:
1) Source generator for generate bindings code
2) Source generator for generate ui controls like android compose
3) Source generator for DI container
4) Source generator for generate outlets on .xib files