Merge remote-tracking branch 'origin/master'

This commit is contained in:
18142669586 2023-04-06 13:32:18 +08:00
commit 028f2794bf
3 changed files with 38 additions and 12 deletions

View File

@ -4,6 +4,9 @@
<shape android:shape="rectangle">
<corners android:radius="15dp" />
<solid android:color="#ffffff" />
<stroke
android:width="1dp"
android:color="#EBEBEB" />
</shape>
</item>
</selector>

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_fff"
android:background="@drawable/bg_preview"
android:orientation="vertical">
<LinearLayout
@ -12,7 +12,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:layout_marginEnd="2dp"
android:orientation="horizontal">
<com.makeramen.roundedimageview.RoundedImageView
@ -28,20 +28,21 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="12dp"
android:text="@string/dialog_share_info"
android:layout_weight="1"
android:text="@string/dialog_share_info"
android:textColor="#333333"
android:textSize="12sp"
/>
android:textSize="12sp" />
<Button
<TextView
android:id="@+id/share_copy"
android:layout_width="70dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:layout_weight="0.01"
android:background="@drawable/bg_btn"
android:gravity="center"
android:layout_marginStart="25dp"
android:text="@string/dialog_share_copy"
android:textColor="@color/white"
android:textSize="16sp" />
@ -52,9 +53,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:orientation="horizontal">
<ImageView

View File

@ -10,13 +10,19 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
public class LiveUserAnchorMailBoxWebInfoPopDialog extends AbsDialogPopupWindow {
WebView mWebView;
TextView textView;
@ -47,10 +53,13 @@ public class LiveUserAnchorMailBoxWebInfoPopDialog extends AbsDialogPopupWindow
@Override
protected void onCreate() {
super.onCreate();
mWebView=findViewById(R.id.webView);
textView=findViewById(R.id.title);
textView.setText(String.format(WordUtil.getString(R.string.live_user_mailbox_web_title),anchorName));
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(CommonAppContext.getTopActivity(),mWebView),"androidObject");
Bus.getOn(this);
mWebView = findViewById(R.id.webView);
textView = findViewById(R.id.title);
textView.setText(String.format(WordUtil.getString(R.string.live_user_mailbox_web_title), anchorName));
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance()
.setDialogClose(true)
.setmContext(CommonAppContext.getTopActivity(), mWebView), "androidObject");
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
String appCachePath = getContext().getCacheDir().getAbsolutePath();
@ -78,4 +87,17 @@ public class LiveUserAnchorMailBoxWebInfoPopDialog extends AbsDialogPopupWindow
});
mWebView.loadUrl(url);
}
@Override
public void dismiss() {
super.dismiss();
Bus.getOff(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) {
if (event.getMethod().equals("androidGoBack")) {
dismiss();
}
}
}