Skip to content

Commit 8d1ed2e

Browse files
electron-botmolant
authored andcommitted
docs: platform controls
1 parent c2716ec commit 8d1ed2e

File tree

5 files changed

+66
-11
lines changed

5 files changed

+66
-11
lines changed

docs/browser-engine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dynamically to any form factor, work offline, send notifications, and more.
2828
With all these new features and capabilities, browsers have had to evolve and become more like mini
2929
OSes, protecting users from malicious attacks and poorly written code.
3030

31-
Tthe [most used ones][statcounter] are [Chrome] ([Chromium]), [Safari] ([WebKit]), and [Firefox]
31+
The [most used ones][statcounter] are [Chrome] ([Chromium]), [Safari] ([WebKit]), and [Firefox]
3232
([Gecko]). But even though they all are considered modern engines, they are not the same. Even for
3333
the same browser there can be significant differences accross platforms (more notably on iOS where
3434
they are force to be a wrapper around the WebKit's WebView).

docs/platform-controls.md

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,66 @@ id: platform-controls
44

55
# Platform controls
66

7-
- Use the platform provided controls
8-
- UI patterns are different accross platforms
9-
- A lot of the code reuse happens in the business logic with fine tuning at the UI level to
10-
have it better integrated with the OS
7+
:::note
8+
Crossplatform technologies work by providing abstractions to the developers. In this section we will
9+
learn more about those that operate at the platform controls level.
10+
:::
1111

12-
<!-- List with technologies filtered by type -->
12+
All platforms provide a set of controls or components for developers to use so their application
13+
is more integrated with the look and feel of the platform where they are running. For example, Apple
14+
provides its [Human Interface Guidelines] and Android is [Material Design].
15+
16+
There are some foundational pieces that are "universal": links, buttons, images, labels, etc.
17+
18+
<p align="center">
19+
20+
<!-- Resize these images -->
21+
22+
![Buttons in Apple's Human Interface Guidelines](/img/design-buttons-hig.png)
23+
![Buttons in Android's Material Design](/img/design-buttons-material.png)
24+
25+
</p>
26+
27+
But there are other controls or interactions that are completely different and cannot be translated
28+
from one platform to another.
29+
30+
Technologies in this category focus on make it easy to:
31+
32+
- share the business logic code, which should be (mostly) the same accross all platforms
33+
- write custom UI for a particular platform if needed
34+
35+
While this means that you might still have to write custom code per platform, it will be using
36+
mostly the same technology, and it will also allow you to provide a more integrated experience to
37+
your users by "fine tuning" the UI to where the application is running.
38+
39+
:::tip
40+
The percentage of code share accross platforms will depend a lot in your application. In some cases
41+
it can be really high (over 95%!), in others it might be a bit lower.
42+
43+
When evaluating these type of technologies consider how much "tweaks" you want to do per platform to
44+
have a better idea on how much code you will be capable of reusing.
45+
:::
46+
47+
Contrary to technologies under [Browser engine], the architecture of this category can vary vastly
48+
from one to another. Even for the same technology the implementations could be different accross
49+
platforms (like [Xamarin]). For that reason each technology will have its own internals section to
50+
explain how they work.
51+
52+
## Technologies
53+
54+
The following is a non-exhaustive list of technologies under this category. If you know of more,
55+
please [report them in GitHub][new-technology]!
56+
57+
| Technology |
58+
| :------------: |
59+
| [React Native] |
60+
| [Xamarin] |
61+
62+
<!-- Reference links -->
63+
64+
[browser engine]: browser-engine.md
65+
[human interface guidelines]: https://developer.apple.com/design/human-interface-guidelines/ios/controls/buttons/
66+
[material design]: https://material.io/components?platform=android
67+
[new-technology]: https://github.com/crossplatform-dev/crossplatform.dev/issues/new
68+
[react native]: react-native.md
69+
[xamarin]: xamarin.md

sidebars.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ module.exports = {
99
],
1010
rendering: [
1111
'rendering',
12-
{
13-
type: 'category',
14-
label: 'Strategies',
15-
items: ['browser-engine', 'platform-controls', 'direct-drawing'],
16-
},
12+
'browser-engine',
13+
'platform-controls',
14+
'direct-drawing',
1715
],
1816
examples: ['examples', 'examples/url-protocol-handler'],
1917
};

static/img/design-buttons-hig.png

53.3 KB
Loading
18.1 KB
Loading

0 commit comments

Comments
 (0)