//-----------clicking on images -> image on fullscreen---------//
 protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
 {
     imageView.Click += ((object sender, System.EventArgs e) => {
         Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
         if (isImageFitToScreen) {
             downScreen.RemoveView(imageView);
             imageView.SetMaxHeight (1500);
             imageView.SetMaxWidth (1500);
             fullScreen.AddView(imageView);
             fullScreen.AddView(takeIt);
             Log.Info(Tag, "maximize");
             canBeSelected = true;
             isImageFitToScreen = false;
         } else {
             fullScreen.RemoveView(takeIt);
             fullScreen.RemoveView(imageView);
             imageView.SetMaxHeight (450);
             imageView.SetMaxWidth (450);
             downScreen.AddView(imageView);
             Log.Info(Tag, "minimize");
             canBeSelected = false;
             isImageFitToScreen = true;
         }
     });
 }
        private void StopAll()
        {
            Log.Debug(TAG, "stopAll");

            if (vieAndroidAPI != null)
            {
                if (voERunning)
                {
                    voERunning = false;
                    stopVoiceEngine();
                }

                if (viERunning)
                {
                    viERunning = false;
                    viEAndroidJavaAPI.StopRender(channel);
                    viEAndroidJavaAPI.StopReceive(channel);
                    viEAndroidJavaAPI.StopSend(channel);
                    viEAndroidJavaAPI.RemoveRemoteRenderer(channel);
                    viEAndroidJavaAPI.ViE_DeleteChannel(channel);
                    channel = -1;
                    viEAndroidJavaAPI.StopCamera(cameraId);
                    viEAndroidJavaAPI.Terminate();
                    mLlRemoteSurface.RemoveView(remoteSurfaceView);
                    mLlLocalSurface.RemoveView(svLocal);
                    remoteSurfaceView = null;
                    svLocal           = null;
                }
            }
        }
Beispiel #3
0
        //Долгое нажатие
        private void MMap_MapLongClick(object sender, MapLongClickEventArgs e)
        {
            LatLng   pos    = e.Point;
            double   minPos = 10000;
            double   gip;
            int      iPos     = 0;
            Vibrator vibrator = (Vibrator)GetSystemService(Context.VibratorService);

            vibrator.Vibrate(500);
            for (int i = 0; i < arrayPointX.Count; i++)
            {
                for (int j = 0; j < arrayPointX[i].Count; j++)
                {
                    gip = Math.Sqrt(Math.Pow(arrayPointX[i][j] - pos.Longitude, 2) + Math.Pow(arrayPointY[i][j] - pos.Latitude, 2));
                    if (minPos > gip)
                    {
                        minPos = gip;
                        iPos   = i;
                    }
                }
            }
            container.RemoveView(polygon);
            container.AddView(progressBar);
            getJSON(iPos);
        }
Beispiel #4
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            LinearLayout layout = new LinearLayout(context);

            density                 = context.Resources.DisplayMetrics.Density;
            sampleContext           = context;
            layout.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.MatchParent, Android.Views.ViewGroup.LayoutParams.MatchParent);
            layout.Orientation      = Orientation.Vertical;
            layout.LayoutChange    += Layout_LayoutChange1;
            handler                 = new Handler();
            AddGridView();
            SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context);

            sfBusyIndicator.IsBusy        = true;
            sfBusyIndicator.AnimationType = Com.Syncfusion.Sfbusyindicator.Enums.AnimationTypes.SlicedCircle;
            sfBusyIndicator.ViewBoxWidth  = 50;
            sfBusyIndicator.ViewBoxHeight = 50;
            sfBusyIndicator.TextColor     = Color.ParseColor("#779772");
            layout.AddView(sfBusyIndicator);
            TextView textView = new TextView(context);

            textView.TextSize = 16;
            textView.SetPadding(10, 20, 10, 0);

            handler                   = new Handler();
            textView.Text             = "Since this application requires network connection, Please check your network connection.";
            textView.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.WrapContent, Android.Views.ViewGroup.LayoutParams.WrapContent);

            if (IsOnline())
            {
                Java.Lang.Runnable run = new Java.Lang.Runnable(() =>
                {
                    layout.RemoveView(sfBusyIndicator);
                    layout.AddView(mainGrid);
                });
                handler.PostDelayed(run, 100);
            }
            else
            {
                Java.Lang.Runnable run = new Java.Lang.Runnable(() =>
                {
                    layout.RemoveView(sfBusyIndicator);
                    layout.AddView(textView);
                });
                handler.PostDelayed(run, 100);
            }


            return(layout);
        }
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch ((DialogButtonType)which)
            {
            case DialogButtonType.Positive:
                Dictionary <string, string> update = new Dictionary <string, string>
                {
                    { "operation", "patch" },
                    { "text", editView.Text },
                    { "key", editView.Tag.ToString() }
                };

                controller.DataUpdated(update);
                ((TextView)options.FindViewWithTag(editView.Tag)).Text = editView.Text;
                dialog.Dismiss();
                break;

            case DialogButtonType.Neutral:
                Dictionary <string, string> del = new Dictionary <string, string>
                {
                    { "operation", "del" },
                    { "key", editView.Tag.ToString() }
                };
                controller.DataUpdated(del);
                options.RemoveView(options.FindViewWithTag(editView.Tag));
                dialog.Dismiss();
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Beispiel #6
0
        protected override void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _disposed = true;

                if (_imageContainer?.ChildCount > 0)
                {
                    for (int i = _imageContainer.ChildCount - 1; i >= 0; i--)
                    {
                        var view = _imageContainer.GetChildAt(i);

                        if (view is ImageView imageView)
                        {
                            _imageContainer.RemoveView(imageView);

                            imageView.Dispose();
                            imageView = null;
                        }
                    }
                }

                _imageContainer = null;

                //This is here just to prove that with normal imageviews the drawables are not disposed correctly
                GC.Collect();
            }

            base.Dispose(disposing);
        }
Beispiel #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            progressBar = FindViewById <ProgressBar>(Resource.Id.progressBar);
            container   = FindViewById <LinearLayout>(Resource.Id.container);
            polygon     = FindViewById <TextView>(Resource.Id.polygon);

            container.RemoveView(progressBar);
            FragmentTransaction transaction = FragmentManager.BeginTransaction();
            dialog_start        dialogStart = new dialog_start();

            dialogStart.Show(transaction, "dialog_fragment");
            arrayPointX.Add(new List <double>());
            arrayPointY.Add(new List <double>());
            SetUpMap();

            if (Intent.Extras != null)
            {
                foreach (var key in Intent.Extras.KeySet())
                {
                    var value = Intent.Extras.GetString(key);
                    Log.Debug(TAG, "Key: {0} Value: {1}", key, value);
                }
            }
            IsPlayServicesAvailable();
        }
        private void getNewsDB()
        {
            try
            {
                DBHelper myDB   = new DBHelper(myView.Context);
                string[] fields = { "TITLE", "NEWSURL", "IMAGEURL" };
                ICursor  result = myDB.selectStm("NEWS", fields, new Dictionary <string, string> {
                    { "EMAIL", userLogged }
                });
                while (!result.IsAfterLast)
                {
                    var news = new News();
                    news.title      = result.GetString(0);
                    news.url        = result.GetString(1);
                    news.urlToImage = result.GetString(2);
                    newsList.Add(news);

                    result.MoveToNext();
                }
                newsListView.Adapter = new NewsListAdapter(this.Context, newsList, this);
            }
            catch (Exception ex)
            {
                Toast.MakeText(this.Context, "No favorites to exhibit", ToastLength.Long).Show();
            }
            progressBarSpinner.Visibility = ViewStates.Invisible;
            mainNewsLayout.RemoveView(progressBarSpinner);
        }
        private void InsertAction(object sender, EventArgs e)
        {
            TextView     txtSongName = (TextView)FindViewById(Resource.Id.TxtMusicName);
            LinearLayout svSongsList = (LinearLayout)FindViewById(Resource.Id.LlSongsList);

            if (txtSongName.Text.Length == 0)
            {
                return;
            }

            TextView v = new TextView(ApplicationContext)
            {
                Text = txtSongName.Text
            };

            v.LongClick += (s, es) =>
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Delete Song");
                alert.SetMessage("Do you want to delete this song?\n" + $"  \"{v.Text}\"");
                alert.SetPositiveButton("Delete", (d, w) => { svSongsList.RemoveView(v); alert.Dispose(); });
                alert.SetNegativeButton("Cancel", (d, w) => { alert.Dispose(); });
                alert.Show();
            };
            v.Clickable = true;

            svSongsList.AddView(v);
            Songs.Add(v.Text);
            txtSongName.Text = "";
        }
Beispiel #10
0
        private void resetMethod()
        {
            curTime      = 0;
            compareState = false;
            touchAllowed = true;

            if (tilesArr.Count > 0)
            {
                tilesArr.Clear();
            }

            if (coordsArr.Count > 0)            //just making sure the array is clear
            {
                coordsArr.Clear();
            }

            if (gameViewLinearLayout.ChildCount > 0)
            {
                gameViewLinearLayout.RemoveView(gameGridLayout);
            }

            setGameView();
            tileMakerMethod();
            randomizeMethod();

            foreach (ImageView any in tilesArr)
            {
                int noImgResId = Resources.GetIdentifier("no_img", "drawable", PackageName);
                any.SetImageResource(noImgResId);
            }
        }
Beispiel #11
0
        private void win()
        {
            //ADD POINTS
            score += 150;
            //DISPLAY POINTS
            playerScore.Text = score.ToString();
            //SHOW LAST WORD
            Toast.MakeText(this, word + ". Well Done!", ToastLength.Long).Show();
            //NEW WORD
            loseCount = 0;
            imgHangman.SetImageResource(hangmanDrawables[0]);
            for (int i = 0; i < word.Length; i++)
            {
                anwserLayout.RemoveView(lettersForAnwser[i]);
            }
            for (int i = 0; i < alphaButtons.Length; i++)
            {
                alphaButtons[i].Clickable = true;
                alphaButtons[i].Alpha     = 1f;
            }

            //get new word
            newWord();
            //set blank letter for word length
            setLetters();
        }
Beispiel #12
0
        /// <summary>
        /// Метод, предназначенный для подключения трех основых страниц к приложению.
        /// </summary>
        private void CreatePages()
        {
            LinearLayout General = FindViewById <LinearLayout>(Resource.Id.General);

            // Находим страничку с картой.
            mapPage = General.FindViewById <LinearLayout>(Resource.Id.Map);
            General.RemoveView(mapPage);
            ContextThemeWrapper wrapper  = new ContextThemeWrapper(this, Resource.Style.AppTheme);
            LayoutInflater      inflater = (LayoutInflater)wrapper.GetSystemService(LayoutInflaterService);

            // Страничка с поиском.
            searchPage = inflater.Inflate(Resource.Layout.PageSearch, null) as LinearLayout;
            // Страничка с настройками.
            settingsPage = inflater.Inflate(Resource.Layout.PageSetting, null) as LinearLayout;
            // Привязка страничек к кнопкам переключения.
            viewPager = FindViewById <ViewPager>(Resource.Id.viewPager1);
            TabLayout tab = FindViewById <TabLayout>(Resource.Id.sliding_tabs);

            // Установка основных вкладок для приложения.
            viewPager.Adapter = new MyPagerAdapter(this, searchPage, mapPage, settingsPage);
            // Установка главной страницы для приложения.
            viewPager.CurrentItem = 1;

            // Привязка заголовков к страницам.
            tab.SetupWithViewPager(viewPager);

            // Установка изображений и текста, для отдельных "табов".
            for (int i = 0; i < iconsForTabs.Length; i++)
            {
                tab.GetTabAt(i).SetText(textForTabs[i]);
                Drawable icon = new BitmapDrawable(bitmapFromVector(ApplicationContext, iconsForTabs[i], 1));
                tab.GetTabAt(i).SetIcon(icon);
            }
        }
Beispiel #13
0
        private void AddTimeToOutputList(Time t)
        {
            LayoutInflater inflater     = (LayoutInflater)BaseContext.GetSystemService(Context.LayoutInflaterService);
            View           timeView     = inflater.Inflate(Resource.Layout.single_output_layout, null);
            TextView       textOutput   = timeView.FindViewById <TextView>(Resource.Id.outText);
            Button         removeButton = timeView.FindViewById <Button>(Resource.Id.removeButton);

            outputContainer.AddView(timeView, outputContainer.IndexOfChild(listButtonsGrid));

            textOutput.Text = string.Format("{0}\n{1}", t.SavedTime.ToLongDateString(), t.SavedTime.ToShortTimeString());

            removeButton.Click += delegate
            {
                var alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                alert.SetTitle("Confirmation");
                alert.SetMessage("Do you really want to permanently delete this recorded time ?");

                alert.SetPositiveButton("YES", delegate
                {
                    outputContainer.RemoveView(timeView);
                    //await client.GetTable<RegisteredTime>().DeleteAsync(t);
                    registeredTimesDB.Delete <Time>(t.Id);
                    Toast.MakeText(this, $"The {t.SavedTime.ToLongTimeString()} of {t.SavedTime.ToShortDateString()} has been deleted.", ToastLength.Long).Show();
                });
                alert.SetNegativeButton("NO", delegate { return; });
                alert.Create().Show();
            };
            UpdateGraphicsLayout();
        }
        void LoadCodeWords()
        {
            // Remove the views that
            // are based on the code words
            foreach (var kvp in _secretItems)
            {
                _mainLayout.RemoveView(kvp.Key);
            }
            _secretItems.Clear();

            if (CrossCopyApp.HistoryData.Secrets.Count == 0)
            {
                _tvSecretsTitle.Visibility = ViewStates.Invisible;
                return;
            }

            _tvSecretsTitle.Visibility = ViewStates.Visible;;

            // Start adding all use code words
            Task.Factory.StartNew(() => {
                RunOnUiThread(() => {
                    foreach (var s in CrossCopyApp.HistoryData.Secrets)
                    {
                        AddCodeWordToView(s);
                    }
                });
            });
        }
Beispiel #15
0
        /// <summary>
        /// Populates the list of history items with the
        /// values we already know
        /// </summary>
        void LoadHistory()
        {
            _tvHistoryLabel.Visibility = (_historyItems.Count == 0)
                                                        ? ViewStates.Invisible
                                                        : ViewStates.Visible;

            if (CrossCopyApp.Srv.CurrentSecret.DataItems.Count <= _historyItems.Count)
            {
                return;
            }

            foreach (var v in _historyItems.Keys)
            {
                _mainLayout.RemoveView(v);
            }

            _historyItems.Clear();
            Task.Factory.StartNew(() => {
                var its = CrossCopyApp.Srv.CurrentSecret.DataItems.ToList();
                its.Reverse();
                foreach (var d in its)
                {
                    AddOldItemToHistory(d);
                }
            });
        }
Beispiel #16
0
        private async void GetCatsImages(List <Cats> lstCats)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                ImageCommon imageCommon = new ImageCommon();
                //ProgressBar progress = null;

                foreach (var cat in lstCats)
                {
                    //loading para cada foto enquanto carrega
                    ProgressBar progress = new ProgressBar(Context);
                    llImages.AddView(progress);

                    string urlFoto = cat.url;
                    var    bitmap  = await imageCommon.GetImageBitmapFromUrlAsync(urlFoto);

                    //Criando o imageView para ser adicionado ao LinearLayout Dinamicamente
                    AppCompatImageView imgView = new AppCompatImageView(Context);
                    imgView.SetPadding(20, 20, 20, 20);
                    imgView.SetImageBitmap(bitmap);

                    //Adicionado o imageView ao LinearLayout
                    llImages.AddView(imgView);

                    //retira o loading
                    llImages.RemoveView(progress);
                }
            }
        }
Beispiel #17
0
        public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
        {
            llMainLayout.RemoveView(webView);

            base.OnConfigurationChanged(newConfig);

            llMainLayout.AddView(webView);
        }
 private void NewButtonLongClickListener(Button button)
 {
     Toast.MakeText(this, "Object " + button.Text +
                    "was deleted", ToastLength.Short).Show();
     DeleteFolder(getFolder(button.Text));
     layoutObjects.RemoveView(button);
     countButtons--;
 }
Beispiel #19
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            handler = new Handler();
            LinearLayout layout   = new LinearLayout(context);
            TextView     textView = new TextView(context);

            textView.TextSize = 16;
            textView.SetPadding(10, 20, 0, 0);
            textView.SetHeight(90);

            textView.Text = "Primary Agricultural Activity of USA";
            layout.AddView(textView);
            textView.Gravity = Android.Views.GravityFlags.Top;

            layout.Orientation = Orientation.Vertical;
            maps = new SfMaps(context);

            ShapeFileLayer layer = new ShapeFileLayer();

            layer.Uri = "usa_state.shp";

            layer.ShapeIdTableField = "STATE_NAME";
            layer.ShapeIdPath       = "Name";
            layer.DataSource        = GetDataSource();
            layer.ShapeSettings.ShapeColorValuePath = "Type";
            layer.ShapeSettings.ShapeFill           = Color.ParseColor("#A9D9F7");
            SetColorMapping(layer.ShapeSettings);

            LayerCustomTooltipSetting layerCustomTooltip = new LayerCustomTooltipSetting(context);

            layerCustomTooltip.ShowTooltip = true;
            layer.TooltipSettings          = layerCustomTooltip;

            layer.LegendSetting = new LegendSetting()
            {
                ShowLegend = true, ItemMargin = 0
            };

            maps.Layers.Add(layer);

            SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context);

            sfBusyIndicator.IsBusy        = true;
            sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle;
            sfBusyIndicator.ViewBoxWidth  = 50;
            sfBusyIndicator.ViewBoxHeight = 50;
            sfBusyIndicator.TextColor     = Color.ParseColor("#779772");

            layout.AddView(sfBusyIndicator);
            Java.Lang.Runnable run = new Java.Lang.Runnable(() =>
            {
                layout.RemoveView(sfBusyIndicator);
                layout.AddView(maps);
            });
            handler.PostDelayed(run, 100);

            return(layout);
        }
            private void OnGotItButtonClick(object sender, EventArgs e)
            {
                var settingsStore = ServiceContainer.Resolve <SettingsStore> ();

                settingsStore.GotWelcomeMessage = true;

                listView.RemoveHeaderView(headerView);
                emptyLinearLayout.RemoveView(emptyView);
            }
 void RadialMenu_Opening(object sender, OpeningEventArgs e)
 {
     if (textFrame.ChildCount == 10)
     {
         textFrame.RemoveView(textFrame.GetChildAt(10));
     }
     text = new TextView(con);
     text.SetTextColor(Color.Black);
     textFrame.AddView(text, 0);
     text.Text = "RadialMenu is Opening";
     scrollviewer.ScrollTo(textFrame.Bottom, 0);
 }
Beispiel #22
0
        public void ClearTextViews()
        {
            LinearLayout linearLayout = FindViewById <LinearLayout>(Resource.Id.workplace_layout);

            foreach (TextView item in timeTextViews)
            {
                linearLayout.RemoveView(item);
            }
            timeTextViews.Clear();
        }
Beispiel #23
0
 public void RemoveItemFromView(int pID)
 {
     for (int i = 0; i < itemList.Count; i++)
     {
         if (itemList[i].PartyId == pID)
         {
             inlineView.RemoveView(itemList[i]);
         }
     }
 }
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            handler = new Handler();
            LinearLayout layout = new LinearLayout(context);

            layout.Orientation = Orientation.Vertical;
            maps         = new SfMaps(context);
            currentToast = new Toast(context);
            ShapeFileLayer layer = new ShapeFileLayer();

            layer.Uri            = "usa_state.shp";
            layer.ShapeSelected += (object sender, ShapeFileLayer.ShapeSelectedEventArgs e) => {
                JSONObject data = (JSONObject)e.P0;
                if (data != null)
                {
                    if (currentToast != null)
                    {
                        currentToast.Cancel();
                    }
                    currentToast = Toast.MakeText(context, data.Get("Name") + "\n" + data.Get("Type"), ToastLength.Short);
                    currentToast.Show();
                }
            };
            layer.EnableSelection   = true;
            layer.ShapeIdTableField = "STATE_NAME";
            layer.ShapeIdPath       = "Name";
            layer.DataSource        = GetDataSource();
            layer.LegendSetting     = new LegendSetting()
            {
                ShowLegend = true
            };
            layer.ShapeSettings.ShapeStrokeThickess = 2;
            SetColorMapping(layer.ShapeSettings);
            layer.ShapeSettings.ShapeColorValuePath = "Type";
            maps.Layers.Add(layer);

            SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context);

            sfBusyIndicator.IsBusy        = true;
            sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle;
            sfBusyIndicator.ViewBoxWidth  = 50;
            sfBusyIndicator.ViewBoxHeight = 50;
            sfBusyIndicator.TextColor     = Color.ParseColor("#779772");
            //sfBusyIndicator.SetBackgroundColor(Color.ParseColor("#779772"));

            layout.AddView(sfBusyIndicator);
            Java.Lang.Runnable run = new Java.Lang.Runnable(() =>
            {
                layout.RemoveView(sfBusyIndicator);
                layout.AddView(maps);
            });
            handler.PostDelayed(run, 100);

            return(layout);
        }
Beispiel #25
0
        // ----------------------------------------------------------------------------------------------------------------
        // Removes the @param v from its Parent view;
        // @param view should not be initialized as null;
        private void removeDiskFromLinearLayout(View view)
        {
            // Save the view into the instance variable disk for one reason:
            // The lifetime of disk is the lifetime of the game (so no data is lost), when we
            // try to insert the disk back into a LinearLayout.
            disk = view;
            removedFromLinearLayout = (view.Parent) as LinearLayout;

            //Remove the view (disk) from its Parent.
            removedFromLinearLayout.RemoveView(view);
        }
Beispiel #26
0
        void btnRemoveImage_Click(object sender, EventArgs e)
        {
            var image = images.FirstOrDefault(i => i.Selected);

            if (image != null)
            {
                images.Remove(image);
                llImages.RemoveView(image.layoutWithImage);
            }
            CheckShowNoImage();
        }
 private void ShowResult(string htmlContent)
 {
     // Display the content in a web view. Note that the web view needs to be re-created each time.
     _sampleLayout.RemoveView(_htmlView);
     _htmlView = new WebView(this)
     {
         LayoutParameters = _layoutParams
     };
     _htmlView.LoadData(htmlContent, "text/html", "UTF-8");
     _sampleLayout.AddView(_htmlView);
 }
 public void hideBannerAds()
 {
     if (ll != null)
     {
         fl.RemoveView(ll);
         ll.RemoveView(bannerAd);
         bannerAd.Dispose();
         bannerAd = null;
         ll.Dispose();
         ll = null;
     }
 }
Beispiel #29
0
        public void HideBannerAd()
        {
            if (null != _adContainer && null != _banner)
            {
                _adContainer.RemoveView(_banner);

                var activity = (Activity1)Game.Activity;
                activity._mainLayout.RemoveView(_adContainer);
            }

            _adContainer = null;
            _banner      = null;
        }
Beispiel #30
0
        // GUI Events
        protected override void OnCreate()
        {
            // Setup GUI
            SetContentView(Resource.Layout.RoundLayout);

            // Assign local references to GUI elements
            roundLayout  = FindViewById <LinearLayout>(Resource.Id.RoundLinearLayout);
            autoLayout   = FindViewById <LinearLayout>(Resource.Id.AutoLinearLayout);
            teleOPLayout = FindViewById <LinearLayout>(Resource.Id.TeleOPLinearLayout);
            doneBtn      = FindViewById <Button>(Resource.Id.RoundDoneBtn);

            // Assign events to GUI elements
            doneBtn.Click += DoneBtn_Click;

            // Set ActionBar Label
            if (CurrentTeam != null)
            {
                Title = CurrentTeam.ToString();
            }

            // Build GUI from DataSet
            if (DataSet.Current != null)
            {
                // Build Autonomous GUI
                DataSet.Current.FillAutonomousGUI(autoLayout);
                if (autoLayout.ChildCount < 1)
                {
                    roundLayout.RemoveView(autoLayout);
                }

                // Build Tele-OP GUI
                DataSet.Current.FillTeleOPGUI(teleOPLayout);
                if (teleOPLayout.ChildCount < 1)
                {
                    roundLayout.RemoveView(teleOPLayout);
                }
            }
        }
Beispiel #31
0
        public void RemoveFooterView(View footer)
        {
            if (footerLayout == null)
            {
                return;
            }

            footerLayout.RemoveView(footer);
            if (footerLayout.ChildCount == 0)
            {
                footerLayout = null;
            }
            this.NotifyDataSetChanged();
        }
Beispiel #32
0
        //-----------clicking on images -> image on fullscreen---------//
        protected void ImageZoom(ImageView imageView, string Tag, LinearLayout fullScreen, LinearLayout downScreen, Button takeIt)
        {
            imageView.Click += ((object sender, System.EventArgs e) => {
                if(phase == 1) {
                    Log.Info(Tag, "isImageFitToScreen: " + isImageFitToScreen.ToString());
                    if (isImageFitToScreen) {
                        downScreen.RemoveView(imageView);
                        imageView.SetMaxHeight (1500);
                        imageView.SetMaxWidth (1500);
                        fullScreen.AddView(imageView);
                        fullScreen.AddView(takeIt);
                        Log.Info(Tag, "maximize");
                        clickingImage(imageView, takeIt);
                        isImageFitToScreen = false;
                    } else {
                        fullScreen.RemoveView(takeIt);
                        fullScreen.RemoveView(imageView);
                        imageView.SetMaxHeight (450);
                        imageView.SetMaxWidth (450);
                        downScreen.AddView(imageView);
                        Log.Info(Tag, "minimize");
                        isImageFitToScreen = true;
                        isSelected = true;
                    }
                }
                if(phase == 2) {
                    if(isImageChoosen) {
                        if (imageView == firstPersonImage) {
                            imageView.SetImageResource(Resource.Drawable.test_test);
                        }
                        else if (imageView == secondPersonImage) {

                        }
                        else if (imageView == thirdPersonImage) {

                        }
                        else if (imageView == fourthPersonImage) {

                        }
                        isImageChoosen = false;
                        if(imagesSelected < 1) {
                            imagesSelected += 1;
                            phase = 3;
                        }
                        Log.Info(Tag, "Image Choosen" + imagesSelected.ToString());
                        definingTag(imageView, true);
                    } else {
                        if (imageView == firstPersonImage) {
                            imageView.SetImageResource(Resource.Drawable.test);
                        }
                        else if (imageView == secondPersonImage) {

                        }
                        else if (imageView == thirdPersonImage) {

                        }
                        else if (imageView == fourthPersonImage) {

                        }
                        if(imagesSelected > 0) {
                            imagesSelected -= 1;
                            phase = 2;
                        }
                        isImageChoosen = true;
                        Log.Info(Tag, "Image De-Choosen" + imagesSelected.ToString());
                    }
                }
            });
        }
Beispiel #33
0
		public void initUnidades(int indexCurso, int indexUnidad)
		{
			//this.isFavoritos = false;
			var textFormat = Android.Util.ComplexUnitType.Px;
			_spaceUnidades.RemoveAllViews();
			_listLinearUnidades.Clear();
			_listIconMap.Clear();
			_listIconVerMap.Clear();
			int numUnidades = _listUnidades.Count;
			_mainSpace.SetY(Configuration.getHeight(0));
			try
			{
				_mainSpace.RemoveAllViews();
				_mainSpace.AddView(_fondo2);
				_mainSpace.AddView(_contentScrollView_S2);
				_mainSpace.AddView(mensajeFavoritos);
				_mainSpace.AddView(_spaceUnidades);
			}
			catch (Exception e)
			{
				//ya existe esos hijos
			}
			_mainSpace.SetPadding(0, 0, 0, 0);

			//Color para los LoView
			if (indice_navigator == 0) { Configuration.colorGlobal = Configuration.colorPartida; }//La Partida
			if (indice_navigator == 1) {Configuration.colorGlobal = Configuration.ListaColores50Campamentos[indexUnidad]; }//50 campamentos
			if (indice_navigator == 2) { Configuration.colorGlobal = Configuration.azul; }//Mejores campamentos
			if (indice_navigator == 3) { Configuration.colorGlobal = Configuration.colorExpertos;}//Expertos

			mensajeFavoritos.RemoveAllViews();
			if(indexUnidad==3 || isFavoritos){
				

				//Sacar la lista de Favoritos
				listFavorites = FavoritosItemManager.GetTasks();
				int tam = listFavorites.Count;
				_listUnidades.Clear ();

				////// 
				//MLearning.Core.ViewModels.MainViewModel.lo_by_circle_wrapper currentLearningObject = vm.LearningOjectsList[currentcurso];
				//int circleID = currentLearningObject.lo.Circle_id;
				var tasks = FavoritosItemManager.GetTasks();

				List<int> items = new List<int>();
				foreach (var task in tasks)
				{
					items.Add(task.Id_unidad);
				}
				for (int i = 0; i < tam; i++)
				{
					UnidadItem unItem = new UnidadItem();
					unItem.Description = listFavorites[i].Descripcion;
					unItem.Title = listFavorites[i].Titulo;
					unItem.CurrentSection = listFavorites[i].SectionID;
					unItem.Id = listFavorites[i].Id_unidad;
					unItem.LO_ID = listFavorites[i].LOID; 
					 

					_listUnidades.Add(unItem);
				}
				//this.isFavoritos = true;
					

				vm.bookmarks = items;

				//vm.OpenFavs.Execute(null);

				//_mainSpace.RemoveAllViews();
				//initUnidades(currentcurso, currentunidad);

				//-----------------------------
				numUnidades = _listUnidades.Count;


				//if (numUnidades == 0)
				//{
				//_mainSpace.RemoveAllViews();
				//_mainSpace.SetPadding(Configuration.getWidth(10), 0, Configuration.getWidth(10), 0);
				//


				if (numUnidades == 0) { Toast.MakeText(context, Resources.GetText(Resource.String.listaVaciamismejoresCampamentos), ToastLength.Short).Show(); }
				else { /*Toast.MakeText(context, Resources.GetText(Resource.String.mismejoresCampamentos), ToastLength.Short).Show();*/ }

					TextView txtTmp = new TextView(context);
					//txtTmp.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
				txtTmp.Text = Resources.GetText(Resource.String.agregaCampamentos);
					txtTmp.SetTextSize(ComplexUnitType.Fraction, Configuration.getWidth(34));
				txtTmp.SetTextColor(Color.ParseColor("#616161"));
					mensajeFavoritos.AddView(txtTmp);

					TextView txtTmp2 = new TextView(context);
				txtTmp2.Text = Resources.GetText(Resource.String.completalosCampamentos);
					//txtTmp2.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
					txtTmp2.SetTextColor(Color.ParseColor(Configuration.ListaColores[0 % 6]));
					txtTmp2.SetTextSize(ComplexUnitType.Fraction, Configuration.getWidth(38));
					mensajeFavoritos.AddView(txtTmp2);


				//}

				//return;
			}

            if (isNotas)
			{
				_mainSpace.RemoveAllViews();
				taskListView = new ListView(context);
				taskListView.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(850));

				addTaskButton = new Button(context);
				addTaskButton.Text = Resources.GetText(Resource.String.aniadirNota);
				addTaskButton.LayoutParameters = new LinearLayout.LayoutParams(-1, -2);

				_mainSpace.SetY (Configuration.getHeight (20));

				//addTaskButton.SetY (Configuration.getHeight (130));
				//_mainLayout.AddView(addTaskButton);
				_mainSpace.AddView(addTaskButton);
				_mainSpace.AddView(taskListView);

				if (addTaskButton != null)
				{
					addTaskButton.Click += (sender, e) =>
					{
						//layoutSave.Visibility = Android.Views.ViewStates.Visible;
						context.StartActivity(typeof(NotasItemScreen));
					};
				}

				// wire up task click handler
				if (taskListView != null)
				{
					taskListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
					{
						var taskDetails = new Intent(context, typeof(NotasItemScreen));
						taskDetails.PutExtra("TaskID", tasks[e.Position].ID);
						context.StartActivity(taskDetails);
					};
				}
				return;
			}

			/*if (isFavoritos && numUnidades == 0)
			{
				Toast.MakeText(context, "Mis mejores Campamentos VACIOO", ToastLength.Short).Show();
			}*/

			for (int i = 0; i < numUnidades; i++) 
			{
				LinearLayoutLO linearUnidad = new LinearLayoutLO (context);
				linearUnidad.content = _listUnidades[i];
				linearUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
				linearUnidad.Orientation = Orientation.Vertical;
				linearUnidad.SetGravity (Android.Views.GravityFlags.CenterVertical);
				//linearUnidad.SetBackgroundColor (Color.Blue);
				linearUnidad.index = i;
				linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (25));
				//linearUnidad.SetX (100);



				TextView titleUnidad = new TextView(context);
				titleUnidad.SetTextSize (textFormat,Configuration.getHeight(42));
				titleUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);


				/*if (indexCurso == 2) {
					if (indexUnidad == 3) {
						linearUnidad.Orientation = Orientation.Horizontal;
						ImageIconMap icon = new ImageIconMap (context);
						icon.index = i;
						icon.SetImageBitmap(iconPlay);
						icon.SetX (Configuration.getWidth (60));
						linearUnidad.AddView (icon);
						_listIconMap.Add (icon);
					}
				} */

				if (indexCurso == 3) {
					
					titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55));

				}

				RelativeLayout linearContenido = new RelativeLayout (context);
				linearContenido.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
				linearContenido.SetGravity (Android.Views.GravityFlags.Center);



				//TextView titleUnidad = new TextView(context);
				//titleUnidad.Text = _listUnidades [i].Title;
				titleUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Title);
				titleUnidad.SetTextColor(Color.ParseColor(Configuration.colorGlobal));
				if (indice_navigator == 0)
				{
					if (titleUnidad.Text.Equals("Calzado") || titleUnidad.Text.Equals("Footwear"))
					{
						titleUnidad.SetTextColor(Color.ParseColor(Configuration.colorCalzado));
					}
				}

				//titleUnidad.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");


				TextView descriptionUnidad = new TextView(context);
				descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);
				//descriptionUnidad.Text = _listUnidades [i].Description;

				descriptionUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Description);
				//descriptionUnidad.Text = _listUnidades [i].Description;
				//descriptionUnidad.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
				descriptionUnidad.SetTextSize (textFormat,Configuration.getHeight(28));
				descriptionUnidad.SetTextColor(Color.ParseColor("#616161"));
				Linkify.AddLinks (descriptionUnidad, MatchOptions.All);
				//descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance;
				//descriptionUnidad.LinksClickable = true;

				//descriptionUnidad.SetTextIsSelectable (true);

				LinearLayout linearContenidoIn = new LinearLayout (context);
				linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
				linearContenidoIn.Orientation = Orientation.Vertical;
				//linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);



				linearContenidoIn.AddView (titleUnidad);
				linearContenidoIn.AddView (descriptionUnidad);

				linearContenido.AddView (linearContenidoIn);

				/*if (indexCurso == 2) {
					linearContenidoIn.RemoveView (descriptionUnidad);
					ImageView imgUnidad = new ImageView (context);
					Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(440),Configuration.getHeight(440)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
					linearContenidoIn.AddView (imgUnidad);
					linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
					linearUnidad.SetPadding (0, Configuration.getWidth (25),0, Configuration.getWidth (25));

				} */

				linearUnidad.AddView (linearContenido);

				if (indexCurso == 3) {
					

					if (indexUnidad != 4) {//Antes era 3, ahora no es necesario eso

						/*ImageView info = new ImageView (context);
						info.Tag = i;
						info.SetImageBitmap (iconInfo);
						info.SetX (Configuration.getWidth(450));
						info.SetY (Configuration.getHeight (10));*/

						ImageView favorit_ = new ImageView(context);
						favorit_.Tag = i;
						favorit_.SetX(Configuration.getWidth(450));
						favorit_.SetY(Configuration.getHeight(50));
						favorit_.Click += delegate {
							funcFavoritos(favorit_,indexCurso,indexUnidad);
						};
						//Colocando icono de Favoritos
						if(!isFavoritos){
							
							int id_auto = 0;
							if (isListFavorites(_listUnidades[i].Id)!=-1)
							{
								favorit_.SetImageBitmap(iconFavorito);
							}
							else
							{
								favorit_.SetImageBitmap(iconFavorito_BN);
							}


							linearContenido.AddView (favorit_);
						}
						bool removido = true;
						if(isFavoritos){
                            /*_mainSpace.RemoveView(_contentScrollView_S2);
							_mainSpace.RemoveView (_fondo2);*/
                            
							_mainSpace.RemoveAllViews ();
                            favorit_.SetImageBitmap(iconFavorito);
							linearContenido.AddView (favorit_);
							_mainSpace.AddView(mensajeFavoritos);
							_mainSpace.AddView (_spaceUnidades);
							removido = false;
						}
						if(removido){
							try{
								_mainSpace.RemoveAllViews ();
								_mainSpace.AddView (_fondo2);
								_mainSpace.AddView (_contentScrollView_S2);
								_mainSpace.AddView (mensajeFavoritos);
								_mainSpace.AddView (_spaceUnidades);

							}catch(Exception e){
								//ya existe esos hijos
							}
						}


						//linearContenido.AddView (info);

					} else {
						titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55));
					}

				}

				if (indexCurso == 1 && indexUnidad==7) {
					linearContenidoIn.RemoveView (titleUnidad);
					linearContenidoIn.RemoveView (descriptionUnidad);
					//linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-2, -2);
					linearContenidoIn.SetX(Configuration.getWidth (0));
					ImageView imgUnidad = new ImageView (context);
					Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(640),Configuration.getHeight(2362)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
					linearContenidoIn.AddView (imgUnidad);
					linearUnidad.SetPadding (0, 0, 0, 0);
					linearUnidad.SetX(Configuration.getWidth (0));
				}



				_listLinearUnidades.Add (linearUnidad);
				LinearLayout separationLinear = new LinearLayout (context);
				separationLinear.LayoutParameters = new LinearLayout.LayoutParams (-1, 5);
				separationLinear.SetBackgroundColor (Color.ParseColor ("#D8D8D8"));
				separationLinear.Orientation = Orientation.Horizontal;


				//linearUnidad.AddView (separationLinear);
				_spaceUnidades.AddView (linearUnidad);
				_spaceUnidades.AddView (separationLinear);
			}
		}
        private void startPlaying()
        {
            var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;
            //View view = inflater.Inflate (Resource.Id.incomingVideo,null,false);
            View _container = inflater.Inflate (Resource.Layout.IncomingCall, null, false);
            //_container.SetBackgroundResource (view);
            LinearLayout _lay = new LinearLayout (this);
            SurfaceView _tv = new SurfaceView (this);
            //_tv = _container.FindViewById<SurfaceView> (Resource.Id.incomingVideo);
            _tv = _container.FindViewById<SurfaceView> (Resource.Id.incomingVideo);
            _lay.RemoveView (_tv);
            _lay.AddView (_tv);

            //View view = inflater.Inflate(Resource.Layout.IncomingCall,null);

            play ("test.mp4");

            /*var notificationService = (NotificationManager) GetSystemService(NotificationService);
            var notification = new Notification(Resource.Drawable.Icon, "Music started",
                Java.Lang.JavaSystem.CurrentTimeMillis());
            notification.Flags = NotificationFlags.NoClear;

            var notificationIntent = PendingIntent.GetActivity(this, 0, new Intent(this, typeof(CallActivity)), 0);

            notificationService.Notify (VideoPlayingNotification, notification);*/
        }
Beispiel #35
0
		public void initUnidades(int indexCurso, int indexUnidad)
		{
			var textFormat = Android.Util.ComplexUnitType.Px;
			_spaceUnidades.RemoveAllViews ();
			_listLinearUnidades.Clear ();
			_listIconMap.Clear ();
			_listIconVerMap.Clear ();
			int numUnidades = _listUnidades.Count;
			for (int i = 0; i < numUnidades; i++) 
			{
				LinearLayoutLO linearUnidad = new LinearLayoutLO (context);
				linearUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
				linearUnidad.Orientation = Orientation.Vertical;
				linearUnidad.SetGravity (Android.Views.GravityFlags.CenterVertical);
				linearUnidad.index = i;
				linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (25));
				//linearUnidad.SetX (100);

				if (indexCurso == 0) {//Para que solo afecte a las Rutas
					linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (-25));
				}

				TextView titleUnidad = new TextView(context);
				titleUnidad.SetTextSize (textFormat,Configuration.getHeight(42));
				titleUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);


				if (indexCurso == 2) {
					if (indexUnidad == 3) {
						linearUnidad.Orientation = Orientation.Horizontal;
						ImageIconMap icon = new ImageIconMap (context);
						icon.index = i;
						icon.SetImageBitmap(iconPlay);
						icon.SetX (Configuration.getWidth (60));
						linearUnidad.AddView (icon);
						_listIconMap.Add (icon);
					}
				}

				if (indexCurso == 3) {
					titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55));
				}

				RelativeLayout linearContenido = new RelativeLayout (context);
				linearContenido.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
				linearContenido.SetGravity (Android.Views.GravityFlags.Center);



				//TextView titleUnidad = new TextView(context);
				//titleUnidad.Text = _listUnidades [i].Title;
				titleUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Title);
				titleUnidad.SetTextColor(Color.ParseColor (Configuration.ListaColores [i % 6]));
				titleUnidad.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");


				TextView descriptionUnidad = new TextView(context);
				descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2);
				//descriptionUnidad.Text = _listUnidades [i].Description;

				descriptionUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Description);
				//descriptionUnidad.Text = _listUnidades [i].Description;
				descriptionUnidad.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
				descriptionUnidad.SetTextSize (textFormat,Configuration.getHeight(28));
				//Linkify.AddLinks (descriptionUnidad, MatchOptions.All);
				//Huillca
				if (indexCurso == 1   && indexUnidad!=6) {//Para que no afecte a las Rutas ni a los precios
					//Linkify.AddLinks(descriptionUnidad,Patterns.Phone,"tel:");
					//(084) 21-1122  --------modelo de telefono
					//984-820715 ----modelo celular
					Linkify.AddLinks(descriptionUnidad,Java.Util.Regex.Pattern.Compile("\\W\\d+\\W\\s\\d+\\W\\d+"),"tel:");
					Linkify.AddLinks(descriptionUnidad,Java.Util.Regex.Pattern.Compile("\\d+\\W\\d+"),"tel:");
					Linkify.AddLinks(descriptionUnidad,Patterns.EmailAddress,"email:");
					Linkify.AddLinks(descriptionUnidad,Patterns.WebUrl,"http://");
				}


				//descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance;
				//descriptionUnidad.LinksClickable = true;

				//descriptionUnidad.SetTextIsSelectable (true);

				LinearLayout linearContenidoIn = new LinearLayout (context);
				linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
				linearContenidoIn.Orientation = Orientation.Vertical;
				//linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);



				linearContenidoIn.AddView (titleUnidad);
				linearContenidoIn.AddView (descriptionUnidad);

				linearContenido.AddView (linearContenidoIn);

				if (indexCurso == 2) {
					linearContenidoIn.RemoveView (descriptionUnidad);
					ImageView imgUnidad = new ImageView (context);
					Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(440),Configuration.getHeight(440)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
					linearContenidoIn.AddView (imgUnidad);
					linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
					linearUnidad.SetPadding (0, Configuration.getWidth (25),0, Configuration.getWidth (25));

				}

				linearUnidad.AddView (linearContenido);

				if (indexCurso == 0) {
					if (indexUnidad != 3) {

						ImageView info = new ImageView (context);
						info.Tag = i;
						info.SetImageBitmap (iconInfo);
						info.SetX (Configuration.getWidth(450));
						info.SetY (Configuration.getHeight (10));


						linearContenido.AddView (info);

						
						if (indexUnidad == 2 && i > 1 ) {
							
						} else {
							
							LinearLayout test = new LinearLayout (context);
							//test.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
							test.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(100));
							test.SetGravity (Android.Views.GravityFlags.Center);
							test.Tag = i;
							test.SetX( Configuration.getWidth (0));
							test.SetY( Configuration.getWidth (-40));
							//test.SetPadding (Configuration.getWidth(30), Configuration.getWidth (25), Configuration.getWidth(30), Configuration.getWidth (25));

							test.SetGravity (GravityFlags.Left | GravityFlags.Center);

							TextView verMapa = new TextView (context);
							verMapa.Text = Resources.GetText(Resource.String.See_maps_and_photos);
							verMapa.Typeface = Typeface.CreateFromAsset (context.Assets, "fonts/ArcherMediumPro.otf");
							verMapa.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight (35));
							verMapa.SetTextColor (Color.ParseColor (Configuration.ListaColores [i % 6]));

							test.AddView (verMapa);
							linearUnidad.AddView (test);
							_listIconVerMap.Add (test);
						}

					} else {
						titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55));
					}



				}

				if (indexCurso == 1 && indexUnidad==7) {
					linearContenidoIn.RemoveView (titleUnidad);
					linearContenidoIn.RemoveView (descriptionUnidad);
					//linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-2, -2);
					linearContenidoIn.SetX(Configuration.getWidth (0));
					ImageView imgUnidad = new ImageView (context);
					Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(640),Configuration.getHeight(2362)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
					linearContenidoIn.AddView (imgUnidad);
					linearUnidad.SetPadding (0, 0, 0, 0);
					linearUnidad.SetX(Configuration.getWidth (0));
				}



				_listLinearUnidades.Add (linearUnidad);
				LinearLayout separationLinear = new LinearLayout (context);
				separationLinear.LayoutParameters = new LinearLayout.LayoutParams (-1, 5);
				separationLinear.SetBackgroundColor (Color.ParseColor ("#D8D8D8"));
				separationLinear.Orientation = Orientation.Horizontal;


				//linearUnidad.AddView (separationLinear);
				_spaceUnidades.AddView (linearUnidad);
				_spaceUnidades.AddView (separationLinear);
			}
		}
Beispiel #36
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            Log.Warn (Tag, "OnCreate");

            /************************************************|
            * 				DECLARING VARIABLES				 |
            * 					for global class use		 |
            * 												 |
            *************************************************/

            Log.Info (Tag, "Choosing Phase began");
            SetContentView(Resource.Layout.NewJourney);

            //--------Layout Variables---------//
            // Images - Interests - New Journey
            firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
            secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
            thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
            fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);
            // Images - Person Count Symbols
            firstPersonImage = (ImageView) FindViewById (Resource.Id.imageView5);
            secondPersonImage = (ImageView)FindViewById (Resource.Id.imageView6);
            thirdPersonImage = (ImageView)FindViewById (Resource.Id.imageView7);
            fourthPersonImage = (ImageView)FindViewById (Resource.Id.imageView8);

            // Layout - Special Preference - New Journey
            layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
            layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
            layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
            layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
            fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);
            mainPreferences = (LinearLayout)FindViewById (Resource.Id.MainPreferences);
            imageChoosingExplanation = (LinearLayout)FindViewById (Resource.Id.ImageChoosingExplanation);

            // Buttons - Moodboard
            takeItFirst = (Button)FindViewById (Resource.Id.takeItFirst);
            takeItSecond = (Button) FindViewById (Resource.Id.takeItSecond);
            takeItThird = (Button)FindViewById (Resource.Id.takeItThird);
            takeItFourth = (Button)FindViewById (Resource.Id.takeItFourth);
            // Buttons - Back Buttons
            backButtonMoodboard = (Button)FindViewById (Resource.Id.backButton);
            backButtonExplanation = (Button)FindViewById (Resource.Id.backButtonChoosing);
            backButtonDateStart = (Button)FindViewById (Resource.Id.backButtonDateStart);
            backButtonDateEnd = (Button)FindViewById (Resource.Id.backButtonDateEnd);
            backButtonPersonCount = (Button)FindViewById (Resource.Id.backButtonPersonCount);

            // Buttons - Next Buttons
            nextButtonMoodboard = (Button) FindViewById (Resource.Id.nextButton);
            nextButtonChoosing = (Button)FindViewById (Resource.Id.nextButtonChoosing);
            nextButtonDateStart = (Button)FindViewById (Resource.Id.nextButtonDateStart);
            nextButtonDateEnd = (Button)FindViewById (Resource.Id.nextButtonDateEnd);
            nextButtonPersonCount = (Button)FindViewById (Resource.Id.nextButtonPersonCount);

            // Remove Like Buttons from View (o t in Fullscreen View)
            fullScreen.RemoveView (takeItFirst);
            fullScreen.RemoveView (takeItSecond);
            fullScreen.RemoveView (takeItThird);
            fullScreen.RemoveView (takeItFourth);

            // Flipper - Main Preferences Main
            flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);

            // Date Picker
            dateStart = (DatePicker)FindViewById (Resource.Id.DatePickerStart);
            dateEnd = (DatePicker)FindViewById (Resource.Id.DatePickerEnd);

            //-----------Method Variables---------//
            // bools
            isImageFitToScreen = true;
            isImageChoosen = true;
            isSelected = true;

            // ints
            imagesSelected = 0;
            phase = 1;

            /************************************************|
            * 				INVOKING METHODS				 |
             	* 												 |
            * 												 |
            *************************************************/

            nextButtonChoosing.Click += delegate {
                flipper.ShowNext();
            };
            // Only for testing
            // ONLY FOR TESTING - DELETED WHEN RELEASED
            //-----------Database is created---------//
            createDatabase(dbPath);

            // Phase Handler
            next (Tag, nextButtonMoodboard);
            next (Tag, nextButtonPersonCount);
            next (Tag, nextButtonDateStart);
            next (Tag, nextButtonDateEnd);
            back (backButtonMoodboard);
            back (backButtonExplanation);
            back (backButtonDateStart);
            back (backButtonDateEnd);

            // Zoom Methods - Interests
            ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage, takeItSecond);
            ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage, takeItThird);
            ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage, takeItFourth);
            ImageZoom (firstPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (secondPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (thirdPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (fourthPersonImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
        }
Beispiel #37
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            Log.Warn (Tag, "OnCreate");

            /************************************************|
            * 				DECLARING VARIABLES				 |
            * 					for global class use		 |
            * 												 |
            *************************************************/

            Log.Info (Tag, "Choosing Phase began");
            SetContentView(Resource.Layout.MainPreferencesPhaseOne);

            //--------Layout Variables---------//
            // Images - Interests - Main Preferences
            firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
            secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
            thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
            fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);
            //imageArray = {firstImage, secondImage, thirdImage, fourthImage}

            // Layout - MainPreferences - Main Preferences
            layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
            layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
            layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
            layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
            fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);
            mainPreferences = (LinearLayout)FindViewById (Resource.Id.MainPreferences);
            imageChoosingExplanation = (LinearLayout)FindViewById (Resource.Id.ImageChoosingExplanation);

            // Buttons - Main Preferences
            takeIt = (Button)FindViewById (Resource.Id.takeItFirst);
            backButton = (Button)FindViewById (Resource.Id.backButton);
            nextButton = (Button) FindViewById (Resource.Id.nextButton);
            nextButtonChoosing = (Button)FindViewById (Resource.Id.nextButtonChoosing);
            fullScreen.RemoveView (takeIt);

            // Flipper - Main Preferences Main
            flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);
            flipper.ShowNext ();

            //-----------Method Variables---------//
            // bools
            isImageFitToScreen = true;
            isSelected = true;
            hasStarted = true;

            /************************************************|
            * 				INVOKING METHODS				 |
             	* 												 |
            * 												 |
            *************************************************/

            // Creating the Databse
            createDatabase(dbPath);

            nextButtonChoosing.Click += delegate {
                flipper.ShowPrevious();
            };

            // Phase Handler
            next(Tag);

            // Zoom Methods - Interests
            ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage);
            ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage);
            ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage);
            ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage);
        }
        //----------image is clicked and color filter is set---------//
        private void clickingImage(ImageView imageView, Button takeIt, LinearLayout fullScreen, LinearLayout downScreen)
        {
            // TODO: If one image is zoomed in multiple times, this function is also executed this amount of times.
            //		 This function should only be executed one time no matter what.

            takeIt.Click += ((object sender, System.EventArgs e) => {
                Log.Info(Tag, "takeIt Button: " + takeIt.ToString());
                if(isSelected && canBeSelected) {
                    if(imagesSelected < 1) {
                        imagesSelected += 1;
                    }
                    if (takeIt == takeItFirst) {
                        imageView.SetImageResource(Resource.Drawable.InDieBerge_confirmed);
                    }
                    if (takeIt == takeItSecond) {
                        imageView.SetImageResource(Resource.Drawable.InDenBusch_confirmed);
                    }
                    if (takeIt == takeItThird) {
                        imageView.SetImageResource(Resource.Drawable.InDieCity_confirmed);
                    }
                    if (takeIt == takeItFourth) {
                        imageView.SetImageResource(Resource.Drawable.AnDenStrand_confirmed);
                    }
                    Log.Info(Tag, "Images Selected: " + imagesSelected.ToString());
                    if(choosenImage != imageView) {
                        choosenImage = imageView;
                    } else {
                        choosenImage = null;
                    }
                    definingTag(imageView, true);
                    isSelected = false;
                    fullScreen.RemoveView(takeIt);
                    fullScreen.RemoveView(imageView);
                    imageView.SetMaxHeight (450);
                    imageView.SetMaxWidth (450);
                    downScreen.AddView(imageView);
                    Log.Info(Tag, "minimize");
                    canBeSelected = false;
                    isImageFitToScreen = true;
                } else if (!isSelected && canBeSelected){
                    if(imagesSelected > 0) {
                        imagesSelected -= 1;
                    }
                    if (takeIt == takeItFirst) {
                        imageView.SetImageResource(Resource.Drawable.InDieBerge);
                    }
                    if (takeIt == takeItSecond) {
                        imageView.SetImageResource(Resource.Drawable.InDenBusch);
                    }
                    if (takeIt == takeItThird) {
                        imageView.SetImageResource(Resource.Drawable.InDieCity);
                    }
                    if (takeIt == takeItFourth) {
                        imageView.SetImageResource(Resource.Drawable.AnDenStrand);
                    }
                    Log.Info(Tag, "Images Selected: " + imagesSelected.ToString());
                    definingTag(imageView, false);
                    isSelected = true;
                }

                if (choosenImage != null) {
                    Log.Info(Tag, "choosenImage: " + choosenImage.ToString());
                } else {
                    Log.Info(Tag, "choosen Image: null");
                }
                Log.Info(Tag, "isSelected: " + isSelected.ToString());

            });
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            /************************************************|
            * 				DECLARING VARIABLES				 |
            * 					for global class use		 |
            * 												 |
            *************************************************/

            Log.Info (Tag, "Choosing Phase began");
            SetContentView(Resource.Layout.NewJourneySpecificPreferences);
            //--------Layout Variables---------//
            // Images - Interests - New Journey
            firstImage = (ImageView)FindViewById (Resource.Id.imageView1);
            secondImage = (ImageView)FindViewById (Resource.Id.imageView2);
            thirdImage = (ImageView)FindViewById (Resource.Id.imageView3);
            fourthImage = (ImageView)FindViewById (Resource.Id.imageView4);

            // Buttons - Moodboard
            takeItFirst = (Button)FindViewById (Resource.Id.takeItFirst);
            takeItSecond = (Button) FindViewById (Resource.Id.takeItSecond);
            takeItThird = (Button)FindViewById (Resource.Id.takeItThird);
            takeItFourth = (Button)FindViewById (Resource.Id.takeItFourth);

            // Buttons - Transitions
            nextButton = (Button) FindViewById (Resource.Id.nextButton);
            backButton = (Button)FindViewById (Resource.Id.backButton);
            nextButtonExplanation = (Button)FindViewById (Resource.Id.nextButtonChoosing);
            backButtonExplanation = (Button)FindViewById (Resource.Id.backButtonChoosing);

            // Layout - Special Preference - New Journey
            layoutFirstImage = (LinearLayout)FindViewById (Resource.Id.layoutFirstImage);
            layoutSecondImage = (LinearLayout)FindViewById (Resource.Id.layoutSecondImage);
            layoutThirdImage = (LinearLayout)FindViewById (Resource.Id.layoutThirdImage);
            layoutFourthImage = (LinearLayout)FindViewById (Resource.Id.layoutFourthImage);
            fullScreen = (LinearLayout)FindViewById (Resource.Id.fullScreenLayout);

            // Flipper - Specific Preferences - New Journey
            flipper = (ViewFlipper) FindViewById (Resource.Id.viewFlipper1);

            //-----------Method Variables---------//
            // bools
            isImageFitToScreen = true;
            isSelected = true;
            canBeSelected = false;

            // ints
            imagesSelected = 0;

            // Remove Like Buttons from View (o t in Fullscreen View)
            fullScreen.RemoveView (takeItFirst);
            fullScreen.RemoveView (takeItSecond);
            fullScreen.RemoveView (takeItThird);
            fullScreen.RemoveView (takeItFourth);

            nextButtonExplanation.Click += delegate {
                flipper.ShowNext();
            };
            backButton.Click += delegate {
                flipper.ShowPrevious();
            };

            /************************************************|
            * 				INVOKING METHODS				 |
             	* 												 |
            * 												 |
            *************************************************/

            // Zoom Methods - Interests
            ImageZoom (firstImage, Tag, fullScreen, layoutFirstImage, takeItFirst);
            ImageZoom (secondImage, Tag, fullScreen, layoutSecondImage, takeItSecond);
            ImageZoom (thirdImage, Tag, fullScreen, layoutThirdImage, takeItThird);
            ImageZoom (fourthImage, Tag, fullScreen, layoutFourthImage, takeItFourth);

            // Like Methods - Interests
            clickingImage (firstImage, takeItFirst, fullScreen, layoutFirstImage);
            clickingImage (secondImage, takeItSecond, fullScreen, layoutSecondImage);
            clickingImage (thirdImage, takeItThird, fullScreen, layoutThirdImage);
            clickingImage (fourthImage, takeItFourth, fullScreen, layoutFourthImage);

            // Transition Methods
            Transition (nextButton);
            Transition (backButtonExplanation);
        }