Update UserInactivityView to use MobilePopUp component.

This commit is contained in:
Ghazi Triki 2018-04-12 20:23:28 +01:00
parent ba2e8212aa
commit a7725fca21
9 changed files with 55 additions and 62 deletions

4
clients/flash/air-client/src/Main.mxml Executable file → Normal file
View File

@ -23,8 +23,6 @@
<![CDATA[
import mx.events.FlexEvent;
import spark.components.Alert;
import org.bigbluebutton.air.AppConfig;
import org.bigbluebutton.air.chat.ChatConfig;
import org.bigbluebutton.air.main.MainConfig;
@ -57,8 +55,6 @@
public var currentOrientation:String;
protected function preinitializeHandler(event:FlexEvent):void {
Alert.buttonHeight = 80;
Alert.buttonWidth = 200;
setupContext();
resizeForSoftKeyboard = true;
//ResourceManager.getInstance().localeChain = LocaleUtil.sortLanguagesByPreference(['en_US'], Capabilities.languages, "en_US");

View File

@ -5,7 +5,6 @@ package org.bigbluebutton.air.common {
import org.bigbluebutton.air.chat.views.ChatRoomView;
import org.bigbluebutton.air.main.views.DisconnectView;
import org.bigbluebutton.air.main.views.ExitView;
import org.bigbluebutton.air.main.views.UserInactivityView;
import org.bigbluebutton.air.main.views.MainView;
import org.bigbluebutton.air.participants.views.ParticipantsView;
import org.bigbluebutton.air.settings.views.SettingsView;
@ -50,8 +49,6 @@ package org.bigbluebutton.air.common {
public static const APPLICATION_SETTINGS:String = "ApplicationSettings";
public static const INACTIVITY_VIEW:String = "UserInactivityView";
/**
* Especials
*/
@ -77,7 +74,6 @@ package org.bigbluebutton.air.common {
dic[DISCONNECT] = DisconnectView;
// dic[DESKSHARE] = DeskshareView;
dic[EXIT] = ExitView;
dic[INACTIVITY_VIEW] = UserInactivityView;
dicInitiated = true;
}
}

View File

@ -1,21 +1,22 @@
package org.bigbluebutton.air.main.commands
{
import org.bigbluebutton.air.common.PageEnum;
import org.bigbluebutton.air.main.models.IUISession;
package org.bigbluebutton.air.main.commands {
import mx.core.FlexGlobals;
import spark.components.Application;
import org.bigbluebutton.air.main.views.UserInactivityView;
import robotlegs.bender.bundles.mvcs.Command;
public class UserInactivityTimerCommand extends Command
{
[Inject]
public var uiSession:IUISession
public class UserInactivityTimerCommand extends Command {
[Inject]
public var responseDuration: Number
public var responseDuration:Number
override public function execute():void {
trace("RECEIVED INACTIVITY TIMER MESSAGE responseDuration=" + responseDuration);
uiSession.pushPage(PageEnum.INACTIVITY_VIEW);
var userInactivityView:UserInactivityView = new UserInactivityView();
userInactivityView.text = "Your client is going to close in " + responseDuration.toString() + " seconds";
userInactivityView.open(Application(FlexGlobals.topLevelApplication), true);
}
}
}
}

View File

@ -1,28 +1,19 @@
package org.bigbluebutton.air.main.commands
{
import org.bigbluebutton.air.main.models.IUISession;
package org.bigbluebutton.air.main.commands {
import org.bigbluebutton.air.user.services.IUsersService;
import robotlegs.bender.bundles.mvcs.Command;
public class UserInactivityTimerResponseCommand extends Command
{
public class UserInactivityTimerResponseCommand extends Command {
[Inject]
public var userService:IUsersService;
[Inject]
public var uiSession:IUISession
public function UserInactivityTimerResponseCommand()
{
public function UserInactivityTimerResponseCommand() {
super();
}
override public function execute():void {
uiSession.popPage();
userService.userInactivityAuditResponse();
}
}
}
}

View File

@ -16,7 +16,10 @@ package org.bigbluebutton.air.main.views {
protected var _title:String;
[SkinPart(required = "false")]
[SkinPart(required = "true")]
public var chrome:Group;
[SkinPart(required = "true")]
public var titleDisplay:Label;
[SkinPart(required = "false")]
@ -28,6 +31,10 @@ package org.bigbluebutton.air.main.views {
[SkinPart(required = "false")]
public var controlBarGroup:Group;
public function set text(value:String):void {
_text = value;
}
public function MobilePopUp() {
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removeFromStage, false, 0, true);

View File

@ -1,40 +1,40 @@
package org.bigbluebutton.air.main.views
{
package org.bigbluebutton.air.main.views {
import spark.components.Button;
import spark.components.Label;
import spark.layouts.HorizontalAlign;
import spark.layouts.HorizontalLayout;
import spark.layouts.VerticalLayout;
import org.bigbluebutton.air.common.views.NoTabView;
public class UserInactivityView extends NoTabView
{
public var okButton:Button;
public class UserInactivityView extends MobilePopUp {
private var _okButton:Button;
public function UserInactivityView()
{
public function get okButton():Button {
return _okButton;
}
public function UserInactivityView() {
super();
var l:VerticalLayout = new VerticalLayout();
l.horizontalAlign = "center";
layout = l;
_okButton = new Button();
_okButton.label = "Reset Timer"
var messageText:Label = new Label();
messageText.percentWidth = 90;
messageText.text = "Inactivity Timer";
messageText.setStyle("textAlign", "center");
messageText.styleName = "disconnectMessage";
addElement(messageText);
_title = "Inactivity Timer";
}
override protected function partAdded(partName:String, instance:Object):void {
super.partAdded(partName, instance);
okButton = new Button();
okButton.percentWidth = 90;
okButton.label = "Ok";
addElement(okButton);
if (instance == contentGroup) {
var contentGroupLayout:HorizontalLayout = new HorizontalLayout();
contentGroupLayout.horizontalAlign = HorizontalAlign.CENTER;
contentGroup.layout = contentGroupLayout;
contentGroup.addElement(okButton);
}
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
this.layout["gap"] = getStyle("gap");
this.layout["padding"] = getStyle("padding");
VerticalLayout(chrome.layout).padding = getStyle("padding");
HorizontalLayout(contentGroup.layout).padding = getStyle("padding");
}
}
}
}

View File

@ -26,6 +26,7 @@ package org.bigbluebutton.air.main.views
private function okButtonClicked(event:Event):void {
userInactivityTimerResponseSignal.dispatch();
view.close();
}
}
}

View File

@ -60,6 +60,8 @@
bgFill.alpha = getStyle("backgroundAlpha");
}
separator.visible = separator.includeInLayout = controlBarGroup.numElements > 0;
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
]]>
@ -129,9 +131,9 @@
</s:Scroller>
<s:VGroup gap="0" width="100%">
<s:Line width="100%">
<s:Line width="100%" id="separator">
<s:stroke>
<s:SolidColorStroke color="{getStyle('separatorColor')}" weight="1" />
<s:SolidColorStroke color="{getStyle('separatorColor')}" weight="1"/>
</s:stroke>
</s:Line>
<s:Group id="controlBarGroup" width="100%">

View File

@ -1,6 +1,5 @@
package org.bigbluebutton.air.poll.views {
import flash.display.DisplayObjectContainer;
import flash.events.Event;
import spark.components.Application;
import spark.components.Button;