Example #1
0
        //a copy method for RelativeLayout.LayoutParams for backward compartibility
        public static RelativeLayout.LayoutParams CloneParams(RelativeLayout.LayoutParams @params)
        {
            RelativeLayout.LayoutParams copy = new RelativeLayout.LayoutParams(@params.Width, @params.Height);
            copy.LeftMargin   = @params.LeftMargin;
            copy.TopMargin    = @params.TopMargin;
            copy.RightMargin  = @params.RightMargin;
            copy.BottomMargin = @params.BottomMargin;
            int[] rules = @params.GetRules();

            for (int i = 0; i < rules.Length; i++)
            {
                copy.AddRule((LayoutRules)i, rules[i]);
            }

            //copy.setMarginStart(params.getMarginStart());
            //copy.setMarginEnd(params.getMarginEnd());

            return(copy);
        }