From e08a444a9d7acea0cf39f50d22d29179f6a59292 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 01 十二月 2020 09:37:11 +0800 Subject: [PATCH] 2020-12-1 --- HDL-ON_Android/Other/JLCountrycode.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/HDL-ON_Android/Other/JLCountrycode.cs b/HDL-ON_Android/Other/JLCountrycode.cs new file mode 100644 index 0000000..cdf913a --- /dev/null +++ b/HDL-ON_Android/Other/JLCountrycode.cs @@ -0,0 +1,56 @@ +锘縰sing 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); + } + } +} \ No newline at end of file -- Gitblit v1.8.0