how to avoid dialog skinning for certain android roms - android

In my app I have a custom dialog that works great on my stock gingerbread rom. I checked my app out on my friend's Atrix, and there is this extra border that looks to be consistent with the rest of the ui (sorry, dont have an Atrix here to test it out). The same thing happens when i use my app on a Droid 1 with stock froyo (theres a thicker, grey border). Is there a way to get rid of this?

The only way to get rid of it is by overriding all the styles used in a dialog. Most of the time this is not necessary... a dialog on the Atrix will look like every other dialog on the Atrix, so the user doesn't really notice the difference. If you need a specific look to match your app, however, you need to style it.

Related

Immersive like feature in JB and ICS

I am developing an Application where I need to go completely full screen. In kitkat its very easy by using Immersive tag. But since not all devices support kitkat I need to take JB and ICS (atleast) into consideration.
Well although there is a way of hiding navigation bar and status bar in JB and ICS it becomes visible as soon as the user interacts. This certainly does not looks good. It also takes one extra touch.
I did a lot of searching on net and was surprised that there is no way we can achieve it. I was hoping to find some trick or hack but nothing.
I am pretty sure that before kitkat came there were games which used full screen so I guess there should be a way (like Temple Run and Andgry Birds). Can some one please guide me in correct direction.
P.S: I am looking solution for devices which are not rooted.
Thanks :)
Use a full screen theme, or set it from code as described here https://developer.android.com/training/system-ui/status.html
As I already pointed out in the comments, this will give you full screen. Not the immersive mode as seen on KitKat where the user can easily unhide the status bar. If you're going with the theme approach it's probably best to set a not full screen theme on API19+ (KitKat) and tell it to use Immersive mode from there on.

Custom ActionMode for TextView doesn't work on all devices

I implemented a TextView with a custom ActionMode.Callback, where I add an item to the menu if certain criteria is met. This works like a charm on most devices (N4, N7, GS4) but now I noticed that it doesn't work on The LG G2. I don't have other devices to test it on, but LG has implemented the default TextView- ActionMode in a way that the menu is not shown in the actionbar, but on top of the selected text (much like it happens on iOS afaik) and I'm wondering whether somebody else had this experience and how I could solve it?
(Maybe it would also help to let me know of other apps that use a custom TextView action mode, so I can check, whether they work properly on this device, I couldn't think of one yet...)
Thanks,
j
I found several other posts about the same behavior on HTC (sense) devices, and there was not a solution which somehow forces those stupid custom android versions to behave the way it's supposed to...
So I ended up adding the functionality in another way :(

Dialog box positive / negative buttons in different position depending on android version

I've been writing an new app for our company and came across an odd thing. On the test device (running 2.3.x) the alert dialog buttons will always be in the order of:
POSITIVE | NEGATIVE
Yet, when I tested the app on my personal cell (running 4.x) the alert dialog buttons were switched to:
NEGATIVE | POSITIVE
The code is obviously the same.
I don't really want to make different versions. But I could cater for later versions in code, and maybe (although its rubbish) swap the text of the positive and negative buttons... Which would work, I'm guessing, but it's a bit horrible!
The only problem I can foresee, is that our end-users aren't that tech-savvy and having multiple devices, using differing versions of the OS, could cause issues (which I could easily cater for, but would rather some kind of 'standard').
Is this something I can get around? Or is it best to leave as is and let the OS handle it (as I am doing now)? Also, are there any other small issues I'm going to run into. I.e. Can I guarantee that on 4+ devices that if I'm only using 2 buttons that they will remain in the above order.
What I'm hoping someone will post is a hidden flag that magically sets 4.x alert dialogs to 2.x style :) I'm pushing my luck, I know!
Cheers. Any help is greatly appreciated.
It's an interesting piece of lunacy from Google (see issue 24138) but, as of ICS, this is how it's supposed to be. Definitely best to let the OS choose the ordering.
If you wish to have it the same for all versions, you could potentially check which version of Android is being run, and change the negative/positive buttons yourself. I don't recommend it, and people will expect it to like it is on their device, don't shoehorn everyone into having the exact same flow.

How to add padding to the android screen?

I want to add black padding (a thick black border) to the android screen such that every app is displayed with the padding around it. I know how to do this for my app but how do I do this such that when my app is running in background the display is padded?
I don't believe this is possible unless you're willing to create and run a custom ROM.
Thankfully, this is not possible for the average non-ROM third party Android developer.
The screen on mobile devices is actually very limited, and when programming for the mobile environment, you have to learn to get away from the windows metaphor used by traditional desktop PCs.
On the other hand, may be your app could pretend it is running in the background, but still stay in the foreground with its transparency enabled. And perhaps if you can't do something, may be you can find a way to fake that something for your users.
Also, note that the default home launcher is capable of doing something similar to what you want, but only for widgets. And if being able to run widgets is sufficient for you, perhaps you could write your own launcher application that can embed widgets.

each android device had it's own default theme for applications?

I run my applcation in Motorola,HTC devices and each group of devices my application dialog box,Text box appearance is different.Why this will happend?Is device to device any specific theme applied on my application?Iam n't used any custom theme for my application.
how to persist my application look and feel in all devices.I know little bit, by using our own theme we can persist.but, I don't have time to develope my own theme.I want to take the source of one device default theme and utilise that one in my application.So that I think i can see the application same in all devices.how to get the theme from one device,if my above sentence correct?
You are right every manufacturer applies some styling to their user interface.
There are some places where this is fine for example dialog boxes should look the same in every application on the device. If a dialog box would look completely different then all the other dialogs this would confuse the user.
Some things are annoying for example the motorola motoblur phones use a black background image for spinners and normal andoroid phones use a grey one.
Have a look at my question regarding this problem. It is a solution for a small part of your problem but maybe it shows you how to search for the other images and themes that you need to copy.

Categories

Resources