网页标题整改
This commit is contained in:
@@ -1381,7 +1381,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
public void openLuckGiftTip() {
|
||||
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&anchorUid=" + mLiveUid + "&anchorName=" + mAncherName;
|
||||
startActivity(new Intent(this, ZhuangBanActivity.class).putExtra("url", url));
|
||||
startActivity(new Intent(this, ZhuangBanActivity.class).putExtra("url", url).putExtra("title", ""));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.webkit.WebViewClient;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
@@ -59,6 +60,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
private SVGAImageView svga;
|
||||
private FrameLayout title;
|
||||
private TextView titleView;
|
||||
private RelativeLayout rootView;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -78,11 +80,21 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
if (isFullWindow) {
|
||||
title.setVisibility(View.GONE);
|
||||
}
|
||||
if (getIntent().hasExtra("title") && TextUtils.isEmpty(titleString)) {
|
||||
title.setVisibility(View.GONE);
|
||||
} else {
|
||||
title.setVisibility(View.VISIBLE);
|
||||
titleView.setText(titleString);
|
||||
if (getIntent().hasExtra("title")) {
|
||||
if (TextUtils.isEmpty(titleString)){
|
||||
title.setVisibility(View.GONE);
|
||||
}else {
|
||||
if (TextUtils.equals(titleString, "blank")) {
|
||||
title.setVisibility(View.GONE);
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) rootView.getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(24);
|
||||
rootView.setLayoutParams(params);
|
||||
} else {
|
||||
title.setVisibility(View.VISIBLE);
|
||||
titleView.setText(titleString);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
mWebView = new WebView(mContext);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
@@ -256,7 +268,6 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
Log.i("tag", url);
|
||||
Intent intent = new Intent(mContext, ZhuangBanActivity.class);
|
||||
intent.putExtra("url", url);
|
||||
intent.putExtra("isFull", false);
|
||||
intent.putExtra("title", title);
|
||||
mContext.startActivity(intent);
|
||||
|
||||
@@ -369,7 +380,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
Intent intent = new Intent(context, ZhuangBanActivity.class);
|
||||
Log.i("tag", url);
|
||||
intent.putExtra(Constants.URL, url);
|
||||
if (url.contains("Noble/index.html")){
|
||||
if (url.contains("Noble/index.html")) {
|
||||
intent.putExtra("title", "");
|
||||
}
|
||||
context.startActivity(intent);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
</FrameLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/root_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user