Skip to content

Commit b443bda

Browse files
authored
Merge pull request #4519 from crazyserver/MOBILE-4796
MOBILE-4796 screen: Watch full screen to hide statusbars
2 parents 3a6db6e + 03aab35 commit b443bda

File tree

11 files changed

+46
-16
lines changed

11 files changed

+46
-16
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"@moodlehq/cordova-plugin-ionic-webview": "5.0.0-moodle.5",
8484
"@moodlehq/cordova-plugin-media-capture": "5.0.0-moodle.1",
8585
"@moodlehq/cordova-plugin-qrscanner": "3.0.1-moodle.5",
86-
"@moodlehq/cordova-plugin-statusbar": "4.0.0-moodle.4",
86+
"@moodlehq/cordova-plugin-statusbar": "4.0.0-moodle.5",
8787
"@moodlehq/cordova-plugin-zip": "3.1.0-moodle.1",
8888
"@moodlehq/phonegap-plugin-push": "4.0.0-moodle.12",
8989
"@ngx-translate/core": "^16.0.4",

src/addons/block/myoverview/lang.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"allincludinghidden": "All (including removed from view)",
44
"aria:card": "Switch to card view",
55
"aria:list": "Switch to list view",
6-
"browseallcourses": "Browse available courses",
6+
"browseallcourses": "Browse all courses",
77
"favourites": "Starred",
88
"future": "Future",
99
"hiddencourses": "Removed from view",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"pluginname": "Main menu"
2+
"pluginname": "Additional activities"
33
}

src/addons/block/sitemainmenu/tests/behat/block_sitemainmenu.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@addon_block_site_main_menu @app @block @block_site_main_menu @javascript @lms_from5.0
2-
Feature: Basic tests of Main menu block
2+
Feature: Basic tests of Additional activities block
33

44
Background:
55
Given the Moodle site is compatible with this feature
@@ -10,18 +10,18 @@ Feature: Basic tests of Main menu block
1010
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
1111
| site_main_menu | System | 1 | site-index | side-pre |
1212

13-
Scenario: View the Main menu block in site home
13+
Scenario: View the Additional activities block in site home
1414
Given the following "activities" exist:
1515
| activity | course | section | name |
1616
| forum | Acceptance test site | 0 | My forum name |
1717
And I entered the app as "student1"
1818
When I press "Site home" in the app
1919
And I press "Open block drawer" in the app
20-
Then I should find "My forum name" within "Main menu" "ion-card" in the app
20+
Then I should find "My forum name" within "Additional activities" "ion-card" in the app
2121
When I press "My forum name" in the app
2222
Then the header should be "My forum name" in the app
2323

24-
Scenario: Activities in main menu block can be made available but not visible on a course page
24+
Scenario: Activities in additional activities block can be made available but not visible on a course page
2525
Given the following config values are set as admin:
2626
| allowstealth | 1 |
2727
And the following "activities" exist:
@@ -36,8 +36,8 @@ Feature: Basic tests of Main menu block
3636
And I entered the app as "student1"
3737
When I press "Site home" in the app
3838
And I press "Open block drawer" in the app
39-
Then I should find "Visible forum" within "Main menu" "ion-card" in the app
40-
Then I should not find "My forum name" within "Main menu" "ion-card" in the app
39+
Then I should find "Visible forum" within "Additional activities" "ion-card" in the app
40+
Then I should not find "My forum name" within "Additional activities" "ion-card" in the app
4141
When I press "Visible forum" in the app
4242
Then the header should be "Visible forum" in the app
4343

@@ -51,4 +51,4 @@ Feature: Basic tests of Main menu block
5151
And I entered the app as "student1"
5252
When I press "Site home" in the app
5353
And I press "Open block drawer" in the app
54-
Then I should not find "Main menu" in the app
54+
Then I should not find "Additional activities" in the app

src/addons/mod/lesson/lang.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"loginfail": "Login failed, please try again...",
3939
"lowscore": "Low score",
4040
"lowtime": "Low time",
41-
"maximumnumberofattemptsreached": "Maximum number of attempts reached - Moving to next page",
41+
"maximumnumberofattemptsreached": "You have reached the maximum number of tries for this question. The lesson will now move to the next page.",
4242
"modattemptsnoteacher": "Student review only works for students.",
4343
"modulenameplural": "Lessons",
4444
"noanswer": "One or more questions have no answer given. Please go back and submit an answer.",
-53 Bytes
Loading
160 Bytes
Loading

src/core/initializers/watch-screen-status.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ export default function(): void {
2222
CoreScreen.watchViewport();
2323

2424
CoreScreen.watchOrientation();
25+
26+
CoreScreen.watchFullscreen();
2527
}

src/core/services/screen.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Injectable } from '@angular/core';
1616
import { BehaviorSubject, Observable } from 'rxjs';
1717
import { distinctUntilChanged, map } from 'rxjs/operators';
1818

19-
import { makeSingleton } from '@singletons';
19+
import { makeSingleton, StatusBar } from '@singletons';
2020
import { CoreEvents } from '@singletons/events';
2121
import { CorePlatform } from '@services/platform';
2222

@@ -128,6 +128,27 @@ export class CoreScreenService {
128128
});
129129
}
130130

131+
/**
132+
* Watch fullscreen changes.
133+
*/
134+
async watchFullscreen(): Promise<void> {
135+
await CorePlatform.ready();
136+
137+
// During video playback, Android 11 and previous versions show the status bar on the first click.
138+
// We're not hiding the status bar in this case to avoid this issue.
139+
if (CorePlatform.isAndroid() && CorePlatform.getPlatformMajorVersion() < 12) {
140+
return;
141+
}
142+
143+
document.addEventListener('fullscreenchange', () => {
144+
if (document.fullscreenElement) {
145+
StatusBar.hide();
146+
} else {
147+
StatusBar.show();
148+
}
149+
});
150+
}
151+
131152
/**
132153
* Watch viewport changes.
133154
*/

0 commit comments

Comments
 (0)