What is the difference between MotionLayout and Animation in Android & which one should we use? - android-motionlayout

MotionLayout Extends ConstraintLayout and have all its feature while we can move a widget on click in Motionlaout scene and we can also move a widget via our old Animation. I just want to ask which one is better and which one to use and what is the difference.

Related

UIScrollView Xamarin Ios

How to use both vertical and horizontal ScrollView in Xamarin iOS ?
I am using CollectionView but with it I only get one scrollview working at a time.
It's because it's nature of collection view, you can make it scroll in one direction at a time i.e. either horizontal or vertical. What you exactly want to achieve that you have not mentioned. if you are going to use collection view inside the scroll view, you have to manage it properly.
The best solution would be use a UICollectionView for the horizontal
scroll and the UITableView for the vertical scroll.
But if you want to make it work only using UICollectionView you have to use Subclassing UICollectionViewLayout.
here is link you can refer to make it work, hope this might help you:
1.https://www.brightec.co.uk/ideas/uicollectionview-using-horizontal-and-vertical-scrolling-sticky-rows-and-columns
2.Subclassing UICollectionView
3.UICollectionView scrolling in both directions

JavaFX equivalent to XCode layout

I'm sketching a UI in Scene Builder and was a bit surprised about the layout behaviors.
In XCode I'm used to define distance constraints so that widgets will stick to a side of a given container and won't overlap each other when window is resized.
In SB it seems that I have to wrap widgets in HBOXes before I can glue them to a corner in a parent Anchor container. Is that correct or am I missing something?
Also, I'd like to maintain a fixed distance between widgets but HBOX doesn't seem to provide one by default.
Is there a layout manager that provides "springy" distance minimums like Qt or Apple?
TIA,
Eddy

JavaFX-2: What is the difference between a Scene and a Pane

I'm trying to understand (in general terms) the difference between a javafx 2 Scene and Pane. I can get them to work, but I haven't found a clear explanation of what functionality each provides.
The javadoc api defines a Scene as "the container for all content in a scene graph". A Pane (subclass of Region, Parent, Node) is also a container (since widgets like Button) get added to it, rather than to Scene. Apparently Pane handles layout and Scene does not.
Or to put it another way: widgets get added to Panes, a Pane is attached to a Scene, and a Scene is attached to the top level container, Stage. Since Pane does layout and can have properties set such as size, css style, etc., what functionality does the Scene provide? It does appear to be required.
Thanks
what functionality does the Scene provide?
Why don't you just compare the Javadoc of both?
E.g.
Scene is not a Node
Scene has a camera and a window property
...
So you have only one Scene per Stage but possibly several Panes (a Pane is-a Node).
The Scene is the start of, well, the scence graph. But it is more light-weight than a Stage/ Windows, AFAIK.
Scene class is the container for all content in a scene graph While Pane Class is subclass of Scene Class.
In Scene u can set element(Pane) using (SceneObject).setroot() method while In pane u can set element(Node) using (Pane Object).getchildren.add(element(Node)Object).

Android wallpaper also sliding left and right when we swipe the home screen

I want to develop a new home screen application for android. I saw the default home screen in my android 2.3.3 device, when ever I swipe the home screen left and right, the background wallpaper also sliding left and right. What is that view? How to get the same effect in an app?
Is it ViewPager? I checked the ViewPager class, but I didn't found any common background image for all views in that.
You probably want to use a canvas with a draw-able, then detect the users swiping and animate it in the background. It is likely that the default android backgrounds are doing the same. You wont be drawing the unseen portions of the view.
http://developer.android.com/guide/topics/graphics/2d-graphics.html
I suggest doing their lunar lander tutorial to learn how to use the canvas first.
You will make a canvas the background to your app and then lay your other ui elements on top of it unless you make the ui based inside the canvas.

PyQt4 Qt Designer making dynamic GUIs

I'm trying to figure out a way of using Qt Designer to make a dynamic GUI. For example, let's say I have a main window with a horizontal layout. I have a push button on one side and an empty area on the other. When I click the button the empty area will be filled with a widget that I've made in Qt Designer. When the button is pressed again the widget will be replaced with another widget that I've made in Qt Designer. Would I have to go about making all my widgets, to fill the empty area, custom widgets?
I've tried setting the parent to the empty are, but on the second change I get this
QLayout: Attempting to add QLayout "" to QWidget "t2", which already has a layout
So then I tried deleting the layout but still see the old widget underneath the new one and the layout is now messed up.
help please
Never mind, figured it out. Simple really. Use QStackedWidget and as for the UIs made in Qt Designer wrap that in a class that inherits from QWidget.

Resources