How should a material design dialog box be animated? - material-design

I'm writing an application with a material design layout, but can't find any guidelines on how to animate dialog boxes onto the screen.
This suggests that the box should just "ping" into existence, but that seems to go against the ethos of the design, with its animations and tactile feel.
Does anyone have more information on what the correct course of action is?
Here are the specs for dialog boxes, by the way: http://www.google.co.uk/design/spec/components/dialogs.html#dialogs-specs

I took a look at existing Google apps, and it appears that the dialog box fades in at full size. The transition is pretty quick, like 0.25 seconds.
If you go into Developer Options and change Window animation scale to 10x, it will slow things down enough for you to see it clearly.
I chose Google Calendar > New Event, then select the different fields to see the dialog appear.
Here's a screen recording I did that shows the animation.
https://www.youtube.com/watch?v=jbU5yRhSbKg

Related

Xcode 10 - how to pin UI element library window?

I'm laying out UI on a storyboard using the new, controversial library button which has been moved up.
This is driving me crazy - I want to be able to "PIN" this window to a secondary monitor so I can always see available components as opposing to having to click that button every single time I need an element. Currently it disappears, even on secondary monitor once I shift focus to the view controller on screen.
How do I pin the UI Elements library to be able to always see it ?
You can press the option button in keyboard and click in the library window, it's will hold
Picture of library windown

Uwp phone toolbar

I'd like to have a toolbar in my uwp app (only on phone version) and I can't figure it out. I'd like to make it like Groove Music store app have it on mobile phone :
I' d like to customize this toolbar with a toggle button and a title at least. So is there a way to do that on universal win?
It will probably be slightly different than you are thinking. UWP doesn't think so much about "what device am I on" as it thinks about what screen size it is being displayed at. So when you design your app, you want the toolbar to appear only at screen sizes below a certain amount. The closest thing to what you want might be a Command Bar, which you can put at the bottom or top.
https://msdn.microsoft.com/en-us/library/windows/apps/hh465302.aspx
Or you could make a custom XAML control that appears where you want it to and only shows up with a screen below a certain size. I hope this helps answer the question.

WPF - Flahing button with a icon on it

How do I place two icons on a WPF button, one in the middle (static icon) and one on the top left (based on a condition)? Also need to Flash the same WPF Button based on a condition?
(While flasing it switches between two background colors, the icons remains same).
Not sure if anyone will want to help you develop super annoying flashing advertising ad style buttons :)
But to point you in the right direction the answer is in learning how to override default control template for the button then for flashing - work on Animation. Once you try that and encounter problems, then post your code and someone will help.
P.S. 'Adam Nathan's WPF Unleashed' is a good start. Good luck!

Flicker-free dialogs with custom controls

I have a problem with MFC dialog boxes that are drawn using derived MFC classes for custom drawing of controls.
One of our customers has a real slow PC with a poor graphics card and even normal Windows dialogs paint quite slow. In our case, the problem is far worse. Each individual control (e.g. buttons, group boxes, labels) can be seen to draw seperately.
In most cases I've overridden/implemented the OnPaint() handlers, thinking that drawing on whatever device context I'm provided should be the way to go.
Ideally, what I would like to do is have all controls painted on an off-screen buffer so that when a dialog repaint is required - bang - it just copies the single rendered image to the screen, rather than painting each control to the screen one by one.
Can somebody please advise me how I can achieve this kind of double-buffering?
I've sort of found the solution to my problem.. By setting the dialog extended style to WS_EX_COMPOSITED, the drawing works nicely.. The problem I'm having now concerns a continuous stream of WM_PAINT and WM_ERASEBKGND messages that I keep getting when this style is enabled.
Does anyone know how I can stop the WM_PAINT/WM_ERASEBKGND messages from continously occurring?

Magnifier like feature inside popup window....how to?

I need to create a magnifier like feature in my app. Like the "loupe" effect on the iphone !
The problem is that I need to do that inside a popup window and I don't get how to make it work !
The popup window display a grid of colors that I generate and draw one by one using shapeDrawables. What I want is to display that color bigger, zoom on it when the user touch and move his finger around the popup window (color grid). The idea is to create a tracking-zooming effect on the colors so the user can see more clearly under wich color his finger is currently located.
Problems are :
I can't seem to create another popup window on top of this one, Android limitation I think ?
If I modify the current shapeDrawable, resize it, change the boundaries, It needs to re-display the popup window before it takes effect (which is not acceptable of course)
So, anyone knows of a way I could draw over that popup window ?
EDIT :
I've tried solving this issue using a Custom Toast object...But it doesn't quite do the trick. It works, but toast object appears slowly and so the touch motion is not in sync at all with the user movement over the color grid.
I'm not sure if this will help you or not, but you might be able to accomplish this by using a second Activity... this second Activity would use Android's translucent theme if you include the following attribute in your manifest:
<activity android:theme="#android:style/Theme.Translucent">
This second activity will now only contain what you place in your layout. That is... the "real" activity you're running will still be visible behind it (anywhere you don't cover it up with views in the new layout).
You also might prefer Theme.Dialog if you really want to resemble a popup.
Something to keep in mind if you take this approach is you will probably want to override onWindowFocusChanged() in the new activity, and finish() in the event of you losing focus. Additionally, you'll need to figure out how to share your data between the two activities.

Resources