@@ -38,29 +38,37 @@ public sealed class AndroidConfiguration
3838 const int ColorModeHdrMask = 12 ;
3939 const int ColorModeWideColorGamutMask = 3 ;
4040
41- private int colorMode { get ; }
42- public int densityDpi { get ; }
43- public float fontScale { get ; }
44- public int fontWeightAdjustment { get ; }
45- public AndroidKeyboard keyboard { get ; }
46- public AndroidHardwareKeyboardHidden hardKeyboardHidden { get ; }
47- public AndroidKeyboardHidden keyboardHidden { get ; }
48- public int mobileCountryCode { get ; }
49- public int mobileNetworkCode { get ; }
50- public AndroidNavigation navigation { get ; }
51- public AndroidNavigationHidden navigationHidden { get ; }
52- public AndroidOrientation orientation { get ; }
53- public int screenHeightDp { get ; }
54- public int screenWidthDp { get ; }
55- public int smallestScreenWidthDp { get ; }
56- private int screenLayout { get ; }
57- public AndroidTouchScreen touchScreen { get ; }
58- private int uiMode { get ; }
59- private string primaryLocaleCountry { get ; }
60- private string primaryLocaleLanguage { get ; }
41+ private int colorMode { get ; set ; }
42+ public int densityDpi { get ; private set ; }
43+ public float fontScale { get ; private set ; }
44+ public int fontWeightAdjustment { get ; private set ; }
45+ public AndroidKeyboard keyboard { get ; private set ; }
46+ public AndroidHardwareKeyboardHidden hardKeyboardHidden { get ; private set ; }
47+ public AndroidKeyboardHidden keyboardHidden { get ; private set ; }
48+ public int mobileCountryCode { get ; private set ; }
49+ public int mobileNetworkCode { get ; private set ; }
50+ public AndroidNavigation navigation { get ; private set ; }
51+ public AndroidNavigationHidden navigationHidden { get ; private set ; }
52+ public AndroidOrientation orientation { get ; private set ; }
53+ public int screenHeightDp { get ; private set ; }
54+ public int screenWidthDp { get ; private set ; }
55+ public int smallestScreenWidthDp { get ; private set ; }
56+ private int screenLayout { get ; set ; }
57+ public AndroidTouchScreen touchScreen { get ; private set ; }
58+ private int uiMode { get ; set ; }
59+ private string primaryLocaleCountry { get ; set ; }
60+ private string primaryLocaleLanguage { get ; set ; }
6161 // Having this as an array, because it seems you can have multiple locales set, but for now we can only acquire primary locale
6262 // In case we'll have a way to acquire multiple locales in the future, have this as an array to prevent API changes
63- public AndroidLocale [ ] locales => new [ ] { new AndroidLocale ( primaryLocaleCountry , primaryLocaleLanguage ) } ;
63+ public AndroidLocale [ ] locales
64+ {
65+ get
66+ {
67+ if ( primaryLocaleCountry == null && primaryLocaleLanguage == null )
68+ return new AndroidLocale [ 0 ] ;
69+ return new [ ] { new AndroidLocale ( primaryLocaleCountry , primaryLocaleLanguage ) } ;
70+ }
71+ }
6472
6573 // Below properties are not marshalled
6674 public AndroidColorModeHdr colorModeHdr => ( AndroidColorModeHdr ) ( colorMode & ColorModeHdrMask ) ;
@@ -72,6 +80,39 @@ public sealed class AndroidConfiguration
7280 public AndroidUIModeNight uiModeNight => ( AndroidUIModeNight ) ( uiMode & UiModeNightMask ) ;
7381 public AndroidUIModeType uiModeType => ( AndroidUIModeType ) ( uiMode & UiModeTypeMask ) ;
7482
83+ public AndroidConfiguration ( )
84+ {
85+ }
86+
87+ public AndroidConfiguration ( AndroidConfiguration otherConfiguration )
88+ {
89+ this . CopyFrom ( otherConfiguration ) ;
90+ }
91+
92+ public void CopyFrom ( AndroidConfiguration otherConfiguration )
93+ {
94+ colorMode = otherConfiguration . colorMode ;
95+ densityDpi = otherConfiguration . densityDpi ;
96+ fontScale = otherConfiguration . fontScale ;
97+ fontWeightAdjustment = otherConfiguration . fontWeightAdjustment ;
98+ keyboard = otherConfiguration . keyboard ;
99+ hardKeyboardHidden = otherConfiguration . hardKeyboardHidden ;
100+ keyboardHidden = otherConfiguration . keyboardHidden ;
101+ mobileCountryCode = otherConfiguration . mobileCountryCode ;
102+ mobileNetworkCode = otherConfiguration . mobileNetworkCode ;
103+ navigation = otherConfiguration . navigation ;
104+ navigationHidden = otherConfiguration . navigationHidden ;
105+ orientation = otherConfiguration . orientation ;
106+ screenHeightDp = otherConfiguration . screenHeightDp ;
107+ screenWidthDp = otherConfiguration . screenWidthDp ;
108+ smallestScreenWidthDp = otherConfiguration . smallestScreenWidthDp ;
109+ screenLayout = otherConfiguration . screenLayout ;
110+ touchScreen = otherConfiguration . touchScreen ;
111+ uiMode = otherConfiguration . uiMode ;
112+ primaryLocaleCountry = otherConfiguration . primaryLocaleCountry ;
113+ primaryLocaleLanguage = otherConfiguration . primaryLocaleLanguage ;
114+ }
115+
75116 [ Preserve ]
76117 public override string ToString ( )
77118 {
0 commit comments