Understanding constraintBottom and constraintBaseline - android-layout

Among all the ConstraintLayout attributes available in Android Studio 2.2, there are these two Bottom constrains and a Baseline constrain:
layout_constraintBottom_toTopOf
layout_constraintBottom_toBottomOf
layout_constraintBaseline_toBaselineOf
And it seems that not every view has baseline.
What's the difference and similarities between Bottom and Baseline constrain? Why do only certain views have a Baseline?
The official documentation lacks this kind of information.
EDIT
This image helps to understand baseline vs base:

Baseline is used for make view bottom to bottom of text
for example in EditText the text is not the bottom so
if you use baseline it will be in bottom of
EditText's text not EditText's view
more info from android developer training official website

Related

Show grid in Papyrus class diagram

I am looking for a grid / raster in Papyrus Neon, so I am able to align the components in my UML class diagram more precisely.
Is there such an option available? If so, where do I find it?
e.g. in ArgoUML such a grid is shown by default:
My research with Google was not successful either.
The easiest way to find properties like that is to use the search box at the top of the Properties drop-down menu. Type "grid" in there ant you will see that you can set diagrams that support grids an set your desired grid for each. Note tha the way to do this will change change slightly with Papyrus Oxygen, but the capability will remain.
Note that in the diagrams's toolbar, there are also actions to align model element representations (vertically/horizontally/spaced equally) or to make there sizes the same.

UMLDesigner – Diagram auto layout

I tried to use UMLDesigner to draw my project related diagrams. I see there is a Arrange functionality that can automatically layout diagram elements and links to save some manual work. But when i used it in my Activity diagrams it designed it upside down.
Here is an example. I created following simple activity diagram.
And here is how auto layout result for the same model looks like: auto layout.
The initial node is at the bottom and the final nodes are on top. But i want it the other way - to start at the top and end at the bottom. Is there a way to configure this?
I tried pinning starting and final nodes but it just made a mess after arranging the rest automatically. I searched the settings but couldn't find anything. I use UML Designer Version 7.1.0.
Thanks ahead for any help.
I am sorry there is no way from the preferences to change this behaviour.
This is because I never provide a specific layout for this diagram. Please, fill an issue in the bug tracker and it will be fixed for the next version of UML Designer as it is really easy to fix: https://github.com/ObeoNetwork/UML-Designer/issues.
Thanks for your feedback!

Android Responsive design using android studio

Hi all !!
I'm newbie to android, Can i get any solutions to make my android app layout that fits in all screens.
If there is any tutorial on it, that would be appreciated !!
Thanks,
Create the following folders in res and add the xml in that
res/layout-small
res/layout-normal
res/layout-large
res/layout-xlarge
And open it from studio layout and make changes.
this link helps you.
The Android resource system gives you the tools to provide alternate resources based on the available width, height, or smallest width — important measurements that serve as the basis for choosing when to change our UI based on the space available.
Width and Breakpoints
Width is perhaps the most important dimension when it comes to choosing when to change your UI. This is because width is the basis for the breakpoint system.
A very good example is here

windows 10 UWP UI design for mobile device

I am working on windows 10 mobile app. If I design an UI for 5' device, it doesn't look good on 5.2' device. Also on emulators of different screen size show messed up UI. Is there any work around this? Or do I have to design it for every screen size?
Usually, please avoid to have fixed Width/Height for your controls. With a Grid layout, you can set columns/rows and place your controls inside each cells. This is a first level to adapt properly your interface. In addition, UWP provides AdaptiveTriggers if you want to adapt the layout based on the screen resolution (cf. https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10/07) for additional information. Last but not least, please check Design&UI documention on https://developer.microsoft.com/en-us/windows/design.
The trick is with UWP that you can design for every screensize at once. It's just a responsive design you use (either HTML/CSS or XAML). But you have to use the right controls and settings.
Some guidance on how to design for various sizes can be found at the MSDN design page.
To create a dynamic layout with XAML, see this article. There are various panel-types you can use to do the layout (see this article). But if you really want to build a responsive UI (or change it dramatically in various sizes) RelativePanel is your friend.

Why can't I size android components at will?

Okay, so I'm really trying to do a lab for a class thing and I don't get why I can't have a textbox that takes up the width of the phone and a button that takes up the width of the phone on the bottom, but I don't know why that is? Here's a picture of what I have.
I know this is a noob question but it hasn't been addressed yet on the online course I'm taking and I really need an answer because I wanted android development to be as easy as .NET on windows.
Well anyway here is one picture:
Also here is the other picture:
Notice if I try to make one element bigger, it leads to it pushing the other one out of the activity, I want to have one activity with both elements taking up the entire width of the phone.
Does anyone know what I'm doing wrong?
EDIT: I'm using Ubuntu 14.04 not Mac OS X.
Your controls are children of a LinearLayout with android:orientation="horizontal". This means that the parent ViewGroup is aligning them horizontally; you cannot get the children aligned vertically in this configuration.
If you change the attribute to android:orientation="vertical", you will achieve the result you're looking for.
I strongly suggest getting yourself familiar with the default set of layouts available in the Android SDK by reading this official guide.
Edit : Please refer to this answer for placing views at bottom of the screen.
When you use a android:orientation=horizontal orientation in the layout, the views are stacked/placed in a single row. Since both your views have their width set to fill the screen, only the first one is shown/seen.
What you want is the vertical orientation. This places the views in a single column, one below the other. The width set to fill-parent will allow you the view to occupy all available space.
Official documentation on views : Layouts : Android Dev Docs
Understanding Android Layouts : Techtopia
Android Layout Tutorials : Learn-Android

Resources