Bug fixes

Fix: remove extra padding when Show additional Keyboard is set to false
This commit is contained in:
Wisest_wizard 2021-08-18 15:44:11 +05:30 committed by Wisest_wizard
parent cca1b0487a
commit 7c50f04486

View File

@ -125,6 +125,8 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) { public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
if (isInPictureInPictureMode) { if (isInPictureInPictureMode) {
if (kbd.getVisibility() != View.GONE) if (kbd.getVisibility() != View.GONE)
kbd.setVisibility(View.GONE); kbd.setVisibility(View.GONE);
@ -132,11 +134,13 @@ public class MainActivity extends AppCompatActivity {
return; return;
} else { } else {
if (kbd.getVisibility() != View.VISIBLE) if (kbd.getVisibility() != View.VISIBLE)
kbd.setVisibility(View.VISIBLE); if (preferences.getBoolean("showAdditionalKbd", true)) {
int paddingDp = 35; kbd.setVisibility(View.VISIBLE);
float density = this.getResources().getDisplayMetrics().density; int paddingDp = 35;
int paddingPixel = (int)(paddingDp * density); float density = this.getResources().getDisplayMetrics().density;
frm.setPadding(0,0,0,paddingPixel); int paddingPixel = (int)(paddingDp * density);
frm.setPadding(0,0,0,paddingPixel);
}
return; return;
} }
} }