diff --git a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java index d9bc9e968..f4ac8a40b 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -59,7 +59,6 @@ public abstract class AbsActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { - create(); Intent intent = getIntent(); if (intent != null) { isFullWindow = getIntent().getBooleanExtra("isFull", false); @@ -68,6 +67,7 @@ public abstract class AbsActivity extends AppCompatActivity { getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); } } + create(); super.onCreate(savedInstanceState); mTag = this.getClass().getSimpleName(); setStatusBar(); @@ -133,7 +133,7 @@ public abstract class AbsActivity extends AppCompatActivity { /** * 设置透明状态栏 */ - private void setStatusBar() { + public void setStatusBar() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index dc238840c..4a33c908c 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -5,6 +5,7 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; +import android.graphics.Color; import android.net.Uri; import android.os.Build; import android.os.Handler; @@ -12,6 +13,7 @@ import android.provider.MediaStore; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; +import android.view.WindowManager; import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebSettings; @@ -82,6 +84,15 @@ public class WebViewActivity extends AbsActivity { return R.layout.activity_webview; } + + + @Override + public void setStatusBar() { + getWindow().setStatusBarColor(Color.parseColor("#FFFFFF")); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + } + @Override protected void main() { String url = getIntent().getStringExtra(Constants.URL); diff --git a/common/src/main/res/layout/activity_webview.xml b/common/src/main/res/layout/activity_webview.xml index 44c9ef453..e22ab8281 100644 --- a/common/src/main/res/layout/activity_webview.xml +++ b/common/src/main/res/layout/activity_webview.xml @@ -17,8 +17,9 @@ android:layout_width="match_parent" android:layout_height="72dp" + android:background="@color/white" android:paddingTop="24dp" - android:background="@color/white"> + tools:visibility="gone">