塔罗牌支付弹窗使用一个单独的
This commit is contained in:
@@ -1255,6 +1255,10 @@
|
||||
<activity
|
||||
android:name=".ui.webview.DialogWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.webview.TarotPayWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
<!-- Fix bug Only fullscreen opaque activities can request orientation -->
|
||||
<activity
|
||||
android:name="com.sdk.base.module.permission.PermissionActivity"
|
||||
|
@@ -500,7 +500,7 @@ public class JSInterface {
|
||||
|
||||
@JavascriptInterface
|
||||
public void closeDialogWebView() {
|
||||
if (mActivity instanceof DialogWebViewActivity) mActivity.finish();
|
||||
if (mActivity instanceof TarotPayWebViewActivity) mActivity.finish();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -508,13 +508,13 @@ public class JSInterface {
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void openDialogWebview(String url) {
|
||||
DialogWebViewActivity.start(mActivity, url);
|
||||
TarotPayWebViewActivity.start(mActivity, url);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void checkResultFinish(int result) {
|
||||
EventBus.getDefault().post(new TaroPayResultEvent().setResult(result));
|
||||
if (mActivity instanceof DialogWebViewActivity) mActivity.finish();
|
||||
if (mActivity instanceof TarotPayWebViewActivity) mActivity.finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
package com.yizhuan.erban.ui.webview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.yizhuan.erban.R;
|
||||
|
||||
|
||||
/**
|
||||
* 塔罗牌支付页面弹窗,仅塔罗牌支付使用
|
||||
*/
|
||||
public class TarotPayWebViewActivity extends CommonWebViewActivity {
|
||||
|
||||
public static void start(Context context, String url ) {
|
||||
Intent intent = new Intent(context, TarotPayWebViewActivity.class);
|
||||
intent.putExtra("url", url);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setFinishOnTouchOutside(false);
|
||||
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT,ScreenUtil.dip2px(150));
|
||||
getWindow().setGravity(Gravity.CENTER);
|
||||
layoutTitleBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_tarot_pay_web_view;
|
||||
}
|
||||
}
|
93
app/src/main/res/layout/activity_tarot_pay_web_view.xml
Normal file
93
app/src/main/res/layout/activity_tarot_pay_web_view.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:orientation="vertical"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="@dimen/dp_10"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_left" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_webview_close" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_share"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/icon_title_share"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:text="常见问题" />
|
||||
</FrameLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_drawable" />
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</WebView>
|
||||
</androidx.cardview.widget.CardView>
|
Reference in New Issue
Block a user