diff --git a/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java b/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java index a56b42658..762980571 100644 --- a/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/MainHomeCommunityFragment.java @@ -8,6 +8,8 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -65,14 +67,18 @@ import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.MyWalletActivity; import com.yunbao.main.dialog.EncourageDialog; import com.yunbao.main.utils.BottomBarUtil; +import com.yunbao.main.utils.UIUtils; import com.yunbao.share.ui.SharePopDialog; import com.yunbao.video.activity.VideoPlayActivity; import com.yunbao.video.utils.VideoStorge; +import net.lucode.hackware.magicindicator.buildins.UIUtil; + import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.Arrays; +import java.util.List; import java.util.Locale; public class MainHomeCommunityFragment extends BaseFragment { @@ -180,6 +186,18 @@ public class MainHomeCommunityFragment extends BaseFragment { view.loadUrl(jsUrl); view.reload(); } + + view.postDelayed(new Runnable(){ + @Override + public void run() { + int height = view.getMeasuredHeight(); + + int starHeight = UIUtils.getStatusBarHeight(mContext); + Log.e("网页高度", height + ""); + view.loadUrl("javascript:setTop(" + 200 + ")"); + } + },3000); + } }); mWebView.setWebChromeClient(new WebChromeClient() { diff --git a/main/src/main/java/com/yunbao/main/utils/UIUtils.java b/main/src/main/java/com/yunbao/main/utils/UIUtils.java new file mode 100644 index 000000000..24e3f237b --- /dev/null +++ b/main/src/main/java/com/yunbao/main/utils/UIUtils.java @@ -0,0 +1,14 @@ +package com.yunbao.main.utils; + +import android.content.Context; + +public class UIUtils { + public static int getStatusBarHeight(Context mContext) { + int result = 0; + int resourceId = mContext.getResources().getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = mContext.getResources().getDimensionPixelSize(resourceId); + } + return result; + } +} diff --git a/main/src/main/res/layout/view_main_encourage.xml b/main/src/main/res/layout/view_main_encourage.xml index d09c5d0bb..7a7ab6015 100644 --- a/main/src/main/res/layout/view_main_encourage.xml +++ b/main/src/main/res/layout/view_main_encourage.xml @@ -4,7 +4,6 @@ android:layout_height="match_parent">