Resources
Images
Images should be imported as described here:
iOS images should be placed in
Asset
catalogs according to an application theme (Light.xcassets
is used as default).Before pushing:
- Open changed
Asset
catalogs; - Fix all image sets with exclamation points (choose image set, select items with exclamation points and delete them);
- Open
Attributes Inspector
(View
-Inspectors
-Show Attributes Inspector
); - Select all new image sets;
- Set
Appearances
toNone
; - Uncheck all
Devices
exceptUniversal
(if you are using only universal icons and images).
- Open changed
Push resources with "no contribute" commit in order not to spoil repository contribution statistics (details here).
Android image should be placed in
drawable
directory.
Fonts
To add new font (.ttf
supported only) please follow the next steps:
Add new font files (Font-Regular and Font-Bold) to
EduCATS/Fonts/Resources
directory and set build action toEmbeddedResource
.Add the following lines to the
EduCATS/Properties/AssemblyInfo.cs
file:
[assembly: ExportFont("Font-Regular.ttf")]
[assembly: ExportFont("Font-Bold.ttf")]
- If there is no bold version of font, please follow additional steps:
- Open
EduCATS/Fonts/FontExclude.cs
file. - Add font name to the
_excludeList
:
static readonly List<string> _excludeList = new List<string> {
"Other fonts...",
"Font-Regular"
};
- Usage in controls:
var entry = new Entry {
FontFamily = FontsController.GetCurrentFont(bold: true),
FontSize = FontSizeController.GetSize(size, typeof(Entry))
};
- If you use base control (like label, entry or button), you can use
AppStyles
inEduCATS/Heplers/Styles/AppStyles.cs
:
var entry = new Entry {
Style = AppStyles.GetEntryStyle(size: NamedSize.Large, bold: true)
};
Localization
To add a new language, please do the following:
Copy
EduCATS/Localization/**.json
.Translate it to a new language and name it with two-letter language code (
ISO 639-1
). For example,de.json
.Add it to
EduCATS/Localization
and set build action toEmbeddedResource
.Open
EduCATS/Configuration/AppConfig.cs
file, findsetupLocalization()
method and before add there a new line beforeCrossLocalization.SetDefaultLanguage(Languages.EN.LangCode);
:
CrossLocalization.AddLanguageSupport(Languages.DE); // Or whatever language you want
This automatically will add new language support across the application (including Settings).
More info about localization can be found here.
Themes
To add a new theme, please follow the next steps:
Create a new theme class in
EduCATS/Themes/Templates
;Inherit from
DefaultTheme
;Override properties declared in
DefaultTheme
:
override public string MainSelectedTabColor => "#27AEE1";
To add a new theme color/image/etc. do the following:
- Add a new property to
EduCATS/Themes/Interfaces/ITheme.cs
:
string AppStatusBarBackgroundColor { get; }
- Implement it in
DefaultTheme.cs
:
virtual public string AppStatusBarBackgroundColor => "#27AEE1";
- (optional) Override this property in other themes.