修复测试反馈内容
This commit is contained in:
@@ -11,11 +11,13 @@ import android.content.pm.ResolveInfo;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
@@ -27,6 +29,8 @@ import android.webkit.WebViewClient;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
@@ -55,6 +59,7 @@ import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -82,8 +87,10 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
private View v_spacing;
|
||||
private LinearLayout lt_title;
|
||||
private List<String> HTTP_SCHEMES = Arrays.asList("http", "https");
|
||||
|
||||
@Override
|
||||
public void setStatusBar() {
|
||||
super.setStatusBar();
|
||||
// getWindow().setStatusBarColor(Color.parseColor("#FFFFFF"));
|
||||
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
@@ -94,6 +101,12 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
return R.layout.activity_zhuang_ban;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void create() {
|
||||
super.create();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
Bus.getOn(this);
|
||||
@@ -154,6 +167,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
}
|
||||
int height = view.getMeasuredHeight();
|
||||
Log.e("网页高度", height + "");
|
||||
view.loadUrl("javascript:setTop(" + DpUtil.dp2px(15) + ")");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -439,37 +453,38 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the url and open it by system function.
|
||||
* case 1: deal "intent://xxxx" url.
|
||||
* case 2: deal custom scheme. url
|
||||
* case 1: deal "intent://xxxx" url.
|
||||
* case 2: deal custom scheme. url
|
||||
*
|
||||
* @param view: WebView
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
private boolean shouldOverrideUrlLoadingInner(WebView view, String url) {
|
||||
if(!TextUtils.isEmpty(url)) {
|
||||
if (!TextUtils.isEmpty(url)) {
|
||||
Uri uri = Uri.parse(url);
|
||||
if(uri != null) {
|
||||
if (uri != null) {
|
||||
if ("intent".equals(uri.getScheme())) {
|
||||
try {
|
||||
Intent intent = Intent.parseUri(uri.toString(), Intent.URI_INTENT_SCHEME);
|
||||
if(intent != null) {
|
||||
if (intent != null) {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
ResolveInfo info = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
if(info != null) {
|
||||
if (info != null) {
|
||||
mContext.startActivity(Intent.parseUri(uri.toString(), Intent.URI_INTENT_SCHEME));
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
String fallbackUrl = intent.getStringExtra("browser_fallback_url");
|
||||
if (!TextUtils.isEmpty(fallbackUrl)) {
|
||||
if(fallbackUrl.startsWith("market://"))
|
||||
if (fallbackUrl.startsWith("market://"))
|
||||
startAppMarketWithUrl(mContext, fallbackUrl, false);
|
||||
else
|
||||
view.loadUrl(fallbackUrl);
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
mContext.startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||
}
|
||||
}
|
||||
@@ -485,6 +500,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void startAppMarketWithUrl(Activity context, String url, boolean forceUseGoogle) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
@@ -495,9 +511,11 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
startUrl(context, url, true);
|
||||
} catch (Exception e1) {}
|
||||
} catch (Exception e1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasActivity(Context context, Intent intent, String packageName) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
List<ResolveInfo> appList = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
@@ -507,11 +525,12 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void startUrl(Context context, String url, boolean isNewTask) {
|
||||
if(context != null && !TextUtils.isEmpty(url)) {
|
||||
if (context != null && !TextUtils.isEmpty(url)) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
if(isNewTask) {
|
||||
if (isNewTask) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
context.startActivity(intent);
|
||||
|
||||
@@ -69,7 +69,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
@Override
|
||||
public void run() {
|
||||
new GiftWallDialog(mContext, IMLoginManager.get(mContext).getUserInfo().getId() + "",
|
||||
IMLoginManager.get(mContext).getUserInfo().getUserNicename()
|
||||
IMLoginManager.get(mContext).getUserInfo().getUserNicename(),null
|
||||
, false).setFullWindows(true).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,6 +23,11 @@ public class TestWebViewClient extends WebViewClient {
|
||||
private List<String> HTTP_SCHEMES = Arrays.asList("http", "https");
|
||||
public TestWebViewClient(Activity context, WebView webView) {
|
||||
this.mContext = context;
|
||||
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
webView.getSettings().setDomStorageEnabled(true);
|
||||
webView.getSettings().setUseWideViewPort(true);
|
||||
webView.getSettings().setLoadWithOverviewMode(true);
|
||||
}
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
|
||||
Reference in New Issue
Block a user