When I make a static card with a FULL image layout, it looks like there's a shading gradient that fades from dark to clear from bottom to top. This is great for cards that have text, but if I don't have text, I'd like to see the image without modification.
Card card = new Card(this);
card.setImageLayout(Card.ImageLayout.FULL);
card.addImage(R.drawable.full_wiring);
mViews.add(card.toView());
I'm interested if there's a way to specify this with Cards. I know I could make a regular android view as an alternative.
The latest update seems to have killed static cards. However the XE16 GDK has the new authentication features (https://developers.google.com/glass/develop/gdk/authentication) these will let you put a static card in via the Mirror api. These can have HTML and css elements to do the gradients or other items as you see fit.
Related
As shown in the picture below, which is taken from dynamic texture qt example, what I want to do is really simple, I want to get text input from the user and display it on a 3d object. I'm using C++ for the logic part of my application (just mentioning this because I don't know whether this animation is completely do-able in qml)
Qt dynamic texture example's image showing what I am trying to achieve
I am trying to create a credit card simulator, my 3d object would be the credit card and I would like to display the user's name and other such details, I would optionally like to add some logo to this credit card, if possible.
How would I go about doing this.
This is what my end 3d animation result should look like Credit card animation
do I understand correctly that you already have this textured credit card animation written in C++ and Qt3D?
So, I assume that you're using a QTextureMaterial for the credit card. This QTextureMaterial has a QTexture2D attached which in turn has a QTextureImage added to it.
I'd suggest you replace the current QTextureImage and subclass QPaintedTextureImage. QPaintedTextureImage allows you to draw the texture completely yourself, i.e. in the update function you first draw the (pre-loaded) standard credit card image using the painter and then on top you draw all the stuff you want to add. Since it's simply a QPainter you then use to paint you can paint anything on the credit card.
Programming the GDK a few weeks now, the CardScrollView is a pretty nice interface for displaying cards. However one issue with the UI is showing the user how far along they are in the card stack. In the Mirror API, this is nicely handled by the Slider view at the bottom of the screen as described on the Glass Design page:
https://developers.google.com/glass/design/style/metrics-grids
Unfortunately, I have not been able to get this Slider object to display on the CardScrollView and instead have resorted to a klugey 1 of n text.
Is there any way to get this Slider view to display in the GDK?
This is not yet supported by our API but is currently tracked with Issue #256.
For future reference, this feature has been already implemented as described in the original issue.
You can use the method setHorizontalScrollBarEnabled to show the bar, e.g.
mCardScrollView.setHorizontalScrollBarEnabled(true);
So the GDK provides the Card class which is quite nice for creating cards at runtime. Especially useful is the setText() method for cards which automatically sets the font size to best fit the card, based on the amount of text and the available space.
This feature would be very useful in cases where I want to display text on cards, but cannot use the Card class due to customisation needs. I've thus been looking in the GDK to find where this resizable text view is defined, but I don't see it anywhere.
Is it publicly exposed somewhere or is there source code for download?
I think for a custom layout you'll have to use custom code to handle font sizing, like people have done for other Android apps. For example,
Auto Scale TextView Text to Fit within Bounds
Auto-fit TextView for Android
I'm trying to use the following documented API:
https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/Card#addImage%28android.net.Uri%29
in a similar way to this post:
NullPointerException when calling Card.addImage(Uri)
but I'd like to use a an animated gif as the background for an immersion card instead.
Possible?
The layouts built by the Card class use Android's ImageView to represent their images, and the ImageView widget does not support animated GIFs. You would need to construct your own layout and manage the animation manually.
I was researching what graphics to use for a project, and Raphael.js came to be a top contender. However, when reading the sample code and documentation, it shows that Raphael creates a canvas (via the paper variable on the homepage), and then you add stuff to it. Two months later, a passerby comes by and ask some question about our project, and I explained that we didn't use Raphael (instead we chose static SVG and D3) because Raphael used canvas's, and our project would have been greatly disadvantaged by using canvas's. So you Raphael expert's out there, is the canvas in Raphael an actual html canvas or not? and where can you link to it, so that you/and or I can send a pull request to explain that better upfront.
No Raphael's paper is SVG.
It is kinda strange, because the paper object property is called canvas but it only contains the SVGAnimatedString
Fiddle: http://jsfiddle.net/V2DGy/
Raphael uses SVG and VML to create graphics. The variable canvas is simply named as canvas and is not a canvas element. In fact, it is the root SVG element associated with that specific paper.
Raphael is very much similar to d3 but is more on thd lines of a graphics library and the added advantage of compatibility with Internet Explorer 6 through 8 (using VML instead of SVG.)
Though the variable name is misleading, yet Raphael mentions upfront in their home page that it is SVG library.
Quoting their website.
Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.
Raphaël ['ræfeɪəl] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. Raphaël’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy.
Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+.
No. Is svg. Totally different. Canvas contains "a picture", svg contains vectorial elements.