Hi there
Ok, I'm just a newbie when it comes to ABMaterial, my fourth week now. It's been a wonderful journey and very interesting too.
For a while now I have been struggling to understand the grid, Alian also did explain, my two kidneys in the head didnt register at all. Problem is when it comes to a grid, one thinks of rows and columns not rows and cells and the code to create them looked intimidating to say the least.
So for a while I have avoided them, but then I cant do that forever, I want to know all the ins and outs of the ABMaterial framework and thus cant create beautiful apps if I dont know the grid.
Some time ago Alian did a post about a proof of concept, a grid builder, he talked about an inspiration from "Shoelace for Bootstrap". So I thought, let me google "shoelace for bootstrap".
https://www.b4x.com/android/forum/threads/abmaterial-grid-builder-proof-of-concept.64721/
Blah blah blah blah. So, the ABMaterial grid is based on a bootstrap approach of doing the grid. Ok, I though. So what does Bootstrap say about grids? Offsets, Padding, Sizes, Panning etc.
All this time, the Grids page in the demo was saying the same thing, why couldnt I figure it out then? This has just been infront of my eyes.
Here is how I understand it...
The AddRows.... and AddCells methods are used to create a flexible grid for your page. Personally I wanted to find the diference between AddRows and AddRowsM.
Each Row has some properties, when you are creating one, you are specifying these are variables...
Ok, what does AddRows mean?
AddRows just as explained in the demo add rows to your grid. You specify the number of Rows, whether the rows should be centered on the page and pass a theme to use. The default margins for Top and Bottom are set to be 20px, however AddRows sets your TopMargin to 0 and BottomMargin to 20px.
So AddRows(10, True, "lightblue") will add 10 rows centered on the page with a TopMargin of 0 and BottomMargin of 20px with a lighblue theme.
Ok, I'm just a newbie when it comes to ABMaterial, my fourth week now. It's been a wonderful journey and very interesting too.
For a while now I have been struggling to understand the grid, Alian also did explain, my two kidneys in the head didnt register at all. Problem is when it comes to a grid, one thinks of rows and columns not rows and cells and the code to create them looked intimidating to say the least.
So for a while I have avoided them, but then I cant do that forever, I want to know all the ins and outs of the ABMaterial framework and thus cant create beautiful apps if I dont know the grid.
Some time ago Alian did a post about a proof of concept, a grid builder, he talked about an inspiration from "Shoelace for Bootstrap". So I thought, let me google "shoelace for bootstrap".
https://www.b4x.com/android/forum/threads/abmaterial-grid-builder-proof-of-concept.64721/
Blah blah blah blah. So, the ABMaterial grid is based on a bootstrap approach of doing the grid. Ok, I though. So what does Bootstrap say about grids? Offsets, Padding, Sizes, Panning etc.
All this time, the Grids page in the demo was saying the same thing, why couldnt I figure it out then? This has just been infront of my eyes.
Here is how I understand it...
The AddRows.... and AddCells methods are used to create a flexible grid for your page. Personally I wanted to find the diference between AddRows and AddRowsM.
Each Row has some properties, when you are creating one, you are specifying these are variables...
B4X:
NumberOfRows
CenterInPage
MarginTopPx
MarginBottonPx
ThemeName
Ok, what does AddRows mean?
AddRows just as explained in the demo add rows to your grid. You specify the number of Rows, whether the rows should be centered on the page and pass a theme to use. The default margins for Top and Bottom are set to be 20px, however AddRows sets your TopMargin to 0 and BottomMargin to 20px.
So AddRows(10, True, "lightblue") will add 10 rows centered on the page with a TopMargin of 0 and BottomMargin of 20px with a lighblue theme.
B4X:
AddRows(numberOfRows, centerInRow, themeName)