-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: added whitelabel script, added login background color * style: added rounded corner FF * chore: changed assets for progress bar and unibutton color * chore: added multiple assets supporting * chore: move whitelabel config into config repo * chore: moved extra Assets to Theme target * chore: return back splash screen background color * chore: added logs for whitelabel script * chore: rounded buttons theming * chore: changes in whitelabel script * chore: fix after merge * chore: added themed button shape for social login buttons * style: add login navigation text color as separate * chore: added app icon changing * chore: add comment * chore: added bundle id changing * chore: set dev team in project file * chore: got rid original images names from config, now read from Content.json * chore: reorder configs * chore: added documentation * chore: missed quotes * refactor: theme config * chore: backbutton color on sign in view * chore: fixed misspelling * refactor: change to snake_style stage1 * refactor: changed to snake_style stage2 * chore: added app versions, refactor and unify code to search parameters in project file * chore: added install dependencies to documentation * chore: fixed according feedback, improved documentation * chore: fixed how to get config example * chore: improve documentation
- Loading branch information
Showing
21 changed files
with
725 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// ThemeConfig.swift | ||
// Core | ||
// | ||
// Created by Anton Yarmolenka on 01/12/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
private enum ThemeKeys: String { | ||
case isRoundedCorners = "ROUNDED_CORNERS_STYLE" | ||
} | ||
|
||
public final class ThemeConfig: NSObject { | ||
public var isRoundedCorners: Bool | ||
|
||
init(dictionary: [String: AnyObject]) { | ||
isRoundedCorners = dictionary[ThemeKeys.isRoundedCorners.rawValue] as? Bool != false | ||
super.init() | ||
} | ||
} | ||
|
||
private let ThemeKey = "THEME" | ||
extension Config { | ||
public var theme: ThemeConfig { | ||
ThemeConfig(dictionary: self[ThemeKey] as? [String: AnyObject] ?? [:]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Theming Implementation | ||
This documentation provides instructions on how to implement Theme assets for the OpenEdX iOS project. | ||
|
||
## Python dependecies | ||
The `whitelabel.py` theming script requires the following Python dependencies to be installed: | ||
- `pip3 install coloredlogs` | ||
- `pip3 install pillow` | ||
- `pip3 install pyyaml` | ||
|
||
## How to Run the Script | ||
The theming script `whitelabel.py` can be run from the OpenEdX iOS root project folder with the following command: | ||
```bash | ||
python3 config_script/whitelabel.py --config-file=path/to/configfile/whitelabel.yaml -v | ||
``` | ||
where | ||
- `config_script/whitelabel.py` is the path to the `whitelabel.py` script | ||
- `--config-file=path/to/configfile/whitelabel.yaml` is the path to the configuration file `whitelabel.yaml` | ||
- `-v` sets the log level (all messages if '-v' is present and errors only if is not). | ||
|
||
## Example of whitelabel.yaml | ||
You can get example of `whitelabel.yaml` file by run next command: | ||
```bash | ||
python3 config_script/whitelabel.py --help-config-file | ||
``` | ||
Just copy script's output to your `whitelabel.yaml` file. | ||
|
||
## Config Options | ||
The config file `whitelabel.yaml` can be created by yourself or obtained from some config repo. | ||
This config can contain the following options: | ||
### Folder with source assets | ||
This is the folder where all image assets, which should be copied into the project, are placed (can be relative or absolute): | ||
```yaml | ||
import_dir: 'path/to/images/source' | ||
``` | ||
### Xcode Project Settings | ||
The theming script can change the app name, version, development team and app bundle ID: | ||
```yaml | ||
project_config: | ||
project_path: 'path/to/project/project.pbxproj' # path to project.pbxproj file | ||
dev_team: '1234567890' # Apple development team ID | ||
marketing_version: '1.0.1' # App marketing version | ||
current_project_version: '2' # App build number | ||
configurations: | ||
config1: # Build Configuration name in project | ||
app_bundle_id: "bundle.id.app.new1" # Bundle ID to be set | ||
product_name: "Mobile App Name1" # App Name to be set | ||
config2: # Build Configuration name in project | ||
app_bundle_id: "bundle.id.app.new2" # Bundle ID to be set | ||
product_name: "Mobile App Name2" # App Name to be set | ||
``` | ||
### Assets | ||
The config `whitelabel.yaml` can contain a few Asset items (every added Xcode project can have its own Assets). | ||
Every Asset item can be configured with images, colors, and app Icon Assets: | ||
```yaml | ||
assets: | ||
AssetName: | ||
images_path: 'Theme/Theme/Assets.xcassets' # path where images are placed in this Asset | ||
colors_path: 'Theme/Theme/Assets.xcassets/Colors' # path where colors are placed in this Asset | ||
icon_path: 'Theme/Assets.xcassets' # path where app icon is placed in this Asset | ||
images: | ||
image1: # Asset name | ||
image_name: 'some_image.svg' # image to replace the existing one for image1 Asset (light/universal) | ||
image2: # Asset name | ||
current_path: 'SomeFolder' # Path to image2.imageset inside Assets.xcassets | ||
image_name: 'Rectangle.png' # image to replace the existing one for image2 Asset (light/universal) | ||
dark_image_name: 'RectangleDark.png' # image to replace the existing dark appearance for image2 Asset (dark) | ||
colors: | ||
LoginBackground: # color asset name in Assets | ||
current_path: '' # optional: path to color inside colors_path | ||
light: '#FFFFFF' | ||
dark: '#ED5C13' | ||
icon: | ||
AppIcon: | ||
current_path: '' # optional: path to icon inside icon_path | ||
image_name: 'appIcon.jpg' # image to replace the current AppIcon - png or jpg are supported | ||
``` | ||
### Log level | ||
You can set the log level to 'DEBUG' by adding the `-v` parameter to the script running. | ||
The default log level is 'WARN' | ||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Theme/Theme/Assets.xcassets/Colors/AccentButtonColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "1.000", | ||
"green" : "0.408", | ||
"red" : "0.235" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0.976", | ||
"green" : "0.471", | ||
"red" : "0.329" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.