Stuck in Android layout - Android Q&A, Help & Troubleshooting

Hi @all.
I currently try to design a "simple" layout with android. What it should do:
At the top and bottom of the screen should be a bar with a little content. LinearLayout, horizontal.
Between the bars is the space for the content.
This content should be devided into a "large" upper region and a linear layout with (right aligned) buttons at the bottom.
If there is not too much content the content area should be display centered in the available space. If there are more elements in the content, the area should grow until it fills the complete space between top and bottom bars. The Buttons below the content should always be visible. The area for the content should be scrollable in this case.
I tried something like this:
RelativeLayout
LinearLayout TopBar (AlignParentTop)
Button1 Button2 ...
LinearLayout BottomBar (AlignParentBottom)
ButtomA ButtonB ...
This works fine.
Then i tried to add an additional element
FrameLayout (Above Bottombar, Below TopBar)
This FrameLayout fills the remaining space. Fine.
Now i need a layout like this:
RelativeLayout (wrap_content Width/Height)
ScrollView
LinearLayout CONTENT (sometimes small, sometimes really large)
LinearLayout ButtonBar (horizontal)
ButtonX ButtonY ...
If i attach the buttonbar to the bottom of the relative layout the relative layout grows and does no longer wrap around the content. Instead it's height fills the complete available space.
If i put the buttonBar into the upper Relative layout i can fit it between Content and bottomBar. But if the contentn grows the buttonBar slides down outside the screen.
Is it possible that such a simple layout is not managable with Android?
I am working for hours on this and always something does not work :-( HELP PLEASE!!!
Best regards, Udo

I'm not sure how do that, but it's possible. Maybe using a table layout (a table row for each element) and assigning them different weights...

Hi there, I'm not sure if I get what you mean, but here is my understanding of the question.
When your content becomes too large, your bottom bar gets pushed out of the view ?
Try adding this line >> android:layout_weight="1"
into the parent view just above your layout button bar
example :
<LinearLayout ** add to this view here >
<ScrollView>
</ScrollView>
</LinearLayout>
<LinearLayout for ButtonBar>
</LinearLayout>
let me know if it works

I tried weight - does not work. Currently I use margins as described in various articles. Ugly, but it works.
send by tapatalk

Hi,
still stuck with this layout... Another problem now. I tried to have an inner LinearLayout set sets its children to equal width.
I tried every combination of weight, weightSum, layout_width="0sp" etc.
If the textView "MainContent" contains a huge amount of text the radio buttons are compressed to a very narrow size. If the text in the radiobuttons and the textview are nearly equal in size the layout works well. But ONLY then...
The scroll problem still exists.
The layout should work as follows:
If the screensize is big the MainContainer should use no more space than it needs to display its children. It the should be centered on the available space (in my real app it is packed into a relative layout instead of the top-level linear layout in this example).
If the content is larger than the available space a scroller should appear for the content in the scrollarea. The Buttons in the LinearLayout under the scrollview should still be displayed and not scrolled out of the screen. I currently am able to solve the scrolling problem by setting a bottom-margon of e.g. 50sp to the scrollview and -50sp to the linearLayout containing the buttons. Problem here: There are cases where the LinearLayout has no Buttons. With the current solution the Button-Area consumes space in this case too - what i do not want.
On both problems (Scrolling and even distribution of MainContent and the radioGroup) i now am working for days without success.
Any help would be nice. It looks like a really simple layout - but seems to be impossible with android.
Best regards, Udo

Maybe u want to use Fragments (use supportlibrary v4 to Support devices lower than honeycomb)
Use a big one for the Main content. And a small one for the button bar.
So the Fragment may handle the Main content, like an whole activity does.
But dont ask how, cause i have no idea how to do this.
Ok maybe its the solution, so good luck.
Gesendet von meinem GT-I9000 mit Tapatalk 2

Hi,
i currently USE fragments ;-) This does not solve the layout problem...
At the moment i read into creating own custom layouts. Complicated but this seems to be the only way.
Best regards, Udo

Related

Tab 10.1 Wallpaper Template

I've seen a few other wallpaper templates out there, but i wasn't extremely satisfied with them as they only focused on the home screen.
I put alot of work into checking and re-checking this on the honeycomb default launcher (3.1), and it accurately displays the location of each screen both vertical and horizontal.
It's a PNG image to maintain transparency, and the resolution of it is what i've calculated to be optimal to maintain 1280x800 on the primary home screen.
I'm uploading the easier to use PNG file, the psd, and a simple wallpaper i just threw together to illustrate.
When using this template, you just set the crop in the upper left hand corner and expand down as far as you can. there is about a 5px buffer at the bottom to allow some give.
I know it's kind of a busy template, but the green lines will define the home screen in either direction, and each screen is defined by it's matching colored line.
awesome!! thanks!
thanks! time to make some wallpapers
Thanks for sharing, Shane86. This is exactly what I was looking for. You Rock!
Just thought I'd throw up a few wallpapers I've made with this template.
EDIT: Didn't know that this site will re-size image uploads
I've uploaded their original images in the RARs you'll find below.

[Q] Getting eclipse graphical layout to expand with dual scrollview

I am using Eclipse Helios Service Release 2 and the project target is 2.2.
I have a xml layout that has a HorizontalScrollView and ScrollView with a LinearLayout. For some reason unknown to me the graphical layout will not expand when I add objects that exceed the size of the default screen size.
I have other xml layout files that will expand when using a single scrollview type, however when using two of them nested together it does not work.
I have attempted to use ScrollView then HorizontalScrollView and reversed to see if it is a order of priority issue with Eclipse. However this does not work.
There appears to be nothing missing from the properties of the scrollviews between those that will expand and the one that wont.
Is there something I am missing? Or is it not possible to have two different scrollview types in one layout and still have a auto expanding graphical layout editor? I would rather not define a specific screen resolution that would allow me to see all objects; I want the app to be adaptable to any device screen size.
Thank you for your help
Sincerely,
Brandon S
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting
Moving to Q&A

An app for rough building outlines?

Hi guys, Im not entirely sure this belongs in this thread but it seemed more appropriate here than in a specific phone thread.
I am in need of an app with some basic functionality, but very specific.
I need an app that specifically is for rough mapping of buildings and structures, preferably with a re-sizable grid overlay that can be added and removed from the picture.
I need the ability to draw rectangles/squares to represent a building and a 'snap to grid' option so that when I am drawing four rectangular buildings that are roughly the same size and shape, they will appear to be the same size in the picture.
The ability to draw predefined small circles (intended to represent interior and/or exterior lights). Predefined size is important because I dont want a bunch of randomly sized circles and having to size each circle so it 'looks' to be the same size is terribly time consuming.
The ability to 'fill' the above mentioned circles in black or yellow to show whether they are working or out and in need of replacement.
The ability to write text using the keyboard so that I can label each object. Specifically, I DONT want handwriting, I want to use the keyboard and type what I need and have the text appear in the picture where I can size it and move it around.
Drawing straight lines, again with a snap to grid option so that my straight line isnt a diagonal straight line.
I looked at a few apps, the closest I came across is SBM but the UI makes it a pain to use, has no snap to grid, and lacks the ability to place predefined shapes (even if I could make a single circle and copy and paste the circle as often as I need, I would be happy). And since everything in the UI is icon driven, its an utter pain in the ass to figure out what each option does. To give you an idea, I used SBM to make 4 buildings, label them and place circles for all the lights on the property and this took nearly 30 minutes to get it to look half way decent. I could have used a pen and a ruler and done a better job and in one quarter the time.
This doesnt seem difficult but I cant seem to find anything that does this sort of thing. Even MS Paint on Android would be fine.
Anyway, anyone have any suggestions?

Trouble with layout - linearlayout, tablelayout

I am having a real problem wrapping my head around this layout. I've tried everything, tablelayout, linearlayout, can't get the alignment down.
The concept of the layout is attached as an image.
As you can see there are multiple fields, and multiple groups of fields. In the example, there are 2 groups. There couple be more.
In the 2nd row, fields 7 and 8 wrap under the rows above them, as seen in concept. This is giving me a lot of problems. I can't maintain alignment of the rows. I've tried various layout_weight, and layout_span, but everything is giving me problems. Of course, if the amount of text increases or decreases, the alignment needs to stay the same.
In html tables, this would be really easy In android, I've spend hours on it and need help! Thanks!
This could be a horizontal LinearLayout with three vertical LinearLayouts in it. I think this should be relatively simple, just a lot of nested layouts.
sent using the xda app!
Ticklefish said:
This could be a horizontal LinearLayout with three vertical LinearLayouts in it. I think this should be relatively simple, just a lot of nested layouts.
sent using the xda app!
Click to expand...
Click to collapse
Your saying have three vertical columns and then for the 2nd and 3rd column, for rows 1 and 3 break it up in half? For some reason I thought I tried this and couldn't get it to work.

[Q] Impossible quest for editor

I've installed over 50 editors and reviewed 100s in the Play Store... none of them do everything I was looking for. Maybe I missed it.
Editor requirements:
Toolbars at the bottom.
Dark theme (option)
Dark paper / background
Autosave
Insert image (prefer in-line but thumbnail might be OK)
Formatting (bold/font/colors)
File Types = rtf or doc
Opens to last edited and in edit mode.
Trial/free version available for testing before purchase.
No pushy popups asking me to download other things.
Clipboard - easy to use.
Bonus:
Cross platform version in Windows (web version.ok)
Wont freak out if I use AI Keyboard to paste text.
Links - between docs / pages / to web.
Save as text only.
Save selection.
Send selection.
Clipboard history.
Undo history between edits.
No monthly/annual fees
Tags
Toolbars: App buttons should be configurable, always. Buttons for menu/bold/saveas/new could be at the top, bottom, left, right, or floating, per the user preference. I'm really disappointed android has not done more to assist users with reaching across their over sized screens. Almost no apps have this, and only a few place the controls in the obvious place = next to the keyboard = where the user is most likely to want to tap. S5 ships with quick screen sizing ability built in, seems Samsung is ahead on this one. And I don't think it's asking a lot, it's just a matter of moving the bar to a different place, it's too easy!
Theme: A dark theme uses less battery and is easier on my eyes, especially when it's dark out. The theme is the part around the edit area, strictly speaking. This would include all menu's and toolbars. There are great editors out there with dark themes and dark paper but the menu's open super bright, and whats worse is they'll put light gray text on them in wee little fonts with lots of space to make it bigger... and then ask for $$? No.
Paper: A dark paper is super easy to read in any lighting conditions, and uses less battery to display (the display takes 50%+ of most phones battery power) When printing, white paper is best because it is cheap and readily available, and printers are not generally equipped to print light colors on dark paper. Since most people are addicted to printing things they look at 0-1 times, we may be stuck with this for a while. In any case, I want dark paper. This has been a feature in editors for a long long time but is mostly missing from Android.
Autosave: This is a must. If it uses the "save every 10 seconds", it should also save on exit without prompting if I close in only 5s.
Insert image: My preference would be to have text above and below, not around, and not as a layer that is under typed text. If it's attached as a thumbnail, it should be easy to see and tap to zoom.
File Types: My favorite is RTF. It's been around a long time, compatible with most things. Any fairly common windows format is fine like doc or even pdf. I want to avoid special formats that wont work anywhere else. I don't mind if the program has this ability but if it cannot open/save in other formats by default, I'm not interested.
Opening: It should open to the last document opened, and ready to continue typing. If it opens to the home page, then I want to see a recent list with the last edited on top, and one tap to edit. I found some really nice apps that took 5-6 taps to edit a doc. For example, Evernote opens to the home page, you tap to view, scroll to where you want to type, tap and ... nothing.... you have to tap MENU and then some symbol for edit, and then you start typing and it's not typing in the right place, it moved to the top or the bottom or whatever... terrible app IMO.
Fees: I have dropbox and other storage already, I'd rather not sign up for yet another one. Many apps work with existing sharing services just fine, while others require payments for this, generally 4-8 per month. I'm only willing to pay if it is the only one that meets all my other requirements, and it has to be the super ultimate editor and really amazing too.
TagSpaces might do it. There's no trial for Android tho....
Downloads include linux, mac, windows, android and firefox/chrome extensions.
Looks really cool but there's no trial/free version.
TagSpaces does not support themes nor paper color choices.
I'm using SlimRom, it has a great holo theme, and inverted google app package.
Build 7-187 did not invert google play for me.
Build 6-112 works great
The Slim Gaap downloads are here Slim 4-4 Gaaps, stable addon page.
Still looking for a full editor with all the features I mentioned. It's very strange how many apps do not have proper color options for the canvas, any dev who ever opens an app at night or in a dark room knows why. Special lighting apps like Velis Auto Brightness with super dark mode enabled helps a lot, but in a dark room, if the large white areas are bright enough to see the lettering on them, then it's bright enough to light the whole room.
Anyone who wants a longer battery life should be asking every dev to add night modes to their apps

Categories

Resources