diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c0776bf39..f480d7cce 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -54,6 +54,7 @@
+
diff --git a/common/build.gradle b/common/build.gradle
index 907facb14..fe009a375 100644
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -86,6 +86,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
api files('libs/jcc-bate-0.7.3.jar')
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
+ api 'androidx.activity:activity:1.9.1'
api rootProject.ext.dependencies["appcompat-androidx"]
api rootProject.ext.dependencies["recyclerview-androidx"]
api rootProject.ext.dependencies["cardview-androidx"]
diff --git a/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java b/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java
index 541d223c6..9fd1b52ff 100644
--- a/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java
+++ b/common/src/main/java/com/yunbao/common/utils/ProcessImageUtil.java
@@ -3,13 +3,21 @@ package com.yunbao.common.utils;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.ImageDecoder;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
+
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.activity.result.PickVisualMediaRequest;
+import androidx.activity.result.contract.ActivityResultContracts;
+import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentActivity;
import androidx.core.content.FileProvider;
+import com.blankj.utilcode.util.LogUtils;
import com.yalantis.ucrop.UCrop;
import com.yalantis.ucrop.util.FileUtils;
import com.yunbao.common.CommonAppConfig;
@@ -39,6 +47,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
private ImageResultCallback mResultCallback;
private boolean mNeedCrop;//是否需要裁剪
private boolean mNeedGif;//允许gif图
+ ActivityResultLauncher launcher;
public void setNeedGif(boolean mNeedGif) {
this.mNeedGif = mNeedGif;
@@ -117,6 +126,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
return;
}
String path = FileUtils.getPath(mContext, intent.getData());
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+ ImageDecoder.Source source = ImageDecoder.createSource(mContext.getContentResolver(), intent.getData());
+ try {
+ Bitmap bitmap = ImageDecoder.decodeBitmap(source);
+ path=BitmapUtil.getInstance().saveBitmap(bitmap);
+ bitmap.recycle();
+ } catch (Exception e) {
+ e.printStackTrace();
+ mResultCallback.onFailure();
+ return;
+ }
+
+ }
File file = new File(path);
if (file.exists()) {
mResultCallback.onSuccess(file);
@@ -153,6 +175,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
}
}
};
+ launcher = ((AppCompatActivity) mContext).registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new androidx.activity.result.ActivityResultCallback() {
+ @Override
+ public void onActivityResult(Uri result) {
+ LogUtils.e("result:" + result);
+ if (result == null) {
+ mAlumbResultCallback.onFailure();
+ return;
+ }
+ Intent intent = new Intent();
+ intent.setData(result);
+ mAlumbResultCallback.onSuccess(intent);
+ }
+ });
}
/**
@@ -173,15 +208,28 @@ public class ProcessImageUtil extends ProcessResultUtil {
/**
* 相册获取图片
*/
- public void getImageByAlumb() {
+ public void getImageByAlbum() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+ showSystemPick();
+ return;
+ }
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
}
- public void getImageByAlumb(boolean needCrop) {
+ public void getImageByAlbum(boolean needCrop) {
this.mNeedCrop = needCrop;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+ showSystemPick();
+ return;
+ }
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
}
+ private void showSystemPick() {
+ PickVisualMediaRequest.Builder builder = new PickVisualMediaRequest.Builder()
+ .setMediaType(ActivityResultContracts.PickVisualMedia.ImageOnly.INSTANCE);
+ launcher.launch(builder.build());
+ }
/**
* 开启摄像头,执行照相
diff --git a/common/src/main/java/com/yunbao/common/utils/WordUtil.java b/common/src/main/java/com/yunbao/common/utils/WordUtil.java
index 657da30c4..a312b6b4e 100644
--- a/common/src/main/java/com/yunbao/common/utils/WordUtil.java
+++ b/common/src/main/java/com/yunbao/common/utils/WordUtil.java
@@ -35,7 +35,9 @@ public class WordUtil {
public static boolean isNewZh() {
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE
- || IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE ;
+ || IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.TRADITIONAL_CHINESE
+ || IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINESE
+ || IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.CHINA;
}
public static String getNewString(int res) {
diff --git a/common/src/main/res/values-en-rUS/strings.xml b/common/src/main/res/values-en-rUS/strings.xml
index e9012a958..6cc1bab90 100644
--- a/common/src/main/res/values-en-rUS/strings.xml
+++ b/common/src/main/res/values-en-rUS/strings.xml
@@ -796,8 +796,8 @@
6e90a23e0679c8d21b0888d5fa755535
- ui10vIggex2F043HnztYNuA3g
- J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ
+ JDd7XEXr0kLcx0KkkJGUbD4MQ
+ aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws
ZWRrZnRUNlBlcHVxMXpsMzVmb2k6MTpjaQ
aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws
diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml
index 37646658c..4cb3b319f 100644
--- a/common/src/main/res/values-zh/strings.xml
+++ b/common/src/main/res/values-zh/strings.xml
@@ -835,8 +835,9 @@
977019710454991
6e90a23e0679c8d21b0888d5fa755535
- ui10vIggex2F043HnztYNuA3g
- J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ
+ JDd7XEXr0kLcx0KkkJGUbD4MQ
+ aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws
+
F8t7PgspJ8Xl2k09ccqmnmynf
aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws
diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml
index a1bda6cb1..497e12e49 100644
--- a/common/src/main/res/values/strings.xml
+++ b/common/src/main/res/values/strings.xml
@@ -641,8 +641,8 @@
977019710454991
6e90a23e0679c8d21b0888d5fa755535
- ui10vIggex2F043HnztYNuA3g
- J8jvBBeJoZbVojbkWUrvsj0K0UUkuV69CqQ7CEobhJn6tvAKpQ
+ JDd7XEXr0kLcx0KkkJGUbD4MQ
+ aq0eV4R1pqMK_AAeKRWnjPr7ErGMGgTPGgZJdm73WeRY-Kluws
Complete the new person\'s pre task
Unlock custom features
diff --git a/dependencies.gradle b/dependencies.gradle
index fd32a5d29..740ce8126 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -22,7 +22,7 @@ ext {
// "tencent-bugly" : 'com.tencent.bugly:crashreport:2.6.6',//腾讯bugly
// "umeng-common" : 'com.umeng.sdk:common:1.5.3',//友盟统计
// "umeng-analytics" : 'com.umeng.sdk:analytics:7.5.3',//友盟统计
- "ucrop" : 'com.github.yalantis:ucrop:2.2.3',//图片裁剪
+ "ucrop" : 'com.github.yalantis:ucrop:2.2.9',//图片裁剪
"smartRefreshLayout" : 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-20',//下拉刷新上拉加载
"magicIndicator" : 'com.github.hackware1993:MagicIndicator:1.6.0',//ViewPager指示器
"banner" : 'com.ms:banner:1.0.0',//轮播图
diff --git a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java
index 3a6e7aada..6bc57f7ea 100644
--- a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java
+++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWManager.java
@@ -5,11 +5,16 @@ import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
+import android.hardware.camera2.CameraManager;
+import android.net.Uri;
+import android.text.TextUtils;
import android.view.SurfaceView;
import android.widget.FrameLayout;
+import androidx.annotation.NonNull;
import androidx.core.content.res.ResourcesCompat;
+import com.blankj.utilcode.util.LogUtils;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.SwTokenModel;
@@ -65,6 +70,7 @@ public class SWManager extends BaseCacheManager {
private ImageTrackOptions imageTrackOptions = null;
private onDrPkJoinSuccessListener onDrPkJoinSuccessListener;
+ String openCameraId = "1";
public void setOnDrPkJoinSuccessListener(SWManager.onDrPkJoinSuccessListener onDrPkJoinSuccessListener) {
this.onDrPkJoinSuccessListener = onDrPkJoinSuccessListener;
@@ -254,7 +260,20 @@ public class SWManager extends BaseCacheManager {
*/
public void switchCamera() {
if (mRtcEngine != null) {
- mRtcEngine.switchCamera();
+ if (openCameraId.equals("0")) {
+ mRtcEngine.switchCamera("1");
+ openCameraId = "1";
+ } else {
+ mRtcEngine.switchCamera("0");
+ openCameraId = "0";
+ }
+ }
+ }
+
+ public void resetCamera() {
+ LogUtils.e("重置摄像头", openCameraId);
+ if (mRtcEngine != null && !TextUtils.isEmpty(openCameraId)) {
+ mRtcEngine.switchCamera(openCameraId);
}
}
@@ -526,6 +545,9 @@ public class SWManager extends BaseCacheManager {
});
}
+ public void release() {
+ }
+
public interface onRtcEngineListener {
void onOpenSuccess(String channel, int uid);
diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java
index 129445c10..052e063fa 100644
--- a/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java
+++ b/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java
@@ -237,7 +237,7 @@ public class LiveReportAdapter extends RecyclerView.Adapter {
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
}
}
});
diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java
index 47c9411d7..f8d3d1b21 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java
@@ -732,7 +732,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
*/
private void setAvatar() {
if (mLiveSdk == Constants.LIVE_SDK_TX) {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
} else {
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
@@ -741,7 +741,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
}
}
});
diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java
index ffbbca3a2..17378f3c4 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java
@@ -782,7 +782,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
*/
private void setAvatar() {
if (mLiveSdk == Constants.LIVE_SDK_TX) {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum(true);
} else {
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
@@ -791,7 +791,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum(true);
}
}
});
diff --git a/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java
index d281ec6a8..9f84f9d85 100644
--- a/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java
@@ -504,8 +504,9 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
public void onResume() {
mPaused = false;
Log.i("摄像头", "onResume: " + isNeedOpenCamera);
+ swManager.resetCamera();
if (isNeedOpenCamera) {
- RCRTCEngine.getInstance().getDefaultVideoStream().startCamera(new IRCRTCResultDataCallback() {
+ /*RCRTCEngine.getInstance().getDefaultVideoStream().startCamera(new IRCRTCResultDataCallback() {
@Override
public void onSuccess(Boolean data) {
//设置摄像头最大缩放比例
@@ -519,7 +520,7 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
public void onFailed(RTCErrorCode errorCode) {
Log.i("摄像头", "onFailed: 打开摄像头失败 " + errorCode);
}
- });
+ });*/
}
}
@@ -549,6 +550,8 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX
public void release() {
super.release();
Bus.getOff(this);
+ onDestroy();
+ SWManager.get().release();
LiveHttpUtil.cancel(LiveHttpConsts.LINK_MIC_TX_MIX_STREAM);
rtcRoom = null;
}
diff --git a/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java
index 8d44d530f..6e26b6276 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveReadyRyViewHolder.java
@@ -35,7 +35,6 @@ import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveChooseClassActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
-import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.adapter.LiveReadyShareAdapter;
import com.yunbao.common.bean.LiveRoomTypeBean;
import com.yunbao.live.dialog.LiveRoomTypeDialogFragment;
@@ -262,7 +261,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
*/
private void setAvatar() {
if (mLiveSdk == Constants.LIVE_SDK_TX) {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
} else {
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
@@ -271,7 +270,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
}
}
});
diff --git a/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java
index a19123a46..6f88ab017 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveReadyViewHolder.java
@@ -285,7 +285,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
*/
private void setAvatar() {
if (mLiveSdk == Constants.LIVE_SDK_TX) {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
} else {
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
@@ -294,7 +294,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
}
}
});
diff --git a/main/src/main/java/com/yunbao/main/activity/CompleteUserInfoActivity.java b/main/src/main/java/com/yunbao/main/activity/CompleteUserInfoActivity.java
index b6328db14..a1281e664 100644
--- a/main/src/main/java/com/yunbao/main/activity/CompleteUserInfoActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/CompleteUserInfoActivity.java
@@ -218,7 +218,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
if (isCamera) {
cameraUtil.getImageByCamera();
} else {
- cameraUtil.getImageByAlumb();
+ cameraUtil.getImageByAlbum();
}
});
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
diff --git a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java
index 23e020744..5bde4bb94 100644
--- a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java
@@ -546,7 +546,7 @@ public class EditProfileActivity extends AbsActivity {
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else if (tag == R.string.alumb) {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum(true);
} else {
RouteUtil.forwardUserAvatarSelect();
}
diff --git a/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java b/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java
index 61a3df228..0e654e3a7 100644
--- a/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/FeedbackEditActivity.java
@@ -33,8 +33,6 @@ import com.yunbao.main.R;
import java.io.File;
import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
public class FeedbackEditActivity extends AbsActivity {
@@ -299,7 +297,7 @@ public class FeedbackEditActivity extends AbsActivity {
loadingDialog = DialogUitl.loadingDialog(mContext);
loadingDialog.show();
if (tag == 1) {
- imageUtil.getImageByAlumb(false);
+ imageUtil.getImageByAlbum(false);
} else {
imageUtil.getImageByCamera(false);
}
diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java
index 2305ea97f..254cb9766 100644
--- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java
@@ -41,6 +41,7 @@ import androidx.viewpager.widget.ViewPager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
+import com.blankj.utilcode.util.LogUtils;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jakewharton.rxbinding3.view.RxView;
@@ -137,7 +138,7 @@ import com.yunbao.main.views.MainHomeViewHolder;
import com.yunbao.main.views.MainMeViewHolder;
import com.yunbao.main.views.MainMessageViewHolder;
import com.yunbao.video.utils.VideoStorge;
-
+import com.yunbao.common.CommonAppContext;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@@ -224,7 +225,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
super.create();
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
-
}
@Override
@@ -235,6 +235,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
protected void main() {
+ LogUtils.e("MainActivity",
+ "语言:"+IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage(),
+ "测试文本:"+getString(R.string.hot)
+ );
+ ToastUtil.showDebug("打包时间:"+CommonAppConfig.BUILD_TIME+"\n系统语言:"+IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage());
//初始化声网
SWAuManager.get().initRtcEngine(this);
ActivityCompat.postponeEnterTransition(this);
@@ -352,6 +357,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
frameLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
mViewList.add(frameLayout);
}
+ mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, mViewList.get(0));
+
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
@@ -1281,7 +1288,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
return;
}
if (position == 0) {
- mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
+ //mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
vh = mainHomeComViewHolder;
} else if (position == 1) {
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
diff --git a/main/src/main/java/com/yunbao/main/activity/MessageHiConfigActivity.java b/main/src/main/java/com/yunbao/main/activity/MessageHiConfigActivity.java
index b8835eeb1..e823d6a07 100644
--- a/main/src/main/java/com/yunbao/main/activity/MessageHiConfigActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/MessageHiConfigActivity.java
@@ -409,7 +409,7 @@ public class MessageHiConfigActivity extends AbsActivity {
}
}
});
- imageUtil.getImageByAlumb();
+ imageUtil.getImageByAlbum();
loading = DialogUitl.loadingDialog(mContext);
loading.show();
}
diff --git a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java
index 3f9271639..ce9e2b291 100644
--- a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java
@@ -586,7 +586,7 @@ public class MyWebViewActivity extends AbsActivity {
if (tag == com.yunbao.main.R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
}
}
});
diff --git a/main/src/main/java/com/yunbao/main/activity/OneLoginActivity.java b/main/src/main/java/com/yunbao/main/activity/OneLoginActivity.java
index eade89493..c862ccf60 100644
--- a/main/src/main/java/com/yunbao/main/activity/OneLoginActivity.java
+++ b/main/src/main/java/com/yunbao/main/activity/OneLoginActivity.java
@@ -49,7 +49,7 @@ public class OneLoginActivity extends AbsActivity {
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
- mImageUtil.getImageByAlumb();
+ mImageUtil.getImageByAlbum();
}
}
});
diff --git a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
index d36f91ea1..c31076a13 100644
--- a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
+++ b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java
@@ -174,7 +174,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
if (isAnchor) {
String[] permissions;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+ permissions = new String[]{
+ Manifest.permission.CAMERA,
+ Manifest.permission.RECORD_AUDIO
+ };
+ } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
permissions = new String[]{
//Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请
Manifest.permission.CAMERA,
@@ -200,7 +205,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
if (isAnchor) {
String[] permissions;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+ permissions = new String[]{
+ Manifest.permission.CAMERA,
+ Manifest.permission.RECORD_AUDIO
+ };
+ } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
permissions = new String[]{
Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.CAMERA,
@@ -239,9 +249,9 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
JSONObject obj = JSON.parseObject(info[0]);
JSONObject obj1 = JSON.parseObject(info1[0]);
try {
- if(code==201){ //声网
+ if (code == 201) { //声网
LiveSwAnchorActivity.forward(mContext, Constants.LIVE_SDK_SW, JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
- }else if(code==200){//融云
+ } else if (code == 200) {//融云
LiveRyAnchorActivity.forward(mContext, obj.getIntValue("live_sdk"), JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class));
}
} catch (Exception e) {
@@ -316,7 +326,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
if (i == R.id.btn_close) {
} else if (i == R.id.btn_live) {
if (isWifiProxy(mContext) || checkVPN((ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE))) {
- ToastUtil.show(WordUtil.isNewZh()?"檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。":
+ ToastUtil.show(WordUtil.isNewZh() ? "檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。" :
"It is detected that VPN or proxy is turned on. Please turn off VPN or proxy before starting the broadcast.");
DebugUtils.runDebugCode(() -> mCallback.onLiveClick());
} else {
@@ -332,6 +342,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
}
}
}
+
private boolean isWifiProxy(Context context) {
final boolean IS_ICS_OR_LATER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
String proxyAddress;
@@ -353,6 +364,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
boolean isVpnConn = networkInfo == null ? false : networkInfo.isConnected();
return isVpnConn;
}
+
@Override
public void onDestroy() {
super.onDestroy();
diff --git a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java
index 9eb1c2820..7c8498cb3 100644
--- a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java
+++ b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java
@@ -514,7 +514,7 @@ public class MainHttpUtil {
HttpClient.getInstance().get("Login.getCode", MainHttpConsts.GET_REGISTER_CODE)
.params("mobile", mobile)
.params("sign", sign)
- .params("source", "1")
+ .params("source", "2")
.params("langue", WordUtil.isNewZh()?"chinese":"english")
.execute(callback);
}
@@ -537,7 +537,7 @@ public class MainHttpUtil {
.params("Ticket", Ticket)
.params("MacAddress", macUitl.getNewMac())
.params("Imei", uuid)
- .params("source", "1")
+ .params("source", "2")
.params("langue", WordUtil.isNewZh()?"chinese":"english")
.execute(callback);
}
@@ -647,7 +647,7 @@ public class MainHttpUtil {
HttpClient.getInstance().get("Login.getCode", MainHttpConsts.GET_FIND_PWD_CODE)
.params("mobile", mobile)
.params("country_code", country_code)
- .params("source", "1")
+ .params("source", "2")
.params("langue", WordUtil.isNewZh()?"chinese":"english")
.execute(callback);
}
diff --git a/main/src/main/res/mipmap-xxxhdpi/login_twitter.png b/main/src/main/res/mipmap-xxxhdpi/login_twitter.png
index 19654b8ee..4ae6abcf1 100644
Binary files a/main/src/main/res/mipmap-xxxhdpi/login_twitter.png and b/main/src/main/res/mipmap-xxxhdpi/login_twitter.png differ
diff --git a/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java
index ca9b69667..94421560e 100644
--- a/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java
+++ b/video/src/main/java/com/yunbao/video/views/VideoPlayViewHolder.java
@@ -6,6 +6,7 @@ import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
+import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;