mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-17 07:22:45 +00:00
Fix white bar on top after Android 12 upgrade by @Helium314 (#238)
Co-authored-by: Helium314 <helium314@mailbox.org>
This commit is contained in:
parent
c58bd52261
commit
b1c1ea5fac
1 changed files with 16 additions and 3 deletions
|
@ -12,6 +12,7 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
|
@ -56,8 +57,6 @@ import org.dslul.openboard.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
|
|||
import org.dslul.openboard.inputmethod.latin.common.Constants;
|
||||
import org.dslul.openboard.inputmethod.latin.common.CoordinateUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.common.InputPointers;
|
||||
import org.dslul.openboard.inputmethod.latin.common.StringUtils;
|
||||
import org.dslul.openboard.inputmethod.latin.common.StringUtilsKt;
|
||||
import org.dslul.openboard.inputmethod.latin.define.DebugFlags;
|
||||
import org.dslul.openboard.inputmethod.latin.define.ProductionFlags;
|
||||
import org.dslul.openboard.inputmethod.latin.inputlogic.InputLogic;
|
||||
|
@ -1077,8 +1076,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
@Override
|
||||
public void onWindowShown() {
|
||||
super.onWindowShown();
|
||||
if (isInputViewShown())
|
||||
if (isInputViewShown()) {
|
||||
setNavigationBarColor();
|
||||
workaroundForHuaweiStatusBarIssue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2040,4 +2041,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
view.setSystemUiVisibility(mOriginalNavBarFlags);
|
||||
}
|
||||
|
||||
// On HUAWEI devices with Android 12: a white bar may appear in landscape mode (issue #231)
|
||||
// We therefore need to make the color of the status bar transparent
|
||||
private void workaroundForHuaweiStatusBarIssue() {
|
||||
final Window window = getWindow().getWindow();
|
||||
if (window == null) {
|
||||
return;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.S && Build.MANUFACTURER.equals("HUAWEI")) {
|
||||
window.setStatusBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue