コード例 #1
0
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable {
                Color = Colors.ActionBar
            });

            Title = GetType().GetTitle();

            // Create package manager
            File packageFolder = new File(ApplicationContext.GetExternalFilesDir(null), "regionpackages");

            if (!(packageFolder.Mkdir() || packageFolder.IsDirectory))
            {
                this.MakeToast("Could not create package folder!");
            }

            try
            {
                packageManager = new CartoPackageManager("nutiteq.osm", packageFolder.AbsolutePath);
            }
            catch (IOException e)
            {
                this.MakeToast("Exception: " + e);
                Finish();
            }

            // Initialize ListView
            SetContentView(Resource.Layout.List);
            packageAdapter   = new PackageManagerAdapter(this, ListView, Resource.Layout.package_item_row, packageArray);
            ListView.Adapter = packageAdapter;
        }
コード例 #2
0
        public CountryChoiceMenu(Context context) : base(context)
        {
            list = new ListView(context);
            list.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
            AddView(list);

            adapter      = new PackageManagerAdapter(context, list, Resource.Layout.package_item_row, packages);
            list.Adapter = adapter;
        }
コード例 #3
0
        public CountryChoiceMenu(Context context) : base(context)
        {
            list = new ListView(context);
            list.LayoutParameters = new ViewGroup.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
            AddView(list);

            adapter      = new PackageManagerAdapter(context, list, Resource.Layout.package_item_row, packages);
            list.Adapter = adapter;

            SetBackgroundColor(Android.Graphics.Color.White);

            if (Build.VERSION.SdkInt > BuildVersionCodes.Lollipop)
            {
                Elevation = 11;
            }
            else
            {
                // No elevation for you, my friend
            }
        }