flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - - Extract Toast - simpler version of Snackbar - Create IToastModel and ISnackbarModel - responsible for creation of configuration object for Snackbar
Date Wed, 28 Dec 2016 14:03:17 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop c854826f3 -> 79db0740e


- Extract Toast - simpler version of Snackbar
- Create IToastModel and ISnackbarModel - responsible for creation of configuration object
for Snackbar


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/79db0740
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/79db0740
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/79db0740

Branch: refs/heads/develop
Commit: 79db0740ec5a5b70f0c4c730699f0c005071cb4e
Parents: c854826
Author: piotrz <piotrz@apache.org>
Authored: Wed Dec 28 15:03:10 2016 +0100
Committer: piotrz <piotrz@apache.org>
Committed: Wed Dec 28 15:03:10 2016 +0100

----------------------------------------------------------------------
 .../MDLExample/src/main/flex/Snackbar.mxml      |  22 ++-
 .../flex/org/apache/flex/core/IStyleObject.as   |   2 -
 .../src/main/flex/MDLClasses.as                 |   4 +-
 .../main/flex/org/apache/flex/mdl/Snackbar.as   | 157 ++---------------
 .../src/main/flex/org/apache/flex/mdl/Toast.as  | 172 +++++++++++++++++++
 .../flex/mdl/beads/models/ISnackbarModel.as     |  28 +++
 .../apache/flex/mdl/beads/models/IToastModel.as |  32 ++++
 .../flex/mdl/beads/models/SnackbarModel.as      |  88 ++++++++++
 .../apache/flex/mdl/beads/models/ToastModel.as  |  69 ++++++++
 .../src/main/resources/defaults.css             |   9 +
 .../src/main/resources/mdl-manifest.xml         |   3 +
 11 files changed, 439 insertions(+), 147 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/examples/flexjs/MDLExample/src/main/flex/Snackbar.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Snackbar.mxml b/examples/flexjs/MDLExample/src/main/flex/Snackbar.mxml
index 4b9e20e..fb46676 100644
--- a/examples/flexjs/MDLExample/src/main/flex/Snackbar.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/Snackbar.mxml
@@ -21,24 +21,36 @@ limitations under the License.
                  xmlns:mdl="library://ns.apache.org/flexjs/mdl">
     <mdl:Grid>
         <mdl:GridCell column="1">
-            <mdl:Button id="showSnackbar" click="onShowSnackBarClick(event)"
-                        text="Show snackbar!" width="200" accent="true" colored="true" raised="true"/>
-            <mdl:Snackbar id="snackbar" message="Snack bar message" actionText="Undo"
timeout="3000"
+            <mdl:Button id="showToast" click="onShowToastClick(event)"
+                        text="Show Toast!" width="200" accent="true" colored="true" raised="true"/>
+            <mdl:Toast id="toast" message="Toast message" timeout="3000"/>
+        </mdl:GridCell>
+        <mdl:GridCell column="1">
+            <mdl:Button id="showSnackbar" click="onShowSnackbarClick(event)"
+                        text="Show !" width="200" accent="true" colored="true" raised="true"/>
+            <mdl:Snackbar id="snackbar" message="Snackbar message" actionText="Undo" timeout="3000"
                           action="onSnackBarAction(event)"/>
         </mdl:GridCell>
     </mdl:Grid>
     <fx:Script><![CDATA[
         import org.apache.flex.events.Event;
         import org.apache.flex.events.MouseEvent;
+        import org.apache.flex.events.MouseEvent;
 
-        private function onShowSnackBarClick(event:MouseEvent):void
+        private function onShowToastClick(event:MouseEvent):void
+        {
+            toast.show();
+        }
+
+        private function onShowSnackbarClick(event:MouseEvent):void
         {
             snackbar.show();
         }
 
         private function onSnackBarAction(event:Event):void
         {
-           //some action here
+            //some action here
         }
+
         ]]></fx:Script>
 </mdl:TabBarPanel>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStyleObject.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStyleObject.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStyleObject.as
index f8b3862..968a122 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStyleObject.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStyleObject.as
@@ -18,8 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
-	import org.apache.flex.events.IEventDispatcher;
-
     /**
      *  The IStyleObject interface is the interface for
      *  objects that contain style properties.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as b/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as
index a11f639..6136bec 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as
@@ -27,7 +27,9 @@ package
 	*/
 	internal class MDLClasses
 	{	
-		
+		import org.apache.flex.mdl.beads.models.ToastModel; ToastModel;
+		import org.apache.flex.mdl.beads.models.SnackbarModel; SnackbarModel;
+
 		COMPILE::SWF
 		{
 			import org.apache.flex.mdl.beads.SliderThumbView; SliderThumbView;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Snackbar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Snackbar.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Snackbar.as
index 2d614c6..f4b2944 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Snackbar.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Snackbar.as
@@ -18,19 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl
 {
-    import org.apache.flex.events.EventDispatcher;
-
-    COMPILE::SWF
-    {
-        import flash.events.Event;
-    }
-
-    COMPILE::JS
-    {
-        import org.apache.flex.events.Event;
-        import org.apache.flex.core.UIBase;
-        import org.apache.flex.core.WrappedHTMLElement;
-    }
+    import org.apache.flex.mdl.beads.models.ISnackbarModel;
 
     /**
      *  Dispatched when the user click on Snackbar
@@ -43,30 +31,10 @@ package org.apache.flex.mdl
     [Event(name="action", type="org.apache.flex.events.Event")]
 
     COMPILE::SWF
-    public class Snackbar extends EventDispatcher
+    public class Snackbar extends Toast
     {
-        private var _message:String;
         private var _actionText:String;
-        private var _timeout:int = 2750;
-
-        /**
-         *  Message to be displayed on Snackbar
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public function get message():String
-        {
-            return _message;
-        }
-
-        public function set message(value:String):void
-        {
-            _message = value;
-        }
-
+        
         /**
          *  Text which appears on action button
          *
@@ -84,142 +52,53 @@ package org.apache.flex.mdl
         {
             _actionText = value;
         }
-
-        /**
-         *  Timout in milliseconds for hiding Snackbar
-         *
-         *  @default 2750
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public function get timeout():int
-        {
-            return _timeout;
-        }
-
-        public function set timeout(value:int):void
-        {
-            _timeout = value;
-        }
-
-        /**
-         *  Show the snackbar
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public function show():void
-        {
-            dispatchEvent(new Event("action"));
-        }
     }
 
     COMPILE::JS
-    public class Snackbar extends UIBase
+    public class Snackbar extends Toast
     {
         public function Snackbar()
         {
             super();
-
-            className = "";
         }
 
-        private var snackbar:Object;
-
-        private var snackbarText:HTMLDivElement;
-        private var snackbarAction:HTMLButtonElement;
-
-        private var _message:String = "";
-        private var _actionText:String = "";
-        private var _timeout:int = 2000;
-
-        public function get message():String
+        override public function get message():String
         {
-            return _message;
+            return ISnackbarModel(model).message;
         }
 
-        public function set message(value:String):void
+        override public function set message(value:String):void
         {
-            _message = value;
+            ISnackbarModel(model).message = value;
         }
 
-        public function get actionText():String
+        override public function get timeout():int
         {
-            return _actionText;
+            return ISnackbarModel(model).timeout;
         }
 
-        public function set actionText(value:String):void
+        override public function set timeout(value:int):void
         {
-            _actionText = value;
+            ISnackbarModel(model).timeout = value;
         }
 
-        public function get timeout():int
+        public function get actionText():String
         {
-            return _timeout;
+            return ISnackbarModel(model).actionText;
         }
 
-        public function set timeout(value:int):void
+        public function set actionText(value:String):void
         {
-            _timeout = value;
+            ISnackbarModel(model).actionText = value;
         }
 
-        public function show():void
+        override public function show():void
         {
             if (snackbar)
             {
-                var snackbarData:Object = {
-                    message: _message,
-                    timeout: _timeout,
-                    actionHandler: onActionHandler,
-                    actionText: _actionText
-                };
-
+                var snackbarData:Object = ISnackbarModel(model).snackbarData;
                 snackbar.showSnackbar(snackbarData);
             }
         }
-
-        private function onActionHandler(event:Event):void
-        {
-            dispatchEvent(new Event("action"));
-        }
-
-        /**
-         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
-         * @flexjsignorecoercion HTMLDivElement
-         * @flexjsignorecoercion HTMLButtonElement
-         *
-         * @return
-         */
-        override protected function createElement():WrappedHTMLElement
-        {
-            typeNames = "mdl-js-snackbar mdl-snackbar";
-
-            element = document.createElement("div") as WrappedHTMLElement;
-            element.addEventListener("mdl-componentupgraded", onElementMdlComponentUpgraded,
false);
-
-            snackbarText = document.createElement("div") as HTMLDivElement;
-            snackbarText.classList.add("mdl-snackbar__text");
-            element.appendChild(snackbarText);
-
-            snackbarAction = document.createElement("button") as HTMLButtonElement;
-            snackbarAction.classList.add("mdl-snackbar__action");
-            element.appendChild(snackbarAction);
-
-            positioner = element;
-            element.flexjs_wrapper = this;
-
-            return element;
-        }
-
-        private function onElementMdlComponentUpgraded(event:Event):void
-        {
-            if (!event.currentTarget) return;
-
-            snackbar = event.currentTarget.MaterialSnackbar;
-        }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Toast.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Toast.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Toast.as
new file mode 100644
index 0000000..a03dd95
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Toast.as
@@ -0,0 +1,172 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl
+{
+    import org.apache.flex.events.EventDispatcher;
+    import org.apache.flex.mdl.beads.models.IToastModel;
+
+    COMPILE::SWF
+    {
+        import flash.events.Event;
+    }
+
+    COMPILE::JS
+    {
+        import org.apache.flex.events.Event;
+        import org.apache.flex.core.UIBase;
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+
+    COMPILE::SWF
+    public class Toast extends EventDispatcher
+    {
+        private var _message:String;
+        private var _timeout:int = 2750;
+
+        /**
+         *  Message to be displayed on Snackbar
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get message():String
+        {
+            return _message;
+        }
+
+        public function set message(value:String):void
+        {
+            _message = value;
+        }
+
+        /**
+         *  Timout in milliseconds for hiding Snackbar
+         *
+         *  @default 2750
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get timeout():int
+        {
+            return _timeout;
+        }
+
+        public function set timeout(value:int):void
+        {
+            _timeout = value;
+        }
+
+        /**
+         *  Show the snackbar
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function show():void
+        {
+            dispatchEvent(new Event("action"));
+        }
+    }
+
+    COMPILE::JS
+    public class Toast extends UIBase
+    {
+        public function Toast()
+        {
+            super();
+
+            className = "";
+        }
+
+        protected var snackbar:Object;
+
+        private var snackbarAction:HTMLButtonElement;
+        private var snackbarText:HTMLDivElement;
+
+        public function get message():String
+        {
+            return IToastModel(model).message;
+        }
+
+        public function set message(value:String):void
+        {
+            IToastModel(model).message = value;
+        }
+
+        public function get timeout():int
+        {
+            return IToastModel(model).timeout;
+        }
+
+        public function set timeout(value:int):void
+        {
+            IToastModel(model).timeout = value;
+        }
+
+        public function show():void
+        {
+            if (snackbar)
+            {
+                var snackbarData:Object = IToastModel(model).snackbarData;
+                snackbar.showSnackbar(snackbarData);
+            }
+        }
+
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         * @flexjsignorecoercion HTMLDivElement
+         * @flexjsignorecoercion HTMLButtonElement
+         *
+         * @return
+         */
+        override protected function createElement():WrappedHTMLElement
+        {
+            typeNames = "mdl-js-snackbar mdl-snackbar";
+
+            element = document.createElement("div") as WrappedHTMLElement;
+            element.addEventListener("mdl-componentupgraded", onElementMdlComponentUpgraded,
false);
+
+            snackbarText = document.createElement("div") as HTMLDivElement;
+            snackbarText.classList.add("mdl-snackbar__text");
+            element.appendChild(snackbarText);
+
+            snackbarAction = document.createElement("button") as HTMLButtonElement;
+            snackbarAction.classList.add("mdl-snackbar__action");
+            element.appendChild(snackbarAction);
+
+            positioner = element;
+            element.flexjs_wrapper = this;
+
+            return element;
+        }
+
+        private function onElementMdlComponentUpgraded(event:Event):void
+        {
+            if (!event.currentTarget) return;
+
+            snackbar = event.currentTarget.MaterialSnackbar;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ISnackbarModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ISnackbarModel.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ISnackbarModel.as
new file mode 100644
index 0000000..6236f6a
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ISnackbarModel.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl.beads.models
+{
+    import org.apache.flex.events.IEventDispatcher;
+
+    public interface ISnackbarModel extends IToastModel, IEventDispatcher
+    {
+        function get actionText():String;
+        function set actionText(value:String):void;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/IToastModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/IToastModel.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/IToastModel.as
new file mode 100644
index 0000000..cf740d2
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/IToastModel.as
@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl.beads.models
+{
+    import org.apache.flex.core.IBeadModel;
+
+    public interface IToastModel extends IBeadModel
+    {
+        function get message():String;
+        function set message(value:String):void;
+        function get timeout():int
+        function set timeout(value:int):void;
+
+        function get snackbarData():Object;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/SnackbarModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/SnackbarModel.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/SnackbarModel.as
new file mode 100644
index 0000000..be182fd
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/SnackbarModel.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl.beads.models
+{
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.events.EventDispatcher;
+    import org.apache.flex.events.Event;
+
+    public class SnackbarModel extends EventDispatcher implements ISnackbarModel
+    {
+        private var _message:String = "";
+        private var _timeout:int = 2750;
+        private var _actionText:String = "";
+
+        private var _strand:IStrand;
+
+        public function SnackbarModel()
+        {
+            super();
+        }
+
+        public function get message():String
+        {
+            return _message;
+        }
+
+        public function set message(value:String):void
+        {
+            _message = value;
+        }
+
+        public function get timeout():int
+        {
+            return _timeout;
+        }
+
+        public function set timeout(value:int):void
+        {
+            _timeout = value;
+        }
+        
+        public function get actionText():String
+        {
+            return _actionText;
+        }
+
+        public function set actionText(value:String):void
+        {
+            _actionText = value;
+        }
+
+        public function get snackbarData():Object
+        {
+            return {
+                message: _message,
+                timeout: _timeout,
+                actionHandler: onActionHandler,
+                actionText: _actionText
+            };
+        }
+
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+        }
+
+        private function onActionHandler(event:Event):void
+        {
+            dispatchEvent(new Event("action"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ToastModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ToastModel.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ToastModel.as
new file mode 100644
index 0000000..0af73d5
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/models/ToastModel.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl.beads.models
+{
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.events.EventDispatcher;
+
+    public class ToastModel extends EventDispatcher implements IToastModel
+    {
+        private var _message:String = "";
+        private var _timeout:int = 2750;
+
+        private var _strand:IStrand;
+
+        public function ToastModel()
+        {
+            super();
+        }
+
+        public function get message():String
+        {
+            return _message;
+        }
+
+        public function set message(value:String):void
+        {
+            _message = value;
+        }
+
+        public function get timeout():int
+        {
+            return _timeout;
+        }
+
+        public function set timeout(value:int):void
+        {
+            _timeout = value;
+        }
+
+        public function get snackbarData():Object
+        {
+            return {
+                message: _message,
+                timeout: _timeout
+            };
+        }
+
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
index 14efca5..1ebf7dc 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
@@ -42,6 +42,15 @@ List
     IItemRenderer: ClassReference("org.apache.flex.mdl.itemRenderers.ListItemRenderer");
 }
 
+Toast
+{
+    IBeadModel: ClassReference("org.apache.flex.mdl.beads.models.ToastModel");
+}
+
+Snackbar
+{
+    IBeadModel: ClassReference("org.apache.flex.mdl.beads.models.SnackbarModel");
+}
 
 @media -flex-flash
 {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/79db0740/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
index a785b19..dec087f 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -88,5 +88,8 @@
     <component id="MdlTextColor" class="org.apache.flex.mdl.beads.MdlTextColor"/>
     <component id="Spinner" class="org.apache.flex.mdl.Spinner"/>
     <component id="ProgressBar" class="org.apache.flex.mdl.ProgressBar"/>
+    <component id="ToastModel" class="org.apache.flex.mdl.beads.models.ToastModel"/>
+    <component id="Toast" class="org.apache.flex.mdl.Toast"/>
+    <component id="SnackbarModel" class="org.apache.flex.mdl.beads.models.SnackbarModel"/>
     <component id="Snackbar" class="org.apache.flex.mdl.Snackbar"/>
 </componentPackage>


Mime
View raw message