Example #1
0
        public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            _verticalContainer   = new ContainerScrollView(Activity);
            _horizontalContainer = new ContainerHorizontalScrollView(Activity)
            {
                FillViewport = true,
            };

            _grid = new GridBase(Activity)
            {
                Parent = this,
            };
            _verticalContainer.AddView(_horizontalContainer, new ScrollView.LayoutParams(ScrollView.LayoutParams.MatchParent, ScrollView.LayoutParams.MatchParent));
            _horizontalContainer.AddView(_grid, new HorizontalScrollView.LayoutParams(HorizontalScrollView.LayoutParams.MatchParent, HorizontalScrollView.LayoutParams.MatchParent));

            if (_padding != new Thickness())
            {
                _grid.Padding = _padding;
            }

            _grid.Columns.AddRange(_columns);
            _grid.Rows.AddRange(_rows);
            foreach (var control in _controls)
            {
                _grid.AddChild(control);
            }

            HorizontalScrollingEnabled = _horizontallyScrolling;
            VerticalScrollingEnabled   = _verticallyScrolling;

            return(_verticalContainer);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            var theView = inflater.Inflate(Resource.Layout.PlanetPopLayout, container, false);

            titleView = theView.FindViewById <TextView>(Resource.Id.PlanetInfo);
            gridView  = theView.FindViewById <GridLayout>(Resource.Id.Map);
            hScroller = theView.FindViewById <HorizontalScrollView>(Resource.Id.hscroller);
            vScroller = theView.FindViewById <ScrollView>(Resource.Id.vscroller);

            scanBtn     = theView.FindViewById <Button>(Resource.Id.scanBtn);
            gotoBtn     = theView.FindViewById <Button>(Resource.Id.gotoSectorBtn);
            paintBtn    = theView.FindViewById <Button>(Resource.Id.paintBtn);
            bombardBtn  = theView.FindViewById <Button>(Resource.Id.bombardBtn);
            colonizeBtn = theView.FindViewById <Button>(Resource.Id.colonizeBtn);
            landBtn     = theView.FindViewById <Button>(Resource.Id.landBtn);

            hScroller.SetOnTouchListener(this);
            vScroller.SetOnTouchListener(this);

            gridView.Touch += GridView_Touch;

            scanBtn.Click     += ScanBtn_Click;
            gotoBtn.Click     += GotoBtn_Click;
            paintBtn.Click    += PaintBtn_Click;
            bombardBtn.Click  += BombardBtn_Click;
            colonizeBtn.Click += ColonizeBtn_Click;
            landBtn.Click     += LandBtn_Click;

            return(theView);
        }
Example #3
0
        void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Log.Debug(tag, "~ Renderer - ElementPropertyChanged started");

            if (e.PropertyName == "Renderer")
            {
                // post Xamarin.Forms 2.2 implementation; gives Null Exception ~ Mike

                /*_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                 *  .GetField("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                 *  .GetValue(this);
                 */
                // pre Xam.Forms 2.2 implementation
                _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                              .GetField("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                              .GetValue(this);

                _scrollView.HorizontalScrollBarEnabled = false;
                _scrollView.Touch += HScrollViewTouch;
            }
            if (e.PropertyName == CarouselLayout.SelectedIndexProperty.PropertyName && !_motionDown)
            {
                ScrollToIndex(((CarouselLayout)this.Element).SelectedIndex);
            }

            Log.Debug(tag, "~ Renderer - ElementPropertyChanged ended");
        }
        void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            try
            {
                if (e.PropertyName == "Renderer")
                {
                    //_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                    //	.GetField ("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                    //	.GetValue (this);

                    //_scrollView.HorizontalScrollBarEnabled = false;
                    //_scrollView.Touch += HScrollViewTouch;
                    var horizontal = this.ViewGroup.GetChildAt(0) as ViewGroup;
                    if (horizontal is HorizontalScrollView)
                    {
                        _scrollView = horizontal as HorizontalScrollView;
                        _scrollView.HorizontalScrollBarEnabled = false;
                        _scrollView.Touch += HScrollViewTouch;
                    }
                }

                /*if (e.PropertyName == "ScrollX" && !_motionDown) {
                 *  ScrollToIndex (((CarouselLayout)this.Element).SelectedIndex);
                 * }*/
            }
            catch (System.Exception ex)
            {
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            // Set portrait orientation for avoid bugs
            // RequestedOrientation = ScreenOrientation.Portrait;

            // Initialize the array of the buttons
            _buttons = new[]
            {
                FindViewById <Button>(Resource.Id.button1), FindViewById <Button>(Resource.Id.button2),
                FindViewById <Button>(Resource.Id.button3), FindViewById <Button>(Resource.Id.button4),
                FindViewById <Button>(Resource.Id.button5), FindViewById <Button>(Resource.Id.button6),
                FindViewById <Button>(Resource.Id.button7), FindViewById <Button>(Resource.Id.button8),
                FindViewById <Button>(Resource.Id.button9), FindViewById <Button>(Resource.Id.button10),
                FindViewById <Button>(Resource.Id.button11), FindViewById <Button>(Resource.Id.button12),
                FindViewById <Button>(Resource.Id.button13), FindViewById <Button>(Resource.Id.button14),
                FindViewById <Button>(Resource.Id.button14), FindViewById <Button>(Resource.Id.button15),
                FindViewById <Button>(Resource.Id.button16), FindViewById <Button>(Resource.Id.button17)
            };
            // Initialize output text field
            _twOut = FindViewById <TextView>(Resource.Id.twOut);

            // Initialize ScrollView
            _scrollView = FindViewById <HorizontalScrollView>(Resource.Id.horizontalScrollView1);

            // Initialize comma button
            _buttons[0].Click += PointPressed;

            // Initialize zero button
            _buttons[1].Click += ZeroPressed;

            // Add event for digit buttons
            for (int i = 2; i < 11; i++)
            {
                _buttons[i].Click += DigitPressed;
            }

            // Add event for equals button pressed
            _buttons[11].Click += EqualsPressed;

            // Add event for operator button pressed
            for (int i = 12; i < 17; i++)
            {
                _buttons[i].Click += OperatorPressed;
            }

            // Add event for clear button pressed
            _buttons[17].Click += ClearPressed;
            //      _buttons[10].Click += delegate { Toast.MakeText(Application.Context, "Діма хуй", ToastLength.Short).Show(); };

            // Restore saved application state
            if (bundle != null)
            {
                _twOut.Text = bundle.GetString("expression", "");
            }
        }
Example #6
0
        protected override void OnCreate(Bundle bundle)
        {
            CrushReportEmail = Resources.GetString(Resource.String.CrushReportEmail);
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);
            InitButtonBar();

            _adView = FindViewById<AdView>(Resource.Id.adView);
            InitAdView();

            _horizontalScrollView = FindViewById<HorizontalScrollView>(Resource.Id.horizontalScrollView);
            _formulaTextView = FindViewById<TextView>(Resource.Id.formulaTextView);
            _renderTimeTextView = FindViewById<TextView>(Resource.Id.renderTimeTextView);
            _imageView = FindViewById<ImageView>(Resource.Id.imageView);
            _coresCountTextView = FindViewById<TextView>(Resource.Id.coresCountTextView);
            TextView sizeTextView = FindViewById<TextView>(Resource.Id.sizeTextView);
            TextView launcherTextView = FindViewById<TextView>(Resource.Id.launcherTextView);
            _technicalInfoLayout = FindViewById<LinearLayout>(Resource.Id.technicalInfoLayout);

            launcherTextView.Text = "launcher: " + IntentShortcuts.GetLauncherPackageName(this);
            WallpaperManager wallpaperManager = WallpaperManager.GetInstance(this);
            Point wallpaperSize = wallpaperManager.GetDesiredSize(WindowManager.DefaultDisplay, Resources.Configuration);
            Size imageSize = new Size(wallpaperSize.X, wallpaperSize.Y);
            sizeTextView.Text = "image size: " + imageSize.Width + "x" + imageSize.Height;
            _workflow = new FormulaRenderWorkflow(new FormulaRenderArgumentsGenerationParams(), imageSize, s => new AndroidFormulaBitmap(s));
            
            if (_workflow.FormulaRenderArguments != null)
                _formulaTextView.Text = _workflow.FormulaRenderArguments.ToString();

            _wallpaperFileManager = new AndroidWallpaperFileManager(this);

            AdjustButtons();
            ClearImage();
        }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);
            if (e.OldElement != null)
            {
                return;
            }

            _deltaXResetTimer = new Timer(100)
            {
                AutoReset = false
            };
            _deltaXResetTimer.Elapsed += (object sender, ElapsedEventArgs args) => _deltaX = 0;

            _scrollStopTimer = new Timer(200)
            {
                AutoReset = false
            };
            _scrollStopTimer.Elapsed += (object sender, ElapsedEventArgs args2) => UpdateSelectedIndex();

            _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                          .GetField("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                          .GetValue(this);

            _scrollView.HorizontalScrollBarEnabled = false;
            _scrollView.Touch += HScrollViewTouch;

            e.NewElement.PropertyChanged += ElementPropertyChanged;
        }
Example #8
0
        public void ScrollViewSyncer(HorizontalScrollView scrollView, HorizontalScrollView scrollview2)
        {
            bool  initialRun  = true;
            int   currentTime = (DateTime.Now.Hour - 1) * 5 * 60 + DateTime.Now.Minute * 5;
            int   scrolledAt  = 0;
            int   TimerWait   = 30;
            Timer _timer;

            Thread t = new Thread(() => {
                _timer = new Timer(o => {
                    if (scrollView.ScrollX < currentTime && initialRun == true)
                    {
                        RunOnUiThread(() =>
                        {
                            scrollView.ScrollTo(scrolledAt  += 12, 0);
                            scrollview2.ScrollTo(scrolledAt += 12, 0);
                        });
                    }
                    else
                    {
                        initialRun = false;
                        scrollview2.ScrollTo(scrollView.ScrollX, 0);
                    }
                },
                                   null, 0, TimerWait);
            });

            t.Start();
        }
Example #9
0
        protected override void OnElementChanged(ElementChangedEventArgs <Flip> e)
        {
            base.OnElementChanged(e);

            var root = new Android.Widget.RelativeLayout(this.Context);

            root.SetBackgroundColor(Color.Yellow.ToAndroid());

            this.Scroller = new HorizontalScrollView(this.Context);
            root.AddView(this.Scroller, new Android.Widget.RelativeLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent));
            this.Scroller.SetBackgroundColor(Color.Green.ToAndroid());
            this.Scroller.HorizontalScrollBarEnabled = false;

            this.Container             = new Android.Widget.LinearLayout(this.Context);
            this.Container.Orientation = Orientation.Horizontal;

            this.Scroller.AddView(this.Container);
            this.Scroller.Touch += scroller_Touch;

            this.PointsContainer             = new LinearLayout(this.Context);
            this.PointsContainer.Orientation = Orientation.Horizontal;
            //this.PointsContainer. = Android.Views.TextAlignment.Center;

            var lp = new Android.Widget.RelativeLayout.LayoutParams(LayoutParams.WrapContent, 20);

            lp.AddRule(LayoutRules.AlignParentBottom);
            lp.AddRule(LayoutRules.CenterHorizontal);
            root.AddView(this.PointsContainer, lp);

            this.SetNativeControl(root);
            root.Invalidate();
            root.RequestLayout();
        }
        void UpdateOrientation()
        {
            if (_view.Orientation == ScrollOrientation.Horizontal || _view.Orientation == ScrollOrientation.Both)
            {
                if (_hScrollView == null)
                {
                    _hScrollView = new AHorizontalScrollView(Context, this);
                }

                ((AHorizontalScrollView)_hScrollView).IsBidirectional = _isBidirectional = _view.Orientation == ScrollOrientation.Both;

                if (_hScrollView.Parent != this)
                {
                    _container.RemoveFromParent();
                    _hScrollView.AddView(_container);
                    AddView(_hScrollView);
                }
            }
            else
            {
                if (_container.Parent != this)
                {
                    _container.RemoveFromParent();
                    if (_hScrollView != null)
                    {
                        _hScrollView.RemoveFromParent();
                    }
                    AddView(_container);
                }
            }
        }
 private void FindViews()
 {
     horizontalScrollView = FindViewById<HorizontalScrollView>(Resource.Id)
     //right = (Button)findViewById(R.id.right);
     //categoryLayout = (LinearLayout)findViewById(R.id.category_layout);
     //// 新建一个GridView
     //category = new GridView(getApplicationContext());
 }
        private void initHorizontalScrolling()
        {
            mHorizontalView = (HorizontalScrollView)findViewById(R.id.main_scroll_view);

            mPreviousPosition = mCurrentPosition;

            mHorizontalView.addOnLayoutChangeListener(new OnLayoutChangeListenerAnonymousInnerClassHelper(this));
        }
Example #13
0
 private void FindViews()
 {
     horizontalScrollView = FindViewById <HorizontalScrollView>(Resource.Id)
                            //right = (Button)findViewById(R.id.right);
                            //categoryLayout = (LinearLayout)findViewById(R.id.category_layout);
                            //// 新建一个GridView
                            //category = new GridView(getApplicationContext());
 }
Example #14
0
        public BindableItemsView(Android.Content.Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            _horizontalScrollView = new HorizontalScrollView(context);
            _horizontalScrollView.LayoutParameters = new HorizontalScrollView.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);

            _horizontalScrollView.HorizontalScrollBarEnabled = false;
            this.AddView(_horizontalScrollView);
        }
Example #15
0
        void SetTimeline()
        {
            LinearLayout timeLine = FindViewById <LinearLayout>(Resource.Id.timeLine);

            timeLine.SetGravity(GravityFlags.CenterVertical);

            View blockLine;

            blockLine = LayoutInflater.Inflate(Resource.Layout.line, timeLine, false);

            //Make the horizontal white lines between the animals
            LinearLayout.LayoutParams horizontalLine = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 10);
            blockLine.LayoutParameters = horizontalLine;
            blockLine.SetBackgroundColor(Color.ParseColor("#000000"));



            //Make the block that goes where the animal image should go, used to space everything correctly


            //Make the timeline addition
            LinearLayout timelineLayout = (LinearLayout)LayoutInflater.Inflate(Resource.Layout.LinearLayout, timeLine, false);

            LinearLayout.LayoutParams timelineLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 100);
            timelineLayout.Orientation      = Orientation.Horizontal;
            timelineLayout.LayoutParameters = timelineLayoutParams;
            timelineLayout.SetGravity(GravityFlags.Left);

            timeLine.AddView(timelineLayout);


            //for every hour, there should be a xx:00 and a xx:30.
            for (int i = 0; i < 24; i++)
            {
                TextView timelineElement = (TextView)LayoutInflater.Inflate(Resource.Layout.Text, timelineLayout, false);
                timelineElement.SetTextSize(Android.Util.ComplexUnitType.Dip, 17);
                timelineElement.Gravity = GravityFlags.Center;
                timelineElement.SetTextColor(Color.ParseColor("#AAAAAA"));
                timelineElement.Text = i.ToString("00") + ".00";
                timelineElement.SetWidth(30 * 5);
                // timelineElement.Gravity = GravityFlags.Center;
                timelineLayout.AddView(timelineElement);

                timelineElement         = (TextView)LayoutInflater.Inflate(Resource.Layout.Text, timelineLayout, false);
                timelineElement.Gravity = GravityFlags.Center;
                timelineElement.SetTextSize(Android.Util.ComplexUnitType.Dip, 17);
                timelineElement.SetTextColor(Color.ParseColor("#FFFFFF"));
                timelineElement.Text = i.ToString("00") + ".30";
                timelineElement.SetWidth(30 * 5);
                timelineElement.Gravity = GravityFlags.Center;
                timelineLayout.AddView(timelineElement);
            }

            timeLine.AddView(blockLine);
            HorizontalScrollView animalScroller = FindViewById <HorizontalScrollView>(Resource.Id.animalScroller);
        }
Example #16
0
        private void InitHorizotalScrollView()
        {
            hScrollView = new HorizontalScrollView(this.Context);
            hScrollView.LayoutParameters           = new LayoutParams(screenWidth, screenHeight);
            hScrollView.HorizontalScrollBarEnabled = false;

            hScrollView.Touch += (object sender, TouchEventArgs e) =>
            {
                switch (e.Event.Action)
                {
                case Android.Views.MotionEventActions.Down:
                    downX = (int)e.Event.GetX();
                    break;

                case Android.Views.MotionEventActions.Up:
                case Android.Views.MotionEventActions.Cancel:
                    if (Java.Lang.Math.Abs(e.Event.GetX() - downX) > screenWidth / 4)
                    {
                        if (e.Event.GetX() - downX > 0)
                        {
                            SmoothScrollToPrePage();
                        }
                        else
                        {
                            SmoothScrollToNextPage();
                        }
                    }
                    else
                    {
                        SmoothScrollToCurrent();
                    }
                    break;
                }
            };


            linearLayout = new LinearLayout(this.Context);
            linearLayout.LayoutParameters = new LayoutParams(screenWidth, screenHeight);

            foreach (var item in Images)
            {
                linearLayout.AddView(SetImageView(item));
            }

            hScrollView.AddView(linearLayout);

            SetNativeControl(hScrollView);

            //set timer
            Device.StartTimer(TimeSpan.FromSeconds(3), () => {
                ExcuteTimer();
                return(true);
            });
        }
Example #17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            this.Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);

            calculatorTextview   = FindViewById <TextView>(Resource.Id.calculatorDisplayTextview);
            horizontalScrollView = FindViewById <HorizontalScrollView>(Resource.Id.horizontalScrollView);
        }
 void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Renderer")
     {
         _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                       .GetField("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                       .GetValue(this);
         _scrollView.HorizontalScrollBarEnabled = false;
         _scrollView.Touch        += _scrollView_Touch;
         _scrollView.ScrollChange += _scrollView_ScrollChange;
     }
 }
Example #19
0
        public override View GetPropertyWindowLayout(Context context)
        {
            LinearLayout gridLinearLayout = new LinearLayout(context)
            {
                Orientation = Android.Widget.Orientation.Vertical
            };

            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            layoutParams.TopMargin            = (int)(25 * currentDensity);
            gridLinearLayout.LayoutParameters = layoutParams;
            gridLinearLayout.SetBackgroundResource(Resource.Drawable.LinearLayout_Border);

            int width = (int)(context.Resources.DisplayMetrics.WidthPixels - context.Resources.DisplayMetrics.Density) / 3;

            LinearLayout linearLayout4 = new LinearLayout(context);

            linearLayout4.Orientation = Android.Widget.Orientation.Vertical;
            linearLayout4.SetMinimumHeight((int)(190 * currentDensity));
            linearLayout4.SetMinimumWidth(width);

            TextView selectText = new TextView(context)
            {
                Text     = "Layout Schema",
                Gravity  = GravityFlags.Start,
                TextSize = 5 * currentDensity
            };

            selectText.SetMinimumHeight((int)(50 * currentDensity));
            selectText.SetWidth((int)(width * 0.4 * currentDensity));

            linearLayout4.AddView(selectText);

            //Here theme styles starts
            HorizontalScrollView horizontalScroll = new HorizontalScrollView(context);

            //horizontalScroll.SetPadding(0, (int)(10 * currentDensity), 0, (int)(10 * currentDensity));
            horizontalScroll.FillViewport = true;
            horizontalScroll.HorizontalScrollBarEnabled = true;
            horizontalScroll.SetMinimumHeight((int)(205 * currentDensity));
            horizontalScroll.Layout(0, (int)(30 * currentDensity), (int)(175 * currentDensity * 4), (int)(180 * currentDensity));
            scrollLayout = new LinearLayout(context);
            scrollLayout.SetPadding((int)(10 * currentDensity), (int)(10 * currentDensity), (int)(10 * currentDensity), (int)(10 * currentDensity));
            scrollLayout.LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            horizontalScroll.AddView(scrollLayout);
            linearLayout4.AddView(horizontalScroll);
            AddThemes();

            gridLinearLayout.AddView(linearLayout4);

            return(gridLinearLayout);
        }
		void ElementPropertyChanged(object sender, PropertyChangedEventArgs e) {
			if (e.PropertyName == "Renderer") {
				_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
					.GetField ("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
					.GetValue (this);

				_scrollView.HorizontalScrollBarEnabled = false;
				_scrollView.Touch += HScrollViewTouch;
			}
			if (e.PropertyName == CarouselLayout.SelectedIndexProperty.PropertyName && !_motionDown) {
				ScrollToIndex (((CarouselLayout)this.Element).SelectedIndex);
			}
		}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            hScrollView        = FindViewById <HorizontalScrollView>(Resource.Id.horizontalScrollView);
            customLinearLayout = new PanningZoomingApp.CustomLinearLayout(ApplicationContext);
            hScrollView.AddView(customLinearLayout);
            //TwoDScrollView twoDScrollView = new TwoDScrollView(ApplicationContext);
            //mlinearLayout = FindViewById<LinearLayout>(Resource.Id.parentview);
            //mlinearLayout.AddView(twoDScrollView);
        }
Example #22
0
        private void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Renderer")
            {
                this.scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer).GetField("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);

                this.scrollView.HorizontalScrollBarEnabled = false;
                this.scrollView.Touch += this.HScrollViewTouch;
            }

            if (e.PropertyName == CarouselView.SelectedIndexProperty.PropertyName && !this.motionDown)
            {
                this.ScrollToIndex(((CarouselView)this.Element).SelectedIndex);
            }
        }
Example #23
0
 void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Renderer")
     {
         _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                       .GetField("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                       .GetValue(this);
         var listener = new GestureListener();
         listener.OnTouchScrolled += Listener_OnTouchScrolled;
         _detector = new GestureDetector(this.Context, listener);
         _scrollView.HorizontalScrollBarEnabled = false;
         _scrollView.ScrollChange          += _scrollView_ScrollChange;
         _scrollView.SmoothScrollingEnabled = true;
     }
 }
Example #24
0
        private void initLargeDisplay(Context context)
        {
            var pageScrollLp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent);

            pageScrollLp.AddRule(LayoutRules.CenterHorizontal);

            _pageScroll = new HorizontalScrollView(context);
            _pageScroll.LayoutParameters = pageScrollLp;
            _contentLayout.AddView(_pageScroll);

            _scrollContentLayout                  = new LinearLayout(context);
            _scrollContentLayout.Orientation      = Orientation.Horizontal;
            _scrollContentLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent);
            _pageScroll.AddView(_scrollContentLayout);
        }
Example #25
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            var animatedScrollView = (AnimatedScrollView)Element;

            _pages = animatedScrollView.NumberOfPage;
            Pages  = _pages;

            _scroller = (HorizontalScrollView)typeof(ScrollViewRenderer)
                        .GetField("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                        .GetValue(this);

            Animator = new XFScrollviewAnimations.Plugin.Abstractions.Animator();
        }
Example #26
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.RestaurantPage);

            database = FirebaseDatabase.GetInstance(MainActivity.app);
            auth     = FirebaseAuth.GetInstance(MainActivity.app);

            cur_restaurant = JsonConvert.DeserializeObject <Restaurant>(Intent.GetStringExtra("Restaurant"));

            FindViewById <TextView>(Resource.Id.nameTextView).Text      = cur_restaurant.name;
            FindViewById <TextView>(Resource.Id.cuisineTextView).Text   = cur_restaurant.cuisine;
            FindViewById <TextView>(Resource.Id.addressdetail).Text     = cur_restaurant.address;
            FindViewById <TextView>(Resource.Id.phonedetail).Text       = cur_restaurant.phone_number;
            FindViewById <TextView>(Resource.Id.hoursdetail).Text       = cur_restaurant.hours;
            FindViewById <TextView>(Resource.Id.descriptiondetail).Text = cur_restaurant.description;

            reservation_text = FindViewById <TextView>(Resource.Id.reservation);

            horizontalScroll            = FindViewById <HorizontalScrollView>(Resource.Id.horizontalScrollView1);
            horizontalScroll.Visibility = ViewStates.Gone;

            datepick_btn = FindViewById <Button>(Resource.Id.schedule_button);

            queue_btn = FindViewById <Button>(Resource.Id.queueButton);
            menu_btn  = FindViewById <Button>(Resource.Id.menuButton);

            datepick_btn.Click += DateSelect_OnClick;

            menu_btn.Click += delegate {
                Intent intent = new Intent(this, typeof(Views.Customer.View_Menu));
                intent.PutExtra("Cur_Restaurant", JsonConvert.SerializeObject(cur_restaurant));
                StartActivity(intent);
            };

            queue_btn.Click += Queue_Btn_Click;

            var firebase = new FirebaseClient(FBURL);

            customer_name = await firebase
                            .Child("users")
                            .Child(auth.CurrentUser.Uid)
                            .Child("name")
                            .OnceSingleAsync <string>();
        }
        void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Renderer")
            {
                if (ChildCount > 0)
                {
                    _scrollView = (HorizontalScrollView)GetChildAt(0);
                }

                _scrollView.HorizontalScrollBarEnabled = false;
                _scrollView.Touch += HScrollViewTouch;
            }
            if (e.PropertyName == CarouselLayout.SelectedIndexProperty.PropertyName && !_motionDown)
            {
                ScrollToIndex(((CarouselLayout)this.Element).SelectedIndex);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            FullEquationText  = FindViewById <TextView>(Resource.Id.Calculator_Full_equation);
            CurrentNumberText = FindViewById <TextView>(Resource.Id.Calculator_Current_Number_text);

            hsvTotal = FindViewById <HorizontalScrollView>(Resource.Id.Scroll1);
            hsvBig   = FindViewById <HorizontalScrollView>(Resource.Id.Scroll2);

            AllButtons.Setup(new List <Button>
            {
                FindViewById <Button>(Resource.Id.buttonCE),
                FindViewById <Button>(Resource.Id.buttonClear),
                FindViewById <Button>(Resource.Id.buttonBackArrow),
                FindViewById <Button>(Resource.Id.buttonDivide),
                FindViewById <Button>(Resource.Id.button7),
                FindViewById <Button>(Resource.Id.button8),
                FindViewById <Button>(Resource.Id.button9),
                FindViewById <Button>(Resource.Id.buttonTimes),
                FindViewById <Button>(Resource.Id.button4),
                FindViewById <Button>(Resource.Id.button5),
                FindViewById <Button>(Resource.Id.button6),
                FindViewById <Button>(Resource.Id.buttonMinus),
                FindViewById <Button>(Resource.Id.button1),
                FindViewById <Button>(Resource.Id.button2),
                FindViewById <Button>(Resource.Id.button3),
                FindViewById <Button>(Resource.Id.buttonPluse),
                FindViewById <Button>(Resource.Id.buttonPluseorMinus),
                FindViewById <Button>(Resource.Id.button0),
                FindViewById <Button>(Resource.Id.buttonDot),
                FindViewById <Button>(Resource.Id.buttonEquals),
                FindViewById <Button>(Resource.Id.buttonChristmas),
            });

            FullEquationText.SetTextColor(Color.White);
            CurrentNumberText.SetTextColor(Color.White);

            hsvTotal.SetBackgroundColor(Color.Transparent);
            hsvBig.SetBackgroundColor(Color.Transparent);

            AllButtons.NormalButtons();
            SongPlayer.SetUp(MediaPlayer.Create(this, Resource.Raw.ChristmasCalcMusic), CurrentNumberText, FullEquationText);
        }
Example #29
0
        void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Renderer")
            {
                _scrollView = (HorizontalScrollView)this.ViewGroup.GetChildAt(0); // REMARK: Temporary solution to the problem with Xamarin Forms 2.2

                // REMARK: This stopped working with Xamarin Forms 2.2
                //_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer).GetField("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);

                _scrollView.HorizontalScrollBarEnabled = false;
                _scrollView.Touch += HScrollViewTouch;
            }
            if (e.PropertyName == CarouselLayout.SelectedIndexProperty.PropertyName && !_motionDown)
            {
                ScrollToIndex(((CarouselLayout)this.Element).SelectedIndex);
            }
        }
Example #30
0
 void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     try {
         if (e.PropertyName == "Renderer")
         {
             if (this.ChildCount > 0)
             {
                 _scrollView = (HorizontalScrollView)GetChildAt(0);
             }
             //_scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
             //	.GetField ("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
             //	.GetValue (this);
             _scrollView.HorizontalScrollBarEnabled = false;
         }
     } catch (ObjectDisposedException) {
     } catch (Exception) {
     }
 }
        private void InitUi()
        {
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            toolbar.NavigationClick += delegate
            {
                OnBackPressed();
            };

            verticalScrollLinearLayout   = FindViewById <LinearLayout>(Resource.Id.LinearLayout);
            horizontalScrollLinearLayout = FindViewById <LinearLayout>(Resource.Id.linearLayout2);
            _scrollViewButtons           = FindViewById <HorizontalScrollView>(Resource.Id.ScrollViewButtons);
            _tvDate = FindViewById <TextView>(Resource.Id.tvDate);

            buttonBackground           = Resources.GetDrawable(Resource.Drawable.sharing_round_button_inactiv, Theme);
            buttonBackgroundA          = Resources.GetDrawable(Resource.Drawable.sharing_round_button_activ, Theme);
            buttonBackgroundDatePicker = Resources.GetDrawable(Resource.Drawable.sharing_date_button_style, Theme);
            bottomNavigation           = FindViewById <BottomNavigationView>(Resource.Id.top_navigation);
            _lineChart = FindViewById <LineChart>(Resource.Id.chart);
            bottomNavigation.NavigationItemSelected += BottomNavigationOnNavigationItemSelected;

            _name     = Intent.GetStringExtra("Name");
            _email    = Intent.GetStringExtra("Email");
            _imei     = Intent.GetStringExtra("Imei");
            _dataType = Intent.GetStringExtra("DataType");
            switch (_dataType)
            {
            case "BloodPressure":
                Title = $"Tensiune: {_name}";
                break;

            case "BloodGlucose":
                Title = $"Glicemie: {_name}";
                break;
            }
            bottomNavigation.SelectedItemId = Resource.Id.week_tab;
            bottomNavigation.PerformClick();
            //LoadDaySelectorButtons();
            _tvDate.Text = DateTime.Now.ToShortDateString();
        }
        void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Renderer")
            {
                _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                              .GetField("_hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                              .GetValue(this);

                _scrollView.HorizontalScrollBarEnabled = false;
                _scrollView.Touch += HScrollViewTouch;
            }
            if (e.PropertyName == CarouselLayout.SelectedIndexProperty.PropertyName && !_motionDown)
            {
                if (this.Element != null) // RFP:: added null check to allow for SelectedIndexProperty to be set before display
                {
                    ScrollToIndex(((CarouselLayout)this.Element).SelectedIndex);
                }
            }
        }
        void ElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Renderer")
            {
                _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                              .GetField("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                              .GetValue(this);

                _scrollView.HorizontalScrollBarEnabled = false;
                _scrollView.Touch += HScrollViewTouch;
            }
            if (e.PropertyName == GalleryCarouselView.SelectedItemProperty.PropertyName && !_motionDown)
            {
                if (_IsScrolled)
                {
                    ScrollToIndex(((CarouselView)this.Element).SelectedIndex);
                }
            }
        }
        protected override void OnElementChanged (VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);
            if (e.OldElement != null)
                return;

            _deltaXResetTimer = new Timer(100) { AutoReset = false };
            _deltaXResetTimer.Elapsed += (object sender, ElapsedEventArgs args) => _deltaX = 0;

            _scrollStopTimer = new Timer (200) { AutoReset = false };
            _scrollStopTimer.Elapsed += (object sender, ElapsedEventArgs args2) => UpdateSelectedIndex ();

            _scrollView = (HorizontalScrollView)typeof(ScrollViewRenderer)
                .GetField ("hScrollView", BindingFlags.NonPublic | BindingFlags.Instance)
                .GetValue (this);

            _scrollView.HorizontalScrollBarEnabled = false;
            _scrollView.Touch += HScrollViewTouch;

            e.NewElement.PropertyChanged += ElementPropertyChanged;
        }
Example #35
0
		void UpdateOrientation()
		{
			if (_view.Orientation == ScrollOrientation.Horizontal || _view.Orientation == ScrollOrientation.Both)
			{
				if (_hScrollView == null)
					_hScrollView = new AHorizontalScrollView(Context, this);

				((AHorizontalScrollView)_hScrollView).IsBidirectional = _isBidirectional = _view.Orientation == ScrollOrientation.Both;

				if (_hScrollView.Parent != this)
				{
					_container.RemoveFromParent();
					_hScrollView.AddView(_container);
					AddView(_hScrollView);
				}
			}
			else
			{
				if (_container.Parent != this)
				{
					_container.RemoveFromParent();
					if (_hScrollView != null)
						_hScrollView.RemoveFromParent();
					AddView(_container);
				}
			}
		}
Example #36
0
		/*
		 * instanitates a horizontal scroll view then addes the specified catagories subviews to it
		 */
		private HorizontalScrollView getCatagoryHorizontalScrollViewLayout(IPollSearchResultsByCategory pollsByCatagory)
		{
			//set orientation and sizes
			HorizontalScrollView horizontalScrollView = new HorizontalScrollView (mActivityContext);
			HorizontalScrollView.LayoutParams horizontalLayoutParameters = new HorizontalScrollView.LayoutParams (
				HorizontalScrollView.LayoutParams.WrapContent, HorizontalScrollView.LayoutParams.WrapContent);
			horizontalScrollView.LayoutParameters = horizontalLayoutParameters;

			LinearLayout pollLinearLayout = new LinearLayout (mActivityContext);
			pollLinearLayout.Orientation = Orientation.Horizontal;
			LinearLayout.LayoutParams linearLayoutParameters = new LinearLayout.LayoutParams (
				LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
			pollLinearLayout.LayoutParameters = linearLayoutParameters;

			var polls = pollsByCatagory.SearchResults;
			foreach(IPollSearchResult poll in polls)
			{
				RelativeLayout pollLayout = (RelativeLayout)mActivityContext.LayoutInflater.Inflate (Resource.Layout.pollview_container, null);
				pollLayout.SetBackgroundColor (Color.Transparent);

				ImageView pollLayoutImage = pollLayout.FindViewById<ImageView> (Resource.Id.pollview_cellImage);
				if(poll.ImageLink.CompareTo("")!=0)
					pollLayoutImage.SetUrlDrawable (poll.ImageLink);

				TextView pollLayoutTitle = pollLayout.FindViewById<TextView> (Resource.Id.pollview_cellTitle);
				pollLayoutTitle.Text = poll.Question;

				TextView pollLayoutResponsesCountText = pollLayout.FindViewById<TextView> (Resource.Id.pollview_voteCounts);
				pollLayoutResponsesCountText.Text = poll.SubmissionCount.ToString() + " Responses";

				pollLayout.Click += delegate {
				    this.ViewPoll (poll);
				};

				pollLinearLayout.AddView(pollLayout);
			}

			horizontalScrollView.AddView (pollLinearLayout);

			return horizontalScrollView;
		}
        void Initialize()
        {
            Orientation = Orientation.Vertical;
            WeightSum = 1;

            PostingTitle = new TextView(_context) { LayoutParameters = rowParams };
            PostingTitle.SetTextSize(Android.Util.ComplexUnitType.Dip, 18);
            PostingTitle.SetPadding(10, 10, 10, 10);
            PostingTitle.SetTypeface(Typeface.DefaultBold, TypefaceStyle.Bold);
            AddRowItem(PostingTitle, rowParams);

            PostingImage = new ImageView(_context);// { LayoutParameters = rowParams };
            PostingImage.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.MatchParent,
                                                                       Convert.ToInt16(_context.Resources.DisplayMetrics.HeightPixels * 0.4));
            AddRowItem(PostingImage, rowParams);

            LinearLayout spacing = new LinearLayout(_context);
            spacing.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.MatchParent, PixelConverter.DpToPixels(5));

            AddView(spacing);

            ImageCollectionHolder = new LinearLayout(_context) { Orientation = Orientation.Horizontal };
            ImageCollectionHolder.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            ImageCollectionHolder.Clickable = false;
            HorizontalScrollView scrollView = new HorizontalScrollView(_context);
            scrollView.AddView(ImageCollectionHolder);
            scrollView.Clickable = false;
            AddView(scrollView);

            PostingDescription = new TextView(_context) { LayoutParameters = rowParams };
            PostingDescription.SetTextSize(Android.Util.ComplexUnitType.Dip, 14);
            PostingDescription.SetPadding(10, 10, 10, 10);
            PostingDescription.SetTypeface(Typeface.Default, TypefaceStyle.Normal);
            AddRowItem(PostingDescription, rowParams);

            mapFrame = new FrameLayout(_context);
            mapFrame.Id = 12345;
            AddView(mapFrame);

            PostingDate = new TextView(_context) { LayoutParameters = rowParams };
            PostingDate.SetPadding(10, 10, 10, 10);
            PostingDate.SetTextSize(Android.Util.ComplexUnitType.Dip, 14);
            AddRowItem(PostingDate, rowParams);

            WebLink = new TextView(_context) { LayoutParameters = rowParams };
            WebLink.SetPadding(10, 10, 10, 10);
            WebLink.SetTextSize(Android.Util.ComplexUnitType.Dip, 14);
            AddRowItem(WebLink, rowParams);
        }
        private LinearLayout createConfigPicker()
        {
            LinearLayout holder = new LinearLayout (context);
            holder.Orientation = Orientation.Horizontal;
            holder.LayoutParameters = new ViewGroup.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            holder.SetBackgroundResource (Resource.Drawable.footerback);

            LinearLayout level2 = new LinearLayout (context);
            level2.Orientation = Orientation.Vertical;
            level2.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (260f, context), LinearLayout.LayoutParams.FillParent);

            LinearLayout topSeekHolder = new LinearLayout (context);
            topSeekHolder.Orientation = Orientation.Horizontal;
            LinearLayout.LayoutParams viewParams;
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), (int)ImageHelper.convertDpToPixel (10f, context), 0, 0);
            topSeekHolder.LayoutParameters = viewParams;

            SeekBar topSeek = new SeekBar (context);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, (int)ImageHelper.convertDpToPixel (10f, context));
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (15f, context), 0, (int)ImageHelper.convertDpToPixel (15f, context), 0);
            topSeek.LayoutParameters = viewParams;
            topSeekHolder.AddView (topSeek);

            LinearLayout set1 = new LinearLayout (context);
            set1.Orientation = Orientation.Horizontal;
            set1.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context));
            TextView set1Text = new TextView (context);
            set1Text.SetTextColor (Color.Black);
            set1Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent);
            set1Text.Gravity = GravityFlags.CenterHorizontal;
            set1Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f);
            set1Text.Text = "1";
            HorizontalScrollView set1HSV = new HorizontalScrollView (context);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0);
            set1HSV.LayoutParameters = viewParams;
            set1.AddView (set1Text);
            set1.AddView (set1HSV);

            LinearLayout gap1 = new LinearLayout (context);
            gap1.Orientation = Orientation.Vertical;
            gap1.SetBackgroundColor (Color.Brown);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (10f, context));
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), 0, 0, 0);
            gap1.LayoutParameters = viewParams;
            set1.AddView (gap1);

            LinearLayout set2 = new LinearLayout (context);
            set2.Orientation = Orientation.Horizontal;
            set2.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context));
            TextView set2Text = new TextView (context);
            set2Text.SetTextColor (Color.Black);
            set2Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent);
            set2Text.Gravity = GravityFlags.CenterHorizontal;
            set2Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f);
            set2Text.Text = "2";
            HorizontalScrollView set2HSV = new HorizontalScrollView (context);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0);
            set2HSV.LayoutParameters = viewParams;
            set2.AddView (set2Text);
            set2.AddView (set2HSV);

            LinearLayout gap2 = new LinearLayout (context);
            gap2.Orientation = Orientation.Vertical;
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (10f, context));
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), 0, 0, 0);
            gap2.LayoutParameters = viewParams;
            gap2.SetBackgroundColor (Color.Brown);
            set2.AddView (gap2);

            LinearLayout set3 = new LinearLayout (context);
            set3.Orientation = Orientation.Horizontal;
            set3.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context));
            TextView set3Text = new TextView (context);
            set3Text.SetTextColor (Color.Black);
            set3Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent);
            set3Text.Gravity = GravityFlags.CenterHorizontal;
            set3Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f);
            set3Text.Text = "3";
            HorizontalScrollView set3HSV = new HorizontalScrollView (context);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0);
            set3HSV.LayoutParameters = viewParams;
            set3.AddView (set3Text);
            set3.AddView (set3HSV);

            LinearLayout gap3 = new LinearLayout (context);
            gap3.Orientation = Orientation.Vertical;
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (10f, context));
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), 0, 0, 0);
            gap3.LayoutParameters = viewParams;
            gap3.SetBackgroundColor (Color.Brown);
            set3.AddView (gap3);

            LinearLayout set4 = new LinearLayout (context);
            set4.Orientation = Orientation.Horizontal;
            set4.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context));
            TextView set4Text = new TextView (context);
            set4Text.SetTextColor (Color.Black);
            set4Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent);
            set4Text.Gravity = GravityFlags.CenterHorizontal;
            set4Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f);
            set4Text.Text = "4";
            HorizontalScrollView set4HSV = new HorizontalScrollView (context);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0);
            set4HSV.LayoutParameters = viewParams;
            set4.AddView (set4Text);
            set4.AddView (set4HSV);

            level2.AddView (topSeekHolder);
            level2.AddView (set1);
            level2.AddView (set2);
            level2.AddView (set3);
            level2.AddView (set4);

            LinearLayout level3 = new LinearLayout (context);
            level3.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (25f, context), LinearLayout.LayoutParams.FillParent);
            level3.SetBackgroundColor (Color.Brown);
            level3.Orientation = Orientation.Vertical;

            ImageView addThing = new ImageView (context);
            addThing.SetBackgroundResource (Resource.Drawable.add);
            viewParams = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (23f, context), (int)ImageHelper.convertDpToPixel (23f, context));
            viewParams.SetMargins (0, (int)ImageHelper.convertDpToPixel (15f, context), 0, 0);
            addThing.LayoutParameters = viewParams;
            ImageView wipeThing = new ImageView (context);
            wipeThing.SetBackgroundResource (Resource.Drawable.delete);
            viewParams = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (23f, context), (int)ImageHelper.convertDpToPixel (23f, context));
            viewParams.SetMargins (0, (int)ImageHelper.convertDpToPixel (10f, context), 0, 0);
            wipeThing.LayoutParameters = viewParams;

            level3.AddView (addThing);
            level3.AddView (wipeThing);

            LinearLayout level4 = new LinearLayout (context);
            level4.Orientation = Orientation.Vertical;
            level4.SetBackgroundColor (Color.Brown);
            level4.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);

            SeekBar scroller = new SeekBar (context);
            viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.MatchParent);
            viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (5f, context), (int)ImageHelper.convertDpToPixel (15f, context), 0, (int)ImageHelper.convertDpToPixel (20.8f, context));
            scroller.LayoutParameters = viewParams;
            level4.AddView (scroller);

            holder.AddView (level2);
            holder.AddView (level3);
            holder.AddView (level4);

            return holder;
        }
Example #39
0
		private void iniMenu(){
			mainLayout = new RelativeLayout (this);

			_foro = new LOContainerView (this);

			_dialogDownload = new ProgressDialog (this);
			_dialogDownload.SetCancelable (false);
			_dialogDownload.SetMessage ("Downloading...");

			txtUserName = new TextView (this);
			txtCurse = new TextView (this);
			txtSchoolName = new TextView (this);
			txtUserRol = new TextView (this);
			txtPorcentaje = new TextView (this);
			txtCurseTitle = new TextView (this);
			txtTaskTitle = new TextView (this);
			txtPendiente = new TextView (this);
			txtValorBarra = new TextView (this);

			imgChat = new ImageView (this);
			imgUser = new ImageView (this);
			imgSchool = new ImageView (this);
			imgNotificacion = new ImageView (this);
			imgCurse = new ImageView (this);
			imgTask = new ImageView (this);

			linearBarraCurso = new LinearLayout (this);
			linearCurse= new LinearLayout (this);
			linearSchool= new LinearLayout (this);
			linearTask= new LinearLayout (this);
			linearUserData= new LinearLayout (this);
			linearUser = new LinearLayout (this);
			linearListCurso = new LinearLayout (this);
			linearListTask = new LinearLayout (this);



			linearListTaskTop = new LinearLayout(this);
			linearListRutas = new LinearLayout (this);
			linearListTaskBotton = new LinearLayout(this);

			linearList = new LinearLayout (this);
			linearPendiente = new LinearLayout (this);

			linearTxtValorBarra = new LinearLayout (this);

			listCursos = new ListView (this);
			listTasks = new ListView (this);

			scrollRutas = new HorizontalScrollView (this);
			scrollRutas.LayoutParameters = new HorizontalScrollView.LayoutParams (-1,-2);





			_listTasksTop = new ListView (this);
			_listTasksBotton = new ListView (this);

			mItemsChat = new List<ChatDataRow> ();

			mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
			Drawable d = new BitmapDrawable (getBitmapFromAsset ("icons/fondo.png"));
			mainLayout.SetBackgroundDrawable (d);
			d = null;

			linearBarraCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
			linearCurse.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50));
			linearTask.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50));
			linearSchool.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
			linearUserData.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
			linearUser.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
			linearListCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(250));

			linearListTask.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);

			linearListTaskTop.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);
			linearListRutas.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			linearListTaskBotton.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);


			linearList.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			linearPendiente.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (30), Configuration.getWidth (30));
			linearTxtValorBarra.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);

			linearBarraCurso.Orientation = Android.Widget.Orientation.Vertical;
			linearBarraCurso.SetGravity (GravityFlags.Center);

			linearTxtValorBarra.Orientation = Android.Widget.Orientation.Vertical;
			linearTxtValorBarra.SetGravity (GravityFlags.Center);
			txtValorBarra.Gravity = GravityFlags.Center;

			linearCurse.Orientation = Android.Widget.Orientation.Horizontal;
			linearCurse.SetGravity (GravityFlags.CenterVertical);

			linearTask.Orientation = Android.Widget.Orientation.Horizontal;
			linearTask.SetGravity (GravityFlags.CenterVertical);

			linearSchool.Orientation = Android.Widget.Orientation.Horizontal;

			linearUserData.Orientation = Android.Widget.Orientation.Vertical;
			linearUserData.SetGravity (GravityFlags.Center);

			linearUser.Orientation = Android.Widget.Orientation.Vertical;
			linearUser.SetGravity (GravityFlags.CenterHorizontal);

			linearListCurso.Orientation = Android.Widget.Orientation.Vertical;

			linearListTask.Orientation = Android.Widget.Orientation.Vertical;

			linearListTaskTop.Orientation = Android.Widget.Orientation.Vertical;
			linearListRutas.Orientation = Android.Widget.Orientation.Horizontal;
			linearListTaskBotton.Orientation = Android.Widget.Orientation.Vertical;


			linearListRutas.SetGravity (GravityFlags.Center);

			linearList.Orientation = Android.Widget.Orientation.Vertical;

			linearPendiente.Orientation = Android.Widget.Orientation.Horizontal;
			linearPendiente.SetGravity (GravityFlags.Center);
			//linearList.SetGravity (GravityFlags.CenterVertical);

			progressBar = new ProgressBar (this,null,Android.Resource.Attribute.ProgressBarStyleHorizontal);
			progressBar.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (274), Configuration.getHeight (32));
			progressBar.ProgressDrawable = Resources.GetDrawable (Resource.Drawable.progressBackground);
			progressBar.Progress = 60;
			txtValorBarra.Text = "60%";
			//progressBar.text
			txtValorBarra.SetY(13);

			txtCurse.Text = "Cursos del 2015";
			txtCurse.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");


			//	txtUserName.Text ="David Spencer";
			txtUserName.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtUserRol.Text ="Perú";
			txtUserRol.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtSchoolName.Text ="Colegio Sagrados Corazones";
			txtSchoolName.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtPorcentaje.Text = "60%";
			txtPorcentaje.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtCurseTitle.Text = "CURSOS";
			txtCurseTitle.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtTaskTitle.Text = "TAREAS";	
			txtTaskTitle.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");

			txtPendiente.Text = "1";
			txtPendiente.Typeface =  Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
			txtPendiente.SetY (-10);


			txtPendiente.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
			txtUserName.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (35));
			txtUserRol.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));


			txtCurseTitle.SetPadding (Configuration.getWidth (48), 0, 0, 0);
			txtTaskTitle.SetPadding (Configuration.getWidth (48), 0, 0, 0);

			txtCurse.SetTextColor (Color.ParseColor ("#ffffff"));
			txtUserName.SetTextColor (Color.ParseColor ("#ffffff"));
			txtUserRol.SetTextColor (Color.ParseColor ("#999999"));
			txtSchoolName.SetTextColor (Color.ParseColor ("#ffffff"));
			txtPorcentaje.SetTextColor (Color.ParseColor ("#ffffff"));
			txtPendiente.SetTextColor (Color.ParseColor ("#ffffff"));
			txtTaskTitle.SetTextColor (Color.ParseColor ("#ffffff"));
			txtCurseTitle.SetTextColor (Color.ParseColor ("#ffffff"));
			txtValorBarra.SetTextColor (Color.ParseColor ("#ffffff"));

			txtUserName.Gravity = GravityFlags.CenterHorizontal;
			txtUserRol.Gravity = GravityFlags.CenterHorizontal;
			txtCurse.Gravity = GravityFlags.CenterHorizontal;

			/*
			imgChat.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/chat.png"),Configuration.getWidth (45), Configuration.getWidth (40),true));
			imgUser.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/user.png"),Configuration.getWidth (154), Configuration.getHeight (154),true));
			imgSchool.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/colegio.png"),Configuration.getWidth (29), Configuration.getHeight (29),true));
			imgNotificacion.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/notif.png"),Configuration.getWidth (35), Configuration.getWidth (40),true));
			imgCurse.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/curso.png"),Configuration.getWidth (23), Configuration.getHeight (28),true));
			imgTask.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/vertareas.png"),Configuration.getWidth (23), Configuration.getHeight (28),true));

			Drawable drPendiente = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/pendiente.png"), Configuration.getWidth(30), Configuration.getWidth(30), true));
			linearPendiente.SetBackgroundDrawable (drPendiente);
			drPendiente = null;
*/
			imgCurse.SetPadding (Configuration.getWidth (68), 0, 0, 0);
			imgTask.SetPadding(Configuration.getWidth(68),0,0,0);


			linearCurse.SetBackgroundColor(Color.ParseColor("#0d1216"));
			linearTask.SetBackgroundColor (Color.ParseColor ("#0d1216"));

			//linearBarraCurso.AddView (txtCurse);
			//linearBarraCurso.AddView (progressBar);

			//linearTxtValorBarra.AddView (txtValorBarra);

			linearCurse.AddView (imgCurse);
			//linearCurse.AddView (txtCurseTitle);
			linearTask.AddView (imgTask);
			linearTask.AddView (txtTaskTitle);
			linearPendiente.AddView (txtPendiente);



			imgSchool.SetPadding (Configuration.getWidth(68),0,0,0);
			txtSchoolName.SetPadding (Configuration.getWidth(40),0,0,0);
			linearSchool.AddView (imgSchool);
			linearSchool.AddView (txtSchoolName);

			linearUser.AddView (txtUserName);
			linearUser.AddView (txtUserRol);

			linearUserData.AddView (imgUser);
			linearUserData.AddView (linearUser);

			linearListCurso.AddView (listCursos);

			linearListTask.AddView (listTasks);


			for (int i = 0; i < listRutas.Count; i++) 
			{
				linearListRutas.AddView (listRutas [i]);
			}
			scrollRutas.AddView (linearListRutas);
			scrollRutas.SetPadding (Configuration.getWidth (45), 0, Configuration.getWidth (45), 0);


			linearListTaskTop.AddView (_listTasksTop);
			//linearListRutas.AddView (scrollRutas);
			linearListTaskBotton.AddView (_listTasksBotton);

			linearList.AddView (linearListTaskTop);
			//linearList.AddView (scrollRutas);
			//linearList.AddView (linearinfo1);

			//linearList.AddView (linearCurse);
			//linearList.AddView (linearListCurso);
			//linearList.AddView (linearTask);
			//linearList.AddView (linearListTask);
			linearList.AddView (linearListTaskBotton);



			imgChat.SetX (Configuration.getWidth(59)); imgChat.SetY (Configuration.getHeight(145));
			imgChat.Click += delegate {
				mDrawerLayout.CloseDrawer (mLeftDrawer);
				//mDrawerLayout.OpenDrawer (mRightDrawer);
			};

			imgNotificacion.SetX (Configuration.getWidth(59));  imgNotificacion.SetY (Configuration.getHeight(233)); 
			imgNotificacion.Click += delegate {
				mDrawerLayout.CloseDrawer (mLeftDrawer);
				main_ContentView.RemoveAllViews ();
				main_ContentView.AddView(new NotificationView(this));
			};


			linearPendiente.SetX (Configuration.getWidth(94));  linearPendiente.SetY (Configuration.getHeight(217)); 

			linearUserData.SetX (0); linearUserData.SetY (Configuration.getHeight(100));
			linearBarraCurso.SetX (0); linearBarraCurso.SetY (Configuration.getHeight(412));
			linearTxtValorBarra.SetX (0); linearTxtValorBarra.SetY (Configuration.getHeight(443));
			linearSchool.SetX (0); linearSchool.SetY (Configuration.getHeight(532));
			linearList.SetX (0); linearList.SetY (Configuration.getHeight(360));

			Bitmap bm;
			txtUserName.Text = vm.UserFirstName + " "+ vm.UserLastName;

			if (vm.UserImage != null) {
				bm = BitmapFactory.DecodeByteArray (vm.UserImage, 0, vm.UserImage.Length);

				Bitmap newbm = Configuration.GetRoundedCornerBitmap (Bitmap.CreateScaledBitmap (bm,Configuration.getWidth (154), Configuration.getHeight (154),true));
				imgUser.SetImageBitmap (newbm);

				newbm = null;
			}
			bm = null;

			vm.PropertyChanged += Vm_PropertyChanged;

			//mainLayout.AddView (imgChat);
			//mainLayout.AddView (imgNotificacion);
			//mainLayout.AddView (linearPendiente);
			//mainLayout.AddView (linearUserData);
			//mainLayout.AddView (linearBarraCurso);
			//mainLayout.AddView (linearTxtValorBarra);
			//mainLayout.AddView (linearSchool);
			ImageView header = new ImageView(this);
			Bitmap iconH = Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/logo.png"),Configuration.getWidth (320), Configuration.getHeight (205),true);
			header.SetImageBitmap (iconH);


			LinearLayout lheader = new LinearLayout (this);
			lheader.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			lheader.SetGravity (GravityFlags.CenterHorizontal);
			lheader.SetY (Configuration.getHeight (100));
			lheader.AddView (header);

			mainLayout.AddView (lheader);
			mainLayout.AddView (linearList);

			imgChat = null;
			imgNotificacion = null;
			imgCurse = null;
			imgTask = null;
			imgSchool = null;
			imgUser = null;
		}
Example #40
0
		public void ini(){


			//creating comment List



			commentLayout = new LinearLayout(context);
			commentLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (934));
			commentList = new ListView (context);


			//commentList.AddView (commentList);



			//end comment List

			_mainLayout = new RelativeLayout (context);


			linearGradiente = new LinearLayout (context);
			linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (541));
			linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente);


			var textFormat = Android.Util.ComplexUnitType.Px;

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

			_fondo2 = new LinearLayout (context);
			_fondo2.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getWidth (640));
			_fondo2.SetY (Configuration.getHeight (109));

			Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png"));
			_fondo2.SetBackgroundDrawable (dr1);
			dr1 = null;
			_mainLayout.AddView (_fondo2);

			//section1-----------------------------------------------
			_contentRLayout_S1 = new RelativeLayout(context);
			_txtTitle_S1 = new TextView (context);
			_txtAuthor_S1 = new TextView (context);
			_imAuthor_S1 = new ImageView (context);
			_txtChapter_S1 = new TextView (context);

			_itemsLayout_S1 = new LinearLayout (context);//not used
			_imItem_S1 = new List<ImageView> ();
			_txtItem_S1 = new List<TextView>();





			//_mainLayout.AddView (_txtTitle_S1);
			//_mainLayout.AddView (_txtAuthor_S1);
			_mainLayout.AddView (_imAuthor_S1);

			//_mainLayout.AddView (_txtChapter_S1);







			_contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480));


			LinearLayout _linearTitle = new LinearLayout (context);
			_linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_linearTitle.SetGravity (Android.Views.GravityFlags.Center);
			_linearTitle.AddView (_txtTitle_S1);
			_linearTitle.SetY (Configuration.getHeight (60));

			linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(502));
			_mainLayout.AddView (linearGradiente);
			_mainLayout.AddView (_linearTitle);

			//_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60));

			Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170));
		
			_imAuthor_S1.SetImageBitmap (newbm);
		//	newbm.Recycle ();
			newbm = null;

			_imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189));

			LinearLayout _linearAuthor = new LinearLayout (context);
			_linearAuthor.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_linearAuthor.SetGravity (Android.Views.GravityFlags.Center);
			_linearAuthor.AddView (_txtAuthor_S1);
			_linearAuthor.SetY (Configuration.getHeight (378));
			_mainLayout.AddView (_linearAuthor);

			//_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378));

			LinearLayout _linearChapter = new LinearLayout (context);
			_linearChapter.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_linearChapter.SetGravity (Android.Views.GravityFlags.Center);
			_linearChapter.AddView (_txtChapter_S1);
			_linearChapter.SetY (Configuration.getHeight (502));
			_mainLayout.AddView (_linearChapter);


			//_txtChapter_S1.SetX (Configuration.getWidth (191));_txtChapter_S1.SetY (Configuration.getHeight (502));






			_txtTitle_S1.Text = "Camino Inca";
			_txtTitle_S1.SetTextColor (Color.White);
			_txtTitle_S1.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtTitle_S1.SetTextSize (textFormat,Configuration.getHeight(30));

			_txtAuthor_S1.Text = "David Spencer";
			_txtAuthor_S1.SetTextColor (Color.White);
			_txtAuthor_S1.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtAuthor_S1.SetTextSize (textFormat,Configuration.getHeight(30));
			//_txtAuthor_S1.SetBackgroundColor (Color.ParseColor ("#60000000"));
			_txtAuthor_S1.SetShadowLayer (50.8f, 0.0f, 0.0f, Color.ParseColor ("#000000"));



			_txtChapter_S1.Text = "FLORA Y FAUNA";
			_txtChapter_S1.SetTextColor (Color.White);
			_txtChapter_S1.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtChapter_S1.SetTextSize (textFormat,Configuration.getHeight(35));


			List<string> item_path = new List<string> ();
			item_path.Add ("icons/icona.png");
			item_path.Add ("icons/iconb.png");
			item_path.Add ("icons/iconc.png");
			item_path.Add ("icons/icond.png");
			item_path.Add ("icons/icone.png");
			item_path.Add ("icons/iconf.png");
			item_path.Add ("icons/icong.png");


			int inixItemIM = Configuration.getWidth (33);
			int crecIM = Configuration.getWidth (90);

			int inixItemTXT = Configuration.getWidth (42);
			int crecTXT = Configuration.getWidth (90);
			int inixLinea = Configuration.getWidth (93);

			for (int i = 0; i < item_path.Count; i++) {
				
				_imItem_S1.Add(new ImageView(context));
				_imItem_S1[i].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(item_path[i]), Configuration.getWidth (30), Configuration.getWidth (30), true));
				_mainLayout.AddView (_imItem_S1 [i]);
				_imItem_S1 [i].SetX (inixItemIM+(i*crecIM));_imItem_S1 [i].SetY (Configuration.getHeight(602));


				if (i != item_path.Count - 1) {
					ImageView linea = new ImageView (context);
					linea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 1, Configuration.getHeight (68), true));
					_mainLayout.AddView (linea);
					linea.SetX (inixLinea + (i * crecIM));
					linea.SetY (Configuration.getHeight (605));
					linea = null;
				}



				_txtItem_S1.Add (new TextView (context));
				_txtItem_S1 [i].Text = "0";
				_txtItem_S1 [i].SetTextColor (Color.ParseColor ("#2E9AFE"));
				_txtItem_S1[i].Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
				_txtItem_S1[i].SetTextSize (textFormat,Configuration.getHeight(30));
				_mainLayout.AddView (_txtItem_S1 [i]);
				_txtItem_S1 [i].SetX (inixItemTXT+(i*crecTXT));_txtItem_S1 [i].SetY (Configuration.getHeight(640));
				_imItem_S1 [i] = null;

			}
			_imItem_S1 = null;


			//-------------------------------------------------------


			//section2------------------------------------------------

			_contentScrollView_S2 = new HorizontalScrollView (context);
			_contentScrollView_S2.LayoutParameters = new HorizontalScrollView.LayoutParams (-1, Configuration.getWidth(160));
			_contentScrollView_S2.HorizontalScrollBarEnabled = false;

			_images_S2 = new LinearLayout (context);
			_images_S2.Orientation = Orientation.Horizontal;
			_images_S2.LayoutParameters = new LinearLayout.LayoutParams(-2,-1);

			_contentScrollView_S2.SetX (0);
			_contentScrollView_S2.SetY (Configuration.getHeight (700));


			_contentScrollView_S2.AddView (_images_S2);

			//----------------------------------------------------------

			//section3------------------------------------------------

			_contentLLayout_S3 = new LinearLayout (context);
			_contentLLayout_S3.Orientation = Orientation.Vertical;
			_contentLLayout_S3.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (160));
			_contentLLayout_S3.SetX (0);_contentLLayout_S3.SetY (Configuration.getHeight(875));
			_contentLLayout_S3.SetGravity (Android.Views.GravityFlags.Center);


			_txtInfo1_S3 = new TextView (context);
			_txtInfo2_S3 = new TextView (context);
			_txtInfo3_S3 = new TextView (context);

			_txtInfo1_S3.Text = "Duración: 05 dias / 04 noches ";
			_txtInfo2_S3.Text = "Distancia: 65km";
			_txtInfo3_S3.Text = "Punto mas elevado: 4,6386 msnm (Salkantay)";

			_txtInfo1_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal;
			_txtInfo2_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal;
			_txtInfo3_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal;


			_txtInfo1_S3.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtInfo2_S3.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtInfo3_S3.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");

			_txtInfo1_S3.SetTextSize (textFormat,Configuration.getHeight(30));
			_txtInfo2_S3.SetTextSize (textFormat,Configuration.getHeight(30));
			_txtInfo3_S3.SetTextSize (textFormat,Configuration.getHeight(30));

			_txtInfo1_S3.SetTextColor (Color.White);
			_txtInfo2_S3.SetTextColor (Color.White);
			_txtInfo3_S3.SetTextColor (Color.White);


			_contentLLayout_S3.AddView (_txtInfo1_S3);
			_contentLLayout_S3.AddView (_txtInfo2_S3);
			_contentLLayout_S3.AddView (_txtInfo3_S3);

			//Drawable dr3 = new BitmapDrawable (getBitmapFromAsset("icons/fondonotif.png"));
			//_contentLLayout_S3.SetBackgroundDrawable(dr3);
				//_contentLLayout_S3.SetBackgroundColor(Color.ParseColor("#80000000"));
			_mainLayout.AddView (_contentLLayout_S3);
			_mainLayout.AddView (_contentScrollView_S2);

			//----------------------------------------------------------

			//section4------------------------------------------------
			_imItems_S4 = new List<ImageView>();


			List<string> botton_icon_path = new List<string> ();
			botton_icon_path.Add ("icons/btnunidadesazul.png");
			botton_icon_path.Add ("icons/btncomentariosazul.png");
			botton_icon_path.Add ("icons/btncontenidoazul.png");
			botton_icon_path.Add ("icons/btnchatazul.png");
			botton_icon_path.Add ("icons/btntareasazul.png");

			_imItems_S4.Add (new ImageView (context));
			_imItems_S4[0].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[0]), Configuration.getWidth (60), Configuration.getWidth (54), true));
			_mainLayout.AddView (_imItems_S4[0]);
			_imItems_S4[0].SetX (Configuration.getWidth(58));_imItems_S4[0].SetY (Configuration.getHeight(1069));

			_imItems_S4.Add (new ImageView (context));
			_imItems_S4[1].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[1]), Configuration.getWidth (78), Configuration.getWidth (55), true));
			_mainLayout.AddView (_imItems_S4[1]);
			_imItems_S4[1].SetX (Configuration.getWidth(169));_imItems_S4[1].SetY (Configuration.getHeight(1069));



			_imItems_S4.Add (new ImageView (context));
			_imItems_S4[2].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[2]), Configuration.getWidth (60), Configuration.getWidth (60), true));
			_mainLayout.AddView (_imItems_S4 [2]);
			_imItems_S4[2].SetX (Configuration.getWidth(297));_imItems_S4[2].SetY (Configuration.getHeight(1069));



			_imItems_S4.Add (new ImageView (context));
			_imItems_S4[3].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[3]), Configuration.getWidth (30), Configuration.getWidth (51), true));
			_mainLayout.AddView (_imItems_S4[3]);
			_imItems_S4[3].SetX (Configuration.getWidth(421));_imItems_S4[3].SetY (Configuration.getHeight(1069));


			_imItems_S4.Add (new ImageView (context));
			_imItems_S4[4].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[4]), Configuration.getWidth (41), Configuration.getWidth (50), true));
			_mainLayout.AddView (_imItems_S4 [4]);
			_imItems_S4[4].SetX (Configuration.getWidth(540));_imItems_S4[4].SetY (Configuration.getHeight(1069));

			//----------------------------------------------------------


			
			Drawable dr = new BitmapDrawable (getBitmapFromAsset("icons/fondo.png"));
			_mainLayout.SetBackgroundDrawable (dr);
			dr = null;
		
			_workspace = new LinearLayout (context);
			_workspace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (1045));
			//_workspace.SetY (Configuration.getHeight (110));

			_mainLayout.AddView (_workspace);
			//_workspace.AddView (_foro);
			//_workspace.Visibility = Android.Views.ViewStates.Invisible;


		}
Example #41
0
		private void initHorizontalScrolling()
		{
			mHorizontalView = (HorizontalScrollView) findViewById(R.id.main_scroll_view);

			mPreviousPosition = mCurrentPosition;

			mHorizontalView.addOnLayoutChangeListener(new OnLayoutChangeListenerAnonymousInnerClassHelper(this));
		}
Example #42
0
        private void createImages(HorizontalScrollView view)
        {
            MediaMetadataRetriever data = new MediaMetadataRetriever();
            data.SetDataSource(filename);
            int videoLength = Convert.ToInt32(data.ExtractMetadata(MetadataKey.Duration));
            #if DEBUG
            Console.WriteLine("Duration = {0}, videoLength = {1}", data.ExtractMetadata(MetadataKey.Duration), videoLength);
            #endif
            LinearLayout linLay = new LinearLayout(context);
            linLay.Orientation = Android.Widget.Orientation.Horizontal;
            linLay.LayoutParameters = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);

            ShowLightboxDialog(Application.Resources.GetString(Resource.String.videoEditGenerateThumbs));
            ImageView imageView = new ImageView(context);
            imageView.LayoutParameters = new ViewGroup.LayoutParams((int)ImageHelper.convertDpToPixel(55f, context),
                                                                    (int)ImageHelper.convertDpToPixel(55f, context));

            #if DEBUG
            for (int n = 0; n < videoLength; ++n)
            {
                using (Bitmap bmp = data.GetFrameAtTime((long)n * 1000, (int)Option.ClosestSync))
                {
                    if (bmp != null)
                        Console.WriteLine("frame {0} contains an image", n);
                }
            }
            #endif

            for (int n = 10; n < /*videoLength*/timeUsed * fps; ++n)
            {
                using (Bitmap bmp = data.GetFrameAtTime((long)n, (int)Option.ClosestSync))
                {
                    if (bmp != null)
                    {
                        using (Bitmap smBmp = Bitmap.CreateScaledBitmap(bmp, (int)ImageHelper.convertDpToPixel(55f, context),
                                                                    (int)ImageHelper.convertDpToPixel(55f, context), true))
                        {
                            int m = new int();
                            m = n;
                            imageView.Tag = m;
                            imageView.Click += (object sender, EventArgs e) => frameClicked(sender, e);
                            imageView.SetImageBitmap(smBmp);
                        }
                    } else
                        imageView.SetBackgroundColor(Color.AliceBlue);
                }
                RunOnUiThread(() => linLay.AddView(imageView));
            }

            DismissLightboxDialog();
            data.Release();
        }
Example #43
0
		public void ini(){

			_txtCursoN = new TextView (context);
			_txtCursoN.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_txtUnidadN = new TextView (context);
			_mainLayout = new RelativeLayout (context);

			linearGradiente = new LinearLayout (context);
			linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (310));
			linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente);


			var textFormat = Android.Util.ComplexUnitType.Px;

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

			_scrollSpace = new VerticalScrollView (context);
			_scrollSpace.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(1015-85));
			_scrollSpace.SetY (Configuration.getHeight (125));
			//_scrollSpace.SetBackgroundColor (Color.ParseColor ("#FF0000"));
			_mainLayout.AddView (_scrollSpace);


			_publicidadLayout = new LinearLayout (context);
			_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
			Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
			_publicidadLayout.SetBackgroundDrawable (dr);
			_publicidadLayout.SetY (Configuration.getHeight(1136-85));
			_mainLayout.AddView (_publicidadLayout);
			_publicidadLayout.Click += delegate {
				if (adOpen) {
					hideAd ();
				} else {
					Random rnd = new Random();
					showAd (rnd.Next(adsImagesPath.Count));
				}
			};




			_mapSpace = new LinearLayout (context);

			_mapSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (1015));
			_mapSpace.SetY(Configuration.getHeight (125));
			_mainLayout.AddView (_mapSpace);


			_mainSpace = new LinearLayout (context);
			_mainSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_mainSpace.Orientation = Orientation.Vertical;

			_scrollSpace.AddView (_mainSpace);

			_fondo2 = new RelativeLayout (context);
			_fondo2.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getWidth (640));
			_fondo2.SetY (Configuration.getHeight (0));

			Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png"));
			_fondo2.SetBackgroundDrawable (dr1);
			dr1 = null;

			_mainSpace.AddView (_fondo2);

			infoCursoUnidad = new LinearLayout (context);
			infoCursoUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
			infoCursoUnidad.Orientation = Orientation.Vertical;
			infoCursoUnidad.SetGravity(Android.Views.GravityFlags.Right);
			infoCursoUnidad.SetPadding (Configuration.getWidth(30), Configuration.getWidth (25), Configuration.getWidth(30), Configuration.getWidth (25));
			infoCursoUnidad.SetBackgroundColor (Color.ParseColor ("#40000000"));

			TextView _txtCurso = new TextView (context);
			_txtCurso.Text = Resource.String.THE_ROUTES.ToString ();;
			_txtCurso.SetY (-100);

			//section1-----------------------------------------------
			_contentRLayout_S1 = new RelativeLayout(context);
			_txtTitle_S1 = new TextView (context);
			_txtAuthor_S1 = new TextView (context);
			_imAuthor_S1 = new ImageView (context);
			_txtChapter_S1 = new TextView (context);

			_itemsLayout_S1 = new LinearLayout (context);//not used
			_imItem_S1 = new List<ImageView> ();
			_txtItem_S1 = new List<TextView>();

			_contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480));

			LinearLayout _linearTitle = new LinearLayout (context);
			_linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_linearTitle.SetGravity (Android.Views.GravityFlags.Center);
			_linearTitle.AddView (_txtTitle_S1);
			_linearTitle.SetY (Configuration.getHeight (60));

			linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(860));
			//_mainLayout.AddView (linearGradiente);
			//_mainLayout.AddView (_linearTitle);

			//_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60));

			//Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170));

			//_imAuthor_S1.SetImageBitmap (newbm);
			//	newbm.Recycle ();
			//newbm = null;

			//_imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189));

			LinearLayout _linearAuthor = new LinearLayout (context);
			_linearAuthor.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_linearAuthor.SetGravity (Android.Views.GravityFlags.Center);
			_linearAuthor.AddView (_txtAuthor_S1);
			_linearAuthor.SetY (Configuration.getHeight (378));
			//_mainLayout.AddView (_linearAuthor);

			//_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378));

			LinearLayout _linearChapter = new LinearLayout (context);
			_linearChapter.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_linearChapter.SetGravity (Android.Views.GravityFlags.Center);
			//_linearChapter.AddView (_txtChapter_S1);
			_linearChapter.SetY (Configuration.getHeight (502));
			//_mainLayout.AddView (_linearChapter);


			//_txtChapter_S1.SetX (Configuration.getWidth (191));_txtChapter_S1.SetY (Configuration.getHeight (502));






			_txtTitle_S1.Text = "Camino Inca";
			_txtTitle_S1.SetTextColor (Color.White);
			_txtTitle_S1.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtTitle_S1.SetTextSize (textFormat,Configuration.getHeight(30));

			_txtAuthor_S1.Text = "David Spencer";
			_txtAuthor_S1.SetTextColor (Color.White);
			_txtAuthor_S1.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtAuthor_S1.SetTextSize (textFormat,Configuration.getHeight(30));
			//_txtAuthor_S1.SetBackgroundColor (Color.ParseColor ("#60000000"));
			_txtAuthor_S1.SetShadowLayer (50.8f, 0.0f, 0.0f, Color.ParseColor ("#000000"));



			_txtChapter_S1.Text = "FLORA Y FAUNA";
			_txtChapter_S1.SetTextColor (Color.White);
			_txtChapter_S1.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtChapter_S1.SetTextSize (textFormat,Configuration.getHeight(35));


			List<string> item_path = new List<string> ();
			item_path.Add ("icons/icona.png");
			item_path.Add ("icons/iconb.png");
			item_path.Add ("icons/iconc.png");
			item_path.Add ("icons/icond.png");
			item_path.Add ("icons/icone.png");
			item_path.Add ("icons/iconf.png");
			item_path.Add ("icons/icong.png");


			int inixItemIM = Configuration.getWidth (33);
			int crecIM = Configuration.getWidth (90);

			int inixItemTXT = Configuration.getWidth (42);
			int crecTXT = Configuration.getWidth (90);
			int inixLinea = Configuration.getWidth (93);

			for (int i = 0; i < item_path.Count; i++) {

				_imItem_S1.Add(new ImageView(context));
				//_imItem_S1[i].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(item_path[i]), Configuration.getWidth (30), Configuration.getWidth (30), true));
				//_mainLayout.AddView (_imItem_S1 [i]);
				_imItem_S1 [i].SetX (inixItemIM+(i*crecIM));_imItem_S1 [i].SetY (Configuration.getHeight(602));


				if (i != item_path.Count - 1) {
					ImageView linea = new ImageView (context);
					//linea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 1, Configuration.getHeight (68), true));
					//_mainLayout.AddView (linea);
					linea.SetX (inixLinea + (i * crecIM));
					linea.SetY (Configuration.getHeight (605));
					linea = null;
				}



				_txtItem_S1.Add (new TextView (context));
				_txtItem_S1 [i].Text = "0";
				_txtItem_S1 [i].SetTextColor (Color.ParseColor ("#2E9AFE"));
				_txtItem_S1[i].Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
				_txtItem_S1[i].SetTextSize (textFormat,Configuration.getHeight(30));
				//_mainLayout.AddView (_txtItem_S1 [i]);
				_txtItem_S1 [i].SetX (inixItemTXT+(i*crecTXT));_txtItem_S1 [i].SetY (Configuration.getHeight(640));
				_imItem_S1 [i] = null;

			}
			_imItem_S1 = null;


			//-------------------------------------------------------


			//section2------------------------------------------------

			_contentScrollView_S2 = new HorizontalScrollView (context);
			_contentScrollView_S2.LayoutParameters = new HorizontalScrollView.LayoutParams (-1, Configuration.getWidth(160));
			_contentScrollView_S2.HorizontalScrollBarEnabled = false;

			_images_S2 = new LinearLayout (context);
			_images_S2.Orientation = Orientation.Horizontal;
			_images_S2.LayoutParameters = new LinearLayout.LayoutParams(-2,-1);

			_contentScrollView_S2.SetX (0);


			_contentScrollView_S2.AddView (_images_S2);

			//----------------------------------------------------------

			//section3------------------------------------------------

			_contentLLayout_S3 = new LinearLayout (context);
			_contentLLayout_S3.Orientation = Orientation.Vertical;
			_contentLLayout_S3.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (160));
			_contentLLayout_S3.SetX (0);_contentLLayout_S3.SetY (Configuration.getHeight(875));
			_contentLLayout_S3.SetGravity (Android.Views.GravityFlags.Center);



			_txtInfo1_S3 = new TextView (context);
			_txtInfo2_S3 = new TextView (context);
			_txtInfo3_S3 = new TextView (context);

			_txtInfo1_S3.Text = "Duración: 05 dias / 04 noches ";
			_txtInfo2_S3.Text = "Distancia: 65km";
			_txtInfo3_S3.Text = "Punto mas elevado: 4,6386 msnm (Salkantay)";

			_txtInfo1_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal;
			_txtInfo2_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal;
			_txtInfo3_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal;


			_txtInfo1_S3.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtInfo2_S3.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
			_txtInfo3_S3.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");

			_txtInfo1_S3.SetTextSize (textFormat,Configuration.getHeight(30));
			_txtInfo2_S3.SetTextSize (textFormat,Configuration.getHeight(30));
			_txtInfo3_S3.SetTextSize (textFormat,Configuration.getHeight(30));

			_txtInfo1_S3.SetTextColor (Color.White);
			_txtInfo2_S3.SetTextColor (Color.White);
			_txtInfo3_S3.SetTextColor (Color.White);


			_contentLLayout_S3.AddView (_txtInfo1_S3);
			_contentLLayout_S3.AddView (_txtInfo2_S3);
			_contentLLayout_S3.AddView (_txtInfo3_S3);

			//Drawable dr3 = new BitmapDrawable (getBitmapFromAsset("icons/fondonotif.png"));
			//_contentLLayout_S3.SetBackgroundDrawable(dr3);
			//_contentLLayout_S3.SetBackgroundColor(Color.ParseColor("#80000000"));
			//_mainLayout.AddView (_contentLLayout_S3);

			//_mainLayout.AddView (_contentScrollView_S2);

			_mainSpace.AddView (_contentScrollView_S2);
			//----------------------------------------------------------
			/*
			_listUnidades.Add(new UnidadItem{ Title = "Dia 1", Description = "Piscacucho-Wayllabamba" });
			_listUnidades.Add(new UnidadItem{ Title = "Dia 2", Description = "Wayllabamba-Pacaymayo" });
			_listUnidades.Add(new UnidadItem{ Title = "Dia 3", Description = "Pacaymayo-Wiñay Wayna" });
			_listUnidades.Add(new UnidadItem{ Title = "Dia 4", Description = "WIñay Wayna-Machu PIcchu"});
		*/

			/*
			_listViewUnidades = new ListView(context);
			_listViewUnidades.Adapter = new UnidadAdapter (context, _listUnidades);

			_mainSpace.AddView (_listViewUnidades);
			*/

			_spaceUnidades = new LinearLayout (context);
			_spaceUnidades.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			_spaceUnidades.Orientation = Orientation.Vertical;
			_spaceUnidades.SetBackgroundColor (Color.White);
			_mainSpace.AddView (_spaceUnidades);

			//section4------------------------------------------------
			_imItems_S4 = new List<ImageView>();


			List<string> botton_icon_path = new List<string> ();
			botton_icon_path.Add ("icons/btnhome.png");
			botton_icon_path.Add ("icons/btncomentariosazul.png");
			botton_icon_path.Add ("icons/btncontenido.png");
			botton_icon_path.Add ("icons/btnchatazul.png");
			botton_icon_path.Add ("icons/btnmap.png");

			_imItems_S4.Add (new ImageView (context));
			//_imItems_S4[0].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[0]), Configuration.getWidth (40), Configuration.getWidth (40), true));
			//_mainLayout.AddView (_imItems_S4[0]);
			_imItems_S4[0].SetX (Configuration.getWidth(58));_imItems_S4[0].SetY (Configuration.getHeight(1069));
			_imItems_S4 [0].Visibility = Android.Views.ViewStates.Invisible;

			_imItems_S4.Add (new ImageView (context));
			//_imItems_S4[1].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[1]), Configuration.getWidth (78), Configuration.getWidth (55), true));
			//_mainLayout.AddView (_imItems_S4[1]);
			_imItems_S4[1].SetX (Configuration.getWidth(169));_imItems_S4[1].SetY (Configuration.getHeight(1069));
			_imItems_S4 [1].Visibility = Android.Views.ViewStates.Invisible;




			_imItems_S4.Add (new ImageView (context));
			//_imItems_S4[2].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[2]), Configuration.getWidth (80), Configuration.getWidth (80), true));
			//_mainLayout.AddView (_imItems_S4 [2]);
			_imItems_S4[2].SetX (Configuration.getWidth(297));_imItems_S4[2].SetY (Configuration.getHeight(1050));
			_imItems_S4 [2].Visibility = Android.Views.ViewStates.Invisible;



			_imItems_S4.Add (new ImageView (context));
			//_imItems_S4[3].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[3]), Configuration.getWidth (30), Configuration.getWidth (51), true));
			//_mainLayout.AddView (_imItems_S4[3]);
			_imItems_S4[3].SetX (Configuration.getWidth(421));_imItems_S4[3].SetY (Configuration.getHeight(1069));
			_imItems_S4 [3].Visibility = Android.Views.ViewStates.Invisible;


			_imItems_S4.Add (new ImageView (context));
			//_imItems_S4[4].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[4]), Configuration.getWidth (30), Configuration.getWidth (40), true));
			//_mainLayout.AddView (_imItems_S4 [4]);
			_imItems_S4[4].SetX (Configuration.getWidth(540));_imItems_S4[4].SetY (Configuration.getHeight(1069));
			_imItems_S4 [4].Visibility = Android.Views.ViewStates.Invisible;

			//----------------------------------------------------------

			//Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/header1.png"));
			header = new LinearLayout(context);
			header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
			header.Orientation = Orientation.Vertical;

			//header.SetBackgroundDrawable (dr);


			//_mainLayout.SetBackgroundDrawable (dr);
			_mainLayout.AddView(header);
			//dr = null;






			_workspace = new LinearLayout (context);
			_workspace.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
			//_workspace.SetBackgroundColor (Color.ParseColor ("#ffffff"));
			//_workspace.SetY (Configuration.getHeight (110));

			_mainLayout.AddView (_workspace);
			//_mainLayout.SetBackgroundColor (Color.ParseColor ("#ffffff"));
			//_workspace.AddView (_foro);
			//_workspace.Visibility = Android.Views.ViewStates.Invisible;


		}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.HomeScreenscrollview);
            checkForImages();
            messageBar = FindViewById<LinearLayout>(Resource.Id.linmessageBlock);
            parent = messageBar;
            MessageItems = new Dictionary<Guid, Messages.MessageInfo>();
            context = messageBar.Context;

            if (unknownContacts == null)
                unknownContacts = new List<Guid>();
            else
                unknownContacts.Clear();

            if (Messages.ComposeMessageMainUtil.currentPosition == null)
            {
                Messages.ComposeMessageMainUtil.currentPosition = new int[6];
                for (int n = 0; n < 6; ++n)
                    Messages.ComposeMessageMainUtil.currentPosition [n] = 0;
            } else
                for (int n = 0; n < 6; ++n)
                    Messages.ComposeMessageMainUtil.currentPosition [n] = 0;

            if (Messages.ComposeMessageMainUtil.msgSteps != null)
                Messages.ComposeMessageMainUtil.msgSteps.Clear();

            if (Messages.MessageConversations.storedMessages == null)
                Messages.MessageConversations.storedMessages = new List<MessageDB>();

            ImageView btns = FindViewById<ImageView>(Resource.Id.imgNewloginHeader);
            TextView header = FindViewById<TextView>(Resource.Id.txtFirstScreenHeader);
            RelativeLayout relLayout = FindViewById<RelativeLayout>(Resource.Id.relativeLayout1);
            ImageHelper.setupTopPanel(btns, header, relLayout, context);

            Header.headertext = Application.Context.Resources.GetString(Resource.String.mainTitle);
            Header.fontsize = 36f;
            ImageHelper.fontSizeInfo(header.Context);
            header.SetTextSize(Android.Util.ComplexUnitType.Dip, Header.fontsize);
            header.Text = Header.headertext;
            killed = false;
            newX = (int)wowZapp.LaffOutOut.Singleton.ScreenXWidth;
            //string filename = base.Intent.GetStringExtra ("playname");
            //string toplay = filename == "" ? String.Empty : filename;
            bool[] checkCameraRecord = new bool[3];
            AndroidData.IsAppActive = true;
            wowZapp.LaffOutOut.Singleton.ScreenXWidth = WindowManager.DefaultDisplay.Width;
            if (AndroidData.GeoLocationEnabled)
                wowZapp.LaffOutOut.Singleton.EnableLocationTimer();

            ImageButton btnAddressBook = FindViewById<ImageButton>(Resource.Id.btnAddressBook);
            btnAddressBook.Tag = 0;
            btnAddressBook.Click += delegate
            {
                StartActivityForResult(typeof(Contacts.ManageContactsActivity), CONTACTS);
            };
            ImageButton btnMessageList = FindViewById<ImageButton>(Resource.Id.btnMessageList);
            btnMessageList.Click += delegate
            {
                wowZapp.LaffOutOut.Singleton.ReceivedMessages -= AppDelegate_ReceivedMessages;
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Intent i = new Intent(this, typeof(Messages.Conversations));
                i.PutExtra("list", true);
                StartActivityForResult(i, MESSAGE_LIST);
            };
            btnMessageList.Tag = 1;
            ImageButton btnLogout = FindViewById<ImageButton>(Resource.Id.btnLogout);
            btnLogout.Click += new EventHandler(btnLogout_Click);
            btnLogout.Tag = 2;

            if (Contacts.SelectContactsUtil.selectedContacts == null)
                Contacts.SelectContactsUtil.selectedContacts = new List<ContactDB>();

            ImageButton[] buttons = new ImageButton[3];
            buttons [0] = btnAddressBook;
            buttons [1] = btnMessageList;
            buttons [2] = btnLogout;
            Messages.MessageReceivedUtil.FromMessages = false;
            ImageButton startTextMessage = FindViewById<ImageButton>(Resource.Id.btnTextMessage);
            startTextMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = TEXT_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };

            ImageButton startDrawMessage = FindViewById<ImageButton>(Resource.Id.btnDrawMessage);
            #if DEBUG
            startDrawMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = DRAW_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };
            #endif

            ImageButton startComixMessage = FindViewById<ImageButton>(Resource.Id.btnComixMessage);
            startComixMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = COMIX_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };

            ImageButton startComiconMessage = FindViewById<ImageButton>(Resource.Id.btnComiconMessage);
            startComiconMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = COMICON_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };

            ImageButton startPollMessage = FindViewById<ImageButton>(Resource.Id.btnPollMessage);
            startPollMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = POLL_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };

            ImageButton startSFXMessage = FindViewById<ImageButton>(Resource.Id.btnSFXMessage);
            startSFXMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = SFX_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };

            ImageButton startEmoticonMessage = FindViewById<ImageButton>(Resource.Id.btnEmotMessage);
            startEmoticonMessage.Click += delegate
            {
                if (scroller != null)
                {
                    scroller.Stop();
                }
                Contacts.SelectContactsUtil.messageType = EMOTICON_MESSAGE;
                StartActivity(typeof(Contacts.SelectContactsActivity));
            };

            ImageButton startVideoMessage = FindViewById<ImageButton>(Resource.Id.btnVideoMessage);
            ImageButton startVoiceMessage = FindViewById<ImageButton>(Resource.Id.btnVoiceMessage);

            hsv = FindViewById<HorizontalScrollView>(Resource.Id.horizontalScrollView1);
            hsv.SmoothScrollingEnabled = true;
            LinearLayout bottom = FindViewById<LinearLayout>(Resource.Id.bottomHolder);
            ImageHelper.setupButtonsPosition(buttons, bottom, context);

            dbm = wowZapp.LaffOutOut.Singleton.dbm;
            checkCameraRecord = GeneralUtils.CamRecLong();

            if (checkCameraRecord [1] == false)
                startVoiceMessage.SetBackgroundResource(Resource.Drawable.nomicrophone2);
            else
                startVoiceMessage.Click += delegate
                {
                    if (scroller != null)
                    {
                        scroller.Stop();
                    }
                    Contacts.SelectContactsUtil.messageType = VOICE_MESSAGE;
                    StartActivity(typeof(Contacts.SelectContactsActivity));
                };

            if (checkCameraRecord [0] == false || checkCameraRecord [2] == false)
                startVideoMessage.SetBackgroundResource(Resource.Drawable.novideo2);
            #if DEBUG
            else
                startVideoMessage.Click += delegate
                {
                    if (scroller != null)
                    {
                        scroller.Stop();
                    }
                    Contacts.SelectContactsUtil.messageType = VIDEO_MESSAGE;
                    StartActivity(typeof(Contacts.SelectContactsActivity));
                };
            #endif

            float picXSize = 100f;
            if (wowZapp.LaffOutOut.Singleton.resizeFonts)
                picXSize = (25 * (float)wowZapp.LaffOutOut.Singleton.ScreenXWidth) / 100;
            picSize = (int)ImageHelper.convertDpToPixel(picXSize, context);

            if (Messages.ComposeMessageMainUtil.msgSteps == null)
                Messages.ComposeMessageMainUtil.msgSteps = new List<LOLMessageDelivery.MessageStep>();
            if (Messages.ComposeMessageMainUtil.messageDB == null)
                Messages.ComposeMessageMainUtil.messageDB = new MessageDB();
            wowZapp.LaffOutOut.Singleton.ReceivedMessages += AppDelegate_ReceivedMessages;
            //RunOnUiThread (delegate {
            wowZapp.LaffOutOut.Singleton.EnableMessageTimer();
            wowZapp.LaffOutOut.Singleton.CheckForUnsentMessages(context);
            getcontacts();
            //});
        }
		void Initialize ()
		{
			this.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
			this.Orientation = Orientation.Vertical;

			linea_separador = new View (context);
			linea_separador.LayoutParameters = new ViewGroup.LayoutParams (-1, 5);
			linea_separador.SetBackgroundColor (Color.ParseColor ("#eeeeee"));

			imgUser = new ImageView (context);
			scrollImage = new HorizontalScrollView (context);
			scrollImage.HorizontalScrollBarEnabled = false;
			linearImage = new LinearLayout (context);
			linearPanelScroll = new LinearLayout (context);
			linearContainer = new LinearLayout (context);
			linearAll = new LinearLayout (context);

			txtAuthor = new TextView (context);
			txtContainer = new TextView (context);
			txtTitle = new TextView (context);


			linearAll.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);
			linearImage.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(140),-2);
			linearContainer.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(500),-2);
			linearPanelScroll.LayoutParameters = new LinearLayout.LayoutParams (-2,-2);
			scrollImage.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (500), -2);


			linearAll.Orientation = Orientation.Horizontal;
			linearImage.Orientation = Orientation.Vertical;
			linearContainer.Orientation = Orientation.Vertical;

			txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight(40));
			txtAuthor.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (30));
			txtContainer.SetTextSize(ComplexUnitType.Px, Configuration.getHeight (45));
			txtAuthor.SetTextColor (Color.ParseColor("#3c3c3c"));
			txtContainer.SetTextColor (Color.ParseColor("#3c3c3c"));

			txtTitle.SetSingleLine (true);
			txtAuthor.SetSingleLine (true);
			txtContainer.SetSingleLine (false);
			txtContainer.SetPadding (0, 0, 20, 0);
			txtContainer.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeueLight.ttf");
			txtAuthor.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeueLight.ttf");

			scrollImage.AddView (linearPanelScroll);
			linearAll.AddView (linearImage);
			linearAll.AddView (linearContainer);

			linearImage.AddView (imgUser);

			linearContainer.AddView (txtTitle);
			linearContainer.AddView (txtAuthor);
			linearContainer.AddView (txtContainer);
			linearContainer.AddView (scrollImage);

			int space = Configuration.getHeight (50);



			scrollImage.SetPadding (0, 0, 0, space);
			this.AddView (linearAll);
			this.AddView (linea_separador);
			this.SetPadding (0, 0,0, space);


		}