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 a3ac74556..aa49fd96f 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -38,6 +38,7 @@ public abstract class AbsActivity extends AppCompatActivity { protected String mTag; protected Activity mContext; protected List mLifeCycleListeners; + protected boolean isFullWindow; @Override public Resources getResources() { @@ -51,6 +52,11 @@ public abstract class AbsActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { + isFullWindow=getIntent().getBooleanExtra("isFull",false); + if(isFullWindow){ + getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); + } super.onCreate(savedInstanceState); mTag = this.getClass().getSimpleName(); setStatusBar(); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 1cfce84e9..903b70d5e 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -827,11 +827,10 @@ public class LiveAudienceActivity extends LiveActivity { url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; Log.i("tag", url); - Bundle bundle1 = new Bundle(); - bundle1.putString("url", url); - liveHDDialogFragment = new LiveHDDialogFragment(true); - liveHDDialogFragment.setArguments(bundle1); - liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + Intent intent=new Intent(mContext,ZhuangBanActivity.class); + intent.putExtra("url", url); + intent.putExtra("isFull",true); + mContext.startActivity(intent); break; } diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index 8e6ecadb9..8cfc7ae1d 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -1,5 +1,9 @@ package com.yunbao.live.activity; +import static com.yunbao.common.CommonAppContext.logger; +import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; @@ -7,7 +11,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.MediaStore; -import androidx.annotation.RequiresApi; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -18,9 +21,12 @@ import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.ProgressBar; +import androidx.annotation.RequiresApi; + import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; import com.alibaba.android.arouter.launcher.ARouter; @@ -40,10 +46,6 @@ import com.yunbao.live.R; import java.net.MalformedURLException; import java.net.URL; -import static com.yunbao.common.CommonAppContext.logger; -import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; -import static com.yunbao.common.utils.RouteUtil.PATH_COIN; - public class ZhuangBanActivity extends AbsActivity { private ProgressBar mProgressBar; @@ -53,10 +55,11 @@ public class ZhuangBanActivity extends AbsActivity { private ValueCallback mValueCallback; private ValueCallback mValueCallback2; private SVGAImageView svga; + private FrameLayout title; @Override protected int getLayoutId() { - return R.layout.activity_zhuang_ban; + return R.layout.activity_zhuang_ban_new; } @Override @@ -66,9 +69,12 @@ public class ZhuangBanActivity extends AbsActivity { LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); mProgressBar = (ProgressBar) findViewById(R.id.progressbar); svga = (SVGAImageView) findViewById(R.id.svga); - + title=findViewById(R.id.ft_title); + if (isFullWindow){ + title.setVisibility(View.GONE); + } mWebView = new WebView(mContext); - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); params.topMargin = DpUtil.dp2px(1); mWebView.setLayoutParams(params); mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index 59dd56382..80fb75167 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -1,16 +1,20 @@ package com.yunbao.live.dialog; -import android.app.Dialog; +import static com.yunbao.common.CommonAppContext.logger; +import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + import android.graphics.Color; -import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.text.TextUtils; -import android.util.DisplayMetrics; import android.util.Log; +import android.view.Display; import android.view.Gravity; import android.view.View; +import android.view.ViewGroup; import android.view.Window; +import android.view.WindowInsets; import android.view.WindowManager; import android.webkit.JavascriptInterface; import android.webkit.WebSettings; @@ -20,7 +24,6 @@ import android.webkit.WebViewClient; import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; import com.alibaba.android.arouter.launcher.ARouter; -import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.JsWishBean; import com.yunbao.common.dialog.AbsDialogFragment; @@ -29,10 +32,6 @@ import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; -import static com.yunbao.common.CommonAppContext.logger; -import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; -import static com.yunbao.common.utils.RouteUtil.PATH_COIN; - public class LiveHDDialogFragment extends AbsDialogFragment { private WebView mWebView; @@ -73,7 +72,24 @@ public class LiveHDDialogFragment extends AbsDialogFragment { WindowManager.LayoutParams params = window.getAttributes(); params.width = WindowManager.LayoutParams.MATCH_PARENT; if(isFullWindow){ + Display display=null; + window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.MATCH_PARENT); + if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.R) { + display= requireContext().getDisplay(); + window.getInsetsController().hide(WindowInsets.Type.statusBars()); + window.getInsetsController().hide(WindowInsets.Type.navigationBars()); + }else { + display=window.getWindowManager().getDefaultDisplay(); + window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT); + window.getDecorView().setBackgroundColor(Color.parseColor("#10000000")); params.height = WindowManager.LayoutParams.MATCH_PARENT; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + window.getDecorView().setMinimumHeight(display.getMode().getPhysicalHeight()); + window.getDecorView().setMinimumWidth(display.getMode().getPhysicalWidth()); + } + window.getDecorView().setPadding(10,-10,0,0); }else { params.height = WindowManager.LayoutParams.WRAP_CONTENT; } @@ -192,6 +208,10 @@ public class LiveHDDialogFragment extends AbsDialogFragment { dismiss(); ((LiveAudienceActivity) mContext).openGiftWindow(); } + @JavascriptInterface + public void androidGoBack(){ + dismiss(); + } } /** diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 91059625f..24c2f8dac 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -379,7 +379,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { liveNewPeople.setVisibility(View.VISIBLE); newPeopleUrl = peopleInfo.getLink(); } - }, throwable -> throwable.printStackTrace()).isDisposed(); + }, Throwable::printStackTrace).isDisposed(); } @Override diff --git a/live/src/main/res/layout/activity_zhuang_ban_new.xml b/live/src/main/res/layout/activity_zhuang_ban_new.xml new file mode 100644 index 000000000..1fcf37766 --- /dev/null +++ b/live/src/main/res/layout/activity_zhuang_ban_new.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file