111
This commit is contained in:
@@ -21,6 +21,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
@@ -31,6 +32,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.android.billingclient.api.Purchase;
|
||||
import com.android.billingclient.api.SkuDetails;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.firebase.messaging.FirebaseMessaging;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.jakewharton.rxbinding3.view.RxView;
|
||||
@@ -122,10 +126,9 @@ import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import kotlin.Unit;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.isReady;
|
||||
|
||||
import kotlin.*;
|
||||
@Route(path = RouteUtil.PATH_MAIN)
|
||||
public class MainActivity extends AbsActivity implements MainAppBarLayoutListener {
|
||||
|
||||
@@ -270,11 +273,27 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
Display mDisplay = getWindowManager().getDefaultDisplay();
|
||||
Height = mDisplay.getHeight();
|
||||
// IMLib 初始化
|
||||
RongIMClient.init(this, RongcloudIMManager.RONG_IM_KEY);
|
||||
RongIMClient.init(this, RongcloudIMManager.RONG_IM_KEY,true);
|
||||
// RTCLib 初始化
|
||||
RCRTCConfig.Builder config = RCRTCConfig.Builder.create();
|
||||
RCRTCEngine.getInstance().init(MainActivity.this, config.build());
|
||||
|
||||
// FirebaseMessaging.getInstance().getToken()
|
||||
// .addOnCompleteListener(new OnCompleteListener<String>() {
|
||||
// @Override
|
||||
// public void onComplete(@NonNull Task<String> task) {
|
||||
// if (!task.isSuccessful()) {
|
||||
// Log.w(TAG, "Fetching FCM registration token failed", task.getException());
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // Get new FCM registration token
|
||||
// String token = task.getResult();
|
||||
//
|
||||
// // Log and toast
|
||||
// Log.d(TAG, token);
|
||||
// Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
|
||||
// }
|
||||
// });
|
||||
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
|
||||
mRootView = (ViewGroup) findViewById(R.id.rootView);
|
||||
floatBanner = findViewById(R.id.float_banner_home);
|
||||
@@ -380,7 +399,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Unit unit) {
|
||||
public void onNext(kotlin.Unit unit) {
|
||||
String Uid = floatBanner.getUid();
|
||||
LiveHttpUtil.getLiveInfo(Uid + "", new HttpCallback() {
|
||||
@Override
|
||||
|
||||
@@ -127,7 +127,7 @@ public class MyWebViewActivity extends AbsActivity {
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
L.e("H5-------->" + url);
|
||||
L.e("H5--------1>" + url);
|
||||
if (url.startsWith(Constants.COPY_PREFIX)) {
|
||||
String content = url.substring(Constants.COPY_PREFIX.length());
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class MyWebViewActivity2 extends AbsActivity {
|
||||
mWebView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
L.e("H5-------->" + url);
|
||||
L.e("H5--------1>" + url);
|
||||
if (url.startsWith(Constants.COPY_PREFIX)) {
|
||||
String content = url.substring(Constants.COPY_PREFIX.length());
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
|
||||
@@ -150,6 +150,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
});
|
||||
mWebView.getSettings().setJavaScriptEnabled(true); // 是否开启JS支持
|
||||
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
mWebView.addJavascriptInterface(new JsInteration(), "androidObject");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
@@ -336,7 +337,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
}
|
||||
Intent intent = new Intent(context, ZhuangBanActivity.class);
|
||||
Log.i("tag", url);
|
||||
Log.i("tag1212", url);
|
||||
intent.putExtra(Constants.URL, url);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
if (!bean.getSlide_url().equals("")) {
|
||||
Constants.isTitle = true;
|
||||
String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
|
||||
ZhuangBanActivity.forward(mContext, url, false);
|
||||
WebViewActivity.forward(mContext, url, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user