Android Details Layout Issue - android

I'm trying to achieve the following layout design:
I tried a few times, but I couldn't achieve it. I almost got it by using the following code.
However, I'm not good on working with layouts on Android. I only know a few about the topic.
For more information about what I got, look at: http://pasted.co/4afcaa94
Any help will be appreciated!
Thank you

Try creating your layout using Frame Layout. Study about it how frame layout works and then try creating your layout accordingly.
Make frame layout as your parent layout

RelativeLayout As parentView, circileView and confirmar button upon a linear layout . Use minus margin to set them on the linearlayout.

Related

How does reply layout appears in android chat app?

I'm creating an android chat. In Telegram Android app, when I touch on reply, a layout appears and I want to how to do the same thing. I tried to the same with an extra constraint layout and make it visible or invisible when necessary.
What is the best way to do this?
Please view types in your adapter. Please see the example https://medium.com/#droidbyme/android-recyclerview-with-multiple-view-type-multiple-view-holder-af798458763b
I achived this with add view. By adding constraint layout into Linearlayout. Anyone with better and best practice, please share your answer.
LinearLayout item = findViewById(R.id.reply_layout);
View child = getLayoutInflater().inflate(R.layout.reply_layout, null);
item.addView(child);

What techniques do you think duolingo used to make its lesson list in the app?(pic included)

I'm trying to make the duolingo lesson list for fun because im a big fan of the app, im a beginner programmer.
basically id like your opinion on how you think they did it.
here is what it looks like
https://s-media-cache-ak0.pinimg.com/236x/a3/a8/65/a3a865c47153078e7004b74652af7757.jpg
I think it might be a scroll view and linear layout, then perhaps a class for each icon/progress/name combo that will change based on progress
I think a table layout might be an easier solution.
Check it out here: https://developer.android.com/guide/topics/ui/layout/grid.html
I figured out how to do it, you need to use a scrollView followed by a linearlayout.
Then you can programatically add in relative layouts as rows and in those relative layouts make another square relative layout and in that relative layout you stack up the stuff like image/text/progress

How to decide which layout to use?

I have used both Linear and Relative layout . But still don't know excatly when to use which .
How to decide which one to use ? Explain with some example .
It's a personal preference for most of the cases.
You have to decide according to your necessity. You should however try to stick to RelativeLayout, if you are using multiple nested LinearLayouts since those can drop your performance noticeably.
See this tutorial. You'll have a good idea about different layouts. Hope this helps.. :)
This all depend on personal preferences and Experience matters a lot .
Personally i use combination of Linear layout in most of cases but sometimes FlowLayout and Relative Layout etc are used.
Linear Layout (vertical / Horizontal ) are used to create basic layout. Following properties help create view better and esthetic .
android:Layout_weight
Relative Layout is used to create overlay effect and also used to relate position of different Views according to position . Following properties help create view better and esthetic .
android:layout_margin
android:paddingLeft
android:paddingRight
android:paddingTop
android:paddingBottom
Frame Layout used to create Overlay layout like on option pressed etc.
also Frame Layout Can used to create overlay ads .
Grid Layout is used to create grid , you may have see gallery pics which are basically implemented in grid layout.
Example of Grid is Gallery Photos

Android - Relative layout inside ScrollView

How can I put relative layout inside a scrollview? I want a scrollable view that contains pictures and texts like this:
I searched the Internet for solution or example, but in every sample project they use linear layout. Please help!
Thanks in advance.
Take a look at this tutorial it has exactly what you need.
Based on what you are describing + your mock, you should use a ListView with a header that contains your picture (on the top of the list)

How to place UI elements to the position we want in Android?

I have some buttons, textboxes etc. in my android application, but when i drag them with my mouse in the xml file, their place doesn't change, or changes but they are not placed where i exactly wanted. How can i adjust their positions in the screen?
Thanks
Unfortunatly there is no such thing as absolute positionning in android ( RIP AbsoluteLayout deprecated since years.)
instead you have to position views according to their parents and according to other views in the same parent.
first you have to define wich parent you need ( if you want some viens in a single line go for a LinearLayout. a more custom layout: use a RelativeLayout ...)
then you can drag and drop views inside, but they will always snap a position relative to their parent and/or relative to the other views.
you can of course play with margins.
A list of layout type with some advanced techniques can be found on this page
Hope that helps.
You RelativeLayout as a group layout for your layout so positioning can somewhat easy using mouse.
Best is to arrange them from the xml code. Just Learn about using the Relative layout, LinearLayout and TableLayout
Learn how the XML works. For a LinearLayout, the items come in the order listed. For a RelativeLayout, the items are related by the values of their layout_XXX properties. Then you don't have to worry about the WYSIWYG tool not working.
FYI, the tool bundled with eclipse is extremely buggy. Don't count on whats on there being what's on your phone for anything non-trivial.
Like the others wrote it is easier to edit layout using xml editor. You can read more here http://developer.android.com/guide/topics/ui/declaring-layout.html.

Categories

Resources