处理虚拟按键背景问题

This commit is contained in:
zher52 2020-04-30 20:25:38 +08:00
parent 94631e171a
commit 7edd841078

View File

@ -27,6 +27,7 @@ import android.content.res.Configuration;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Handler;
import android.view.Display;
import android.view.Gravity;
@ -219,7 +220,14 @@ public class SplashScreen extends CordovaPlugin {
private void removeSplashScreen(final boolean forceHideImmediately) {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
if (splashDialog != null && splashImageView != null && splashDialog.isShowing()) {//check for non-null splashImageView, see https://issues.apache.org/jira/browse/CB-12277
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int color = Color.parseColor("#f8f8f9");
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
hsv[2] = 0.5f;
cordova.getActivity().getWindow().setNavigationBarColor(Color.HSVToColor(hsv));
}
if (splashDialog != null && splashImageView != null && splashDialog.isShowing()) {//check for non-null splashImageView, see https://issues.apache.org/jira/browse/CB-12277
final int fadeSplashScreenDuration = getFadeDuration();
// CB-10692 If the plugin is being paused/destroyed, skip the fading and hide it immediately
if (fadeSplashScreenDuration > 0 && forceHideImmediately == false) {