I currently have an app that looks like this, it's a terminal emulator:
and if I press settings this appears on the screen:
However I would like to overlay some custom graphics on top, so that they are always there, some curves etc. Rough sketch:
So even when settings aren't visible this overlay would be shown on the terminal, at the top, around the edges etc. When I press settings I'd like them to come down and match the height of the graphics at the top like I have drawn, the bottom of the overlay matches the bottom of the settings. Is it possible to just have this overlay over everything? Or what is the best way to do this?
Assuming then that you've created your layout using standard Android layouts and Views then my gut feeling is that trying to achieve the overlay is not possible (Using standard Views/Layouts is a trade off between ease-of-use and flexibility).
My own instinct tells me to take a look at using a SurfaceView to create ALL of your UI. This does means a lot of rework but you gain the flexibility I think you need to achieve your aim.
Related
Image of XML code and Design Differnce
In this there is a space left right of the image in AVD but in preview, space is fully covered for ImangeView
Same in case if TextView
I want the AVD design same as Preview. Is there any solution of the problem please help
You have to set the layout_centerOrizontal in "true" for each graphical component. It will solve the question of horizontal align issue. But, the preview cannot show all the devices, have this in mind. So, you have to predict somehow to achieve better performance for differents functions and diffents devices.
In your case, with your example, you have to make the all components be on the center (i'm guessing that is what you want). You can work with padding too. So in order to fill the space in a better way (not too empty, like the space below the images on the first image), you can use margin and padding settings that can bring a better looking.
working on an app and The way I want to set it up is different than what I have ever done before. I want the main activity when launched into the app to exceed past the boundaries of the physical phone screen, and for the user to be able to swipe out to parts of the app that they can't originally see.
I am not sure what the terminology is or what methods or classes etc to use. Any info that could point me in the right direction would be great! Thanks!
Just some clarification:
I think what I'm trying to say is the second thing you talked about. Imagine if you place a iPhone for example in the middle of a piece of computer paper. What I want to achieve is to have the whole view the size of the paper, but only be able to see the size of the iPhone's screen at a time. So you can go up a little bit and see what was above the screen, or left or right
If you want more screens and be able to switch between them, use ViewPager.
If you want one large view bigger than screen, you can either combine ScrollView for vertical scrolling and HorizontalScrollView for horizontal scrolling, or make some custom View, which will be able to scroll (you have to implement it on your own) in both direction.
If you want to have just some views outside of the screen and bring them to visible area on some event, you can use RelativeLayout and set to its views proper margin.
If you want something else, add more information, how it should look and act like.
I will like to develop an application in Android 4 that shows some gauges, text, images, etc.
It will display information read from sensors connected to IOIO board (hardware):
- temperature gauges (linear and angular)
- horizontal horizon (10Dof IMu)
- speed (vertical gauge)
- altitud (vertical gauge)
- etc...
Basically like a Garmin G1000 but the horizontal horizon will be displayed in a square (not all the screen). For example this image: Garmin G1000 image
The screen will contain text and graphics. Some graphic may change high frequently (horizontal horizon, speed, etc), but other no (temperatures, fuel qty, etc).
I was wondering what is the best approach to do it: draw all the screen with canvas, or put text with Textview and graphics with transparent bitmaps, or other options.
I will like if someone could say me what he think about the best approach to design it and to organize the visual components.
Thanks in advance.
With android, your design space is quit limited. So for something like that i would suggest nesting some layouts. You'd set one for the background and others for what ever function you wanna do. I also suggest planning what you wanna display and what layout is best optimized for the function.Eg:
Use a relative layout to set the landscape background
Use the Liner layout for the ruler functions on the sides
Use grid layouts for maps maybe
Use Split action tabs for the options at the bottom
Use menus for calibration settings
Use Relative layouts for all the funny gauges moving about and textboxes and stuff.
Then from there it's a matter of making everything work.
Here are some links on layouts:
Link 1 Link 2
I want my app to run on a wide variety of android devices in portrait only. I have a whole-screen background image that includes borders for other components. I want to place items like listviews/sponsor ads accurately within those borders... overlay them on top of the background in exactly the right place. Is using Framelayout the best/easiest way to do this? How do I make sure I get the listviews or sponsor ads in exactly the right place, and exactly the right size given that the background will be stretched to different dimensions for different devices? I've considered cutting up the background image instead but that seems like more work. What's the best approach? Thanks for any thoughts!
Unfortunately, this scheme is never going to work consistently across all screen sizes. If you want borders, you need to create 9-patch graphics out of those and assigne them as teh background to the UI item.
Is there a way to draw ontop of every view (like a watermark that shows everywhere for example)? sort of how the Dock4Droid app draws a a dockbar ontop of every screen.
Your best bet is to have a relative layout as your top level container. The very last item in your markup should be an imageview containing your watermark which you can then position on the screen anywhere you like.
As an alternative, you can do your own drawing (onDraw) and set the opacity value such that it gives the presentation of being translucent. Works for me with several of my requirements.
I don't think this is possible, as android app drawing is effectively sandboxed.
Even if you could, why would you want to? It seems like a major annoyance for your users. I know I would uninstall an app that did that.