コード例 #1
0
        public LiveOrdersLayout(Context context) : base(context)
        {
            this.Orientation = Orientation.Horizontal;
            this.SetBackgroundColor(Color.White);

            FrameLayout leftFrame = new FrameLayout(context);

            leftFrame.Id = 1;
            leftFrame.SetMinimumHeight(500);
            leftFrame.SetMinimumWidth(700);
            leftFrame.SetBackgroundColor(Color.White);
            this.AddView(leftFrame);

            FrameLayout rightFrame = new FrameLayout(context);

            rightFrame.Id = 2;
            rightFrame.SetMinimumHeight(700);
            rightFrame.SetMinimumWidth(1190);
            rightFrame.SetBackgroundColor(Color.White);

            this.AddView(rightFrame);

            ordersFragment = new LiveOrdersFragment();
            orderFragment  = new OrderFragment();

            Activity activity = (Activity)context;

            FragmentTransaction ft = activity.FragmentManager.BeginTransaction();

            ft.Add(leftFrame.Id, ordersFragment);
            ft.Add(rightFrame.Id, orderFragment);
            ft.Commit();
        }
コード例 #2
0
        public override View GetView(View view, int position)
        {
            var      itemData = menuItems[position];
            View     root     = layoutInflater.Inflate(Resource.Layout.WheelTextLayout, null, false);
            TextView textView = root.FindViewById <TextView>(Resource.Id.wheel_menu_item_tv);

            textView.Visibility = ViewStates.Visible;
            textView.SetTextSize(Android.Util.ComplexUnitType.Sp, 14);
            textView.Text = itemData.mTitle;
            if (textView.LayoutParameters is FrameLayout.LayoutParams)
            {
                ((FrameLayout.LayoutParams)textView.LayoutParameters).Gravity = mGravity;
            }
            if (position == 4)
            {
                textView.SetTextColor(Android.Graphics.Color.Red);
            }
            if (position == 0)
            {
                FrameLayout container = root.FindViewById <FrameLayout>(Resource.Id.TextContainer);
                container.SetBackgroundColor(Android.Graphics.Color.Transparent);
                container.SetBackgroundResource(Resource.Drawable.slice_happy);
                container.SetMinimumHeight(340);
                container.SetPadding(0, 0, 0, 0);
                //container.s
            }
            return(root);
        }
コード例 #3
0
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                var layout = new FrameLayout(this.Context);
                layout.SetMinimumHeight(100);
                layout.SetBackgroundColor(Android.Graphics.Color.Red);
                var textview = new TextView(Forms.Context);
                textview.Text = "Custom Ad Display " + new Random().Next(100, 999);
                layout.AddView(textview);
                SetNativeControl(layout);
            }
        }
コード例 #4
0
        public CurrentOrderLayout(Context context) : base(context)
        {
            Orientation = Android.Widget.Orientation.Vertical;
            SetMinimumHeight(500);
            SetMinimumWidth(1920);
            SetBackgroundColor(Color.White);

            LinearLayout frames = new LinearLayout(context);

            frames.Orientation = Android.Widget.Orientation.Horizontal;

            leftFrame    = new FrameLayout(frames.Context);
            leftFrame.Id = 1;
            leftFrame.SetMinimumHeight(500);
            leftFrame.SetMinimumWidth(850);
            leftFrame.SetBackgroundColor(Color.White);
            frames.AddView(leftFrame);

            rightFrame    = new FrameLayout(frames.Context);
            rightFrame.Id = 2;
            rightFrame.SetMinimumHeight(700);
            rightFrame.SetMinimumWidth(1040);
            rightFrame.SetBackgroundColor(Color.White);
            frames.AddView(rightFrame);

            AddView(frames);

            VariationsFragment variationsFragment = new VariationsFragment(1);

            leftFragment  = variationsFragment;
            orderFragment = new OrderFragment();

            Activity activity = (Activity)context;

            FragmentTransaction ft = activity.FragmentManager.BeginTransaction();

            ft.Add(leftFrame.Id, variationsFragment);
            ft.Add(rightFrame.Id, orderFragment);
            ft.Commit();
        }