protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var mLayout = new FrameLayout(this);

            surface = UrhoSurface.CreateSurface(this, typeof(MySample));
            //surface.Background.SetAlpha(10);

            TextView txtView = new TextView(this);
            txtView.SetBackgroundColor(Color.Violet);
            txtView.SetWidth(10);
            txtView.SetHeight(10);

            txtView.Text = "HAHAH";
            //txtView.Text = surface.Background.ToString();
            Button btn = new Button(this);
            btn.SetBackgroundColor(Color.Transparent);
            btn.Text = "Button";
            btn.SetHeight(100);
            btn.SetWidth(100);
            btn.SetX(30);
            btn.SetY(30);
            btn.TextAlignment = TextAlignment.Center;
            mLayout.AddView(txtView);
            mLayout.AddView(btn);
            mLayout.AddView(surface);
            SetContentView(mLayout);
        }
Exemplo n.º 2
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			Game1.Activity = this;
			var g = new Game1();
			FrameLayout fl = new FrameLayout(this);
			fl.AddView(g.Window);                 
			adView = AdMobHelper.CreateAdView(this,"publisherid");
			//AdMobHelper.AddTestDevice(adView,"deviceid");
			fl.AddView(adView);                        
			AdMobHelper.RequestFreshAd(adView);
			SetContentView (fl);            
			g.Run();  
			
		}
		void Init(IAttributeSet attrs) {
			_headerContainer = new FrameLayout(Context);
			_zoomContainer = new FrameLayout(Context);
			_contentContainer = new FrameLayout(Context);

			_rootContainer = new LinearLayout(Context);
			_rootContainer.Orientation = Android.Widget.Orientation.Vertical;

			if (attrs != null) {
				LayoutInflater layoutInflater = LayoutInflater.From(Context);
				//初始化状态View
				TypedArray a = Context.ObtainStyledAttributes(attrs, Resource.Styleable.PullToZoomScrollView);

				int zoomViewResId = a.GetResourceId(Resource.Styleable.PullToZoomScrollView_scrollZoomView, 0);
				if (zoomViewResId > 0) {
					_zoomView = layoutInflater.Inflate(zoomViewResId, null, false);
					_zoomContainer.AddView(_zoomView);
					_headerContainer.AddView(_zoomContainer);
				}

				int headViewResId = a.GetResourceId(Resource.Styleable.PullToZoomScrollView_scrollHeadView, 0);
				if (headViewResId > 0) {
					_headView = layoutInflater.Inflate(headViewResId, null, false);
					_headerContainer.AddView(_headView);
				}
				int contentViewResId = a.GetResourceId(Resource.Styleable.PullToZoomScrollView_scrollContentView, 0);
				if (contentViewResId > 0) {
					_contentView = layoutInflater.Inflate(contentViewResId, null, false);
					_contentContainer.AddView(_contentView);
				}

				a.Recycle();
			}

			DisplayMetrics localDisplayMetrics = new DisplayMetrics();
			((Activity) Context).WindowManager.DefaultDisplay.GetMetrics(localDisplayMetrics);
			_screenHeight = localDisplayMetrics.HeightPixels;
			_zoomWidth = localDisplayMetrics.WidthPixels;
			_scalingRunnable = new ScalingRunnable(this);

			_rootContainer.AddView(_headerContainer);
			_rootContainer.AddView(_contentContainer);

			_rootContainer.SetClipChildren(false);
			_headerContainer.SetClipChildren(false);

			AddView(_rootContainer);
		}
		void Init(IAttributeSet attrs) {
			_headerContainer = new FrameLayout(Context);
			if (attrs != null) {
				LayoutInflater layoutInflater = LayoutInflater.From(Context);
				//初始化状态View
				TypedArray a = Context.ObtainStyledAttributes(attrs, Resource.Styleable.PullToZoomListView);

				int headViewResId = a.GetResourceId(Resource.Styleable.PullToZoomListView_listHeadView, 0);
				if (headViewResId > 0) {
					_headerView = layoutInflater.Inflate(headViewResId, null, false);
					_headerContainer.AddView(_headerView);
					_isHideHeader = false;
				} else {
					_isHideHeader = true;
				}

				_isParallax = a.GetBoolean(Resource.Styleable.PullToZoomListView_isHeadParallax, true);

				a.Recycle();
			}

			DisplayMetrics localDisplayMetrics = new DisplayMetrics();
			((Activity) Context).WindowManager.DefaultDisplay.GetMetrics(localDisplayMetrics);
			_screenHeight = localDisplayMetrics.HeightPixels;
			_screenWidth = localDisplayMetrics.WidthPixels;
			if (_headerView != null) {
				SetHeaderViewSize(_screenWidth, (int) (9.0F * (_screenWidth / 16.0F)));
				AddHeaderView(_headerContainer);
			}
			_scalingRunnable = new ScalingRunnable(this);
			base.SetOnScrollListener(this);
		}
        public HSVColorPickerDialog(Context context, Color initialColor, Action<Color> listener)
            : base(context)
        {
            this.selectedColor = initialColor;
            this.listener = listener;

            colorWheel = new HSVColorWheel(context);
            valueSlider = new HSVValueSlider(context);
            var padding = (int)(context.Resources.DisplayMetrics.Density * PADDING_DP);
            var borderSize = (int)(context.Resources.DisplayMetrics.Density * BORDER_DP);
            var layout = new RelativeLayout(context);

            var lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
            lp.BottomMargin = (int)(context.Resources.DisplayMetrics.Density * CONTROL_SPACING_DP);
            colorWheel.setListener((color) => valueSlider.SetColor(color, true));
            colorWheel.setColor(initialColor);
            colorWheel.Id = (1);
            layout.AddView(colorWheel, lp);

            int selectedColorHeight = (int)(context.Resources.DisplayMetrics.Density * SELECTED_COLOR_HEIGHT_DP);

            var valueSliderBorder = new FrameLayout(context);
            valueSliderBorder.SetBackgroundColor(BORDER_COLOR);
            valueSliderBorder.SetPadding(borderSize, borderSize, borderSize, borderSize);
            valueSliderBorder.Id = (2);
            lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, selectedColorHeight + 2 * borderSize);
            lp.BottomMargin = (int)(context.Resources.DisplayMetrics.Density * CONTROL_SPACING_DP);
            lp.AddRule(LayoutRules.Below, 1);
            layout.AddView(valueSliderBorder, lp);

            valueSlider.SetColor(initialColor, false);
            valueSlider.SetListener((color) =>
            {
                selectedColor = color;
                selectedColorView.SetBackgroundColor(color);
            });
            valueSliderBorder.AddView(valueSlider);

            var selectedColorborder = new FrameLayout(context);
            selectedColorborder.SetBackgroundColor(BORDER_COLOR);
            lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, selectedColorHeight + 2 * borderSize);
            selectedColorborder.SetPadding(borderSize, borderSize, borderSize, borderSize);
            lp.AddRule(LayoutRules.Below, 2);
            layout.AddView(selectedColorborder, lp);

            selectedColorView = new View(context);
            selectedColorView.SetBackgroundColor(selectedColor);
            selectedColorborder.AddView(selectedColorView);

            SetButton((int)DialogButtonType.Negative, context.GetString(Android.Resource.String.Cancel), ClickListener);
            SetButton((int)DialogButtonType.Positive, context.GetString(Android.Resource.String.Ok), ClickListener);

            SetView(layout, padding, padding, padding, padding);
        }
Exemplo n.º 6
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var game = new Game1();

			var frameLayout = new FrameLayout(this);
            frameLayout.AddView((View)game.Services.GetService(typeof(View)));
            this.SetContentView(frameLayout);

            game.Run(GameRunBehavior.Asynchronous);
        }
Exemplo n.º 7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Game1.Activity = this;
            var game = new Game1();

            var frameLayout = new FrameLayout(this);
            frameLayout.AddView(game.Window);
            this.SetContentView(frameLayout);

            //SetContentView(game.Window);
            game.Run(GameRunBehavior.Asynchronous);
        }
Exemplo n.º 8
0
            void OnPromptRequested(Page sender, PromptArguments arguments)
            {
                // Verify that the page making the request is part of this activity
                if (!PageIsInThisContext(sender))
                {
                    return;
                }

                var alertDialog = new DialogBuilder(Activity).Create();

                alertDialog.SetTitle(arguments.Title);
                alertDialog.SetMessage(arguments.Message);

                var frameLayout = new FrameLayout(Activity);
                var editText    = new EditText(Activity)
                {
                    Hint = arguments.Placeholder, Text = arguments.InitialValue
                };
                var layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)
                {
                    LeftMargin  = (int)(22 * Activity.Resources.DisplayMetrics.Density),
                    RightMargin = (int)(22 * Activity.Resources.DisplayMetrics.Density)
                };

                editText.LayoutParameters = layoutParams;
                editText.InputType        = arguments.Keyboard.ToInputType();
                if (arguments.Keyboard == Keyboard.Numeric)
                {
                    editText.KeyListener = LocalizedDigitsKeyListener.Create(editText.InputType);
                }

                if (arguments.MaxLength > -1)
                {
                    editText.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(arguments.MaxLength) });
                }

                frameLayout.AddView(editText);
                alertDialog.SetView(frameLayout);

                alertDialog.SetButton((int)DialogButtonType.Positive, arguments.Accept, (o, args) => arguments.SetResult(editText.Text));
                alertDialog.SetButton((int)DialogButtonType.Negative, arguments.Cancel, (o, args) => arguments.SetResult(null));
                alertDialog.SetCancelEvent((o, args) => { arguments.SetResult(null); });

                alertDialog.Window.SetSoftInputMode(SoftInput.StateVisible);
                alertDialog.Show();
                editText.RequestFocus();
            }
        void RefreshSample(Sample selectedSample)
        {
            FrameLayout layout = (FrameLayout)FindViewById(Resource.Id.samplearea);

            layout.SetPadding(5, 5, 5, 5);
            layout.SetBackgroundColor(Color.White);
            selectedPageSample = selectedSample;
            ImageView settingsImage = (ImageView)FindViewById(Resource.Id.settings);

            if (propertyIndent != null && propertyWindow != null)
            {
                propertyWindow.Finish();
            }
            if (sample != null)
            {
                sample.Destroy();
            }
            propertyIndent = new Intent(this, typeof(PropertyWindow));
            TextView textView = (TextView)FindViewById(Resource.Id.title_text);

            textView.Text = selectedSample.Title;
            RelativeLayout settingButton = (RelativeLayout)FindViewById(Resource.Id.settingsParent);
            RelativeLayout textParent    = (RelativeLayout)FindViewById(Resource.Id.textParent);

            textParent.Click += (object sender, EventArgs e) => {
                OnBackButtonPressed();
            };
            bool isClassExists = Type.GetType("SampleBrowser." + selectedSample.Name) != null;

            if (isClassExists)
            {
                var handle = Activator.CreateInstance(null, "SampleBrowser." + selectedSample.Name);
                sample = (SamplePage)handle.Unwrap();
                layout.RemoveAllViews();
                layout.AddView(sample.GetSampleContent(this));
                if (sample.GetPropertyWindowLayout(this) == null)
                {
                    settingsImage.Visibility = ViewStates.Invisible;
                    settingButton.Clickable  = false;
                }
                else
                {
                    settingsImage.Visibility = ViewStates.Visible;
                    settingButton.Clickable  = true;
                }
            }
        }
Exemplo n.º 10
0
        /// <inheritdoc />
        /// <summary>
        /// Create layout with loading indicator and message, place it in a top of current activity view
        /// and make it visible.
        /// </summary>
        public void ShowLoading(string message = null)
        {
            if (_relLayout != null)
            {
                _relLayout.Visibility = ViewStates.Invisible;
            }

            FrameLayout layout = (FrameLayout)CrossCurrentActivity.Current.Activity.Window.DecorView.FindViewById(Android.Resource.Id.Content);

            _relLayout = new RelativeLayout(CrossCurrentActivity.Current.Activity)
            {
                LayoutParameters = layout.LayoutParameters
            };
            _relLayout.SetBackgroundColor(Color.Black);
            _relLayout.Alpha  = 0.5F;
            _relLayout.Click += null;

            _bar = new ProgressBar(CrossCurrentActivity.Current.Activity)
            {
                Indeterminate = true,
                Visibility    = ViewStates.Visible,
                Id            = 231236123
            };
            _bar.IndeterminateDrawable.SetColorFilter(Color.White, PorterDuff.Mode.SrcIn);

            var param1 = new RelativeLayout.LayoutParams(100, 100);

            param1.AddRule(LayoutRules.CenterInParent);
            _relLayout.AddView(_bar, param1);

            var textView = new TextView(CrossCurrentActivity.Current.Activity)
            {
                Text     = message ?? "Loading",
                TextSize = 14
            };

            textView.SetTextColor(Color.White);
            var param2 = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);

            param2.AddRule(LayoutRules.Below, _bar.Id);
            param2.AddRule(LayoutRules.CenterHorizontal);
            _relLayout.AddView(textView, param2);

            layout.AddView(_relLayout, layout.LayoutParameters);

            _relLayout.Visibility = ViewStates.Visible;
        }
Exemplo n.º 11
0
        private async void TransformXamarinViewToAndroidBitmap(Pin outerItem, ClusteredMarker nativeItem)
        {
            if (outerItem?.Icon?.Type == BitmapDescriptorType.View && outerItem?.Icon?.View != null)
            {
                var iconView   = outerItem.Icon.View;
                var nativeView = await Utils.ConvertFormsToNative(iconView, new Rectangle(0, 0, (double)Utils.DpToPx((float)iconView.WidthRequest), (double)Utils.DpToPx((float)iconView.HeightRequest)), Platform.Android.Platform.CreateRenderer(iconView));

                var otherView = new FrameLayout(nativeView.Context);
                nativeView.LayoutParameters = new FrameLayout.LayoutParams(Utils.DpToPx((float)iconView.WidthRequest), Utils.DpToPx((float)iconView.HeightRequest));
                otherView.AddView(nativeView);
                nativeItem.Icon = await Utils.ConvertViewToBitmapDescriptor(otherView);

                nativeItem.AnchorX = (float)iconView.AnchorX;
                nativeItem.AnchorY = (float)iconView.AnchorY;
                nativeItem.Visible = true;
            }
        }
Exemplo n.º 12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
#if OUYA
            Ouya.Console.Api.OuyaFacade.Instance.Init(this, "XXXXXXXXXXXXXX"); // Our UUID dev ID
#endif

            Game1.Activity = this;
            var game = new Game1();

            var frameLayout = new FrameLayout(this);
            frameLayout.AddView(game.Window);
            this.SetContentView(frameLayout);

            //SetContentView(game.Window);
            game.Run(GameRunBehavior.Asynchronous);
        }
Exemplo n.º 13
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            var layout = new FrameLayout(this);
            surface = UrhoSurface.CreateSurface(this);
            layout.AddView(surface);
            SetContentView(layout);

            var type = Type.GetType(Intent.GetStringExtra("Type"));
            var options = new ApplicationOptions()
            {
                ResourcePaths = new[] { "Data" }
            };
            app = await surface.Show(type, options);
        }
Exemplo n.º 14
0
        private bool SafeCameraOpenInView(View view)
        {
            ReleaseCameraAndPreview();
            camera = Camera1Fragment.GetCameraInstance(1280 * 720, true);

            if (camera == null)
            {
                return(false);
            }

            preview     = new CameraPreview(Activity.BaseContext, camera, view, true);
            previewView = view.FindViewById <FrameLayout>(Resource.Id.camera_preview);
            previewView.AddView(preview, 0);
            preview.StartCameraPreview();

            return(true);
        }
Exemplo n.º 15
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var mLayout = new FrameLayout(this);

            surface = UrhoSurface.CreateSurface(this);
            mLayout.AddView(surface);
            SetContentView(mLayout);
            app = await surface.Show <MyApp>(new ApplicationOptions("MyData"));


            mSensorManager = (SensorManager)GetSystemService(Activity.SensorService);
            mAccSensor     = mSensorManager.GetDefaultSensor(SensorType.GeomagneticRotationVector);
            //mMagneticSensor = mSensorManager.GetDefaultSensor(SensorType.MagneticField);;
            mSensorManager.RegisterListener(this, mAccSensor, SensorDelay.Game);
            // mSensorManager.RegisterListener(this, mMagneticSensor, SensorDelay.Game);
        }
        public static View BuildBaseItem(Context context, string text, int?background = null, int?foreground = null, bool clickable = true, GravityFlags?gravity = null, bool wrapContentHeight = false)
        {
            background = background ?? ResourceExtension.BrushFlyoutBackground;
            foreground = foreground ?? ResourceExtension.BrushText;

            if (ParamRelativeLayout == null)
            {
                ParamRelativeLayout = new ViewGroup.LayoutParams(DimensionsHelper.DpToPx(150), DimensionsHelper.DpToPx(38));
            }

            var top = new FrameLayout(context);


            top.SetBackgroundColor(new Color(background.Value));
            var holder = new RelativeLayout(context)
            {
                LayoutParameters = wrapContentHeight ? new
                                   ViewGroup.LayoutParams(DimensionsHelper.DpToPx(150), -2) : ParamRelativeLayout
            };

            holder.SetBackgroundResource(ResourceExtension.SelectableItemBackground);

            if (clickable)
            {
                top.Clickable = true;
                top.Focusable = true;
            }

            var txt = new TextView(context)
            {
                LayoutParameters = ParamTextView
            };

            if (gravity != null)
            {
                txt.Gravity = gravity.Value;
            }
            txt.SetTextColor(new Color(foreground.Value));
            txt.Text = text;
            txt.Id   = TextViewTag;

            holder.AddView(txt);
            top.AddView(holder);

            return(top);
        }
Exemplo n.º 17
0
        public override void OnStart()
        {
            base.OnStart();

            //Adding camera preview
            _camera        = GetCameraInstance();
            _cameraPreview = new CameraPreview(Activity, _camera);
            FrameLayout preview = Activity.FindViewById <FrameLayout>(Resource.Id.camera_preview);

            preview.AddView(_cameraPreview);

            //Adding aim drawer
            RelativeLayout camLayout = Activity.FindViewById <RelativeLayout>(Resource.Id.camLayout);

            _aimView = new AimView(camLayout.Context);
            camLayout.AddView(_aimView);
        }
Exemplo n.º 18
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            FrameLayout root = new FrameLayout(this);

            mWebView = new WebView(this);
            root.AddView(mWebView);
            SetContentView(root);

            SetupWebView();

            // so after this page below is visited, we get redirected to whatever it is I specified in my imgur app registration,
            //	which is identical to what it is I set it to in the AndroidManifest file. Since they match up, I can
            //	intercept all the token in SetupWebView (well, the ImgurWVC class) and save them somewhere.
            mWebView.LoadUrl("https://api.imgur.com/oauth2/authorize?client_id=" + AppConstants.IMGUR_CLIENT_ID + "&response_type=token");
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            FrameLayout circleMenu = FindViewById <FrameLayout>(Resource.Id.radialLayout);

            menuRenderer = new RadialMenuRenderer(circleMenu, true, 30f, 60f);
            menuRenderer.MenuSelectedColor   = Color.Purple;
            menuRenderer.MenuBackgroundColor = Color.Yellow;


            // Set our view from the "main" layout resource

            List <RadialMenuItem> menuItems = new List <RadialMenuItem>();

            RadialMenuItem shopMyCo = new RadialMenuItem("1", "shopMyCo");
            RadialMenuItem boutique = new RadialMenuItem("2", "boutique");
            RadialMenuItem blog     = new RadialMenuItem("3", "blog");
            RadialMenuItem herbs    = new RadialMenuItem("4", "herbs");
            RadialMenuItem games    = new RadialMenuItem("5", "mini games");

            menuItems.Add(shopMyCo);
            menuItems.Add(boutique);
            menuItems.Add(blog);
            menuItems.Add(herbs);
            menuItems.Add(games);


            menuRenderer.RadialMenuContent = menuItems;

            circleMenu.AddView(menuRenderer.RenderView());

            Memorygame.TileControl mem = new Memorygame.TileControl();
            mem.InitShuffle4x4Tiles();


            //btnShopMyco = FindViewById<Button>(Resource.Id.btnShopMyco);
            //btnShopMyco.Click += BtnShopMyco_Click;

            //btnShopHerbs = FindViewById<Button>(Resource.Id.btnShopHerbs);
            //btnShopHerbs.Click += BtnShopHerbs_Click;

            //btnShopBoutique = FindViewById<Button>(Resource.Id.btnBoutique);
            //btnShopBoutique.Click += BtnBoutique_Click;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_bcr_customview);
            linearLayout = (FrameLayout)FindViewById(Resource.Id.rim);
            light_layout = (View)FindViewById(Resource.Id.light_layout);
            img          = (ImageView)FindViewById(Resource.Id.imageButton2);
            callback     = new CustomViewBcrResultCallback(this);
            // Calculate the coordinate information of the custom interface
            Rect mScanRect = CreateScanRectFromCamera();

            remoteView = new CustomView.Builder()
                         .SetContext(this)
                         // Set the rectangular coordinate setting of the scan frame, required, otherwise it will not be recognized.
                         .SetBoundingBox(mScanRect)
                         // Set the type of result that the bank card identification expects to return.
                         // MLBcrCaptureConfig.ResultSimple:Only identify the card number and validity period information.
                         // MLBcrCaptureConfig.ResultAll:Identify information such as card number, expiration date, issuing bank, issuing organization, and card type.
                         .SetResultType(MLBcrCaptureConfig.ResultSimple)
                         // Set result monitoring
                         .SetOnBcrResultCallback(callback).Build();

            // External calls need to be made explicitly, depending on the life cycle of the current container Activity or ViewGroup
            remoteView.OnCreate(savedInstanceState);
            FrameLayout.LayoutParams lparams = new FrameLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent,
                                                                            LinearLayout.LayoutParams.MatchParent);
            linearLayout.AddView(remoteView, lparams);
            // Draw custom interface according to coordinates
            // In this step, you can also draw other such as scan lines, masks, and draw prompts or other buttons according to your needs.
            AddMainView(mScanRect);

            light_layout.Click += delegate
            {
                remoteView.SwitchLight();
                isLight = !isLight;
                if (isLight)
                {
                    img.SetBackgroundResource(Resource.Drawable.rn_eid_ic_hivision_light_act);
                }
                else
                {
                    img.SetBackgroundResource(Resource.Drawable.rn_eid_ic_hivision_light);
                }
            };
        }
Exemplo n.º 21
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            ActionBar.Hide();

            SetGoalData();

            /*
             * This code is how to replace the placeholder layout that's part of the CommonLayout.
             */
            FrameLayout frame = FindViewById <FrameLayout>(Resource.Id.Common_FrameLayout);
            View        home  = LayoutInflater.Inflate(Resource.Layout.HomePage, null); // Replace the inside of this method call with your desired layout

            frame.AddView(home.FindViewById <LinearLayout>(Resource.Id.Home_Layout));


            /*
             * This method needs to be called on the OnCreate method for any activities inheriting from CommonActivity,
             * since this is what initializes the navbar
             */
            SetUpNavBar();
            BindRecyclerViews();
            BindActivityWithLayoutManager();
            SetLayoutOnRecyclerViews();
            SetAdaptersForRecyclerViews();
            BindAdapterToRecyclerView();



            usernameBtn = FindViewById <Button>(Resource.Id.usernameBtn);
            UserAccount currentUser = this.userController.CurrentUser;

            usernameBtn.Text = currentUser.UserName;

            // TODO: populate current points user has.
            currentPntBtn      = FindViewById <Button>(Resource.Id.currentPointBtn);
            currentPntBtn.Text = currentUser.Points;

            usernameBtn.Click += LogOutClick;

            //List<Goal> overdue = goalController.GetOverdueGoals(userController.CurrentUser.UserName);
            //List<NonRecurringGoal> upcomingNonRecurring = goalController.GetUpcomingNonRecurringGoals(userController.CurrentUser.UserName);
            //List<RecurringGoal> upcomingRecurring = goalController.GetUpcomingRecurringGoals(userController.CurrentUser.UserName);
            // TODO: populate view with the previous lists of goals
        }
Exemplo n.º 22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Title = "Без преград";

            if (AuthData.AuthResult == null)
            {
                StartActivity(typeof (LoginActivity));
                FinishActivity(0);

                return;
            }

            try
            {
                ReadPoint();

                SetContentView(Resource.Layout.EditItemMainActivity);

                nextButton = FindViewById<Button>(Resource.Id.next_button);
                backButton = FindViewById<Button>(Resource.Id.back_button);
                objectsButton = FindViewById<Button>(Resource.Id.objects_button);
                saveButton = FindViewById<Button>(Resource.Id.save_button);
                contentLayout = FindViewById<FrameLayout>(Resource.Id.content);

                saveButton.Click += saveButton_Click;
                objectsButton.Click += objectsButton_Click;

                nextButton.Click += nextButton_Click;
                backButton.Click += backButton_Click;

                CreateViews();

                foreach (var screen in views)
                {
                    contentLayout.AddView(screen.View);
                }

                UpdateViewAndButtons();
            }
            catch (Throwable t)
            {
                MessageBox.ShowMessage(t.Message, this);
            }
        }
Exemplo n.º 23
0
        async void LaunchUrho()
        {
            if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.Camera) != Permission.Granted)
            {
                ActivityCompat.RequestPermissions(this, new[] { Manifest.Permission.Camera }, 42);
                return;
            }

            if (launched)
            {
                return;
            }

            launched = true;
            surface  = UrhoSurface.CreateSurface(this);
            placeholder.AddView(surface);
            app = await surface.Show <MyApp>(new Urho.ApplicationOptions("MyData"));
        }
Exemplo n.º 24
0
    public void waveformTouchEnd()
    {
        long elapsedMillisecond = JavaSystem.CurrentTimeMillis() - mWaveformTouchStartMsec;

        if (elapsedMillisecond < 300)
        {
            int seekMillisecond = mWaveformView.pixelsToMillisecs((int)(_touchStartX));
            _element.CurrentRangeIndex = seekMillisecond;
            seekableBackgroundView.LayoutParameters =
                new FrameLayout.LayoutParams((int)_touchStartX, _fragmentContainer.Height);
            if (seekableBackgroundView.Parent != null)
            {
                return;
            }

            _fragmentContainer.AddView(seekableBackgroundView);
        }
    }
Exemplo n.º 25
0
        private async void TransformXamarinViewToAndroidBitmap(GroundOverlay outerItem, NativeGroundOverlay nativeItem)
        {
            if (outerItem?.Icon?.Type == BitmapDescriptorType.View && outerItem.Icon?.View != null)
            {
                var iconView   = outerItem.Icon.View;
                var nativeView = await Utils.ConvertFormsToNative(
                    iconView,
                    new Rectangle(0, 0, (double)Utils.DpToPx((float)iconView.WidthRequest), (double)Utils.DpToPx((float)iconView.HeightRequest)),
                    Platform.CreateRendererWithContext(iconView, _context));

                var otherView = new FrameLayout(nativeView.Context);
                nativeView.LayoutParameters = new FrameLayout.LayoutParams(Utils.DpToPx((float)iconView.WidthRequest), Utils.DpToPx((float)iconView.HeightRequest));
                otherView.AddView(nativeView);
                nativeItem.SetImage(await Utils.ConvertViewToBitmapDescriptor(otherView));
                //nativeItem.SetAnchor((float)iconView.AnchorX, (float)iconView.AnchorY);
                nativeItem.Visible = true;
            }
        }
        protected override void UpdateSampleLayoutCore()
        {
            FrameLayout mapContainerView = SampleView.FindViewById <FrameLayout>(Resource.Id.MapContainerView);

            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            layoutParams.Gravity = GravityFlags.Bottom;

            settingsLinearLayout = (LinearLayout)View.Inflate(Application.Context, Resource.Layout.FilterStyleSettings, null);
            mapContainerView.AddView(settingsLinearLayout, layoutParams);

            InitializeSettingView();

            ImageButton settingsButton = SampleView.FindViewById <ImageButton>(Resource.Id.SettingsButton);

            settingsButton.Click += SettingsButtonClick;
            settingsButton.SetImageResource(Resource.Drawable.settings40);
            settingsButton.SetBackgroundResource(Resource.Layout.ButtonBackgroundSelector);
        }
Exemplo n.º 27
0
        private bool SafeCameraOpenInView(View view)
        {
            ReleaseCameraAndPreview();
            mCamera = GetCameraInstance();

            if (mCamera == null)
            {
                return(false);
            }

            mPreview = new CameraPreview(Activity.BaseContext, mCamera, view);
            FrameLayout preview = view.FindViewById <FrameLayout>(Resource.Id.camera_preview);

            preview.AddView(mPreview, 0);
            mPreview.StartCameraPreview();

            return(true);
        }
Exemplo n.º 28
0
        protected virtual void SwitchContent(Page view)
        {
            Context.HideKeyboard(this);

            _frameLayout.RemoveAllViews();

            if (view == null)
            {
                return;
            }

            if (Platform.Android.Platform.GetRenderer(view) == null)
            {
                Platform.Android.Platform.SetRenderer(view, Platform.Android.Platform.CreateRenderer(view));
            }

            _frameLayout.AddView(Platform.Android.Platform.GetRenderer(view).ViewGroup);
        }
Exemplo n.º 29
0
 private void InitializeUI()
 {
     if (webView == null)
     {
         webView = new WebView(this);
         webView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
         webView.Settings.SetSupportZoom(true);
         webView.ScrollBarStyle             = ScrollbarStyles.OutsideOverlay;
         webView.ScrollbarFadingEnabled     = true;
         webView.Settings.JavaScriptEnabled = true;
         webView.SetWebViewClient(webViewClient);
         webView.SetWebChromeClient(new WebChromeClient());
         // Load a page
         webView.LoadUrl(url);
         //add webview to placeholder
         webViewPlaceHolder.AddView(webView);
     }
 }
Exemplo n.º 30
0
		public override View GetSampleContent (Context con)
		{
			int height = con.Resources.DisplayMetrics.HeightPixels/2;

			LinearLayout linearLayout = new LinearLayout(con);
			linearLayout.SetGravity (Android.Views.GravityFlags.CenterHorizontal);
			linearLayout.Orientation = Android.Widget.Orientation.Vertical;
			linearLayout.SetBackgroundColor(Color.White);
			img = new ImageView(con);
			img.SetImageResource (Resource.Drawable.mount);
			linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			linearLayout.SetPadding(20, 20, 20, 20);
			FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height+(height/3.5)),GravityFlags.Center);
			img.SetPadding(12, 0, 10, 0);
			img.LayoutParameters = (layoutParams);


			range=new SfRangeSlider(con);
			range.Minimum = 0;range.Maximum = 100; range.Value = 100;
			range.ShowRange = false; range.SnapsTo = SnapsTo.None;
			range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal;
			range.TickPlacement = TickPlacement.BottomRight;
			range.ShowValueLabel = true; range.TickFrequency = 20;
			range.ValuePlacement = ValuePlacement.BottomRight;
			range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150));
			range.ValueChanged += ValueChanged ;
				
			linearLayout.AddView(img);

			TextView text1 = new TextView(con);
			text1.Text = "  Opacity";
			text1.TextSize=20;
			text1.Gravity = GravityFlags.Left;
			range.SetY(-30);
			linearLayout.AddView(text1);
			linearLayout.AddView(range);

			FrameLayout frame = new FrameLayout(con);
			frame.SetBackgroundColor (Color.White);
			frame.LayoutParameters = ( new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent,GravityFlags.Center));
			frame.AddView(linearLayout);

			return frame;
		}
Exemplo n.º 31
0
        public MainPage()
        {
            InitializeComponent();



            sketchView.SketchUpdated += OnSketchUpdate;

            clearCommand = new Command(OnClearClicked, () => { return(isCanvasDirty); });

            var trash = new ToolbarItem()
            {
                Text    = "Clear",
                Icon    = "trash.png",
                Command = clearCommand,
            };

            trash.Clicked += (o, s) => OnClearClicked();

            ToolbarItems.Add(trash);

#if __ANDROID__
            var actionButton = new FloatingActionButton(Forms.Context);
            actionButton.SetImageResource(XFDraw.Droid.Resource.Drawable.pencil);
            actionButton.Click += (s, e) =>
            {
                OnColorClicked();
                actionButton.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(sketchView.InkColor.ToAndroid());
            };

            var actionButtonFrame = new FrameLayout(Forms.Context);
            actionButtonFrame.SetClipToPadding(false);
            actionButtonFrame.SetPadding(0, 0, 50, 50);
            actionButtonFrame.AddView(actionButton);

            var actionButtonFrameView = actionButtonFrame.ToView();
            actionButtonFrameView.HorizontalOptions = LayoutOptions.End;
            actionButtonFrameView.VerticalOptions   = LayoutOptions.End;

            mainLayout.Children.Add(actionButtonFrameView);
#else
            ToolbarItems.Add(new ToolbarItem("New Color", "pencil.png", OnColorClicked));
#endif
        }
Exemplo n.º 32
0
        public static async Task <T> AttachAndRun <T>(this AView view, Func <Task <T> > action)
        {
            if (view.Parent is WrapperView wrapper)
            {
                view = wrapper;
            }

            if (view.Parent == null)
            {
                var context = view.Context !;
                var layout  = new FrameLayout(context)
                {
                    LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
                };
                view.LayoutParameters = new FrameLayout.LayoutParams(view.Width, view.Height)
                {
                    Gravity = GravityFlags.Center
                };

                var act      = context.GetActivity() !;
                var rootView = act.FindViewById <FrameLayout>(Android.Resource.Id.Content) !;

                view.Id   = AView.GenerateViewId();
                layout.Id = AView.GenerateViewId();

                try
                {
                    await _attachAndRunSemaphore.WaitAsync();

                    layout.AddView(view);
                    rootView.AddView(layout);
                    return(await Run(view, action));
                }
                finally
                {
                    rootView.RemoveView(layout);
                    layout.RemoveView(view);
                    _attachAndRunSemaphore.Release();
                }
            }
            else
            {
                return(await Run(view, action));
            }
Exemplo n.º 33
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            root    = FindViewById <FrameLayout>(Resource.Id.root);

            if (toolbar != null)
            {
                SetSupportActionBar(toolbar);
                SupportActionBar.Title = null;
            }

            View navigationLayout = LayoutInflater
                                    .From(this)
                                    .Inflate(Resource.Layout.guillotine, null);

            root.AddView(navigationLayout);

            var navigationHamburger = navigationLayout
                                      .FindViewById(Resource.Id.guillotineHamburger);

            contentHamburger = FindViewById <ImageView>(Resource.Id.contentHamburger);

            new GuillotineAnimation.GuillotineBuilder(
                navigationLayout,
                navigationHamburger,
                contentHamburger)
            .SetClosedOnStart(true)
            .SetDuration(1000)
            .SetStartDelay(250)
            .SetActionBarViewForAnimation(toolbar)
            .SetInterpolator(new BounceInterpolator())
            .Build();

            var RateAppButton = navigationLayout.FindViewById(Resource.Id.settings_group);

            RateAppButton.Click += (sender, e) => {
                StartActivity(typeof(RatingActivity));
            };
        }
            public void refreshStatus()
            {
                if (container != null)
                {
                    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 (int i = 0; i < container.ChildCount; i++)
                    {
                        if (container.GetChildAt(i) == view)
                        {
                            view.Visibility = ViewStates.Visible;
                        }
                        else
                        {
                            container.GetChildAt(i).Visibility = ViewStates.Gone;
                        }
                    }
                }
            }
Exemplo n.º 35
0
        private async void TransformXamarinViewToAndroidBitmap(Pin outerItem, ClusteredMarker nativeItem)
        {
            try
            {
                if (outerItem?.Icon?.Type == BitmapDescriptorType.View && outerItem.Icon?.View != null && !string.IsNullOrEmpty(outerItem.Tag.ToString()))
                {
                    var iconView = outerItem.Icon.View;
                    nativeItem.Position = outerItem.Position.ToLatLng();
                    var exists = cache.ContainsKey(outerItem.Tag.ToString());
                    if (exists)
                    {
                        nativeItem.Icon = cache[outerItem.Tag.ToString()];
                    }
                    else
                    {
                        var nativeView = await Utils.ConvertFormsToNative(iconView,
                                                                          new Rectangle(0, 0, Utils.DpToPx((float)iconView.WidthRequest),
                                                                                        Utils.DpToPx((float)iconView.HeightRequest)),
                                                                          Platform.CreateRendererWithContext(iconView, context));

                        var otherView = new FrameLayout(nativeView.Context);
                        nativeView.LayoutParameters = new FrameLayout.LayoutParams(Utils.DpToPx((float)iconView.WidthRequest), Utils.DpToPx((float)iconView.HeightRequest));
                        otherView.AddView(nativeView);
                        nativeItem.Icon = await Utils.ConvertViewToBitmapDescriptor(otherView);

                        cache.Add(outerItem.Tag.ToString(), nativeItem.Icon);
                    }
                    nativeItem.AnchorX = (float)iconView.AnchorX;
                    nativeItem.AnchorY = (float)iconView.AnchorY;
                    nativeItem.Visible = true;
                    if (outerItem.NativeObject == null)
                    {
                        AddMarker(outerItem, nativeItem);
                    }
                    else
                    {
                        clusterRenderer.SetUpdateMarker(nativeItem);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 36
0
        public void SetupVideoLayout(View video)
        {
            /**
             * As we don't want the touch events to be processed by the underlying WebView, we do not set the WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE flag
             * But then we have to handle directly back press in our View to exit fullscreen.
             * Otherwise the back button will be handled by the topmost Window, id-est the player controller
             */
            mVideoLayout = new DailyMotionFrameLayout(this, this.Context);
            mVideoLayout.SetBackgroundResource(Android.Resource.Color.Black);
            mVideoLayout.AddView(video);

            var lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            lp.Gravity = GravityFlags.Center;

            mRootLayout.AddView(mVideoLayout, lp);

            this.IsFullScreen = true;
        }
Exemplo n.º 37
0
 private void SetupRemoteVideo(int uid)
 {
     try
     {
         FrameLayout container = (FrameLayout)FindViewById(Resource.Id.remote_video_view_container);
         if (container.ChildCount >= 1)
         {
             return;
         }
         SurfaceView surfaceView = RtcEngine.CreateRendererView(BaseContext);
         container.AddView(surfaceView);
         AgoraEngine.SetupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RenderModeAdaptive, uid));
         surfaceView.Tag = uid; // for mark purpose
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
            private ViewHolder CreateViewHolder()
            {
                var view = CreateView(out var viewCell);

                if (_element.ListLayout == HorizontalListViewLayout.Grid)
                {
                    var contentFrame = new FrameLayout(_context)
                    {
                        LayoutParameters = new FrameLayout.LayoutParams(
                            LayoutParams.MatchParent,
                            (int)(_element.ItemHeight * Resources.System.DisplayMetrics.Density)),
                    };

                    contentFrame.AddView(view);
                    view = contentFrame;
                }

                return(new ViewHolder(view, viewCell));
            }
        public override View GetPropertyWindowLayout(Context context)
        {
            FrameLayout  propertyLayout = new FrameLayout(context);
            LinearLayout container      = new LinearLayout(context);

            container.Orientation = Orientation.Vertical;
            container.SetBackgroundColor(Color.White);
            container.SetPadding(15, 15, 15, 20);
            TextView transitiontype = new TextView(context);

            transitiontype.Text     = "Tranisition Type";
            transitiontype.TextSize = 20;
            transitiontype.SetPadding(0, 0, 0, 10);
            transitiontype.SetTextColor(Color.Black);
            Spinner transitionTypeSpinner = new Spinner(context, SpinnerMode.Dialog);

            transitionTypeSpinner.SetMinimumHeight(60);
            transitionTypeSpinner.SetBackgroundColor(Color.Gray);
            transitionTypeSpinner.DropDownWidth = 600;
            transitionTypeSpinner.SetPadding(10, 10, 0, 10);
            transitionTypeSpinner.SetGravity(GravityFlags.CenterHorizontal);
            container.AddView(transitiontype);
            container.AddView(transitionTypeSpinner);
            List <String> list = new List <String>();

            list.Add("SlideOnTop");
            list.Add("Push");
            ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, list);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            transitionTypeSpinner.Adapter       = dataAdapter;
            transitionTypeSpinner.ItemSelected += transitionTypeSpinner_ItemSelected;
            if (pullToRefresh.TransitionType == TransitionType.SlideOnTop)
            {
                transitionTypeSpinner.SetSelection(0);
            }
            else
            {
                transitionTypeSpinner.SetSelection(1);
            }
            propertyLayout.AddView(container);
            return(propertyLayout);
        }
Exemplo n.º 40
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set content view to FrameLayout with ClockView.
			FrameLayout frameLayout = new FrameLayout (this);
			clockView = new ClockView (this);
			frameLayout.AddView (clockView);
			SetContentView (frameLayout);

			// Create ClockModel to keep clock updated.
			clockModel = new ClockModel {
				IsSweepSecondHand = true
			};

			// Initialize clock.
			SetClockHandAngles ();

			clockModel.PropertyChanged += (object sender, PropertyChangedEventArgs e) => 
			{
				// Update clock.
				SetClockHandAngles();
			};
		}
Exemplo n.º 41
0
        /**
         * 创建基本的背景视图
         */
        private View CreateView()
        {
            FrameLayout parent = new FrameLayout(_mContext);
            FrameLayout.LayoutParams parentParams =
                new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
                {
                    Gravity = GravityFlags.Bottom
                };
            parent.LayoutParameters = parentParams;
            _mBg = new View(_mContext)
            {
                LayoutParameters =
                    new ActionBar.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            };
            _mBg.SetBackgroundColor(Color.Argb(136, 0, 0, 0));
            _mBg.Id = BgViewId;
            _mBg.SetOnClickListener(this);

            _mPanel = new LinearLayout(_mContext);
            FrameLayout.LayoutParams mPanelParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            {
                Gravity = GravityFlags.Bottom
            };
            _mPanel.LayoutParameters = mPanelParams;
            //mPanel.setOrientation(LinearLayout.VERTICAL);
            //mPanel.Orientation = Linear
            parent.AddView(_mBg);
            parent.AddView(_mPanel);
            return parent;
        }
Exemplo n.º 42
0
		//Java.Lang.Object.Locale localinfo;
		public override View GetSampleContent (Context con)
		{
			Context localcontext = con;
			int width = con.Resources.DisplayMetrics.WidthPixels -40;
			FrameLayout frameLayout = new FrameLayout(con);
			FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.FillVertical);
			frameLayout.LayoutParameters = layoutParams;
			LinearLayout layout=new LinearLayout(con);
			layout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
			layout.SetGravity(GravityFlags.FillVertical);
			layout.Orientation=Orientation.Vertical;
			TextView dummy0 = new TextView(con);
			dummy0.Text="Simple Interest Calculator";
			dummy0.Gravity=GravityFlags.Center;
			dummy0.TextSize=24;
			layout.AddView(dummy0);
			TextView dummy7 = new TextView(con);
			layout.AddView(dummy7);
			TextView dummy = new TextView(con);
			dummy.Text="The formula for finding simple interest is:";
			dummy.TextSize=18;
			layout.AddView(dummy);


			layout.FocusableInTouchMode=true;
			SpannableStringBuilder builder = new SpannableStringBuilder();
			TextView dummy1 = new TextView(con);
			String str= "Interest";
			SpannableString strSpannable= new SpannableString(str);
			strSpannable.SetSpan(new ForegroundColorSpan(Color.ParseColor("#66BB6A")), 0, str.Length, 0);
			builder.Append(strSpannable);
			builder.Append(" = Principal * Rate * Time");
			dummy1.SetText(builder, TextView.BufferType.Spannable);
			dummy1.TextSize=18;
			layout.AddView(dummy1);

			TextView dummy8 = new TextView(con);
			layout.AddView(dummy8);

			/*
        Principal amount Stack
       */

			LinearLayout principalStack = new LinearLayout(con);

			TextView txtPricipal = new TextView(con);
			txtPricipal.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			txtPricipal.Text="Principal";

			principalamount =new SfNumericTextBox(con);
			principalamount.FormatString="C";
			principalamount.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			principalamount.Value=1000;
			principalamount.AllowNull = true;
			principalamount.Watermark = "Principal Amount";
			principalamount.MaximumNumberDecimalDigits=2;
			var culture = new Java.Util.Locale("en","US");

			principalamount.CultureInfo = culture;
			principalamount.ValueChangeMode=ValueChangeMode.OnKeyFocus;
			principalStack.Orientation = Orientation.Horizontal;
			principalStack.AddView(txtPricipal);
			principalStack.AddView(principalamount);

			layout.AddView(principalStack);

			TextView dummy3 = new TextView(con);
			layout.AddView(dummy3);

			/*
        Interest Input Box
        */

			LinearLayout InterestcalStack = new LinearLayout(con);

			TextView txtInterest = new TextView(con);
			txtInterest.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			txtInterest.Text="Interest Rate";
			Interestvalue =new SfNumericTextBox(con);
			Interestvalue.FormatString="P"; 
			Interestvalue.PercentDisplayMode=PercentDisplayMode.Compute;
			Interestvalue.MaximumNumberDecimalDigits=2;
			Interestvalue.ValueChangeMode=ValueChangeMode.OnKeyFocus;
			Interestvalue.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			Interestvalue.Value=0.1f;
			Interestvalue.Watermark = "Rate of Interest";
			Interestvalue.AllowNull = true;
			Interestvalue.CultureInfo = culture;
			InterestcalStack.Orientation=Orientation.Horizontal;
			InterestcalStack.AddView(txtInterest);
			InterestcalStack.AddView(Interestvalue);


			layout.AddView(InterestcalStack);

			TextView dummy2 = new TextView(con);
			layout.AddView(dummy2);



			/*
          Period Input TextBox
         */
			LinearLayout periodStack = new LinearLayout(con);

			TextView period = new TextView(con);
			period.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			period.Text="Term";

			periodValue =new SfNumericTextBox(con);
			periodValue.FormatString=" years";
			periodValue.MaximumNumberDecimalDigits=0;
			periodValue.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			periodValue.Value=20;
			periodValue.Watermark = "Period (in years)";
			periodValue.ValueChangeMode=ValueChangeMode.OnKeyFocus;
			periodValue.CultureInfo = culture;
			periodValue.AllowNull = true;

			periodStack.Orientation=Orientation.Horizontal;

			periodStack.AddView(period);
			periodStack.AddView(periodValue);

			layout.AddView(periodStack);



			/*
        OutPut values
         */

			LinearLayout outputStack = new LinearLayout(con);

			TextView outputtxt = new TextView(con);
			outputtxt.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			outputtxt.Text="Interest";
			outputtxt.SetTextColor(Color.ParseColor("#66BB6A"));

			OutputNumbertxtBox =new SfNumericTextBox(con);
			OutputNumbertxtBox.FormatString="c";
			OutputNumbertxtBox.MaximumNumberDecimalDigits=0;
			OutputNumbertxtBox.AllowNull=true;
			OutputNumbertxtBox.CultureInfo = culture;
			OutputNumbertxtBox.Watermark="Enter Values";
			OutputNumbertxtBox.Clickable=false;
			OutputNumbertxtBox.Value = (float)(1000 * 0.1 * 20);
			OutputNumbertxtBox.Enabled=false;
			OutputNumbertxtBox.LayoutParameters=new ViewGroup.LayoutParams(width / 2, 100);
			OutputNumbertxtBox.ValueChangeMode=ValueChangeMode.OnLostFocus;


			outputStack.Orientation=Orientation.Horizontal;

			outputStack.AddView(outputtxt);
			outputStack.AddView(OutputNumbertxtBox);
			layout.AddView(outputStack);

			TextView dummy4 = new TextView(con);
			layout.SetPadding(20, 20, 10, 20);
			layout.AddView(dummy4);

			principalamount.ValueChanged+= (object sender, SfNumericTextBox.ValueChangedEventArgs e) => {
				if(!e.P1.ToString().Equals("")&&!periodValue.Value.ToString().Equals("")&&!Interestvalue.Value.ToString().Equals(""))
					OutputNumbertxtBox.Value=e.P1 * periodValue.Value *  Interestvalue.Value;

			};

			periodValue.ValueChanged+= (object sender, SfNumericTextBox.ValueChangedEventArgs e) => {
				if(!e.P1.ToString().Equals("")&&!principalamount.Value.ToString().Equals("")&&!Interestvalue.Value.ToString().Equals(""))
					OutputNumbertxtBox.Value=e.P1* principalamount.Value*Interestvalue.Value;

			};

			Interestvalue.ValueChanged+= (object sender, SfNumericTextBox.ValueChangedEventArgs e) => {
				if(!e.P1.ToString().Equals("")&&!principalamount.Value.ToString().Equals("")&&!periodValue.Value.ToString().Equals(""))
					OutputNumbertxtBox.Value=e.P1 * principalamount.Value *  periodValue.Value;

			};

			layout.Touch+= (object sender, View.TouchEventArgs e) => {
				if(OutputNumbertxtBox.IsFocused || Interestvalue.IsFocused ||periodValue.IsFocused || principalamount.IsFocused){
					Rect outRect = new Rect();
					OutputNumbertxtBox.GetGlobalVisibleRect(outRect);
					Interestvalue.GetGlobalVisibleRect(outRect);
					periodValue.GetGlobalVisibleRect(outRect);
					principalamount.GetGlobalVisibleRect(outRect);

					if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) {
						if(!OutputNumbertxtBox.Value.ToString().Equals(""))
							OutputNumbertxtBox.ClearFocus();
						if(!Interestvalue.Value.ToString().Equals(""))
							Interestvalue.ClearFocus();
						if(!periodValue.Value.ToString().Equals(""))
							periodValue.ClearFocus();
						if(!principalamount.Value.ToString().Equals(""))
							principalamount.ClearFocus();

					}
					hideSoftKeyboard((Activity)localcontext);
				}
			};






			frameLayout.AddView(layout);

			ScrollView scrollView = new ScrollView(con);
			scrollView.AddView(frameLayout);

			return scrollView;
		}
Exemplo n.º 43
0
		protected override void OnCreate(Bundle bundle)
		{
			this.Window.AddFlags(WindowManagerFlags.Fullscreen);
			base.OnCreate(bundle);
			SetContentView(Resource.Layout.MainView);
			player = new Android.Media.MediaPlayer();
			_currentCurso = 0;
			_lectorOpen = false;
			_mapOpen = false;
			_playerOn = false;
			_isHome = false;


			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header1.png")));
			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header2.png")));
			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header3.png")));
			headersDR.Add (new BitmapDrawable (getBitmapFromAsset("images/header4.png")));

			drBack = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondocondiagonalm.png"), 640, 1136, true));

			vm = this.ViewModel as MainViewModel;

			lo = new WallView(this);
			frontView = new frontView (this);
			lector = new FrontContainerViewPager (this);
			//map = new MapView (this);


			frontView._listLinearItem [0].Click += delegate {showRutas ();};
			frontView._listLinearItem [1].Click += delegate {showServicios ();};
			frontView._listLinearItem [2].Click += delegate {showGuiaSilvestre ();};
			frontView._listLinearItem [3].Click += delegate {showCifras ();};


			LinearLayout linearMainLayout = FindViewById<LinearLayout>(Resource.Id.left_drawer);

			var metrics = Resources.DisplayMetrics;
			widthInDp = ((int)metrics.WidthPixels);
			heightInDp = ((int)metrics.HeightPixels);
			Configuration.setWidthPixel (widthInDp);
			Configuration.setHeigthPixel (heightInDp);

			pausePlayer = Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/pause.png"),Configuration.getWidth(60),Configuration.getWidth(60),true);

			task = new TaskView (this);


			initRutas ();
			initLinearInfo ();
			iniMenu ();

			mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
			SetSupportActionBar(mToolbar);
			mToolbar.SetNavigationIcon (Resource.Drawable.transparent);

			mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			mLeftDrawer = FindViewById<LinearLayout>(Resource.Id.left_drawer);
			//mRightDrawer = FindViewById<LinearLayout>(Resource.Id.right_drawer);

			mLeftDrawer.Tag = 0;
			//mRightDrawer.Tag = 1;

			frameLayout = FindViewById<FrameLayout> (Resource.Id.content_frame);

			main_ContentView = new RelativeLayout (this);
			main_ContentView.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);


			lo.header.SetBackgroundDrawable (headersDR[1]);
			main_ContentView.AddView (lo);
			lo.getWorkSpaceLayout.AddView (frontView);

			frameLayout.AddView (main_ContentView);


			//RL.SetBackgroundDrawable (dr);

			//seting up chat view content

			//title_view = FindViewById<TextView> (Resource.Id.chat_view_title);




			linearMainLayout.AddView (mainLayout);

			vm.PropertyChanged += new PropertyChangedEventHandler(logout_propertyChanged);

			RegisterWithGCM();

			mDrawerToggle = new MyActionBarDrawerToggle(
				this,							//Host Activity
				mDrawerLayout,					//DrawerLayout
				Resource.String.openDrawer,		//Opened Message
				Resource.String.closeDrawer		//Closed Message
			);

			mDrawerLayout.SetDrawerListener(mDrawerToggle);
			SupportActionBar.SetHomeButtonEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled(false);

			mDrawerToggle.SyncState();

			if (bundle != null)
			{
				if (bundle.GetString("DrawerState") == "Opened")
				{
					SupportActionBar.SetTitle(Resource.String.openDrawer);
				}

				else
				{
					SupportActionBar.SetTitle(Resource.String.closeDrawer);
				}
			}
			else
			{
				SupportActionBar.SetTitle(Resource.String.closeDrawer);
			}


			initListCursos ();
			initListTaskTop ();
			initListTaskBotton ();

			viewPager = new ViewPager (this);

			viewPager.SetOnPageChangeListener (new MyPageChangeListenerPager (this, listFrontPager));


		}
Exemplo n.º 44
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
#if OUYA
            Ouya.Console.Api.OuyaFacade.Instance.Init(this, "f3366755-190b-4b95-af21-ca4a01a99478"); // Our UUID dev ID
#endif

            Game1.Activity = this;
            var game = new Game1();

            var frameLayout = new FrameLayout(this);
            frameLayout.AddView(game.Window);
            this.SetContentView(frameLayout);

            //SetContentView(game.Window);
            game.Run(GameRunBehavior.Asynchronous);
        }
Exemplo n.º 45
0
			private void ApplyTo (View target)
			{
				var lp = target.LayoutParameters;
				IViewParent parent = target.Parent;
				FrameLayout container = new FrameLayout (context);

				// borrow some properties from the view which the badge is being applied
				this.Clickable = target.Clickable;
				this.Focusable = target.Focusable;
				this.FocusableInTouchMode = target.FocusableInTouchMode;

				if (target is TabWidget) {
					target = ((TabWidget)target).GetChildTabViewAt (targetTabIndex);
					this.target = target;

					((ViewGroup)target).AddView(
						container,
						new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent)
					);

					Visibility = ViewStates.Gone;
					container.AddView (this);
				} else {
					ViewGroup group = (ViewGroup)parent;	// will throw an exception if not actually a ViewGroup
					int index = group.IndexOfChild (target);

					group.RemoveView (target);
					group.AddView (container, index, lp);

					container.AddView (target);

					Visibility = ViewStates.Gone;
					container.AddView (this);

					group.Invalidate ();
				}
			}
		/// <summary>
		/// Used to tell this instance that the underlying tabs have changed.
		/// </summary>
		public void NotifyDataSetChanged()
		{
			_inNotifyDataSetChanged = true;
			int currentViewCount = _tabsContainer.ChildCount;
			_tabCount = _adapter.Count;
			int viewsToAddCount = _tabCount - currentViewCount;
			_checkedTabWidths = false;

			//means we already have too many views.
			if (viewsToAddCount < 0)
			{
#if DEBUG
				Android.Util.Log.Info("PagerSlidingTabStrip", string.Format("Need to delete {0} tabs as the number of tabs has reduced", Math.Abs(viewsToAddCount)));
#endif
				while (viewsToAddCount++ != 0)
				{
					_tabsContainer.RemoveViewAt(_tabCount);
				}
			}

			FrameLayout tabContainer;
			View toRecycle;
			View newView = null;

			for (int i = 0; i < _tabCount; i++)
			{
				if (i < _tabsContainer.ChildCount)
				{
					tabContainer = _tabsContainer.GetChildAt(i) as FrameLayout;

					if (tabContainer != null)
					{
#if DEBUG
					Android.Util.Log.Info("PagerSlidingTabStrip", "Found old tab FrameLayout, looking to recycle its current child");
#endif
						//the upshot of this is that is another component starts mucking about with our shizzle
						//and inserting other types of views along with our tabs, this algorithm is going to 
						//break and tabs won't be created properly.
						if (tabContainer.ChildCount == 1)
						{
							toRecycle = tabContainer.GetChildAt(0);
							newView = _tabProvider.GetTab(this, tabContainer, i, toRecycle);

							if (newView != toRecycle)
							{
#if DEBUG
								Android.Util.Log.Info("PagerSlidingTabStrip", "Old tab not recycled by ITabProvider implementation - adding new tab");
#endif
								tabContainer.RemoveViewAt(0);
								tabContainer.AddView(newView);
							}
						}
					}
				}
				else
				{
#if DEBUG
					Android.Util.Log.Info("PagerSlidingTabStrip", "Creating brand new FrameLayout for tab and its content");
#endif
					tabContainer = new FrameLayout(Context);
					//tabContainer.LayoutParameters = _defaultTabLayoutParams;
					newView = _tabProvider.GetTab(this, tabContainer, i);
					tabContainer.AddView(newView);
					AddTabClick(tabContainer, i);
					_tabsContainer.AddView(tabContainer);
				}

				if (newView != null)
					_tabProvider.UpdateTab(newView, this, i);
			}

			UpdateTabStyles();

			if (!_globalLayoutSubscribed)
			{
				ViewTreeObserver.GlobalLayout += ViewTreeObserver_GlobalLayout;
				_globalLayoutSubscribed = true;
			}
			_shouldObserve = true;
			_inNotifyDataSetChanged = false;
			RequestLayout();
			Invalidate();
		}
Exemplo n.º 47
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
#if OUYA
            Ouya.Console.Api.OuyaFacade.Instance.Init(this, "XXXXXXXXXXXXXX"); // Our UUID dev ID
#endif

            var game = new Game1();

			var frameLayout = new FrameLayout(this);
            frameLayout.AddView((View)game.Services.GetService(typeof(View)));
            this.SetContentView(frameLayout);

            //SetContentView(game.Window);
            game.Run(GameRunBehavior.Asynchronous);
        }
Exemplo n.º 48
0
        protected override void OnCreate(Bundle bundle)
        {
            try {
                base.OnCreate (bundle);
                RPSArcadeGame.Activity = this;
                currentGame = new RPSArcadeGame ();
                FrameLayout fl = new FrameLayout (this);
                LinearLayout ll = new LinearLayout (this);
                ll.Orientation = Orientation.Vertical;
                ll.SetGravity (GravityFlags.Top);
                fl.AddView (currentGame.Window);
                adView = new AdView (this, AdSize.Banner, "ca-app-pub-3805641000844271/9009097745");
                ll.AddView (adView);
                fl.AddView (ll);
                SetContentView (fl);
                AdRequest adRequest = new AdRequest ();
                #if DEBUG
                adRequest.SetTesting (true);
                adRequest.AddTestDevice (AdRequest.TestEmulator);
                #endif
                adView.LoadAd (adRequest);

                interstitialAd = new InterstitialAd (this, "ca-app-pub-3805641000844271/7877114945");
                AdRequest adRequest2 = new AdRequest ();
                #if DEBUG
                adRequest2.SetTesting (true);
                adRequest2.AddTestDevice (AdRequest.TestEmulator);
                #endif
                interstitialAd.LoadAd (adRequest2);
                interstitialAd.DismissScreen += (sender, e) => FullAdOn = false;

                currentGame.Run ();
            } catch (Exception e) {
                NotifyViaToast (e.Message);
            }
        }
Exemplo n.º 49
0
        protected override void OnCreate(Bundle bundle)
        {
			this.Window.AddFlags(WindowManagerFlags.Fullscreen);
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.MainView);

			vm = this.ViewModel as MainViewModel;
			vm.PropertyChanged += Vm_PropertyChanged;
			loWallView = new WallView(this);
			currentIndexLO = 0;

			LinearLayout linearMainLayout = FindViewById<LinearLayout>(Resource.Id.left_drawer);

			/*scrollIndice = new ScrollView (this);
			scrollIndice.LayoutParameters = new ScrollView.LayoutParams (-1,400);
			linearContentIndice = new LinearLayout (this);
			linearContentIndice.LayoutParameters = new LinearLayout.LayoutParams (-1, 800);
			linearContentIndice.Orientation = Orientation.Vertical;
			linearContentIndice.SetBackgroundColor (Color.Red);

			scrollIndice.AddView (linearContentIndice); */


			var metrics = Resources.DisplayMetrics;
			widthInDp = ((int)metrics.WidthPixels);
			heightInDp = ((int)metrics.HeightPixels);
			Configuration.setWidthPixel (widthInDp);
			Configuration.setHeigthPixel (heightInDp);

			task = new TaskView (this);

			iniMenu ();

			mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
			SetSupportActionBar(mToolbar);
			mToolbar.SetNavigationIcon (Resource.Drawable.hamburger);

			mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			mLeftDrawer = FindViewById<LinearLayout>(Resource.Id.left_drawer);
			mRightDrawer = FindViewById<LinearLayout>(Resource.Id.right_drawer);

			mLeftDrawer.Tag = 0;
			mRightDrawer.Tag = 1;

			frameLayout = FindViewById<FrameLayout> (Resource.Id.content_frame);

			main_ContentView = new RelativeLayout (this);
			main_ContentView.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);


			// main_ContentView.AddView (scrollIndice);
			//main_ContentView.AddView(linearContentIndice);

			LOContainerView LOContainer = new LOContainerView (this);

			//main_ContentView.AddView (LOContainer);
			//WallView wallview = new WallView(this);

			//wallview.OpenLO.Click += Lo_ImagenLO_Click;
			//lo.OpenTasks.Click += ListTasks_ItemClick;

			//wallview.OpenChat.Click += imBtn_Chat_Click;
			//wallview.OpenUnits.Click += imBtn_Units_Click;

			loWallView.OpenChat.Click += imBtn_Chat_Click;
			loWallView.OpenUnits.Click += imBtn_Units_Click;

			main_ContentView.AddView (loWallView);


			frameLayout.AddView (main_ContentView);


			RelativeLayout RL = FindViewById<RelativeLayout> (Resource.Id.main_view_relativeLayoutCL);

			Drawable dr = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/nubeactivity.png"), 768, 1024, true));
			RL.SetBackgroundDrawable (dr);

			dr = null;

			//seting up chat view content


			title_view = FindViewById<TextView> (Resource.Id.chat_view_title);


			info1= FindViewById<TextView> (Resource.Id.chat_view_info1);
			info2 = FindViewById<TextView> (Resource.Id.chat_view_info2);
			title_list = FindViewById<TextView> (Resource.Id.chat_list_title);

			mListViewChat = FindViewById<ListView> (Resource.Id.chat_list_view);

			title_view.SetX (Configuration.getWidth(74));
			title_view.SetY (Configuration.getHeight (202));

			title_view.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			title_view.SetTypeface (null, TypefaceStyle.Bold);

			info1.SetX (Configuration.getWidth (76));
			info1.SetY (Configuration.getHeight (250));
			info1.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			info2.SetX (Configuration.getWidth (76));
			info2.SetY (Configuration.getHeight (285));
			info2.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			title_list.SetX (Configuration.getWidth (76));
			title_list.SetY (Configuration.getHeight (391));

			title_list.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			title_list.SetTypeface (null, TypefaceStyle.Bold);

			mListViewChat.SetX (0);
			mListViewChat.SetY (Configuration.getHeight (440));

			//end setting



			linearMainLayout.AddView (mainLayout);

            vm.PropertyChanged += new PropertyChangedEventHandler(logout_propertyChanged);

            RegisterWithGCM();

			mDrawerToggle = new MyActionBarDrawerToggle(
				this,							//Host Activity
				mDrawerLayout,					//DrawerLayout
				Resource.String.openDrawer,		//Opened Message
				Resource.String.closeDrawer		//Closed Message
			);

			mDrawerLayout.SetDrawerListener(mDrawerToggle);
			SupportActionBar.SetHomeButtonEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled(false);

			mDrawerToggle.SyncState();

			if (bundle != null)
			{
				if (bundle.GetString("DrawerState") == "Opened")
				{
					SupportActionBar.SetTitle(Resource.String.openDrawer);
				}

				else
				{
					SupportActionBar.SetTitle(Resource.String.closeDrawer);
				}
			}
			else
			{
				SupportActionBar.SetTitle(Resource.String.closeDrawer);
			}
				
			initListCursos ();
			iniPeoples ();
			initListTasks ();

			//main_ContentView.AddView (scrollIndice);

        }
		public override View GetSampleContent (Context context)
		{
			btn = new Button(context);
			btn.SetBackgroundResource(Resource.Drawable.burgericon);
			FrameLayout.LayoutParams btlayoutParams = new FrameLayout.LayoutParams(42,32, GravityFlags.Center);

			btn.LayoutParameters = btlayoutParams;
			btn.SetPadding (10,0,0,0);
			btn.Gravity=GravityFlags.CenterVertical;


			TextView textView = new TextView(context);
			textView.TextSize=20;
			textView.Text="Home";
			textView.SetTextColor (Color.White);
			textView.Gravity=GravityFlags.Center;
			LinearLayout linearLayout =  new LinearLayout(context);
			FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 70, GravityFlags.Center);
			layoutParams.SetMargins (10,0,0,0);
			linearLayout.SetPadding (10,0,0,0);
			linearLayout.AddView(btn);linearLayout.AddView(textView,layoutParams);
			linearLayout.SetBackgroundColor(Color.Rgb(47,173,227));



			height = context.Resources.DisplayMetrics.HeightPixels-75;
			width =context.Resources.DisplayMetrics.WidthPixels;

			LinearLayout linear2 = new LinearLayout(context);
			linear2.Orientation=Orientation.Vertical;
			linear2.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			FrameLayout.LayoutParams layout2= new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
			linear2.AddView(linearLayout,layout2);

			/**
			 * Main Content
			 * */




			FrameLayout gridLayout = new FrameLayout(context);
			gridLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

			/**
         * item1
         */

			FrameLayout grid1 = new FrameLayout(context);
			ImageView img1 = new ImageView(context);
			img1.SetScaleType (ImageView.ScaleType.FitXy);
			img1.SetImageResource(Resource.Drawable.profile);

			FrameLayout.LayoutParams layoutParams1 = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center);

			grid1.AddView(img1, layoutParams1);

			grid1.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);

			/**
         * item2
         */

			FrameLayout grid2 = new FrameLayout(context);
			ImageView img2 = new ImageView(context);
			img2.SetImageResource(Resource.Drawable.inbox);
			img2.SetScaleType (ImageView.ScaleType.FitXy);
			grid2.AddView(img2, layoutParams1);
			grid2.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);

			/**
         * item3
         */

			FrameLayout grid3 = new FrameLayout(context);
			ImageView img3 = new ImageView(context);
			img3.SetImageResource(Resource.Drawable.outbox);
			img3.SetScaleType (ImageView.ScaleType.FitXy);
			grid3.AddView(img3, layoutParams1);
			grid3.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);


			/**
         * item4
         */

			FrameLayout grid4 = new FrameLayout(context);
			ImageView img4 = new ImageView(context);
			img4.SetImageResource(Resource.Drawable.flag);
			img4.SetScaleType (ImageView.ScaleType.FitXy);
			grid4.AddView(img4, layoutParams1);
			grid4.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);
			/**
         * item5
         */
			FrameLayout grid5 = new FrameLayout(context);
			ImageView img5 = new ImageView(context);
			img5.SetImageResource(Resource.Drawable.trash);
			img5.SetScaleType (ImageView.ScaleType.FitXy);

			grid5.AddView(img5, layoutParams1);

			grid5.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 155)/3);



			/**
         * item6
         */



			FrameLayout grid6 = new FrameLayout(context);
			ImageView img6 = new ImageView(context);
			img6.SetImageResource(Resource.Drawable.power);		
			grid6.AddView(img6, layoutParams1);
			img6.SetScaleType (ImageView.ScaleType.FitXy);
			grid6.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 155)/3);


			img1.SetPadding (0,0,0,3);
			img2.SetPadding (-1,0,0,3);
			img3.SetPadding (0,0,0,0);
			img4.SetPadding (-1,0,0,0);
			img5.SetPadding (0,0,0,15);
			img6.SetPadding (-1,0,0,15);
			int x=0;
			int y=5;

			int x1,y1;
			x1= (x)+(width/2);
			y1 = (2*y)+((height-100)/3);
			grid1.SetX(x); grid1.SetY(y);
			grid2.SetX(x1); grid2.SetY(y);
			grid3.SetX(x); grid3.SetY(y1);
			grid4.SetX(x1); grid4.SetY(y1);
			grid5.SetX(x); grid5.SetY((2*y1));
			grid6.SetX(x1); grid6.SetY((2*y1));

			gridLayout.AddView(grid1);
			gridLayout.AddView(grid2);
			gridLayout.AddView(grid3);
			gridLayout.AddView(grid4);
			gridLayout.AddView(grid5);
			gridLayout.AddView(grid6);

			FrameLayout ContentFrame = new FrameLayout (context);
			ContentFrame.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, height-75);
			ContentFrame.SetBackgroundColor (Color.White);
			ContentFrame.AddView (gridLayout);
			gridLayout.SetBackgroundColor (Color.White);
			linear2.AddView (ContentFrame);



			LinearLayout contentLayout= new LinearLayout(context);

			RoundedImageView imgvw=new RoundedImageView(context,120,120);
			imgvw.SetPadding(0,10,0,10);
			imgvw.SetImageResource(Resource.Drawable.user);
			LinearLayout.LayoutParams layparams8 = new LinearLayout.LayoutParams(120, 120);
			layparams8.Gravity = GravityFlags.Center;
			imgvw.LayoutParameters=new ViewGroup.LayoutParams(120, 120);

			TextView text = new TextView(context);
			text.Text="James Pollock";
			text.Gravity=GravityFlags.Center;
			text.TextSize=17;
			text.SetTextColor(Color.White);
			text.SetPadding (0,20,0,0);
			text.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			LinearLayout headerLayout=new LinearLayout(context);
			headerLayout.Orientation=Orientation.Vertical;
			headerLayout.SetBackgroundColor(Color.Rgb(47,173,227));
			headerLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 200);
			headerLayout.SetGravity (GravityFlags.Center);
			headerLayout.AddView(imgvw,layparams8);
			headerLayout.AddView(text);
			LinearLayout.LayoutParams layparams2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int) (height * 0.15));
			layparams2.Gravity = GravityFlags.Center;
			contentLayout.AddView(headerLayout);
			LinearLayout.LayoutParams layparams5 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent,  (2));

			contentLayout.AddView(new SeparatorView(context,width){separatorColor=Color.LightGray},layparams5);
			contentLayout.SetBackgroundColor (Color.White);
			linear2.SetBackgroundColor(Color.White);

			slideDrawer = new Com.Syncfusion.Navigationdrawer.SfNavigationDrawer(context);
			slideDrawer.ContentView=linear2;
			slideDrawer.DrawerWidth = (float)(width * 0.60);
			slideDrawer.DrawerHeight = (float)(height * 0.60);
			slideDrawer.Transition=Transition.SlideOnTop;
			slideDrawer.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			listView = new ListView(context);
			listView.VerticalScrollBarEnabled = true;
			btn.Click+= (object sender, EventArgs e) => {
				slideDrawer.ToggleDrawer();
			};

			List<String> list = new List<String>();

			list.Add("Home");
			list.Add("Profile");
			list.Add("Inbox");
			list.Add("Outbox");
			list.Add("Sent Items");
			list.Add("Trash");



			ArrayAdapter<String> arrayAdapter =new ArrayAdapter<String>(context, Android.Resource.Layout.SimpleListItem1,list);
			listView.SetAdapter(arrayAdapter);
			listView.SetBackgroundColor(Color.White);
			listView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,ViewGroup.LayoutParams.MatchParent);
			contentLayout.AddView(listView);

			contentLayout.Orientation=Orientation.Vertical;

			FrameLayout frame = new FrameLayout (context);
			frame.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			frame.SetBackgroundColor (Color.White);
			frame.AddView (contentLayout);
			slideDrawer.DrawerContentView=frame;



			/**
			 * profile content
			 * */

			LinearLayout profilelayout = new LinearLayout(context);
			profilelayout.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
			profilelayout.Orientation = Orientation.Vertical;
			LinearLayout linearLayout2 = new LinearLayout(context);
			linearLayout2.SetGravity(GravityFlags.Center);
			linearLayout2.SetPadding(0,30,0,30);
			linearLayout2.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			RoundedImageView rddimgvw=new RoundedImageView(context,  150,  150);
			rddimgvw.LayoutParameters=new ViewGroup.LayoutParams(  150,  150);
			rddimgvw.SetImageResource(Resource.Drawable.user);
			LinearLayout txtlayout=new LinearLayout(context);
			txtlayout.SetPadding(40,0,0,0);
			txtlayout.Orientation=Orientation.Vertical;
			TextView txtvw=new TextView(context);
			txtvw.TextSize=20;
			txtvw.Text="JamesPollock";
			txtvw.SetTextColor (Color.Black);

			TextView txtvw1=new TextView(context);
			txtvw1.Text="Age 30";
			txtvw1.TextSize=13;			
			txtvw1.SetTextColor (Color.Black);
			txtlayout.AddView(txtvw);
			txtlayout.AddView(txtvw1);
			linearLayout2.AddView(rddimgvw);
			linearLayout2.AddView(txtlayout);
			linearLayout2.SetBackgroundColor(Color.White);
			profilelayout.AddView(linearLayout2);
			//int Width=context.getResources().getDisplayMetrics().widthPixels;
			profilelayout.Orientation=Orientation.Vertical;
			FrameLayout.LayoutParams separatorparams=new FrameLayout.LayoutParams(width,2,GravityFlags.Center);
			SeparatorView separatorView = new SeparatorView(context,width);
			separatorView.separatorColor = Color.LightGray;
			//separatorView.Invalidate ();
			separatorView.SetPadding(20,0,20,20);

			profilelayout.AddView(separatorView, separatorparams);

			TextView textView60 =  new TextView(context);
			textView60.TextSize=16;
			textView60.SetPadding(20,0,20,0);
			textView60.SetBackgroundColor(Color.White);
			textView60.Text="\n" +
				"It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters.\n" +
				"\n" + "\n" + "when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters.\n" +
				"\n" + "\n" + "James Pollock";
			//textView.setHorizontallyScrolling(false);
			profilelayout.AddView(textView60);
			profilelayout.SetBackgroundColor (Color.White);


			/**
         * InBox Layout
         */
			LinearLayout inboxLayout=new LinearLayout(context);
			inboxLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			inboxLayout.SetBackgroundColor (Color.White);
			inboxLayout.Orientation=Orientation.Vertical;
			LinearLayout mail1=new LinearLayout(context);
			TextView textView8 = new TextView(context);
			textView8.Text="John";
			textView8.TextSize=18;
			TextView textView9 = new TextView(context);
			textView9.Text="Update on Timeline";
			textView9.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView9.TextSize=16;
			TextView textView10 = new TextView(context);
			textView10.Text="Hi John, See you at 10AM";

			SeparatorView separate4 = new SeparatorView(context, width * 2);
			separate4.separatorColor = Color.LightGray;
			separate4.LayoutParameters=new ViewGroup.LayoutParams(width * 2, 3);

			LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(width * 2, 3);
			layoutParams5.SetMargins(0, 10, 15, 0);
			textView10.TextSize=13;
			mail1.AddView(textView8);
			mail1.AddView(textView10);

			LinearLayout mail2=new LinearLayout(context);
			TextView textView11 = new TextView(context);
			textView11.Text="Caster";
			textView11.TextSize=18;
			TextView textView12 = new TextView(context);
			textView12.Text="Update on Timeline";
			textView12.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView12.TextSize=16;
			TextView textView13 = new TextView(context);
			textView13.Text="Hi Caster, See you at 11AM";
			//textView13.setTextColor(Color.parseColor("#1CAEE4"));
			textView13.TextSize=13;
			mail2.AddView(textView11);
			//mail2.addView(textView12);
			mail2.AddView(textView13);

			SeparatorView separate1 = new SeparatorView(context, width * 2);
			separate1.separatorColor = Color.LightGray;
			separate1.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));




			LinearLayout mail3=new LinearLayout(context);
			TextView textView14 = new TextView(context);
			textView14.Text="Joey";
			textView14.TextSize=18;
			TextView textView15 = new TextView(context);
			textView15.Text="Update on Timeline";
			textView15.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView15.TextSize=16;
			TextView textView16 = new TextView(context);
			textView16.Text="Hi Joey, See you at 1PM";
			textView16.TextSize=13;
			mail3.AddView(textView14);
			mail3.AddView(textView16);

			SeparatorView separate5 = new SeparatorView(context, width * 2);
			separate5.separatorColor = Color.LightGray;
			separate5.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			LinearLayout mail4=new LinearLayout(context);
			TextView textView17 = new TextView(context);
			textView17.Text="Xavier";
			textView17.TextSize=18;
			TextView textView18 = new TextView(context);
			textView18.Text="Update on Timeline";
			textView18.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView18.TextSize=16;
			TextView textView19 = new TextView(context);
			textView19.Text="Hi Xavier, See you at 2PM";
			textView19.TextSize=13;
			mail4.AddView(textView17);
			mail4.AddView(textView19);

			SeparatorView separate3 = new SeparatorView(context, width * 2);
			separate3.separatorColor = Color.LightGray;
			separate3.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			LinearLayout mail9=new LinearLayout(context);
			TextView textView33 = new TextView(context);
			textView33.Text="Gonzalez";
			textView33.TextSize=18;
			TextView textView34 = new TextView(context);
			textView34.Text="Update on Timeline";
			textView34.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView34.TextSize=16;
			TextView textView35 = new TextView(context);
			textView35.Text="Hi Gonzalez, See you at 3PM";
			textView35.TextSize=13;
			mail9.AddView(textView33);
			//mail4.addView(textView18);
			mail9.AddView(textView35);

			SeparatorView separate7 = new SeparatorView(context, width * 2);
			separate7.separatorColor = Color.LightGray;
			separate7.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			LinearLayout mail10=new LinearLayout(context);
			TextView textView36 = new TextView(context);
			textView36.Text="Rodriguez";
			textView36.TextSize=18;
			TextView textView37 = new TextView(context);
			textView37.Text="Update on Timeline";
			textView37.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView37.TextSize=16;
			TextView textView38 = new TextView(context);
			textView38.Text="Hi Rodriguez, See you at 4PM";
			textView38.TextSize=13;
			mail10.AddView(textView36);
			mail10.AddView(textView38);

			SeparatorView separate10 = new SeparatorView(context, width * 2);
			separate10.separatorColor = Color.LightGray;
			separate10.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			LinearLayout mail11=new LinearLayout(context);
			TextView textView39 = new TextView(context);
			textView39.Text="Ruben";
			textView39.TextSize=18;
			TextView textView40 = new TextView(context);
			textView40.Text="Update on Timeline";
			textView40.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView40.TextSize=16;
			TextView textView41 = new TextView(context);
			textView41.Text="Hi Ruben, See you at 6PM";
			textView41.TextSize=13;
			mail11.AddView(textView39);
			mail11.AddView(textView41);

			SeparatorView separate11 = new SeparatorView(context, width * 2);
			separate11.separatorColor = Color.LightGray;
			separate11.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail1.Orientation=Orientation.Vertical;
			mail2.Orientation=Orientation.Vertical;
			mail3.Orientation=Orientation.Vertical;
			mail4.Orientation=Orientation.Vertical;
			mail9.Orientation=Orientation.Vertical;
			mail10.Orientation=Orientation.Vertical;
			mail11.Orientation=Orientation.Vertical;

			mail1.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail1.SetPadding(20,10,10,5);
			mail2.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail2.SetPadding(20,10,10,5);
			mail3.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail3.SetPadding(20,10,10,5);
			mail4.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail4.SetPadding(20,10,10,5);
			mail9.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail9.SetPadding(20,10,10,5);
			mail10.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail10.SetPadding(20,10,10,5);
			mail11.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail11.SetPadding(20,10,10,5);

			inboxLayout.SetPadding(20,0,20,20);
			inboxLayout.AddView(mail1);
			inboxLayout.AddView(separate4,layoutParams5);
			inboxLayout.AddView(mail2);
			inboxLayout.AddView(separate1,layoutParams5);
			inboxLayout.AddView(mail3);
			inboxLayout.AddView(separate5,layoutParams5);
			inboxLayout.AddView(mail4);
			inboxLayout.AddView(separate3,layoutParams5);
			inboxLayout.AddView(mail9);
			inboxLayout.AddView(separate7,layoutParams5);
			inboxLayout.AddView(mail10);
			inboxLayout.AddView(separate11,layoutParams5);
			inboxLayout.AddView(mail11);
			inboxLayout.AddView(separate10,layoutParams5);

			img2.Click+= (object sender, EventArgs e) => {

				ContentFrame.RemoveAllViews();
				inboxLayout.RemoveAllViews();
				inboxLayout.SetPadding(20,0,20,20);
				inboxLayout.AddView(mail1);
				inboxLayout.AddView(separate4,layoutParams5);
				inboxLayout.AddView(mail2);
				inboxLayout.AddView(separate1,layoutParams5);
				inboxLayout.AddView(mail3);
				inboxLayout.AddView(separate5,layoutParams5);
				inboxLayout.AddView(mail4);
				inboxLayout.AddView(separate3,layoutParams5);
				inboxLayout.AddView(mail9);
				inboxLayout.AddView(separate7,layoutParams5);
				inboxLayout.AddView(mail10);
				inboxLayout.AddView(separate11,layoutParams5);
				inboxLayout.AddView(mail11);
				inboxLayout.AddView(separate10,layoutParams5);
				ContentFrame.AddView(inboxLayout);
				textView.Text="Inbox";

			};

			/**
         * Outbox content
         */


			LinearLayout outboxlayout=new LinearLayout(context);
			outboxlayout.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
			outboxlayout.SetBackgroundColor(Color.White);
			outboxlayout.Orientation=(Orientation.Vertical);
			LinearLayout mail5=new LinearLayout(context);
			TextView textView20 = new TextView(context);
			textView20.Text="Ruben";
			textView20.TextSize=20;
			TextView textView21 = new TextView(context);
			textView21.Text="Update on Timeline";
			textView21.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView21.TextSize=16;
			TextView textView22 = new TextView(context);
			textView22.Text="Hi Ruben, see you at 6PM";

			SeparatorView separate6 = new SeparatorView(context, width * 2);
			separate6.separatorColor = Color.LightGray;
			separate6.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			textView22.TextSize=13;
			mail5.AddView(textView20);
			mail5.AddView(textView22);

			LinearLayout mail6=new LinearLayout(context);
			TextView textView23 = new TextView(context);
			textView23.Text="Rodriguez";
			textView23.TextSize=20;
			TextView textView24 = new TextView(context);
			textView24.Text="Update on Timeline";
			textView24.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView24.TextSize=16;
			TextView textView25 = new TextView(context);
			textView25.Text="Hi Rodriguez, see you at 4PM";
			textView25.TextSize=13;
			mail6.AddView(textView23);
			mail6.AddView(textView25);

			LinearLayout mail12=new LinearLayout(context);
			TextView textView42 = new TextView(context);
			textView42.Text="Gonzalez";
			textView42.TextSize=20;
			TextView textView43 = new TextView(context);
			textView43.Text="Update on Timeline";
			textView43.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView43.TextSize=16;
			TextView textView44 = new TextView(context);
			textView44.Text="Hi Gonzalez, see you at 3PM";
			mail12.AddView(textView42);
			//mail12.addView(textView43);
			mail12.AddView(textView44);

			SeparatorView separate14 = new SeparatorView(context, width * 2);
			separate14.separatorColor = Color.LightGray;
			separate14.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail12.Orientation=Orientation.Vertical;
			mail12.Orientation=(Orientation.Vertical);
			mail5.Orientation=Orientation.Vertical;
			mail6.Orientation=Orientation.Vertical;

			LinearLayout mail13=new LinearLayout(context);
			TextView textView45 = new TextView(context);
			textView45.Text="Xavier";
			textView45.TextSize=20;
			TextView textView46 = new TextView(context);
			textView46.Text="Update on Timeline";
			textView46.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView46.TextSize=16;
			TextView textView47 = new TextView(context);
			textView47.Text="Hi Xavier, see you at 2PM";

			SeparatorView separate15 = new SeparatorView(context, width * 2);
			separate15.separatorColor = Color.LightGray;
			separate15.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail13.AddView(textView45);
			mail13.AddView(textView47);

			mail13.Orientation=(Orientation.Vertical);
			mail13.Orientation=(Orientation.Vertical);

			LinearLayout mail14=new LinearLayout(context);
			TextView textView48 = new TextView(context);
			textView48.Text="Joey";
			textView48.TextSize=20;
			TextView textView49 = new TextView(context);
			textView49.Text="Update on Timeline";
			textView49.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView49.TextSize=16;
			TextView textView50 = new TextView(context);
			textView50.Text="Hi Joey, see you at 1PM";

			SeparatorView separate16 = new SeparatorView(context, width * 2);
			separate16.separatorColor = Color.LightGray;
			separate16.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail14.AddView(textView48);
			//mail12.addView(textView43);
			mail14.AddView(textView50);

			mail14.Orientation=(Orientation.Vertical);
			mail14.Orientation=(Orientation.Vertical);

			LinearLayout mail15=new LinearLayout(context);
			TextView textView51 = new TextView(context);
			textView51.Text="Joey";
			textView51.TextSize=20;
			TextView textView52 = new TextView(context);
			textView52.Text="Update on Timeline";
			textView52.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView52.TextSize=16;
			TextView textView53 = new TextView(context);
			textView53.Text="Hi Joey, see you at 1PM";

			SeparatorView separate17 = new SeparatorView(context, width * 2);
			separate17.separatorColor = Color.LightGray;
			separate17.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail15.AddView(textView51);
			mail15.AddView(textView53);

			mail15.Orientation=(Orientation.Vertical);
			mail15.Orientation=(Orientation.Vertical);


			LinearLayout mail16=new LinearLayout(context);
			TextView textView54 = new TextView(context);
			textView54.Text=("Caster");
			textView54.TextSize=(20);
			TextView textView55 = new TextView(context);
			textView55.Text=("Update on Timeline");
			textView55.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView55.TextSize=(16);
			TextView textView56 = new TextView(context);
			textView56.Text=("Hi Caster, see you at 11PM");

			SeparatorView separate18 = new SeparatorView(context, width * 2);
			separate18.separatorColor = Color.LightGray;
			separate18.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail16.AddView(textView54);
			mail16.AddView(textView56);

			mail16.Orientation=(Orientation.Vertical);
			mail16.Orientation=(Orientation.Vertical);

			LinearLayout mail17=new LinearLayout(context);
			TextView textView57 = new TextView(context);
			textView57.Text="john";
			textView57.TextSize=20;
			TextView textView58 = new TextView(context);
			textView58.Text=("Update on Timeline");
			textView58.SetTextColor(Color.ParseColor("#1CAEE4"));
			textView58.TextSize=(16);
			TextView textView59 = new TextView(context);
			textView59.Text=("Hi John, see you at 10AM");

			SeparatorView separate19 = new SeparatorView(context, width * 2);
			separate19.separatorColor = Color.LightGray;
			separate19.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));

			mail17.AddView(textView57);
			mail17.AddView(textView59);

			mail17.Orientation=(Orientation.Vertical);
			mail17.Orientation=(Orientation.Vertical);

			mail6.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail6.SetPadding(20, 10, 10, 10);
			mail5.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail5.SetPadding(20,10,10,5);
			mail12.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail12.SetPadding(20,10,10,5);
			mail13.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail13.SetPadding(20,10,10,5);
			mail14.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail14.SetPadding(20,10,10,5);
			mail15.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail15.SetPadding(20,10,10,5);
			mail16.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail16.SetPadding(20,10,10,5);
			mail17.LayoutParameters=(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));
			mail17.SetPadding(20,10,10,5);

			SeparatorView separate13 = new SeparatorView(context, width * 2);
			separate13.separatorColor = Color.LightGray;
			separate13.LayoutParameters=(new ViewGroup.LayoutParams(width * 2, 3));




			outboxlayout.SetPadding(20, 0, 20, 20);
			outboxlayout.AddView(mail5);
			outboxlayout.AddView(separate13, layoutParams5);
			outboxlayout.AddView(mail6);
			outboxlayout.AddView(separate6, layoutParams5);
			outboxlayout.AddView(mail12);
			outboxlayout.AddView(separate14, layoutParams5);
			outboxlayout.AddView(mail13);
			outboxlayout.AddView(separate15, layoutParams5);
			outboxlayout.AddView(mail15);
			outboxlayout.AddView(separate17, layoutParams5);
			outboxlayout.AddView(mail16);
			outboxlayout.AddView(separate18, layoutParams5);
			outboxlayout.AddView(mail17);
			outboxlayout.AddView(separate19, layoutParams5);

			img3.Click+= (object sender, EventArgs e) => {




				ContentFrame.RemoveAllViews();
				outboxlayout.RemoveAllViews();
				outboxlayout.SetPadding(20, 0, 20, 20);
				outboxlayout.AddView(mail5);
				outboxlayout.AddView(separate13, layoutParams5);
				outboxlayout.AddView(mail6);
				outboxlayout.AddView(separate6, layoutParams5);
				outboxlayout.AddView(mail12);
				outboxlayout.AddView(separate14, layoutParams5);
				outboxlayout.AddView(mail13);
				outboxlayout.AddView(separate15, layoutParams5);
				outboxlayout.AddView(mail15);
				outboxlayout.AddView(separate17, layoutParams5);
				outboxlayout.AddView(mail16);
				outboxlayout.AddView(separate18, layoutParams5);
				outboxlayout.AddView(mail17);
				outboxlayout.AddView(separate19, layoutParams5);
				ContentFrame.AddView(outboxlayout);
				textView.Text="OutBox";
			};



			listView.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => {
				String selitem= arrayAdapter.GetItem(e.Position);
				if(selitem.Equals("Home")){
					ContentFrame.RemoveAllViews();
					ContentFrame.AddView(gridLayout);
					textView.Text="Home";

				}
				if(selitem.Equals("Profile")){
					ContentFrame.RemoveAllViews();
					ContentFrame.AddView(profilelayout);
					textView.Text="Profile";

				}
				if(selitem.Equals("Inbox")){
					ContentFrame.RemoveAllViews();
					inboxLayout.RemoveAllViews();
					inboxLayout.SetPadding(20,0,20,20);
					inboxLayout.AddView(mail1);
					inboxLayout.AddView(separate4,layoutParams5);
					inboxLayout.AddView(mail2);
					inboxLayout.AddView(separate1,layoutParams5);
					inboxLayout.AddView(mail3);
					inboxLayout.AddView(separate5,layoutParams5);
					inboxLayout.AddView(mail4);
					inboxLayout.AddView(separate3,layoutParams5);
					inboxLayout.AddView(mail9);
					inboxLayout.AddView(separate7,layoutParams5);
					inboxLayout.AddView(mail10);
					inboxLayout.AddView(separate11,layoutParams5);
					inboxLayout.AddView(mail11);
					inboxLayout.AddView(separate10,layoutParams5);
					ContentFrame.AddView(inboxLayout);
					textView.Text="Inbox";
				}
				if(selitem.Equals("Outbox")){

					ContentFrame.RemoveAllViews();
					outboxlayout.RemoveAllViews();
					outboxlayout.SetPadding(20, 0, 20, 20);
					outboxlayout.AddView(mail5);
					outboxlayout.AddView(separate13, layoutParams5);
					outboxlayout.AddView(mail6);
					outboxlayout.AddView(separate6, layoutParams5);
					outboxlayout.AddView(mail12);
					outboxlayout.AddView(separate14, layoutParams5);
					outboxlayout.AddView(mail13);
					outboxlayout.AddView(separate15, layoutParams5);
					outboxlayout.AddView(mail15);
					outboxlayout.AddView(separate17, layoutParams5);
					outboxlayout.AddView(mail16);
					outboxlayout.AddView(separate18, layoutParams5);
					outboxlayout.AddView(mail17);
					outboxlayout.AddView(separate19, layoutParams5);
					ContentFrame.AddView(outboxlayout);
					textView.Text="OutBox";
				}
				if(selitem.Equals("Sent Items")){
					ContentFrame.RemoveAllViews();
					inboxLayout.RemoveAllViews();
					inboxLayout.SetPadding(20,0,20,20);

					inboxLayout.AddView(mail10);
					inboxLayout.AddView(separate1,layoutParams5);
					inboxLayout.AddView(mail9);
					inboxLayout.AddView(separate5,layoutParams5);
					inboxLayout.AddView(mail4);
					inboxLayout.AddView(separate3,layoutParams5);
					inboxLayout.AddView(mail3);
					inboxLayout.AddView(separate10,layoutParams5);
					inboxLayout.AddView(mail11);
					inboxLayout.AddView(separate4,layoutParams5);
					inboxLayout.AddView(mail1);
					inboxLayout.AddView(separate7,layoutParams5);
					inboxLayout.AddView(mail2);
					inboxLayout.AddView(separate11,layoutParams5);
					ContentFrame.AddView(inboxLayout);
					textView.Text="Sent Items";
				}
				if(selitem.Equals("Trash")){
					ContentFrame.RemoveAllViews();
					outboxlayout.RemoveAllViews();
					outboxlayout.SetPadding(20, 0, 20, 20);
					outboxlayout.AddView(mail13);
					outboxlayout.AddView(separate15, layoutParams5);
					outboxlayout.AddView(mail5);
					outboxlayout.AddView(separate13, layoutParams5);
					outboxlayout.AddView(mail12);
					outboxlayout.AddView(separate14, layoutParams5);
					outboxlayout.AddView(mail15);
					outboxlayout.AddView(separate17, layoutParams5);
					outboxlayout.AddView(mail17);
					outboxlayout.AddView(separate19, layoutParams5);
					outboxlayout.AddView(mail16);
					outboxlayout.AddView(separate18, layoutParams5);
					outboxlayout.AddView(mail6);
					outboxlayout.AddView(separate6, layoutParams5);
					ContentFrame.AddView(outboxlayout);
					textView.Text="Trash";
				}
				slideDrawer.ToggleDrawer();


			};


			img1.Click+= (object sender, EventArgs e) => {
				ContentFrame.RemoveAllViews();
				ContentFrame.AddView(profilelayout);
				textView.Text="Profile";
			};





			img4.Click+= (object sender, EventArgs e) => {
				ContentFrame.RemoveAllViews();
				inboxLayout.RemoveAllViews();
				inboxLayout.SetPadding(20,0,20,20);

				inboxLayout.AddView(mail10);
				inboxLayout.AddView(separate1,layoutParams5);
				inboxLayout.AddView(mail9);
				inboxLayout.AddView(separate5,layoutParams5);
				inboxLayout.AddView(mail4);
				inboxLayout.AddView(separate3,layoutParams5);
				inboxLayout.AddView(mail3);
				inboxLayout.AddView(separate10,layoutParams5);
				inboxLayout.AddView(mail11);
				inboxLayout.AddView(separate4,layoutParams5);
				inboxLayout.AddView(mail1);
				inboxLayout.AddView(separate7,layoutParams5);
				inboxLayout.AddView(mail2);
				inboxLayout.AddView(separate11,layoutParams5);
				ContentFrame.AddView(inboxLayout);
				textView.Text="Sent Items";
			};
			img5.Click+= (object sender, EventArgs e) => {
				ContentFrame.RemoveAllViews();
				outboxlayout.RemoveAllViews();
				outboxlayout.SetPadding(20, 0, 20, 20);
				outboxlayout.AddView(mail13);
				outboxlayout.AddView(separate15, layoutParams5);
				outboxlayout.AddView(mail5);
				outboxlayout.AddView(separate13, layoutParams5);
				outboxlayout.AddView(mail12);
				outboxlayout.AddView(separate14, layoutParams5);
				outboxlayout.AddView(mail15);
				outboxlayout.AddView(separate17, layoutParams5);
				outboxlayout.AddView(mail17);
				outboxlayout.AddView(separate19, layoutParams5);
				outboxlayout.AddView(mail16);
				outboxlayout.AddView(separate18, layoutParams5);
				outboxlayout.AddView(mail6);
				outboxlayout.AddView(separate6, layoutParams5);
				ContentFrame.AddView(outboxlayout);
				textView.Text="Trash";
			};


			return slideDrawer;
		}
Exemplo n.º 51
0
        private View CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            FrameLayout parent = new FrameLayout(Activity);
            parent.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent);
            mBg = new View(Activity);
            mBg.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent);
            mBg.SetBackgroundColor(Color.Argb(160, 0, 0, 0));
            mBg.SetOnClickListener(this);

            mPanel = new LinearLayout(Activity);
            FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.WrapContent);
            param.Gravity = GravityFlags.Bottom;
            mPanel.LayoutParameters = param;
            mPanel.Orientation = Android.Widget.Orientation.Vertical;
            View child = OnCreateChildView(inflater, container, savedInstanceState);

            parent.AddView(mBg);
            parent.AddView(mPanel);
            mPanel.AddView(child);
            return parent;
        }