Esempio n. 1
0
        public void FlexLayoutSetFlexAspectRatio()
        {
            tlog.Debug(tag, $"FlexLayoutSetFlexAspectRatio START");

            View view = new View()
            {
                Size            = new Size(400, 400),
                BackgroundColor = Color.White,
                Layout          = new FlexLayout()
                {
                    Direction = FlexLayout.FlexDirection.Column,
                }
            };

            try
            {
                FlexLayout.SetFlexAspectRatio(view, 0.3f);
            }
            catch (Exception e)
            {
                tlog.Error(tag, "Caught Exception" + e.ToString());
                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            view.Dispose();
            tlog.Debug(tag, $"FlexLayoutSetFlexAspectRatio END (OK)");
        }
Esempio n. 2
0
        public void FlexLayoutGetFlexAspectRatio()
        {
            tlog.Debug(tag, $"FlexLayoutGetFlexAspectRatio START");

            View view = new View()
            {
                Size            = new Size(400, 400),
                BackgroundColor = Color.White,
                Layout          = new FlexLayout()
                {
                    Direction = FlexLayout.FlexDirection.Column,
                }
            };

            FlexLayout.SetFlexAspectRatio(view, 0.3f);
            var result = FlexLayout.GetFlexAspectRatio(view);

            Assert.AreEqual(0.3f, result, "should be equal!");

            view.Dispose();
            tlog.Debug(tag, $"FlexLayoutGetFlexAspectRatio END (OK)");
        }