internal virtual void updateMapDownloadButtonText()
        {
            if (btnDownloadMap.Visibility == ViewStates.Visible)
            {
                MapPoint center = mapView.MapCenter;

                mapToDownload = GLMapManager.MapAtPoint(center);

                if (mapToDownload != null)
                {
                    string text;
                    if (mapToDownload.State == GLMapInfoState.InProgress)
                    {
                        text = string.Format("Downloading {0} {1}%", mapToDownload.GetLocalizedName(localeSettings), (int)(mapToDownload.DownloadProgress * 100));
                    }
                    else
                    {
                        text = string.Format("Download {0}", mapToDownload.GetLocalizedName(localeSettings));
                    }
                    btnDownloadMap.Text = text;
                }
                else
                {
                    btnDownloadMap.Text = "Download maps";
                }
            }
        }
Exemple #2
0
        public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
        {
            base.OnCreateContextMenu(menu, v, menuInfo);

            if (selectedMap != null)
            {
                menu.SetHeaderTitle(selectedMap.GetLocalizedName(localeSettings));
                menu.Add(0, (int)ContextItems.Delete, (int)ContextItems.Delete, "Delete");
            }
        }
Exemple #3
0
            public override View GetView(int position, View convertView, ViewGroup parent)
            {
                GLMapInfo map = maps[position];
                TextView  txtDescription, txtHeaderName;

                if (convertView == null)
                {
                    convertView = LayoutInflater.From(context).Inflate(Resource.Layout.map_name, null);
                }
                txtHeaderName  = ((TextView)convertView.FindViewById(Android.Resource.Id.Text1));
                txtDescription = ((TextView)convertView.FindViewById(Android.Resource.Id.Text2));

                string str = map.GetLocalizedName(localeSettings);

                txtHeaderName.SetText(str.ToCharArray(), 0, str.Length);

                if (map.IsCollection)
                {
                    str = "Collection";
                }
                else if (map.State == GLMapInfoState.Downloaded)
                {
                    str = "Downloaded";
                }
                else if (map.State == GLMapInfoState.NeedUpdate)
                {
                    str = "Need update";
                }
                else if (map.State == GLMapInfoState.NeedResume)
                {
                    str = "Need resume";
                }
                else if (map.State == GLMapInfoState.InProgress)
                {
                    str = string.Format("Download {0:0.00}%", map.DownloadProgress * 100);
                }
                else
                {
                    str = NumberFormatter.FormatSize(map.Size);
                }

                txtDescription.SetText(str.ToCharArray(), 0, str.Length);

                return(convertView);
            }