using System;
using Android.Content;
using Com.Widget.Jlcountrycode;
namespace Jlcountrycode
{
public class CountryCodeView
{
///
/// 接口类的返回信息
///
private static CountryCodeView m_Current = null;
///
/// 接口类的返回信息
///
public static CountryCodeView Current
{
get
{
if (m_Current == null)
{
m_Current = new CountryCodeView();
}
return m_Current;
}
}
///
/// 国家区号选择
///
///
public void Show(Action action)
{
JLCountryCodeActivity.OnCountryCodeCallback = new OnCountryCodeCallback(action);
Shared.Application.Activity.StartActivity(new Intent(Shared.Application.Activity, typeof(JLCountryCodeActivity)));
}
}
///
/// OnCountryCodeCallback
///
public class OnCountryCodeCallback : Java.Lang.Object, Com.Widget.Jlcountrycode.Contact.IOnCountryCodeCallback
{
Action mAction;
public OnCountryCodeCallback(Action action)
{
mAction = action;
}
public void OnSelectCountryCallback(string countryName, string code)
{
mAction?.Invoke(countryName, code);
}
}
}