Exemple #1
0
            public void RefreshStatus()
            {
                if (_container == null)
                {
                    return;
                }

                if (_flag == Hide)
                {
                    _container.Visibility = ViewStates.Gone;
                    return;
                }

                if (_container.Visibility != ViewStates.Visible)
                {
                    _container.Visibility = ViewStates.Visible;
                }

                View view = null;

                switch (_flag)
                {
                case ShowMore:
                    view = _moreView;
                    break;

                case ShowError:
                    view = _errorView;
                    break;

                case ShowNoMore:
                    view = _noMoreView;
                    break;
                }

                if (view == null)
                {
                    hide();
                    return;
                }

                if (view.Parent == null)
                {
                    _container.AddView(view);
                }
                for (var i = 0; i < _container.ChildCount; i++)
                {
                    if (_container.GetChildAt(i) == view)
                    {
                        view.Visibility = ViewStates.Visible;
                    }
                    else
                    {
                        _container.GetChildAt(i).Visibility = ViewStates.Gone;
                    }
                }
            }
        protected void ToggleContent(bool prev)
        {
            int oldElementIndex            = mActiveElementIndex;
            PaperOnboardingPage newElement = prev ? toggleToPreviousElement() : toggleToNextElement();

            if (newElement == null)
            {
                if (prev && mOnLeftOutListener != null)
                {
                    mOnLeftOutListener.OnLeftOut();
                }
                if (!prev && mOnRightOutListener != null)
                {
                    mOnRightOutListener.OnRightOut();
                }
                return;
            }

            int newPagerPosX = calculateNewPagerPosition(mActiveElementIndex);

            // 1 - animate BG
            AnimatorSet bgAnimation = createBGAnimatorSet(newElement.BackgroundColor);

            // 2 - animate pager position
            Animator pagerMoveAnimation = ObjectAnimator.OfFloat(mPagerIconsContainer, "x", mPagerIconsContainer.GetX(), newPagerPosX);

            pagerMoveAnimation.SetDuration(ANIM_PAGER_BAR_MOVE_TIME);

            // 3 - animate pager icons
            AnimatorSet pagerIconAnimation = createPagerIconAnimation(oldElementIndex, mActiveElementIndex);

            // 4 animate content text
            ViewGroup newContentText = createContentTextView(newElement);

            mContentTextContainer.AddView(newContentText);
            AnimatorSet contentTextShowAnimation = createContentTextShowAnimation(
                mContentTextContainer.GetChildAt(mContentTextContainer.ChildCount - 2), newContentText);

            // 5 animate content icon
            ImageView newContentIcon = createContentIconView(newElement);

            mContentIconContainer.AddView(newContentIcon);
            AnimatorSet contentIconShowAnimation = createContentIconShowAnimation(
                mContentIconContainer.GetChildAt(mContentIconContainer.ChildCount - 2), newContentIcon);

            // 6 animate centering of all content
            Animator centerContentAnimation = createContentCenteringVerticalAnimation(newContentText, newContentIcon);

            centerContentAnimation.Start();
            bgAnimation.Start();
            pagerMoveAnimation.Start();
            pagerIconAnimation.Start();
            contentIconShowAnimation.Start();
            contentTextShowAnimation.Start();

            if (mOnChangeListener != null)
            {
                mOnChangeListener.OnPageChanged(oldElementIndex, mActiveElementIndex);
            }
        }
        /// <summary>
        /// NOT WORKING JUST FOR TEST PURPOSE
        /// </summary>
        private global::Android.Views.View FindScrollingTabContainer()
        {
            global::Android.Views.View decor = activity.Window.DecorView;

            int containerId = activity.Resources.GetIdentifier("action_bar_container", "id", "android");

            // check if appcompat library is used
            if (containerId == 0)
            {
                return(null);
            }

            FrameLayout container = (FrameLayout)decor.FindViewById(containerId);

            for (int i = 0; i < container.ChildCount; i++)
            {
                global::Android.Views.View scrolling = container.GetChildAt(i);

                if (scrolling.Class.SimpleName == "ActionBarContextView")
                {
                    return(scrolling);
                }
            }

            return(null);
        }
        public void SetCardImage(int drawableId, bool vertical)
        {
            int objectAnimation = vertical ? Resource.Animation.flipping_out_vert : Resource.Animation.flipping_out;
            int backAnim        = Resource.Animation.fade_out;

            CompatibilityAnimation compatibilityAnimationOut = new CompatibilityAnimation(Context, objectAnimation, backAnim);

            if (cardImageLayout.ChildCount > 0)
            {
                ImageView imageView = (ImageView)cardImageLayout.GetChildAt(0);
                compatibilityAnimationOut.Duration     = 350;
                compatibilityAnimationOut.AnimatioEnd += () => Handler.Post(() => cardImageLayout.RemoveView(imageView));

                compatibilityAnimationOut.StartAnimation(imageView);
            }

            ImageView imageView2 = new ImageView(Context);

            imageView2.SetImageResource(drawableId);
            imageView2.Visibility = ViewStates.Invisible;
            cardImageLayout.AddView(imageView2);

            objectAnimation = vertical ? Resource.Animation.flipping_in_vert : Resource.Animation.flipping_in;
            backAnim        = Resource.Animation.fade_in;

            CompatibilityAnimation compatibilityAnimationIn = new CompatibilityAnimation(Context, objectAnimation, backAnim);

            compatibilityAnimationIn.Duration        = 350;
            compatibilityAnimationIn.Delay           = 350;
            compatibilityAnimationIn.AnimationStart += () => imageView2.Visibility = ViewStates.Visible;

            compatibilityAnimationIn.StartAnimation(imageView2);
        }
Exemple #5
0
        public static string get_btn_value(FrameLayout button)
        {
            var gameBtn  = (FrameLayout)button.GetChildAt(0);
            var textView = (TextView)gameBtn.GetChildAt(0);

            return(textView.Text);
        }
Exemple #6
0
        private AndroidBug5497Workaround(Activity activity)
        {
            FrameLayout content = activity.FindViewById <FrameLayout>(Android.Resource.Id.Content);

            mChildOfContent = content.GetChildAt(0);
            mChildOfContent.ViewTreeObserver.AddOnGlobalLayoutListener(new Listener(this));
            frameLayoutParams = (FrameLayout.LayoutParams)mChildOfContent.LayoutParameters;
        }
Exemple #7
0
 void cancel_Click(object sender, EventArgs e)
 {
     parentLayout.GetChildAt(1).Visibility = ViewStates.Invisible;
     parentLayout.GetChildAt(0).Visibility = ViewStates.Visible;
     // issue fix for XAMARINANDROID-1603 Keyboard will not get collapsed after editing a row in swiping.
     HideKeyBoard();
 }
        private AndroidBug5497Workaround(Activity activity)
        {
            FrameLayout content = (FrameLayout)activity.FindViewById(Android.Resource.Id.Content);

            mChildOfContent = content.GetChildAt(0);
            mChildOfContent.ViewTreeObserver.GlobalLayout += (s, e) => { possiblyResizeChildOfContent(); };

            frameLayoutParams = (FrameLayout.LayoutParams)mChildOfContent.LayoutParameters;
        }
        private void OnRemoteUserVideoMuted(int uid, bool muted)
        {
            FrameLayout container   = (FrameLayout)FindViewById(Resource.Id.remote_video_view_container);
            SurfaceView surfaceView = (SurfaceView)container.GetChildAt(0);
            var         tag         = surfaceView.Tag;

            if (tag != null && (int)tag == uid)
            {
                surfaceView.Visibility = muted ? ViewStates.Gone : ViewStates.Visible;
            }
        }
Exemple #10
0
        private AndroidBug5497WorkaroundForXamarinAndroid(Activity activity)
        {
            FrameLayout content = (FrameLayout)activity.FindViewById(Android.Resource.Id.Content);

            mChildOfContent = content.GetChildAt(0);
            ViewTreeObserver vto = mChildOfContent.ViewTreeObserver;

            vto.GlobalLayout += (object sender, EventArgs e) => {
                possiblyResizeChildOfContent();
            };
            frameLayoutParams = (FrameLayout.LayoutParams)mChildOfContent.LayoutParameters;
        }
        private void GetDisplayData()
        {
            FrameLayout content = (FrameLayout)_activity.FindViewById(Android.Resource.Id.Content);

            _childOfContent = content.GetChildAt(0);

            DisplayMetrics metrics = new DisplayMetrics();

            _activity.WindowManager.DefaultDisplay.GetMetrics(metrics);
            _displayDensity = metrics.Density;

            CalculateDisplayHeight();
        }
        protected ViewGroup createPagerIconElement(int iconDrawableRes, bool isActive)
        {
            LayoutInflater vi = LayoutInflater.From(mAppContext);
            FrameLayout    bottomBarElement = (FrameLayout)vi.Inflate(Resource.Layout.onboarding_pager_layout, mPagerIconsContainer, false);
            ImageView      elementShape     = (ImageView)bottomBarElement.GetChildAt(0);
            ImageView      elementIcon      = (ImageView)bottomBarElement.GetChildAt(1);

            elementIcon.SetImageResource(iconDrawableRes);
            if (isActive)
            {
                LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)bottomBarElement.LayoutParameters;
                layoutParams.Width  = mPagerIconsContainer.LayoutParameters.Height;
                layoutParams.Height = mPagerIconsContainer.LayoutParameters.Height;
                elementShape.Alpha  = (0f);
                elementIcon.Alpha   = (1f);
            }
            else
            {
                elementShape.Alpha = (PAGER_ICON_SHAPE_ALPHA);
                elementIcon.Alpha  = (0f);
            }
            return(bottomBarElement);
        }
Exemple #13
0
        public void AddItem(int resId, Action <View> listener)
        {
            var            frame = new FrameLayout(this.Context);
            LayoutInflater li    = (LayoutInflater)this.Context.GetSystemService(Context.LayoutInflaterService);

            li.Inflate(Resource.Layout.item, frame);

            var bgframe  = (FrameLayout)frame.GetChildAt(0);
            var identity = (ImageView)bgframe.GetChildAt(0);

            identity.SetImageResource(resId);
            frame.RemoveView(bgframe);

            this.AddItem(bgframe, listener);
        }
        public override View GetSampleContent(Context context)
        {
            mainLayout = new FrameLayout(context);
            mContext   = context;
            mainLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent);
            density                       = mContext.Resources.DisplayMetrics;
            linearLayout                  = new LinearLayout(context);
            linearLayout.Orientation      = Orientation.Vertical;
            linearLayout.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);

            //creating instance for Schedule
            sfSchedule = new SfSchedule(context);
            sfSchedule.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            sfSchedule.ScheduleView     = ScheduleView.DayView;
            sfSchedule.HeaderHeight     = 0;
            scheduleCustomHeader        = new ScheduleCustomHeader(context);

            ViewHeaderStyle viewHeader = new ViewHeaderStyle();

            viewHeader.BackgroundColor = Color.Argb(255, 242, 242, 242);
            sfSchedule.ViewHeaderStyle = viewHeader;

            //set the appointment collection
            getAppointments();
            sfSchedule.ItemsSource = appointmentCollection;


            linearLayout.AddView(scheduleCustomHeader.HeaderLayout);
            linearLayout.AddView(sfSchedule);

            editor = new ScheduleAppointmentEditor(context, sfSchedule);
            editor.EditorLayout.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);

            viewOptionLayout = new ScheduleViewOptionLayout(mContext, sfSchedule);
            //viewOptionLayout.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            mainLayout.AddView(linearLayout);
            mainLayout.AddView(editor.EditorLayout);
            mainLayout.AddView(viewOptionLayout.OptionLayout);
            mainLayout.GetChildAt(2).SetY(density.HeightPixels / 14);
            editor.EditorLayout.Visibility           = ViewStates.Invisible;
            viewOptionLayout.OptionLayout.Visibility = ViewStates.Invisible;
            HookEvents();
            propertylayout = SetOptionPage(context);
            return(mainLayout);
        }
        private void UpdateTabStyles()
        {
            for (int i = 0; i < _tabCount; i++)
            {
                View v = _tabsContainer.GetChildAt(i);

                v.LayoutParameters = _defaultTabLayoutParams;
                v.SetBackgroundDrawable(BuildTabDrawable());
                v.SetPadding(_tabPadding, 0, _tabPadding, 0);

                FrameLayout vLayout = v as FrameLayout;
                if (vLayout != null && vLayout.ChildCount == 1)
                {
                    //the first and only child of the framelayout is the
                    //view that was created by the tab provider - fetch it.
                    v = vLayout.GetChildAt(0);
                    _tabProvider.UpdateTabStyle(v, this, i);
                }
            }
        }
Exemple #16
0
 public void OnShow(IDialogInterface dialog)
 {
     if (View != null)
     {
         ScrollView  vMessageScrollView               = (ScrollView)View.FindViewById(Resource.Id.sdl_message_scrollview);
         ListView    vListView                        = (ListView)View.FindViewById(Resource.Id.sdl_list);
         FrameLayout vCustomViewNoScrollView          = (FrameLayout)View.FindViewById(Resource.Id.sdl_custom);
         bool        customViewNoScrollViewScrollable = false;
         if (vCustomViewNoScrollView.ChildCount > 0)
         {
             View firstChild = vCustomViewNoScrollView.GetChildAt(0);
             if (firstChild is ViewGroup)
             {
                 customViewNoScrollViewScrollable = IsScrollable((ViewGroup)firstChild);
             }
         }
         bool listViewScrollable = IsScrollable(vListView);
         bool messageScrollable  = IsScrollable(vMessageScrollView);
         bool scrollable         = listViewScrollable || messageScrollable || customViewNoScrollViewScrollable;
         ModifyButtonsBasedOnScrollableContent(scrollable);
     }
 }
Exemple #17
0
        private void OnRemoteUserVideoMuted(int uid, bool muted)
        {
            FrameLayout container   = (FrameLayout)FindViewById(Resource.Id.remote_video_view_container);
            SurfaceView surfaceView = (SurfaceView)container.GetChildAt(0);
            var         tag         = surfaceView.Tag;

            if (tag != null && (int)tag == uid)
            {
                NoteTextView.Text      = this.GetText(Resource.String.Lbl_Muted_his_video);
                surfaceView.Visibility = muted ? ViewStates.Gone : ViewStates.Visible;
                if (muted)
                {
                    UserInfoview_container.Visibility = ViewStates.Visible;
                    NoteTextView.Text = this.GetText(Resource.String.Lbl_Muted_his_video);
                }
                else
                {
                    UserInfoview_container.Visibility = ViewStates.Gone;
                    NoteTextView.Text = "";
                }
            }
        }
Exemple #18
0
        private View FindViewAtLoc(int xloc, int yLoc, int xWidth, int yWidth, View ignoreView = null)
        {
            int cellSize = structureGrid.Width / 10;

            Rect gridRect = new Rect(xloc * cellSize, yLoc * cellSize, (xloc + xWidth) * cellSize, (yLoc + yWidth) * cellSize);

            for (int i = 0; i < structureGrid.ChildCount; i++)
            {
                var curView = structureGrid.GetChildAt(i);
                if (curView != background && curView != selectionRect && curView != ignoreView && curView != selectionFrame)
                {
                    Rect curRect = new Rect();
                    curView.GetHitRect(curRect);
                    if (curRect.Intersect(gridRect))
                    {
                        return(curView);
                    }
                }
            }

            return(null);
        }
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            MaterialDialog dialog = (new MaterialDialog.Builder(Activity)).SetTitle(Resource.String.color_chooser).SetAutoDismiss(false).SetCustomView(Resource.Layout.dialog_color_chooser, false).Build();

            TypedArray ta = Activity.Resources.ObtainTypedArray(Resource.Array.colors);

            mColors = new Color[ta.Length()];
            for (int i = 0; i < ta.Length(); i++)
            {
                mColors[i] = ta.GetColor(i, 0);
            }
            ta.Recycle();
            GridLayout list      = (GridLayout)dialog.CustomView.FindViewById(Resource.Id.grid);
            int        preselect = Arguments.GetInt("preselect", -1);

            for (int i = 0; i < list.ChildCount; i++)
            {
                FrameLayout child = (FrameLayout)list.GetChildAt(i);
                child.Tag = i;
                child.SetOnClickListener(this);
                child.GetChildAt(0).Visibility = preselect == i ? ViewStates.Visible : ViewStates.Gone;

                Drawable selector = CreateSelector(mColors[i]);
                if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
                {
                    int[][]        states       = new int[][] { new int[] { -Android.Resource.Attribute.StatePressed }, new int[] { Android.Resource.Attribute.StatePressed } };
                    int[]          colors       = new int[] { ShiftColor(mColors[i]), mColors[i] };
                    ColorStateList rippleColors = new ColorStateList(states, colors);
                    SetBackgroundCompat(child, new RippleDrawable(rippleColors, selector, null));
                }
                else
                {
                    SetBackgroundCompat(child, selector);
                }
            }
            return(dialog);
        }
Exemple #20
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            parentLayout = new FrameLayout(context);

            optionHeading         = new TextView(context);
            optionHeading.Gravity = GravityFlags.CenterHorizontal;
            body       = new LinearLayout(context);
            optionView = new LinearLayout(context);
            optionView.SetBackgroundColor(Color.Gray);
            editor = new LinearLayout(context);
            bottom = new LinearLayout(context);

            bodyRow1             = new LinearLayout(context);
            bodyRow1.Orientation = Android.Widget.Orientation.Horizontal;
            bodyRow1.SetGravity(GravityFlags.CenterHorizontal);
            bodyRow2             = new LinearLayout(context);
            bodyRow2.Orientation = Android.Widget.Orientation.Horizontal;
            bodyRow2.SetGravity(GravityFlags.CenterHorizontal);
            bodyRow3             = new LinearLayout(context);
            bodyRow3.Orientation = Android.Widget.Orientation.Horizontal;
            bodyRow3.SetGravity(GravityFlags.CenterHorizontal);
            bodyRow4             = new LinearLayout(context);
            bodyRow4.Orientation = Android.Widget.Orientation.Horizontal;
            bodyRow4.SetGravity(GravityFlags.CenterHorizontal);


            col1      = new TextView(context);
            col1.Text = "Order ID";
            col2      = new TextView(context);
            col2.Text = "Customer ID";
            col3      = new TextView(context);
            col3.Text = "Employee ID";
            col4      = new TextView(context);
            col4.Text = "Name";

            orderIDText         = new EditText(context);
            orderIDText.Gravity = GravityFlags.Start;
            customerIDText      = new EditText(context);
            employeeIDText      = new EditText(context);
            nameText            = new EditText(context);

            save          = new Button(context);
            save.Click   += save_Click;
            cancel        = new Button(context);
            cancel.Click += cancel_Click;

            editView = new LinearLayout(context);
            editView.TextAlignment = TextAlignment.Center;
            editView.Orientation   = Android.Widget.Orientation.Horizontal;
            editView.Click        += editView_Click;

            deleteView = new LinearLayout(context);
            deleteView.TextAlignment = TextAlignment.Center;
            deleteView.Orientation   = Android.Widget.Orientation.Horizontal;
            deleteView.Click        += swipeViewImage_Click;

            ImageView editImage = new ImageView(context);

            editImage.SetImageResource(Resource.Drawable.Edit);
            editImage.SetBackgroundColor(Color.ParseColor("#42A5F5"));
            // editImage.SetPadding((int)(16 * Resources.System.DisplayMetrics.Density), 0, (int)(16 * Resources.System.DisplayMetrics.Density), 0);

            TextView edit = new TextView(context);

            edit.Text          = "EDIT";
            edit.TextAlignment = TextAlignment.Center;
            edit.SetTextColor(Color.White);
            edit.SetPadding((int)(16 * Resources.System.DisplayMetrics.Density), (int)(10 * Resources.System.DisplayMetrics.Density), (int)(10 * Resources.System.DisplayMetrics.Density), 0);
            edit.SetBackgroundColor(Color.ParseColor("#42A5F5"));

            ImageView deleteImage = new ImageView(context);

            deleteImage.SetImageResource(Resource.Drawable.Delete);
            deleteImage.SetBackgroundColor(Color.ParseColor("#EF5350"));
            // deleteImage.SetPadding((int)(16 * Resources.System.DisplayMetrics.Density), 0, (int)(16 * Resources.System.DisplayMetrics.Density), 0);

            TextView delete = new TextView(context);

            delete.Text          = "DELETE";
            delete.TextAlignment = TextAlignment.Center;
            delete.SetPadding((int)(14 * Resources.System.DisplayMetrics.Density), (int)(10 * Resources.System.DisplayMetrics.Density), (int)(10 * Resources.System.DisplayMetrics.Density), 0);
            delete.SetTextColor(Color.White);
            delete.SetBackgroundColor(Color.ParseColor("#EF5350"));

            viewModel = new SwipingViewModel();
            viewModel.SetRowstoGenerate(100);

            sfGrid = new SfDataGrid(context);
            sfGrid.AutoGenerateColumns = false;
            sfGrid.ItemsSource         = (viewModel.OrdersInfo);
            sfGrid.AllowSwiping        = true;
            sfGrid.ColumnSizer         = ColumnSizer.Star;

            DisplayMetrics metrics = context.Resources.DisplayMetrics;
            int            width   = metrics.WidthPixels;

            sfGrid.MaxSwipeOffset = (int)(100 * metrics.Density);
            leftSwipeView         = new SwipeView(context);
            rightSwipeView        = new SwipeView(context);

            editView.AddView(editImage, (int)(30 * Resources.System.DisplayMetrics.Density), (int)sfGrid.RowHeight);
            editView.AddView(edit, sfGrid.MaxSwipeOffset - 30, (int)sfGrid.RowHeight);

            deleteView.AddView(deleteImage, (int)(30 * Resources.System.DisplayMetrics.Density), (int)sfGrid.RowHeight);
            deleteView.AddView(delete, sfGrid.MaxSwipeOffset - 30, (int)sfGrid.RowHeight);

            leftSwipeView.AddView(editView, sfGrid.MaxSwipeOffset, (int)sfGrid.RowHeight);
            rightSwipeView.AddView(deleteView, sfGrid.MaxSwipeOffset, (int)sfGrid.RowHeight);

            sfGrid.LeftSwipeView  = leftSwipeView;
            sfGrid.RightSwipeView = rightSwipeView;
            sfGrid.SwipeEnded    += sfGrid_SwipeEnded;
            sfGrid.SwipeStarted  += sfGrid_SwipeStarted;

            GridTextColumn CustomerID = new GridTextColumn();

            CustomerID.MappingName = "CustomerID";
            CustomerID.HeaderText  = "Customer ID";
            GridTextColumn OrderID = new GridTextColumn();

            OrderID.MappingName      = "OrderID";
            OrderID.HeaderText       = "Order ID";
            OrderID.TextMargin       = new Thickness(16, 0, 0, 0);
            OrderID.HeaderTextMargin = new Thickness(16, 0, 0, 0);

            GridTextColumn EmployeeID = new GridTextColumn();

            EmployeeID.MappingName = "EmployeeID";
            EmployeeID.HeaderText  = "Employee ID";
            GridTextColumn Name = new GridTextColumn();

            Name.MappingName = "FirstName";
            Name.HeaderText  = "Name";

            sfGrid.Columns.Add(OrderID);
            sfGrid.Columns.Add(CustomerID);
            sfGrid.Columns.Add(EmployeeID);
            sfGrid.Columns.Add(Name);
            sfGrid.VerticalOverScrollMode = VerticalOverScrollMode.None;
            parentLayout.AddView(sfGrid);

            editor.SetBackgroundColor(Color.White);
            editor.Orientation = Android.Widget.Orientation.Vertical;
            optionHeading.Text = "EDIT DETAILS";
            optionHeading.SetTypeface(null, TypefaceStyle.Bold);
            optionHeading.Gravity = GravityFlags.Center;

            bodyRow1.AddView(col1, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), (int)(50 * sfGrid.Resources.DisplayMetrics.Density));
            bodyRow1.AddView(orderIDText, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), ViewGroup.LayoutParams.WrapContent);
            bodyRow2.AddView(col2, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), (int)(50 * sfGrid.Resources.DisplayMetrics.Density));
            bodyRow2.AddView(customerIDText, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), ViewGroup.LayoutParams.WrapContent);
            bodyRow3.AddView(col3, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), (int)(50 * sfGrid.Resources.DisplayMetrics.Density));
            bodyRow3.AddView(employeeIDText, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), ViewGroup.LayoutParams.WrapContent);
            bodyRow4.AddView(col4, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), (int)(50 * sfGrid.Resources.DisplayMetrics.Density));
            bodyRow4.AddView(nameText, (int)(100 * sfGrid.Resources.DisplayMetrics.Density), ViewGroup.LayoutParams.WrapContent);

            body.Orientation = Android.Widget.Orientation.Vertical;
            body.SetGravity(GravityFlags.CenterHorizontal);
            body.AddView(bodyRow1);
            body.AddView(bodyRow2);
            body.AddView(bodyRow3);
            body.AddView(bodyRow4);

            save.Text          = "Save";
            cancel.Text        = "Cancel";
            bottom.Orientation = Android.Widget.Orientation.Horizontal;
            bottom.AddView(save);
            bottom.AddView(cancel);
            bottom.SetGravity(GravityFlags.Center);

            editor.AddView(optionHeading);
            editor.AddView(body);
            editor.AddView(bottom);
            optionView.AddView(editor, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            if (parentLayout.ChildCount == 1)
            {
                parentLayout.AddView(optionView, 1);
            }
            parentLayout.GetChildAt(0).Visibility = ViewStates.Visible;
            parentLayout.GetChildAt(1).Visibility = ViewStates.Invisible;
            return(parentLayout);
        }
Exemple #21
0
 public void numbered_btn(FrameLayout button, int number)
 {
     button.GetChildAt(0).SetBackgroundColor(get_color_from_number(number));
     set_btn_number(button, number.ToString()); //button = number.ToString();
 }
Exemple #22
0
        public void set_btn_number(FrameLayout button, string number)
        {
            TextView textView = (TextView)button.GetChildAt(0);

            textView.Text = number;
        }
Exemple #23
0
        public string get_btn_value(FrameLayout button)
        {
            TextView textView = (TextView)button.GetChildAt(0);

            return(textView.Text);
        }
Exemple #24
0
 public static void normal_btn(FrameLayout button)
 {
     //game_button game_Button = new game_button(parent_context, 0,information_Container);
     button.GetChildAt(0).SetBackgroundColor(Color.Gray);
     set_btn_number(button, "");
 }