AdjustPan does not work with FLAG_LAYOUT_NO_LIMITS

"My requirements" is a complete transparent status bar with the color of the status bar changing in the same activity dynamically.

For this, I added getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

and in style.xml

 <item name="android:windowTranslucentNavigation">true</item> <item name="android:windowTranslucentStatus">false</item> 

So it works fine, but I need to adjust the screen when the soft keyboard opens. Therefore, I tried android:windowSoftInputMode="adjustPan|adjustResize" , but the screen did not change or scroll. Anyone can help me with this.

+5
source share
1 answer

Make it transparent and dynamically change the color as if you did not set the FLAG_LAYOUT_NO_LIMITS flag, then check the screen when you open the keyboard.

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setStatusBarColor(getResources() .getColor(R.color.themeToolbarColor)); } 
+2
source

All Articles