Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6833091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:56:14+00:00 2026-05-26T22:56:14+00:00

Do you know any examples, screencasts that document how to develop with ToolBar on

  • 0

Do you know any examples, screencasts that document how to develop with ToolBar on “mono for android” ?

I would like to develop a tiny toolbar and I’m searching for the proper way to code it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:56:15+00:00Added an answer on May 26, 2026 at 10:56 pm

    Here is Dashboard, and if you or somebody else will need ActionBar here is a link!

    public class DashboardLayout : ViewGroup
    {
        private const int UNEVEN_GRID_PENALTY_MULTIPLIER = 10;
        private int _mMaxChildWidth;
        private int _mMaxChildHeight;
    
        public DashboardLayout(IntPtr doNotUse, JniHandleOwnership transfer) : base(doNotUse, transfer)
        {
        }
    
        public DashboardLayout(Context context)
            : base(context)
        {
        }
    
        public DashboardLayout(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
        }
    
        public DashboardLayout(Context context, IAttributeSet attrs, int defStyle)
            : base(context, attrs, defStyle)
        {
        }
    
        protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
        {
            _mMaxChildWidth = 0;
            _mMaxChildHeight = 0;
    
            // Measure once to find the maximum child size.
    
            var childWidthMeasureSpec = MeasureSpec.MakeMeasureSpec(
                    MeasureSpec.GetSize(widthMeasureSpec), MeasureSpecMode.AtMost);
            var childHeightMeasureSpec = MeasureSpec.MakeMeasureSpec(
                    MeasureSpec.GetSize(widthMeasureSpec), MeasureSpecMode.AtMost);
    
            var count = ChildCount;
            for (var i = 0; i < count; i++)
            {
                var child = GetChildAt(i);
                if (child.Visibility == ViewStates.Gone)
                {
                    continue;
                }
    
                child.Measure(childWidthMeasureSpec, childHeightMeasureSpec);
    
                _mMaxChildWidth = Math.Max(_mMaxChildWidth, child.MeasuredWidth);
                _mMaxChildHeight = Math.Max(_mMaxChildHeight, child.MeasuredHeight);
            }
    
            // Measure again for each child to be exactly the same size.
    
            childWidthMeasureSpec = MeasureSpec.MakeMeasureSpec(
                    _mMaxChildWidth, MeasureSpecMode.Exactly);
            childHeightMeasureSpec = MeasureSpec.MakeMeasureSpec(
                    _mMaxChildHeight, MeasureSpecMode.Exactly);
    
            for (int i = 0; i < count; i++)
            {
                var child = GetChildAt(i);
                if (child.Visibility == ViewStates.Gone)
                {
                    continue;
                }
    
                child.Measure(childWidthMeasureSpec, childHeightMeasureSpec);
            }
    
            SetMeasuredDimension(
                    ResolveSize(_mMaxChildWidth, widthMeasureSpec),
                    ResolveSize(_mMaxChildHeight, heightMeasureSpec));
        }
    
        protected override void OnLayout(bool changed, int l, int t, int r, int b)
        {
            var width = r - l;
            var height = b - t;
    
            var count = ChildCount;
    
            // Calculate the number of visible children.
            var visibleCount = 0;
            for (var i = 0; i < count; i++)
            {
                var child = GetChildAt(i);
                if (child.Visibility == ViewStates.Gone)
                {
                    continue;
                }
                ++visibleCount;
            }
    
            if (visibleCount == 0)
            {
                return;
            }
    
            // Calculate what number of rows and columns will optimize for even horizontal and
            // vertical whitespace between items. Start with a 1 x N grid, then try 2 x N, and so on.
            var bestSpaceDifference = int.MaxValue;
    
            // Horizontal and vertical space between items
            int hSpace;
            int vSpace;
    
            var cols = 1;
            int rows;
    
            while (true)
            {
                rows = (visibleCount - 1) / cols + 1;
    
                hSpace = ((width - _mMaxChildWidth * cols) / (cols + 1));
                vSpace = ((height - _mMaxChildHeight * rows) / (rows + 1));
    
                var spaceDifference = Math.Abs(vSpace - hSpace);
                if (rows * cols != visibleCount)
                {
                    spaceDifference *= UNEVEN_GRID_PENALTY_MULTIPLIER;
                }
    
                if (spaceDifference < bestSpaceDifference)
                {
                    // Found a better whitespace squareness/ratio
                    bestSpaceDifference = spaceDifference;
    
                    // If we found a better whitespace squareness and there's only 1 row, this is
                    // the best we can do.
                    if (rows == 1)
                    {
                        break;
                    }
                }
                else
                {
                    // This is a worse whitespace ratio, use the previous value of cols and exit.
                    --cols;
                    rows = (visibleCount - 1) / cols + 1;
                    hSpace = ((width - _mMaxChildWidth * cols) / (cols + 1));
                    vSpace = ((height - _mMaxChildHeight * rows) / (rows + 1));
                    break;
                }
    
                ++cols;
            }
    
            // Lay out children based on calculated best-fit number of rows and cols.
    
            // If we chose a layout that has negative horizontal or vertical space, force it to zero.
            hSpace = Math.Max(0, hSpace);
            vSpace = Math.Max(0, vSpace);
    
            // Re-use width/height variables to be child width/height.
            width = (width - hSpace * (cols + 1)) / cols;
            height = (height - vSpace * (rows + 1)) / rows;
    
            var visibleIndex = 0;
            for (var i = 0; i < count; i++)
            {
                var child = GetChildAt(i);
                if (child.Visibility == ViewStates.Gone)
                {
                    continue;
                }
    
                var row = visibleIndex / cols;
                var col = visibleIndex % cols;
    
                var left = hSpace * (col + 1) + width * col;
                var top = vSpace * (row + 1) + height * row;
    
                child.Layout(left, top,
                        (hSpace == 0 && col == cols - 1) ? r : (left + width),
                        (vSpace == 0 && row == rows - 1) ? b : (top + height));
                ++visibleIndex;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you know any examples, screencasts that document how to develop an home screen
I would like to know if there are any examples of solving for Pi
Do you know any libraries similar to java.util.Properties that support more advanced features like
Does anybody know of any examples using AudioQueue that play from an in-memory source?
Does anyone know any jquery script examples to show a full page/content website that
Does anyone know of any good examples of usage of HTML5 elements that are
Does anyone know of any examples or tutorials of an MVC view that shows
Anyone know of any examples that shows COM programming via Lua? Could require a
Does anyone know of any examples or code that shows a class or struct
Do you know of any examples of MooTools and ASP.NET MVC?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.