Toolbar (v7) showing as a white space, however buttons work - android

So yeah, i'm looking for a solution online to this issue since 3 days ago but i couldn't find anyone having this same problem.
This only happens in my Galaxy Note 2 Android version 4.4.2.
What happens is that the toolbar works when i'm using an virtual machine with android 5.0, but unfortunately if i install it in my cellphone it renders as a white space. The funny part is that its buttons work (up button to open my drawer layout). Any clue on this?
Method where i startup my Toolbar:
My main Activity Layout:
My toolbar XML:
The problem itself:

I wasn't able to fix this problem until google released the new AppCompatActivity within the appcompat library. Basically it is a substitute to the ActionBarActivity which eases the implementation of the new Toolbar on pre-lollipop devices.
To anyone interested: Example usage of AppCompatActivity in Android

Related

S8 Specific Bug Android: Black color bottom navigation and action bar

I am developing an app and when I set android:background as "?attr/colorPrimary" , it appears black on s8 but appears fine on all other devices. Does anyone know what might be the reason and a fix apart from manually changing the background?
Finally found what was wrong, it was because of a bug in cardview and using
app:cardBackgroundColor="#color/white"
worked. There is also a similar issue created for google: https://issuetracker.google.com/issues/37087169

Toolbar design breaks in a lollipop device

I have implemented a collapsible toolbar(prevented the collapse) for my app and it works fine Here is the Screenshot of my collapsible toolbar for a device of 4.2.2
When i execute my app in a device of 5.0, App looks like this,
as you can see there is a gap difference at the bottom of a status bar in 5.0, similarly when i go to other fragment activities of my app the app looks ugly in terms of UI here is what i mean
In a device 4.2.2
In a device 5.0
Here is the link for my styles both styles folder
I don't understand what is the mistake i have done. please help.
Thanks
Not sure if this will help, but I had an issue similar to this, but the Toolbar content was pushed upwards. I added
<item name="android:fitsSystemWindows">true</item>
to my app theme and it fixed it.
Finally the solution is solved. I fixed it by using android:fitsSystemWindows="false" to the CoordinatorLayout and android:fitsSystemWindows="true" for the AppbarLayout and collapsingToolbar rather then using it in my style.xml.

#drawable and FrameLayout don't work in Android Studio and an error icon is shown

QUESTION 1
Do you have any idea for how to fix this error?
QUESTION 2
My Activity's layout has worked pretty fine with Android API <=20. But with Android 5.1.1, the FrameLayout holding Button and Progress Bar does not work. The progressBar isn't shown.
Any helps are welcome.
Thanks

Keyboard covers edittext and webview in Lollipop ONLY

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

Android ViewPager not filling screen on Galaxy Nexus only

I'm trying to create a ViewPager that takes up the entire screen. Inside each fragment of the ViewPager, I have an ImageView that displays a semi-transparent picture.
For some reason, when I try my solution on a Galaxy Nexus (4.0.4), it leaves a border on the left and right side of the ViewPager, as shown below:
I've tried this on the following devices and it does not give that problem:
Nexus S (4.1.1)
Nexus One (2.3.6)
Evo 4G (CM7.2, 2.3.7)
Android emulator
Would anyone be able to take a look at the simplified source code and help me out (especially if you have a Galaxy Nexus)? Thanks!
Btw, this is an attempt to solve an earlier question myself, for which I couldn't get a proper answer.
I went through my code again and tried commenting/uncommenting sections to see if I could get rid of the problem.
I narrowed it down to the custom style I was applying to my activity. In it, I had the following item:
<item name="android:windowIsFloating">true</item>
Removing this item fixed the issue, although I still don't understand why. Maybe something related to this question - How to create a transparent activity WITHOUT windowIsFloating
I had originally included this item after reading the following question -
How do I create a transparent Activity on Android?
Anyway, I hope this saves someone else a significant amount of time in debugging.

Categories

Resources