Is there a way where we can control for every screen different states of the keyboard, for example I have one screen where I want to adjust size of the keyboard to the screen and other screens where I do not want that. Currently I was using this
android:windowSoftInputMode="adjustResize" , but when other cases come along this is not working anymore, is there any workaround?
Related
I've noticed when using the design library's Floating Action Button that when the app is put in multi-window mode, the FAB is automatically resized to its "mini" size. Other apps such as Gmail share the same behaviour.
As opposed to that, my own UI elements and buttons don't change size. I set a fixed dp size for them, and they stay with that same size.
Is there any design recommendation to provide smaller UI elements when the app is in multi-window mode? Should one listen for app size changes and resize buttons depending on it? Or is this behaviour only recommended for the FAB button?
Is there any way I can achieve the desired behaviour on rotation of the device, as illustrated in the following sketch (the wavy thing is a widget). Most likely this is something that would be controlled by the launcher, rather than controlled programmatically from any one app -- if so, is there any launcher that allows this?
Basically the reason I'm asking is because I want the widget to behave as illustrated (the widget is what I'm coding), even when the user's device is set to rotate the home screen on device rotation. Basically the only way I can see this working is if the grid layout is fixed relative to the physical screen, with the app icons just rotating within their box, and the widgets either updating their content for the new layout, or just keeping the previous content (so that the content rotates with the screen).
For updating of widget content, is there any way of detecting screen home screen rotation programmatically (different to screen rotation, since the home screen may not rotate)? This is relevant to me even for the "what I get" scenario, because the aspect ratio of the widget seems to change when the home screen is rotated, and I need to detect this and update the widget content to fit better.
dfdd
Use:
1. layout-sw480dp
2. layout-sw600dp
3. layout-sw720dp
You are unlikely to find a solution for this as the home screen (launcher) varies wildly in implementation. Many launchers don't support landscape orientation, and expecting the launcher to accommodate a widget which can expand in two different directions is simply asking too much of them.
For the launchers which do support landscape orientation, the widget should be repositioned for free without effort on your part. You may wish to detect which orientation the widget is in (such as via getResources().getConfiguration().orientation) when your provider is choosing a layout, setting up views etc, but that's about it.
In my AIR mobile application I am trying to resize my application when the softkeyboard is activated so that the bottom of my application will not be covered by the keyboard. From what I have read this is suppose to be the default behavior but I have never been able to get it to work and I have tried everything I have found online, instead the keyboard overlays ontop of the application.
I then decided I would resize my application myself based on the height and y position of the softkeyboard only to find out that the built in AIR methods for determining the height and y position of the keyboard are not correct (YAY). I even tried using a 3rd party ANE for determining the screen height by FreshPlanet and their code does not always return correct values either. I feel like this shouldn't be that hard to figure out but I am stuck. Please help!
TLDR:
How can I resize my application to be the remaining screen space when the softkeyboard is activated?
What renderMode are you using? (in manifest.xml) I found that only cpu is working to get the correct keyboard height.
Also try to set softKeyboardBehavior to none: <softKeyboardBehavior>none</softKeyboardBehavior>
I'm using the showcaseview library in my Android app to display a first time tutorial to new users. So far it's been fairly straightforward to get going; I have a number of different viewpager tabs at the top of the page that are getting consecutively showcased, which is great ... in portrait mode.
However when the device is rotated, or I start my app in landscape orientation, the title and content text that I have for my showcase is displayed at the bottom of the screen and it eventually overflows off the screen. The showcase text content isn't more than a sentence and I can't think I'm the first person to have this problem so I'm wondering if any one else has come across this and how they solved it?
I was thinking that since showcaseview calculates the best position for the text based on free canvas space that I could probably move my content up by reducing the radius of the showcase cirlce, although I have yet to try this.
Also, I don't want to restrict users by locking the orientation to portrait mode during the tutorial.
EDIT: I've temporarily settled for locking the screen to portrait orientation if I deem the height and width of the target device to be too small. It's not my ideal solution so I'm still keen to hear the thoughts of any showcaseview users out there.
I'm developing a simple app with a customized background and a button in the middle.
I've got the whole different resolutions for different screens down, but do all the versions of the background need to be 9patches? How do I take into consideration the always there android top navigation bar and the possible use of advertisements at the bottom? Do they just cover the design or do they change the resolution?
I've got the whole different resolutions for different screens down
that's not how it works on android. see this:
http://developer.android.com/guide/practices/screens_support.html
do all the versions of the background need to be 9patches?
no . you decide . normally, buttons and views use the 9 patch images, but it can be useful for many other things. more info:
http://android10.org/index.php/articlesother/279-draw-9-patch-tutorial
http://radleymarx.com/blog/simple-guide-to-9-patch/
How do I take into consideration the always there android top
navigation bar and the possible use of advertisements at the bottom?
you can put a linear layout which has the ad on the bottom , and once it will be shown , the upper view will shrink its size.
about the action bar on the top, it doesn't matter , since the layout is below it anyway.
if you wish, you can also hide the top bar. however , if you have the bottom navigation bar (as on honeycomb and some ice-cream sandwich devices ) , you can't just hide it , since the end user must be able to press the back and home buttons .
Do they just cover the design or do they change the resolution?
you (and also those components) can't change resolution just like on a PC . everything takes space depending on your code and layout.
it seems that you need some guidelines of how to design for android. may i suggest checking out those links:
http://developer.android.com/design/index.html
http://www.google.com/events/io/2011/sessions/designing-and-implementing-android-uis-for-phones-and-tablets.html
http://www.google.com/events/io/2011/sessions/honeycomb-highlights.html