Which Polymer Datepicker - polymer

I don't see an official Polymer Datepicker component. A quick web search yields the following third party components. One of the below thread has some interesting tidbits. Can we expect an official one in the coming weeks?
Polymer Date Picker
this thread hints at a material design date picker
and this thread also shows several date pickers
Calendar Datepicker
Polymer Datetime Picker
Paper Datepicker
Paper Calendar

I've created paper-date-picker (docs / demo) and paper-time-picker (docs / demo) components with the goal to mirror the android versions as closely as possible, while still having decent performance on mobile devices. I opted against infinite scroll for the date picker, as I couldn't seem to find a way to make it work without sacrificing performance.
Please test on your own devices and let me know what you think (pull requests welcomed)!

For Polymer 0.5:
I found this date-picker:
https://github.com/David-Mulder/paper-date-picker
http://david-mulder.github.io/polymer-docs/bower_components/paper-date-picker/
Doesn't use 3rd party libs.
Has good APIs(beside documented ones) as:
refreshScrollPosition, currentYear, currentMonth, currentDay,...
Example: Plunk
Tip:
Polymer, how to pass value to paper-date-picker attribute that expects string?
domReady: function(){
//paper-date-picker expects 'date' attribute to be of type DATE.
this.birthdate_date = new Date(this.birthdate);
},
Edit:
Time-picker links:
http://nemento.github.io/nemento-timepicker/components/nemento-timepicker/
http://component.kitchen/components/virtual-dev/md-timepicker

Also check out https://vaadin.com/elements/-/element/vaadin-date-picker
It has material design inspired styles, so it fits in well with other paper elements. Well documented and apache 2 licensed.

Related

mxClient renders different shapes all as squares

Several weeks ago I have been asked to upgrade a web application based on a very old version of MXGraph library (version 2.4). The application integrated also the 'grapheditor' a sort of demo application evolved later in Diagramly
and then in Draw.io). Recently I completed the more problematic step, the transition from old "grapheditor" to Draw.io, so I am now able to open all the previous diagrams (saved as plain XML), modify and save them consistently.
Ok, this is the nice part. The bad side is the 'read-only' section of the application ,where the users can more or less, only view the graph.
This page is based on the mxClient.js that renders the graph described in the xml through this code:
var graph = new mxGraph(container);
var diagram = mxUtils.parseXml(xml);
var codec = new mxCodec(diagram);
codec.decode(diagram.documentElement, graph.getModel());
graph.fit();
Upgrading the MX library to the last version (3.9.10) the same code works but some shapes are not rendered properly, they appears as squares instead of
circles, ellipses, etc. The two following images are an example of this misbehavior
Graph in the draw.io:
Same graph rendered by mxClient:
After some tries I discovered that the old mxClient is able to render the same graph perfectly (as draw.io does) so I think there have to be something wrong (or missing) in my code or mxGraph installation/configuration.
As a temporary workaround I can keep in place the old version of mxGraph but obviously I'd like to use the new one.
Can someone give me an hint on this? Any help would be very appreciated.
The tape shape isn't part of core mxGraph, it's part of the GraphEditor example, in the additional shapes JavaScript.
If you look at the style of the ellipse, it's probably not the one in the core, most likely another one from Shapes.js.
Either pull in shapes.js, or use the viewer in draw.io.

How do I add a google map to a lit-element?

I know google-maps component is a polymer 3 component, but it seems to depend on all the Polymer 3 stuff, Polymer project says start with lit-element (polymer 3+), so I want to use lit-element, but want a map on my component. How do I do this?
Background:
If you read the roadmap here - https://www.polymer-project.org/blog/2018-05-02-roadmap-update it says don't start a new project with Polymer 3, instead start with Lit-Element.
It also talks about the future of elements - https://www.polymer-project.org/blog/2017-11-27-future-of-elements.html where they are not doing much with them right now until they rewrite them.
So given this, right now if we are trying to build a component using Lit-Element, how do we incorporate google maps, I cant find a single example anywhere. I tried to use the Polymer Google Map component and it is not compatible and has a bunch of errors.
Take a look at this:
https://github.com/jakelheknight/google-maps-limited
Not much out there but this is probably what you are looking for.
Some time ago I rewrited Polymer Google Map component to use Lit instead. You may take a look: lit-google-map

WinRT barcode scanner component

I have a Windows Store (Metro) application. I need to add support for scanning barcodes.
I tried using ZXing first. From what I was able to get working, you actually need to click and save an image for it to do the processing. There's no nice overlay of a red line "scanner" nor does it process a live feed. This isn't a very elegant solution. It works far better on Android. Basically, this won't work as I need a constant video and a constant search for a barcode to be in focus.
This blog (http://www.soulier.ch/?p=1275&lang=en) mentions that extrapolating a frame out of a WinRT video stream is not allowed in managed code which means I'd need to use C++.
So, are there any components out there that do this? Anything free or paid that I can get that would be written in C++ and can find and extrapolate a barcode? Learning C++ is not on my bucket list.
You can capture frames while displaying a preview with C# only. Here's an example control that does it:
https://winrtxamltoolkit.codeplex.com/SourceControl/latest#WinRTXamlToolkit/Controls/CameraCaptureControl/CameraCaptureControl.cs
Basically you need to create a MediaCapture object and associate it with a CaptureElement control to display the preview. Then you can use CapturePhotoToStreamAsync() to capture a frame to a stream of your selected encoding format and then have a go at it with your bar code reading code.
I made a lib for WinRT using ZXing & Imaging SDK.
It works well (but does not include any additional focus feature).
There is a lib and a sample app that you can try.
It works for barcodes and QRCode (barcode by default but just change the optional parameter in the scan function code to use QRCode)

Custom Container ViewController Xamarin / Monotouch Example

Does anyone have a simple C# Example showing how you could use Custom Container ViewControllers with Xamarin / Monotouch as per this Apple documentation -
http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html
Instead of posting question, thought would be more helpful to go away and create an example.
https://github.com/wickedw/ViewControllerContainer/blob/master/README.md
Readme Excerpt
I got to a point within a project whereby I wanted to display 3 different "Screens" of information based on a user selection.
The TabBarController was not appropriate as the GUI sat within a UINavigationController hierarchy. Yet, the UISegmentedControl fitted the design well.
I already had my views fully coded as seperate ViewControllers (and not all using the same creation pattern, some used Monotouch Dialog, others Nib files, others Programmatic).
Therefore, I did not want to rewrite existing code to use a Single ViewController controlling multiple Views.
I also thought it was time I looked at "Custom ViewController Containers" as they seemed an ideal fit for this scenario.

How can I implement composite Views of composite ViewModels?

I'm just getting into my first project with (the unbelieveably excellent) MVVMCross and I can't figure out how to do something that seems fairly basic: composite views.
Suppose I've got a Person (FirstName, LastName, etc), and a person has an Address (Street, City, PostalCode, etc.). So I'll also have a PersonViewModel and an AddressViewModel.
This is a strictly tablet based app (iPad only, actually) and I want to use containment to have the PersonView contain the (reusable) AddressView, such that the outer (person) view binds to Person, while the inner (address) view binds to Person.Address.
I (dimly) understand the presenter concept for showing the views, as discussed here, but I can't see how to handle the propagation of changes from Person to Address and back.
Suppose the Person object has an Address object, but the PersonViewModel shows the AddressViewModel in an AddressView by passing some sort of Address id and rehydrating. Then the AddressView is binding to a different Address object than the one the Person contains. I don't see how to keep the two in sync, which of course would defeat the whole purpose of binding.
How should I do what I'm trying to do?
This is a really wide topic...
...and there are lots of possible answers.
I think it's important to consider ViewModel's as a very simple concept - I'd like to encourage you to think of ViewModels just as being models for views - definitely don't think of them as 'whole page' objects.
....
Within MvvmCross, you can use ShowViewModel and custom presenters to change the UI if you want to - and this is demonstrated in several MvvmCross examples including the split view presenter - http://slodge.blogspot.com/2013/05/n24-splitviewpresenter-n1-days-of.html
This ShowViewModel technique is really useful for navigation - for changing the whole page or for significant portions of it.
However, you don't have to use navigation paradigms if your app doesn't need them.
If you want to, then you can instead:
build your own hierarchies of viewmodels within the core
and you can then build your own databound hierarchies of views within the UIs
It's entirely up to you - your app is king.
....
I feel like I'm not explaining this very well...
....
So I gave up and recorded this video - maybe it helps: http://slodge.blogspot.co.uk/2013/06/n32-truth-about-viewmodels-starring.html
The video and sample code only covers the iPad, but I hope it's easy(ish) to see how you would extend it to other platforms:
for Windows you can use UserControl
for Android you can use MvxFrameControl, custom view or Fragment code.
There's a plugin that allows Control navigation in addition to the default Views navigation, hope it helps: https://github.com/ChristianRuiz/MvvmCross-ControlsNavigation
Please check out this implementation of a custom presenter for MvvmCross projects. To support Fragments in android and also multiple fragments into one other fragment/activity:
https://github.com/JelleDamen/CustomMvxAndroidPresenter