Merge remote-tracking branch 'origin/master' into pdlive_samsung
# Conflicts: # config.gradle # main/src/main/java/com/yunbao/main/activity/GoogleFragment.java
This commit is contained in:
@@ -40,6 +40,8 @@ public class GoogleFragment extends Fragment {
|
||||
|
||||
GoogleUtils googleUtils;
|
||||
|
||||
boolean isGoogleService = true;
|
||||
|
||||
public GoogleFragment() {
|
||||
}
|
||||
|
||||
@@ -59,8 +61,14 @@ public class GoogleFragment extends Fragment {
|
||||
rlWebview = (WebView) view.findViewById(R.id.rlWebview);
|
||||
Log.e("ttt", url);
|
||||
rlWebview.loadUrl(url);
|
||||
initGooglePay();
|
||||
|
||||
googleUtils = new GoogleUtils(getActivity());
|
||||
|
||||
// 验证是否已在此设备上安装并启用Google Play服务,以及此设备上安装的旧版本是否为此客户端所需的版本
|
||||
if (googleUtils.getGoogleService()) {
|
||||
isGoogleService = true;
|
||||
// 支持Google服务
|
||||
initGooglePay();
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -68,7 +76,6 @@ public class GoogleFragment extends Fragment {
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
WebSettings webSettings = rlWebview.getSettings();
|
||||
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
|
||||
@@ -91,7 +91,6 @@ import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.LocationUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
@@ -511,6 +510,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
isfloatBannernet = false;
|
||||
}
|
||||
mViewHolders[index].onResume();
|
||||
});
|
||||
//获取指导员账号
|
||||
ConversationIMListManager.get(this).getUserInstructor(this);
|
||||
@@ -860,7 +860,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
NoviceInstructorManager.get(mContext).getNoviceInstructor();
|
||||
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
|
||||
initAnchorRecommendBanner();
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1302,7 +1301,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
messageNumber = event.getNumber();
|
||||
if (event.getNumber() > 0) {
|
||||
v_table_redpoint.setVisibility(View.VISIBLE);
|
||||
v_table_redpoint.setText(event.getNumber() + "");
|
||||
if (event.getNumber() > 99) {
|
||||
v_table_redpoint.setText("99+");
|
||||
} else {
|
||||
v_table_redpoint.setText(event.getNumber() + "");
|
||||
}
|
||||
|
||||
} else {
|
||||
v_table_redpoint.setVisibility(View.GONE);
|
||||
v_table_redpoint.setText("");
|
||||
|
||||
@@ -17,6 +17,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
@@ -55,6 +56,7 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.views.LoadingView;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
@@ -101,7 +103,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
Bus.getOn(this);
|
||||
String url = HtmlConfig.ENCOURAGE + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()
|
||||
+ "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
|
||||
// String url = "https://coolshi.feioou.com/testAndroid.html";
|
||||
// String url = "https://api.coolydrama.com/?agentCode=186279";
|
||||
final LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
mWebView = new WebView(mContext);
|
||||
@@ -118,6 +120,12 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
cookieManager.setAcceptThirdPartyCookies(mWebView, true);
|
||||
} else {
|
||||
cookieManager.setAcceptCookie(true);
|
||||
}
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
@@ -399,6 +407,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
public void onSuccess(CoolConfig data) {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.autoOpenSoftInput(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() {
|
||||
@Override
|
||||
@@ -417,6 +426,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
}
|
||||
});
|
||||
} else if (TextUtils.equals(data, "1")) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "兑换成功" : "Successful exchange");
|
||||
mWebView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.LiveClassManager;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
@@ -557,6 +558,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,6 +104,12 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mViewHolders[mViewPager.getCurrentItem()].onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPageCount() {
|
||||
return 4;
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -29,10 +30,12 @@ import com.yunbao.common.bean.ImUserInfoModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
@@ -41,8 +44,6 @@ import com.yunbao.live.activity.SystemMessageActivity;
|
||||
import com.yunbao.live.bean.ImUserBean;
|
||||
import com.yunbao.live.event.RecommendLiveRoomEvent;
|
||||
import com.yunbao.live.http.ImHttpUtil;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.adapter.SystemMessageAdapter;
|
||||
@@ -229,7 +230,15 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsNotice.setVisibility(View.GONE);
|
||||
} else {
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
textNewsNotice.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsNotice.setText("99+");
|
||||
} else {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsNotice.setText(String.valueOf(numberInt));
|
||||
}
|
||||
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgNewsNotice);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> {
|
||||
@@ -249,7 +258,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsInteraction.setVisibility(View.GONE);
|
||||
} else {
|
||||
textNewsInteraction.setVisibility(View.VISIBLE);
|
||||
textNewsInteraction.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsInteraction.setText("99+");
|
||||
} else {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsInteraction.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgNewsInteraction);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> {
|
||||
@@ -269,7 +285,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsOnline.setVisibility(View.GONE);
|
||||
} else {
|
||||
textNewsOnline.setVisibility(View.VISIBLE);
|
||||
textNewsOnline.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsOnline.setText("99+");
|
||||
} else {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsOnline.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgNewsOnline);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> {
|
||||
@@ -278,7 +301,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
netHandler.post(systemNumberRunnable);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
|
||||
if (userBean.getLink() != null && !"".equals(userBean.getLink())) {
|
||||
// WebViewActivity.forward(mContext, userBean.getLink());
|
||||
// WebViewActivity.forward(mContext, userBean.getLink());
|
||||
RouteUtil.forwardCustomerService(userBean.getLink());
|
||||
} else {
|
||||
mContext.startActivity(new Intent(mContext, SystemMessageActivity.class)
|
||||
@@ -295,7 +318,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textSystemMessages.setVisibility(View.GONE);
|
||||
} else {
|
||||
textSystemMessages.setVisibility(View.VISIBLE);
|
||||
textSystemMessages.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textSystemMessages.setText("99+");
|
||||
} else {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textSystemMessages.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> {
|
||||
@@ -402,9 +432,16 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsNotice.setText("");
|
||||
} else {
|
||||
String number = textNewsNotice.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
textNewsNotice.setText(String.valueOf(numberInt));
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
if (numberInt > 99) {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsNotice.setText("99+");
|
||||
} else {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsNotice.setText(String.valueOf(numberInt));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -417,7 +454,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
String number = textNewsInteraction.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textNewsInteraction.setVisibility(View.VISIBLE);
|
||||
textNewsInteraction.setText(String.valueOf(numberInt));
|
||||
if (numberInt > 99) {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsInteraction.setText("99+");
|
||||
} else {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsInteraction.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -431,7 +474,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
String number = textNewsOnline.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textNewsOnline.setVisibility(View.VISIBLE);
|
||||
textNewsOnline.setText(String.valueOf(numberInt));
|
||||
if (numberInt > 99) {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsOnline.setText("99+");
|
||||
} else {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsOnline.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
break; //在線客服
|
||||
case "4":
|
||||
@@ -442,7 +491,13 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
String number = textSystemMessages.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textSystemMessages.setVisibility(View.VISIBLE);
|
||||
textSystemMessages.setText(String.valueOf(numberInt));
|
||||
if (numberInt > 99) {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textSystemMessages.setText("99+");
|
||||
} else {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textSystemMessages.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="45dp"
|
||||
android:layout_marginBottom="68dp"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<ProgressBar
|
||||
|
||||
@@ -52,8 +52,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_news_notice"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
@@ -81,8 +81,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_system_messages"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
@@ -108,8 +108,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_news_interaction"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
@@ -135,8 +135,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_news_online"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
|
||||
Reference in New Issue
Block a user