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"> <shape android:shape="rectangle">
<corners android:radius="15dp" /> <corners android:radius="15dp" />
<solid android:color="#ffffff" /> <solid android:color="#ffffff" />
<stroke
android:width="1dp"
android:color="#EBEBEB" />
</shape> </shape>
</item> </item>
</selector> </selector>

View File

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

View File

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