I do understand that similar issues have been reported here but mine is somewhat different.
I have recently upgraded the com.android.support:appcompat-v7 to v21 and com.android.support:support-v4 to v19.
Everything seemed normal on a pre-lollipop device but when I started to test the device on Android L, two issues appeared:
The softkeyboard was covering EditText
In the webview, system wasn't resizing, pushing the form-fields to the top as it normally should, rather did on pre-lollipop devices.
I read various articles and added the following line to my AndroidManifest.xml file:
android:windowSoftInputMode="adjustPan". It did push the edittextfields on top of the keyboard removing the toolbar from the view however it did not resize the view in webview and still covered the form fields at the bottom.
And after the changes, the app on pre-lollipop devices is malfunctioning in the same fashion as well.
Any help will be very much appreciated.
Extract from android-manifest:
<activity
.....
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
...
</activity>
I am using the Theme.AppCompat.Light.NoActionBar theme for my app.
Incase anyone lands here facing the same issue, the behavior occurs because "they" (Google) have changed the behavior of adjustPan moving forward from Android L.
To fix the issue, I am using a keyboard util in the library as indicated here.
A note from the developer is that this fix is to be used only in fragment/activity becaues this uses a GlobalLayoutListener which lowers the frameRate a bit but this is the only option to get it working
Related
I have a problem with the "pixelization" of the embedded icons (main/res) on some devices. It can be reproduced on some Android 9 TV boxes and it happenes when an icon is upscaled/downscaled somehow (see images as example). But I do not know why it happens. And I can not reproduce this bug on any devices of mine and on any Android Emulator. I am using regular Android resources (R.drawable) in an XML layout. As I can see, it is not an anti-alias problem. Also, the same APK works great on the other TV boxes. This problem was reported by the user and as I said - I can not reproduce it. These resources were set just via android:src in ImageView, nothing special.
What I need to check first? Thanks.
Example of the pixelization:
https://i.stack.imgur.com/k76jx.png
https://i.stack.imgur.com/Tp8iX.png
UPDATE:
I tested this behavior with the user on his TV box: it happens only with SVG(VectorDrawable) graphics and with android:hardwareAccelerated="true" (it is true by default). If I set android:hardwareAccelerated="false" everything works as expected. Any solution for this?
android:resource="#7F160010" />
I have had feedback from Pixel 3/4 users that the bottom of the screen on this app is cut off, obscuring buttons and possibly other controls that the user requires.
This has only started happening on Android 10. The app contains both Xamarin.Android axml and Xamarin.Forms xaml layouts for the views (the particular page that you are viewing below is Xamarin.Forms).
I don't want to set margins, paddings, gravity or such like on the entire app as obviously that would impact non Android 10/Pixel users. I don't really want to check the operating system version and programatically change those properties as that seems quite hacky and will quickly become unmanageable.
I've looked for something similar to a UseSafeArea property for navigation bars rather than notches but there doesn't seem to be any. Is using WindowInsets the only way to this or has someone else had/solved this issue?
How it looks (controls at bottom are obscured):
How it should look (and does on every other device, the data is different here but it's the view that matters):
I had a similar issue which I solved by removing a few lines of code that were there to fix a bug that has since been fixed in Xamarin Forms.
It directly relates to this forum topic: https://forums.xamarin.com/discussion/87176/windowsoftinputmode-doesnt-work-in-xamarin-forms-android
If these lines exist in your MainActivity.cs, try removing them and see if that works:
Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize);
Window.SetSoftInputMode(SoftInput.StateHidden);
AndroidBug5497WorkaroundForXamarinAndroid.assistActivity(this);
When I add a class to make appear a div (display:block) , suddenly view change to black screen. I touch the screen, elements in view still fire event.
How can I resolve the problem?
You should make sure you are using the most recent API (You can probably adjust this in eclipses android sdk manager).
If you still have any issues, make sure you have hardware acceleration on. You can adjust this in the manifest file:
<application
...
android:hardwareAccelerated="true"
...
>
If you still have an issue, try applying a css3 translate to something like your global body on app load. That will help to narrow down the issue. Otherwise, without some more code/information it's going to be hard to answer.
Let me know if I can help with anything else, but for what it's worth I haven't had this issue at all using the most recent android API and cordova 4.0.
I'm developing a PhoneGap-based application and I googled much about how to make my webview adjust its height when virtual keyboard appears, or at least get height of the virtual keyboard. I found a lot of posts (including stackoverflow) which says that
android:windowSoftInputMode="adjustResize"
must be set in the manifest and I did that. I also found that for PhoneGap config.xml there's
<preference name="android-windowSoftInputMode" value="adjustResize"/>
setting and I pasted that too. I also tried combined value 'stateVisible|adjustResize' (not just 'adjustResize') for both parameters, but it seems to me that they both have NO EFFECT. I don't know, maybe I'm doing something wrong, but you can check the screenshots from the emulator (Android 4.0.3, but I also tried 4.1.2 and 4.2.2):
http://screencast.com/t/Mm0mw8c693 - keyboard visible
http://screencast.com/t/lZ2DomqeRR - keyboard hidden
On the screenshot I intentionally captured my manifest and config.xml settings, so you may see they're actually there.
I even recorded short video - http://screencast.com/t/xI9PMcMJxxx
As you may see, no any viewport resizing occur when keyboard shown / hidden.
I also checked window.innerHeight using console.log() and it stays same for both visible and hidden keyboard.
Please, give me some advice.
windowSoftInputMode="adjustResize" does not work if your app is in fullscreen mode (setting fullscreen to true in config.xml). It is Android's issue not Cordova. the issue CB-4404 was filed in Cordova bug tracker for months but recently it turns out that it is working as intended on Android bug tracker.
I solved the problem by setting fullscreen to false since it wasn't a problem for my app not to go fullscreen.
I found I needed to to 3 things to resolve this issue, and prevent the actionBar from hiding itself, from scrolling out of view when the soft keyboard was brought up.
1) In AndroidManifest.xml, in the activity in question, I needed the line:
android:windowSoftInputMode="adjustResize"
The original problem is that adjustPan was present in the line above. At first, just the change above fixed the problem.
The project I am on uses fragments. In the onCreateView method, a different fragment had the line:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
That line, unfortunately, overrode the adjustResize parameter in the Application manifest, and after that other fragment was displayed, the fragment that I fixed broke again. So, to fix the new break, I did 2 additional things.
2) I deleted the SOFT_INPUT_ADJUST_PAN line from the onCreateView method of that other fragment, because it did not need that line anyway.
3) In the onCreateView method of the fragment with which I am primarily concerned, I added the line:
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Actually, doing either of items 2 or 3 would solve the problem. I did both to be thorough.
either you can set this property in android.manifest explicitly to "adjustNothing" then you do not need to set "fullscreen" mode to false.
but you have to update it every time you update/add android platform.
When I use
getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
in my Activity I don't get slightly blurred screen under current Activity but completely black one (top Activity is fine). Need to say it is also black in sample which came with SDK. Can somebody suggest how to make it blurry?
In your AndroidManifest.xml add this line to your Activity declaration: android:theme="#android:style/Theme.Translucent.NoTitleBar" otherwise the activity will have a solid background (and thus blur has no effect).
Also, this post on StackOverflow is helpful, in particular the cautionary notes. On older devices this causes your application to become unresponsive (it is a CPU-intense software rendering), and on newer devices this constant is deprecated and no longer has any effect (see Android Documentation for WindowManager.LayoutParams).
Deprecated on latest versions of OS (check documentation).
Note: the flag FLAG_BLUR_BEHIND is depreciated.
You can use FLAG_DIM_BEHIND Instead.