How to draw a grid of cards/elements with Polymer? - dart

I am an Android developer trying to learn Dart-Polymer(I am also fairly new to HTML dev). I tried the custom card example in the polymer tutorial, and as an extension I want to display multiple cards in a rectangular grid. I see there are horizontal and vertical layouts in Polymer, and I was wondering if Polymer has something like GridView in Android. Can someone suggest how to proceed ?
The grid on left is what I want to achieve :
The core-card is on the right. I can see that element in the designer (please see the panel in right under core). But I am unable to find the core-card in Polymer libraries. That's why I am going with custom card (from the tutorial mentioned above). I would like to use core-card if available.
After posting this question, I found out about core-layout-grid - I am not sure how to use it, and if that's what I need.

Polymer has excellent handling to ease the use of CSS FlexBox. Using the various layout,horizontal,vertical, wrap, and flex attributes it is very easy to make very flexible and responsive layouts, including grids.
You can read more about the Layout attributes and their uses, including various alignment attributes from the Polymer Layout Attributes page. In particular look at the Wrapping section as it helps to create responsive grids that will appropriately adjust based on the width of the display.

Related

Using TextKit 2 to display tables in UITextView

UITextView does not support any kind of tables, but I'm trying to create a text view implementation which would be able to show tables alongside normal text.
Basically: My macOS port uses NSTextTable to render some paragraphs next to each other when creating a PDF. I'm trying to come up with a way to achieve this on iOS.
Documentation and real-world implementations of TextKit 2 are still a bit hazy, but I'm interested if it would be possible to create my own content types using NSTextElement and NSTextElementProvider. If I'm reading it correctly, I'd define a range which is governed by my own implementation/layout?
As the documentation is so sparse, I'm very unsure how to actually implement an NSTextElement which would also be rendered as text when saved as a PDF — or if any of this would even be possible.
Any help or hints would be appreciated.

How to expand components in Vaadin?

SpringBoot 2 Vaadin 12.0.3
I've spent some time watching video tutorials and studying online examples of Vaadin. Unfortunately, so much has changed that options that I was hoping to try are no longer there.
CssLayout is no longer there - replaced by Div which does not expose expand(Component).
component.setWidth("300") has no effect.
component.setWidth("300", UNIT.*) does not work because UNIT is not in class path.
component.setWidth("300px") works but it's far from elegant and setting explicit width on a component which displays text is far from ideal.
I have three pseudo horizontal menu items. On a large screen, they'd be truly horizontal. On smaller screen, I'd like them to go into vertical mode.
Combo Box should expand to the width of the longest label.
Text Box should expand to available real estate. (Available width - Combo Box width - Search Button width)
Search Button should expand to the width of the Icon and Label without any wrapping.
Is this possible to achieve using Vaadin 12 Layout/Component contract or do I have to spend time defining such control in CSS file?
Your question implies that there would have been a trivial way of achieving your use case with the built-in layouts in Vaadin 7 or Vaadin 8 without using CSS. What you're describing about automatically switching between horizontal and vertical modes depending on the screen size sounds like something that would require some degree of responsive layouting, which typically implies directly using CSS.
What you could have done in older versions is to have Java logic that either uses a VerticalLayout or a HorizontalLayout depending on the situation. Those two classes are still available for the same kind of use cases. The APIs have changed to better align with the underlying flexbox functionality, but the overall functionality is still the same.
You could also look in to FormLayout (part of the core framework) or the Board layout (separate add-on) which both provide some responsive functionality. They are, however, originally intended for slightly different use cases (forms and dashboards respectively), so it might be slightly challenging to make them fit your exact requirements.

jquery mobile horizontal center without using CSS

I have a div with a grid inside and I want to center it horizontally but so far I haven't found any solution to this problem yet.
I found a couple of solutions but they are all using CSS is there any other way to do this with out using css?just like when centering text you just put text-aign:center?
honestly? no way imo. text-align=center; is css by the way.
Take a look at this page and start learning css, its easy and fun!
http://webdesign.about.com/od/beginningcss/a/aa012207.htm

Basics on how to setup horizontal paging in iOS app?

I've looked for this for a while, but I can't find any good guides or resources that explain it thoroughly (not even Apple's own documentation, which seems to not have as much information as I'd expect). I want to setup a basic interface that has 6 pages horizontally. Each page will have a bunch of labels and textboxes, but the layout will be the same for each page. Eventually, I want to be able to have each page scroll down to view all the content, but I'm assuming I just need to use scrollviews as the content for each page.
Also, each page will eventually have to have separate names for each textbox (and separate from the other pages too) because I'll need all the content of the whole app to be saved out later.
But really, for now, I just need to figure out how to get paging working. I tried following one demo but when I typed in the code, Xcode wasn't recognizing one of my classes (which I know I included it). Plus, I didn't understand what was going on really, and I feel that I need to understand what I'm coding.
Also as a side note, how do I start programming for iOS 5? I updated Xcode to the latest version which said it had support for iOS 5, but I only get up to 4.3 in my project target.
You can use this project http://cocoacontrols.com/platforms/ios/controls/icarousel, the only downside is it does not support cell reuse, so if you plan on having more than a 5 or so panels the app will really start to blog down.
For any future searchers that have found this thread, I was able to achieve what I wanted.
Basically, just make a scrollview the size of however many pages you want (multiply the width by how many pages you want and that will be the content width). Then just enable paging in interface builder and it will page through the view. Then you can just add content to the scrollview.
It's not hard. When I did it for some of my apps, I had a very detailed 'template view' which included primarily a tableview, but also lots of buttons and text fields and such. I was amazed at how well it all worked when put together -- no real trouble with gestures or anything. Apple's UIPageControl sample code is a good place to start.

How to Automatically adjust TextArea Height in GWT or Smart GWT

I'm having a problem that others have talked about here. ie How to auto adjust TextArea Height. I saw this answer: Creating a textarea with auto-resize
but I was hoping someone here can translate how to do this in GWT or Smart GWT.
Take a look at SimpleLayoutPanel. It enables you to respond to the browser's resize events.
There's a dedicated sample in SmartGWT for this use case:
http://www.smartclient.com/smartgwt/showcase/#layout_form_filling
If you're using SmartGWT you should not introduce core GWT widgets without a good reason (and there isn't one here obviously).

Resources