public void OnAdapterActionButtonClick(object sender, EventArgs e)
        {
            PMButton button = (PMButton)sender;

            Console.WriteLine("Clicked: " + button.PackageId + " - " + button.PackageName + " - " + button.Type);

            if (button.Type == PMButtonType.CancelPackageTasks)
            {
                RoutingPackageManager.CancelPackageTasks(button.PackageId);
            }
            else if (button.Type == PMButtonType.SetPackagePriority)
            {
                RoutingPackageManager.SetPackagePriority(button.PackageId, button.PriorityIndex);
            }
            else if (button.Type == PMButtonType.StartPackageDownload)
            {
                RoutingPackageManager.StartPackageDownload(button.PackageId);
            }
            else if (button.Type == PMButtonType.StartRemovePackage)
            {
                RoutingPackageManager.StartPackageRemove(button.PackageId);
            }
            else if (button.Type == PMButtonType.UpdatePackages)
            {
                // Go to subfolder, however, this example has no foldering system.
            }
        }
        public void OnAdapterActionButtonClick(object sender, EventArgs e)
        {
            PMButton button = (PMButton)sender;

            System.Console.WriteLine("Clicked: " + button.PackageId + " - " + button.PackageName + " - " + button.Type);

            if (button.Type == PMButtonType.CancelPackageTasks)
            {
                packageManager.CancelPackageTasks(button.PackageId);
            }
            else if (button.Type == PMButtonType.SetPackagePriority)
            {
                packageManager.SetPackagePriority(button.PackageId, button.PriorityIndex);
                UpdatePackages();
            }
            else if (button.Type == PMButtonType.StartPackageDownload)
            {
                packageManager.StartPackageDownload(button.PackageId);
            }
            else if (button.Type == PMButtonType.StartRemovePackage)
            {
                packageManager.StartPackageRemove(button.PackageId);
            }
            else if (button.Type == PMButtonType.UpdatePackages)
            {
                currentFolder = currentFolder + button.PackageName + "/";
                UpdatePackages();
            }
        }
Пример #3
0
        public PackageRow(Context context)
            : base(context)
        {
            SetBackgroundColor(Color.Rgb(240, 240, 240));

            Orientation = Orientation.Horizontal;

            textContainer = new LinearLayout(context);
            textContainer.Orientation = Orientation.Vertical;

            AddView(textContainer);

            buttonContainer = new LinearLayout(context);
            AddView(buttonContainer);

            int height = context.Resources.DisplayMetrics.HeightPixels / 10;
            LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, height);

            textContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 7);
            buttonContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 3);

            nameLabel = new TextView(context);
            nameLabel.SetTextColor(Color.Black);
            nameLabel.Gravity = Android.Views.GravityFlags.CenterVertical;
            nameLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);
            nameLabel.SetTextSize(Android.Util.ComplexUnitType.Dip, 16);
            textContainer.AddView(nameLabel);

            statusLabel = new TextView(context);
            statusLabel.SetTextColor(Color.DarkGray);
            statusLabel.Gravity = Android.Views.GravityFlags.Top;
            statusLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);

            textContainer.AddView(statusLabel);

            Button = new PMButton(context);
            buttonContainer.AddView(Button);

            buttonContainer.Measure(0, 0);

            padding = buttonContainer.MeasuredHeight / 3;

            Button.LayoutParameters = GetButtonParams(padding);
        }
Пример #4
0
        public PackageRow(Context context) : base(context)
        {
            SetBackgroundColor(Color.Rgb(240, 240, 240));

            Orientation = Orientation.Horizontal;

            textContainer             = new LinearLayout(context);
            textContainer.Orientation = Orientation.Vertical;

            AddView(textContainer);

            buttonContainer = new LinearLayout(context);
            AddView(buttonContainer);

            int height = context.Resources.DisplayMetrics.HeightPixels / 10;

            LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, height);

            textContainer.LayoutParameters   = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 7);
            buttonContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 3);

            nameLabel = new TextView(context);
            nameLabel.SetTextColor(Color.Black);
            nameLabel.Gravity  = Android.Views.GravityFlags.CenterVertical;
            nameLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);
            nameLabel.SetTextSize(Android.Util.ComplexUnitType.Dip, 16);
            textContainer.AddView(nameLabel);

            statusLabel = new TextView(context);
            statusLabel.SetTextColor(Color.DarkGray);
            statusLabel.Gravity  = Android.Views.GravityFlags.Top;
            statusLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);

            textContainer.AddView(statusLabel);

            Button = new PMButton(context);
            buttonContainer.AddView(Button);

            buttonContainer.Measure(0, 0);

            padding = buttonContainer.MeasuredHeight / 3;

            Button.LayoutParameters = GetButtonParams(padding);
        }