This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new ac48ee9  add visible/hidden responsive properties to GridCellLayout 
depending on device sizes
ac48ee9 is described below

commit ac48ee9075db860640a04fddc7cf676058e19f19
Author: Carlos Rovira <carlosrov...@apache.org>
AuthorDate: Wed Jul 11 18:43:18 2018 +0200

    add visible/hidden responsive properties to GridCellLayout depending on 
device sizes
---
 .../royale/org/apache/royale/jewel/GridCell.as     | 114 +++++++++++++++++++
 .../royale/jewel/beads/layouts/GridCellLayout.as   | 123 +++++++++++++++++++++
 2 files changed, 237 insertions(+)

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as
index f0766e5..9fd44fe 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as
@@ -236,6 +236,120 @@ package org.apache.royale.jewel
         }
 
                /**
+                *  Makes the cell to be visible or hidden in phone size
+                *  Uses "visible-phone" and "hidden-phone" effect selectors.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+        public function get phoneVisible():Boolean
+        {
+            return layout.phoneVisible;
+        }
+
+        public function set phoneVisible(value:Boolean):void
+        {
+                       if (layout.phoneVisible != value)
+            {
+                COMPILE::JS
+                {
+                                       layout.phoneVisible = value;
+
+                                       if(layout.phoneVisible)
+                                       {
+                                               typeNames = 
StringUtil.removeWord(typeNames, " hidden-phone");
+                                               typeNames += " visible-phone";
+                                       } else
+                                       {
+                                               typeNames = 
StringUtil.removeWord(typeNames, " visible-phone");
+                                               typeNames += " hidden-phone";
+                                       }
+
+                                       if (parent)
+                               setClassName(computeFinalClassNames()); 
+                               }
+                       }
+               }
+
+               /**
+                *  Makes the cell to be visible or hidden in phone size
+                *  Uses "visible-tablet" and "hidden-tablet" effect selectors.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+        public function get tabletVisible():Boolean
+        {
+            return layout.tabletVisible;
+        }
+
+        public function set tabletVisible(value:Boolean):void
+        {
+                       if (layout.tabletVisible != value)
+            {
+                COMPILE::JS
+                {
+                                       layout.tabletVisible = value;
+
+                                       if(layout.tabletVisible)
+                                       {
+                                               typeNames = 
StringUtil.removeWord(typeNames, " hidden-tablet");
+                                               typeNames += " visible-tablet";
+                                       } else
+                                       {
+                                               typeNames = 
StringUtil.removeWord(typeNames, " visible-tablet");
+                                               typeNames += " hidden-tablet";
+                                       }
+
+                                       if (parent)
+                               setClassName(computeFinalClassNames()); 
+                               }
+                       }
+               }
+
+               /**
+                *  Makes the cell to be visible or hidden in phone size
+                *  Uses "visible-desktop" and "hidden-desktop" effect 
selectors.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+        public function get desktopVisible():Boolean
+        {
+            return layout.desktopVisible;
+        }
+
+        public function set desktopVisible(value:Boolean):void
+        {
+                       if (layout.desktopVisible != value)
+            {
+                COMPILE::JS
+                {
+                                       layout.desktopVisible = value;
+
+                                       if(layout.desktopVisible)
+                                       {
+                                               typeNames = 
StringUtil.removeWord(typeNames, " hidden-desktop");
+                                               typeNames += " visible-desktop";
+                                       } else
+                                       {
+                                               typeNames = 
StringUtil.removeWord(typeNames, " visible-desktop");
+                                               typeNames += " hidden-desktop";
+                                       }
+
+                                       if (parent)
+                               setClassName(computeFinalClassNames());
+                               }
+                       }
+               }
+
+               /**
                 *  Assigns variable gap to grid from 1 to 20
                 *  Activate "gap-Xdp" effect selector to set a numeric gap 
                 *  between grid cells
diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
index 578f329..6865def 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
@@ -281,6 +281,129 @@ package org.apache.royale.jewel.beads.layouts
                        }
         }
 
+               private var _phoneVisible:Boolean;
+               /**
+                *  Makes the cell to be visible or hidden in phone size
+                *  Uses "visible-phone" and "hidden-phone" effect selectors.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+        public function get phoneVisible():Boolean
+        {
+            return _phoneVisible;
+        }
+
+        public function set phoneVisible(value:Boolean):void
+        {
+                       if (_phoneVisible != value)
+            {
+                COMPILE::JS
+                {
+                                       _phoneVisible = value;
+
+                                       if(hostComponent)
+                                       {
+                                               if(_phoneVisible)
+                                               {
+                                                       if 
(hostClassList.contains("hidden-phone"))
+                                                               
hostClassList.remove("hidden-phone");
+                                                       
hostClassList.add("visible-phone");
+                                               } else
+                                               {
+                                                       if 
(hostClassList.contains("visible-phone"))
+                                                               
hostClassList.remove("visible-phone");
+                                                       
hostClassList.add("hidden-phone");
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               private var _tabletVisible:Boolean;
+               /**
+                *  Makes the cell to be visible or hidden in phone size
+                *  Uses "visible-tablet" and "hidden-tablet" effect selectors.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+        public function get tabletVisible():Boolean
+        {
+            return _tabletVisible;
+        }
+
+        public function set tabletVisible(value:Boolean):void
+        {
+                       if (_tabletVisible != value)
+            {
+                COMPILE::JS
+                {
+                                       _tabletVisible = value;
+
+                                       if(hostComponent)
+                                       {
+                                               if(_tabletVisible)
+                                               {
+                                                       if 
(hostClassList.contains("hidden-tablet"))
+                                                               
hostClassList.remove("hidden-tablet");
+                                                       
hostClassList.add("visible-tablet");
+                                               } else
+                                               {
+                                                       if 
(hostClassList.contains("visible-tablet"))
+                                                               
hostClassList.remove("visible-tablet");
+                                                       
hostClassList.add("hidden-tablet");
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               private var _desktopVisible:Boolean;
+               /**
+                *  Makes the cell to be visible or hidden in phone size
+                *  Uses "visible-desktop" and "hidden-desktop" effect 
selectors.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.3
+                */
+        public function get desktopVisible():Boolean
+        {
+            return _desktopVisible;
+        }
+
+        public function set desktopVisible(value:Boolean):void
+        {
+                       if (_desktopVisible != value)
+            {
+                COMPILE::JS
+                {
+                                       _desktopVisible = value;
+
+                                       if(hostComponent)
+                                       {
+                                               if(_desktopVisible)
+                                               {
+                                                       if 
(hostClassList.contains("hidden-desktop"))
+                                                               
hostClassList.remove("hidden-desktop");
+                                                       
hostClassList.add("visible-desktop");
+                                               } else
+                                               {
+                                                       if 
(hostClassList.contains("visible-desktop"))
+                                                               
hostClassList.remove("visible-desktop");
+                                                       
hostClassList.add("hidden-desktop");
+                                               }
+                                       }
+                               }
+                       }
+               }
+
         /**
          * @copy org.apache.royale.core.IBeadLayout#layout
                 * @royaleignorecoercion org.apache.royale.core.UIBase

Reply via email to