Karamunting.Android.Metalurgus.LocaleText
0.0.1.1
dotnet add package Karamunting.Android.Metalurgus.LocaleText --version 0.0.1.1
NuGet\Install-Package Karamunting.Android.Metalurgus.LocaleText -Version 0.0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Karamunting.Android.Metalurgus.LocaleText" Version="0.0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Karamunting.Android.Metalurgus.LocaleText --version 0.0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Karamunting.Android.Metalurgus.LocaleText, 0.0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Karamunting.Android.Metalurgus.LocaleText as a Cake Addin #addin nuget:?package=Karamunting.Android.Metalurgus.LocaleText&version=0.0.1.1 // Install Karamunting.Android.Metalurgus.LocaleText as a Cake Tool #tool nuget:?package=Karamunting.Android.Metalurgus.LocaleText&version=0.0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Simple Usage
Please refer to original doc https://github.com/metalurgus/LocaleText for more information.
// Rofiq Setiawan
using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Metalurgus.Github.Com.Lib.Base.Base;
using Metalurgus.Github.Com.Lib.Base.Views;
using Locale = Java.Util.Locale;
using R = LocaleTextDemo.Resource;
namespace LocaleTextDemo
{
[Activity(Label = "@string/app_name", MainLauncher = true, Theme = "@style/AppTheme.NoActionBar")]
public sealed class MainActivity : AppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(R.Layout.activity_main);
// RU button
FindViewById<LocaleTextButton>(R.Id.rus).Click += delegate
{
LocaleText.SetLocale(new Locale("ru", "RU"), this);
};
// EN button
FindViewById<LocaleTextButton>(R.Id.eng).Click += delegate
{
LocaleText.SetLocale(new Locale("en", "US"), this);
};
// Custom Listener TextView
FindViewById<LocaleTextTextView>(R.Id.custom_listener).SetOnLocaleChangeListener(
new OnLocaleChangeListener(
(locale, localeResId, context, listenable) =>
{
switch (locale.ISO3Language.ToLower())
{
case "rus":
listenable.SetText(context.Resources.GetString(R.String.custom_text));
break;
case "eng":
listenable.SetText(context.Resources.GetString(R.String.custom_text));
break;
}
}
)
);
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
MonoAndroid | monoandroid70 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
MonoAndroid 7.0
- Xamarin.Android.Support.Animated.Vector.Drawable (>= 25.4.0.2)
- Xamarin.Android.Support.Annotations (>= 25.4.0.2)
- Xamarin.Android.Support.Compat (>= 25.4.0.2)
- Xamarin.Android.Support.Core.UI (>= 25.4.0.2)
- Xamarin.Android.Support.Core.Utils (>= 25.4.0.2)
- Xamarin.Android.Support.Fragment (>= 25.4.0.2)
- Xamarin.Android.Support.Media.Compat (>= 25.4.0.2)
- Xamarin.Android.Support.v7.AppCompat (>= 25.4.0.2)
- Xamarin.Android.Support.Vector.Drawable (>= 25.4.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.1.1 | 1,205 | 4/27/2018 |