示例#1
0
        public NUIWHAdapter(WidgetViewManager manager)
        {
            _viewManager = manager;
            dataList     = new List <FaceData>();
            dataList.Add(new FaceData(FaceData.FaceType.WATCH, ""));
            sampleCreator = new SampleCreator();
            int count = sampleCreator.GetDictCount();

            for (int i = 0; i < count; i++)
            {
                dataList.Add(new FaceData(FaceData.FaceType.SAMPLE, sampleCreator.GetDictString(i)));
            }

            widgetList = WidgetApplicationInfo.LoadAllParameters();
        }
示例#2
0
        public void CreatePage()
        {
            scrollable = new ScrollableBase()
            {
                Size       = new Size(360, 360),
                SnapToPage = true,

                ScrollingDirection     = ScrollableBase.Direction.Horizontal,
                ParentOrigin           = ParentOrigin.Center,
                PivotPoint             = PivotPoint.Center,
                PositionUsesPivotPoint = true,
            };

            View view = new View()
            {
                WidthSpecification  = LayoutParamPolicies.WrapContent,
                HeightSpecification = 360,
                Layout = new LinearLayout()
                {
                    LinearOrientation   = LinearLayout.Orientation.Horizontal,
                    SetPositionByLayout = false,
                },
                BackgroundColor = new Color(0.15f, 0.15f, 0.15f, 1.0f),
            };

            scrollable.Add(view);

            List <string> appList = WidgetApplicationInfo.LoadAllParameters();

            for (int i = 0; i < appStr.Count; i++)
            {
                ImageView viewer = new ImageView()
                {
                    Name = appList[i],
                    //ParentOrigin = ParentOrigin.Center,
                    //PivotPoint = PivotPoint.Center,
                    //PositionUsesPivotPoint = true,
                    Size            = new Size(360, 360),
                    CornerRadius    = 180.0f,
                    Scale           = new Vector3(0.6f, 0.6f, 0.6f),
                    BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "widget_capture/" + appStr[i],
                };
                viewer.TouchEvent += Viewer_TouchEvent;

                view.Add(viewer);
            }
        }