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