static void Main(string[] args) { Smartphone sp; IFounder founder; IOffice office; sp = new Huawei(); founder = new IHuawei(); office = new IHuawei(); founder.Founder(); office.officeAddress(); sp.subBrand(); sp.OS(); sp.Games(); sp.Calling(); sp.Internet(); Console.WriteLine(); sp = new OPPO(); founder = new IOPPO(); office = new IOPPO(); founder.Founder(); office.officeAddress(); sp.subBrand(); sp.OS(); sp.Games(); sp.Calling(); sp.Internet(); Console.WriteLine(); sp = new Xiaomi(); founder = new IXiaomi(); office = new IXiaomi(); founder.Founder(); office.officeAddress(); sp.subBrand(); sp.OS(); sp.Games(); sp.Calling(); sp.Internet(); Console.ReadKey(); }
/// <summary> /// 是否为刘海屏设备 /// </summary> /// <param name="activity"></param> /// <returns></returns> public static bool?IsNotch(Activity activity) { if (Build.VERSION.SdkInt >= BuildVersionCodes.P) { return(activity?.Window?.DecorView.RootWindowInsets?.DisplayCutout != null); } else if (AndroidROM.Current.IsMIUI) { return(MI.IsNotch()); } else if (AndroidROM.Current.IsEMUI) { return(HUAWEI.HasNotchInScreen(activity)); } else if (AndroidROM.Current.IsColorOS) { return(OPPO.IsNotch(activity)); } else if (AndroidROM.Current.IsFuntouchOS) { return(Vivo.IsNotch(activity)); } return(null); }