Skip to content

Commit

Permalink
feat(status_bar): Make status bar style configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
silviolleite committed May 30, 2020
1 parent 43a8131 commit 8e39aeb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ PWA_APP_DISPLAY = 'standalone'
PWA_APP_SCOPE = '/'
PWA_APP_ORIENTATION = 'any'
PWA_APP_START_URL = '/'
PWA_APP_STATUS_BAR_COLOR = 'default'
PWA_APP_ICONS = [
{
'src': '/static/images/my_app_icon.png',
Expand Down
1 change: 1 addition & 0 deletions pwa/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
PWA_APP_ORIENTATION = getattr(settings, 'PWA_APP_ORIENTATION', 'any')
PWA_APP_START_URL = resolve_url(getattr(settings, 'PWA_APP_START_URL', _PWA_SCRIPT_PREFIX))
PWA_APP_FETCH_URL = resolve_url(getattr(settings, 'PWA_APP_FETCH_URL', _PWA_SCRIPT_PREFIX))
PWA_APP_STATUS_BAR_COLOR = getattr(settings, 'PWA_APP_STATUS_BAR_COLOR', 'default')
PWA_APP_ICONS = getattr(settings, 'PWA_APP_ICONS', [
{
'src': '/static/images/icons/icon-72x72.png',
Expand Down
1 change: 1 addition & 0 deletions pwa/templates/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"orientation": {{ PWA_APP_ORIENTATION|js }},
"background_color": {{ PWA_APP_BACKGROUND_COLOR|js }},
"theme_color": {{ PWA_APP_THEME_COLOR|js }},
"status_bar": {{ PWA_APP_STATUS_BAR_COLOR|js }},
"icons": {{ PWA_APP_ICONS|js }},
"dir": {{ PWA_APP_DIR|js }},
"lang": {{ PWA_APP_LANG|js }}
Expand Down
2 changes: 1 addition & 1 deletion pwa/templates/pwa.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="{{ PWA_APP_NAME }}">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-status-bar-style" content="{{ PWA_APP_STATUS_BAR_COLOR }}">

{% if PWA_APP_ICONS_APPLE %}
{% for icon in PWA_APP_ICONS_APPLE %}
Expand Down
3 changes: 2 additions & 1 deletion tests/test_settings_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def test_has_defined(self):
'PWA_APP_FETCH_URL',
'PWA_APP_ICONS',
'PWA_APP_DIR',
'PWA_APP_LANG'
'PWA_APP_LANG',
'PWA_APP_STATUS_BAR_COLOR'
]
for attr in attributes:
with self.subTest():
Expand Down
3 changes: 2 additions & 1 deletion tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def test_manifest_contains(self):
'"orientation":',
'"icons":',
'"dir":',
'"lang":'
'"lang":',
'"status_bar":'
]
for expected in contents:
with self.subTest():
Expand Down

0 comments on commit 8e39aeb

Please sign in to comment.