From 1d8cdf250d41b5ae782d7d05869e7e6f1eab4241 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 27 Oct 2022 10:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B6=A3=E5=91=B3=E6=B8=B8?= =?UTF-8?q?=E6=88=8Ftab=E9=80=89=E4=B8=AD=E7=BA=BF=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/dialog/LiveGameDialogFragment.java | 4 ++++ live/src/main/res/layout/dialog_live_game.xml | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java index d48199f20..3b9176a55 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java @@ -66,6 +66,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { private String roomId; private TabLayout tabLayout; private int tabIndex = 0; + private LinearLayout layout; public LiveGameDialogFragment() { @@ -110,6 +111,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { super.onActivityCreated(savedInstanceState); mWebView = (WebView) findViewById(R.id.rlWebview); tabLayout = (TabLayout) findViewById(R.id.tabLayout); + layout = (LinearLayout) findViewById(R.id.bg_layout); mWebView.addJavascriptInterface(new JsInteration(), "androidObject"); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); @@ -190,9 +192,11 @@ public class LiveGameDialogFragment extends AbsDialogFragment { if (model != null) { if (!StringUtil.isEmpty(model.getBgColor()) && !"#".equals(model.getBgColor())) { tabLayout.setBackgroundColor(Color.parseColor(model.getBgColor())); + layout.setBackgroundColor(Color.parseColor(model.getBgColor())); } if (!StringUtil.isEmpty(model.getTextColor()) && !"#".equals(model.getTextColor())) { tabLayout.setTabTextColors(Color.parseColor("#B3FFFFFF"), Color.parseColor(model.getTextColor())); + tabLayout.setSelectedTabIndicatorColor(Color.parseColor(model.getTextColor())); } String url = model.getActiveSrc(); if (!url.startsWith("http")) { diff --git a/live/src/main/res/layout/dialog_live_game.xml b/live/src/main/res/layout/dialog_live_game.xml index 3bf39c4de..acd1adfdd 100644 --- a/live/src/main/res/layout/dialog_live_game.xml +++ b/live/src/main/res/layout/dialog_live_game.xml @@ -9,18 +9,22 @@ + + app:layout_constraintTop_toTopOf="parent" + app:tabIndicatorFullWidth="false" + app:tabMaxWidth="100dp" + app:tabMode="scrollable">