合并了图片选择 现在能跑起来了
This commit is contained in:
parent
eb594fcfce
commit
39dc287623
@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||||
<uses-permission android:name="android.permission.NETWORK_PROVIDER" />
|
<uses-permission android:name="android.permission.NETWORK_PROVIDER" />
|
||||||
|
@ -86,6 +86,7 @@ dependencies {
|
|||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
api files('libs/jcc-bate-0.7.3.jar')
|
api files('libs/jcc-bate-0.7.3.jar')
|
||||||
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
compileOnly fileTree(dir: '../libs', include: ['*.aar'])
|
||||||
|
api 'androidx.activity:activity:1.9.1'
|
||||||
api rootProject.ext.dependencies["appcompat-androidx"]
|
api rootProject.ext.dependencies["appcompat-androidx"]
|
||||||
api rootProject.ext.dependencies["recyclerview-androidx"]
|
api rootProject.ext.dependencies["recyclerview-androidx"]
|
||||||
api rootProject.ext.dependencies["cardview-androidx"]
|
api rootProject.ext.dependencies["cardview-androidx"]
|
||||||
|
@ -3,13 +3,21 @@ package com.yunbao.common.utils;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.ImageDecoder;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.provider.MediaStore;
|
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.fragment.app.FragmentActivity;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.yalantis.ucrop.UCrop;
|
import com.yalantis.ucrop.UCrop;
|
||||||
import com.yalantis.ucrop.util.FileUtils;
|
import com.yalantis.ucrop.util.FileUtils;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
@ -39,6 +47,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
private ImageResultCallback mResultCallback;
|
private ImageResultCallback mResultCallback;
|
||||||
private boolean mNeedCrop;//是否需要裁剪
|
private boolean mNeedCrop;//是否需要裁剪
|
||||||
private boolean mNeedGif;//允许gif图
|
private boolean mNeedGif;//允许gif图
|
||||||
|
ActivityResultLauncher<PickVisualMediaRequest> launcher;
|
||||||
|
|
||||||
public void setNeedGif(boolean mNeedGif) {
|
public void setNeedGif(boolean mNeedGif) {
|
||||||
this.mNeedGif = mNeedGif;
|
this.mNeedGif = mNeedGif;
|
||||||
@ -117,6 +126,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String path = FileUtils.getPath(mContext, intent.getData());
|
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);
|
File file = new File(path);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
mResultCallback.onSuccess(file);
|
mResultCallback.onSuccess(file);
|
||||||
@ -153,6 +175,19 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
launcher = ((AppCompatActivity) mContext).registerForActivityResult(new ActivityResultContracts.PickVisualMedia(), new androidx.activity.result.ActivityResultCallback<Uri>() {
|
||||||
|
@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);
|
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getImageByAlumb(boolean needCrop) {
|
public void getImageByAlbum(boolean needCrop) {
|
||||||
this.mNeedCrop = needCrop;
|
this.mNeedCrop = needCrop;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||||
|
showSystemPick();
|
||||||
|
return;
|
||||||
|
}
|
||||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showSystemPick() {
|
||||||
|
PickVisualMediaRequest.Builder builder = new PickVisualMediaRequest.Builder()
|
||||||
|
.setMediaType(ActivityResultContracts.PickVisualMedia.ImageOnly.INSTANCE);
|
||||||
|
launcher.launch(builder.build());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启摄像头,执行照相
|
* 开启摄像头,执行照相
|
||||||
|
@ -35,7 +35,9 @@ public class WordUtil {
|
|||||||
|
|
||||||
public static boolean isNewZh() {
|
public static boolean isNewZh() {
|
||||||
return IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE
|
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) {
|
public static String getNewString(int res) {
|
||||||
|
@ -22,7 +22,7 @@ ext {
|
|||||||
// "tencent-bugly" : 'com.tencent.bugly:crashreport:2.6.6',//腾讯bugly
|
// "tencent-bugly" : 'com.tencent.bugly:crashreport:2.6.6',//腾讯bugly
|
||||||
// "umeng-common" : 'com.umeng.sdk:common:1.5.3',//友盟统计
|
// "umeng-common" : 'com.umeng.sdk:common:1.5.3',//友盟统计
|
||||||
// "umeng-analytics" : 'com.umeng.sdk:analytics:7.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',//下拉刷新上拉加载
|
"smartRefreshLayout" : 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-20',//下拉刷新上拉加载
|
||||||
"magicIndicator" : 'com.github.hackware1993:MagicIndicator:1.6.0',//ViewPager指示器
|
"magicIndicator" : 'com.github.hackware1993:MagicIndicator:1.6.0',//ViewPager指示器
|
||||||
"banner" : 'com.ms:banner:1.0.0',//轮播图
|
"banner" : 'com.ms:banner:1.0.0',//轮播图
|
||||||
|
@ -237,7 +237,7 @@ public class LiveReportAdapter extends RecyclerView.Adapter {
|
|||||||
if (tag == R.string.camera) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -691,7 +691,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
*/
|
*/
|
||||||
private void setAvatar() {
|
private void setAvatar() {
|
||||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
} else {
|
} else {
|
||||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||||
@ -700,7 +700,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
if (tag == R.string.camera) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -673,7 +673,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
*/
|
*/
|
||||||
private void setAvatar() {
|
private void setAvatar() {
|
||||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum(true);
|
||||||
} else {
|
} else {
|
||||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
||||||
@ -682,7 +682,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
if (tag == R.string.camera) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -35,7 +35,6 @@ import com.yunbao.live.R;
|
|||||||
import com.yunbao.live.activity.LiveActivity;
|
import com.yunbao.live.activity.LiveActivity;
|
||||||
import com.yunbao.live.activity.LiveChooseClassActivity;
|
import com.yunbao.live.activity.LiveChooseClassActivity;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
|
||||||
import com.yunbao.live.adapter.LiveReadyShareAdapter;
|
import com.yunbao.live.adapter.LiveReadyShareAdapter;
|
||||||
import com.yunbao.common.bean.LiveRoomTypeBean;
|
import com.yunbao.common.bean.LiveRoomTypeBean;
|
||||||
import com.yunbao.live.dialog.LiveRoomTypeDialogFragment;
|
import com.yunbao.live.dialog.LiveRoomTypeDialogFragment;
|
||||||
@ -262,7 +261,7 @@ public class LiveReadyRyViewHolder extends AbsViewHolder implements View.OnClick
|
|||||||
*/
|
*/
|
||||||
private void setAvatar() {
|
private void setAvatar() {
|
||||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
} else {
|
} else {
|
||||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
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) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -285,7 +285,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
|
|||||||
*/
|
*/
|
||||||
private void setAvatar() {
|
private void setAvatar() {
|
||||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
} else {
|
} else {
|
||||||
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
|
||||||
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
|
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) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -218,7 +218,7 @@ public class CompleteUserInfoActivity extends AbsActivity {
|
|||||||
if (isCamera) {
|
if (isCamera) {
|
||||||
cameraUtil.getImageByCamera();
|
cameraUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
cameraUtil.getImageByAlumb();
|
cameraUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
new XPopup.Builder(mContext).asCustom(userAvatarPopup).show();
|
||||||
|
@ -546,7 +546,7 @@ public class EditProfileActivity extends AbsActivity {
|
|||||||
if (tag == R.string.camera) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else if (tag == R.string.alumb) {
|
} else if (tag == R.string.alumb) {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum(true);
|
||||||
} else {
|
} else {
|
||||||
RouteUtil.forwardUserAvatarSelect();
|
RouteUtil.forwardUserAvatarSelect();
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,6 @@ import com.yunbao.main.R;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
|
@Route(path = RouteUtil.PATH_FEEDBACK_EDIT_ACTIVITY)
|
||||||
public class FeedbackEditActivity extends AbsActivity {
|
public class FeedbackEditActivity extends AbsActivity {
|
||||||
@ -299,7 +297,7 @@ public class FeedbackEditActivity extends AbsActivity {
|
|||||||
loadingDialog = DialogUitl.loadingDialog(mContext);
|
loadingDialog = DialogUitl.loadingDialog(mContext);
|
||||||
loadingDialog.show();
|
loadingDialog.show();
|
||||||
if (tag == 1) {
|
if (tag == 1) {
|
||||||
imageUtil.getImageByAlumb(false);
|
imageUtil.getImageByAlbum(false);
|
||||||
} else {
|
} else {
|
||||||
imageUtil.getImageByCamera(false);
|
imageUtil.getImageByCamera(false);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import androidx.viewpager.widget.ViewPager;
|
|||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.jakewharton.rxbinding3.view.RxView;
|
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.MainMeViewHolder;
|
||||||
import com.yunbao.main.views.MainMessageViewHolder;
|
import com.yunbao.main.views.MainMessageViewHolder;
|
||||||
import com.yunbao.video.utils.VideoStorge;
|
import com.yunbao.video.utils.VideoStorge;
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
@ -224,7 +225,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
super.create();
|
super.create();
|
||||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -235,6 +235,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
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);
|
SWAuManager.get().initRtcEngine(this);
|
||||||
ActivityCompat.postponeEnterTransition(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));
|
frameLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||||
mViewList.add(frameLayout);
|
mViewList.add(frameLayout);
|
||||||
}
|
}
|
||||||
|
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, mViewList.get(0));
|
||||||
|
|
||||||
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
|
mViewPager.setAdapter(new ViewPagerAdapter(mViewList));
|
||||||
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -1281,7 +1288,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (position == 0) {
|
if (position == 0) {
|
||||||
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
//mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
|
||||||
vh = mainHomeComViewHolder;
|
vh = mainHomeComViewHolder;
|
||||||
} else if (position == 1) {
|
} else if (position == 1) {
|
||||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||||
|
@ -409,7 +409,7 @@ public class MessageHiConfigActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
imageUtil.getImageByAlumb();
|
imageUtil.getImageByAlbum();
|
||||||
loading = DialogUitl.loadingDialog(mContext);
|
loading = DialogUitl.loadingDialog(mContext);
|
||||||
loading.show();
|
loading.show();
|
||||||
}
|
}
|
||||||
|
@ -586,7 +586,7 @@ public class MyWebViewActivity extends AbsActivity {
|
|||||||
if (tag == com.yunbao.main.R.string.camera) {
|
if (tag == com.yunbao.main.R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -49,7 +49,7 @@ public class OneLoginActivity extends AbsActivity {
|
|||||||
if (tag == R.string.camera) {
|
if (tag == R.string.camera) {
|
||||||
mImageUtil.getImageByCamera();
|
mImageUtil.getImageByCamera();
|
||||||
} else {
|
} else {
|
||||||
mImageUtil.getImageByAlumb();
|
mImageUtil.getImageByAlbum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -174,7 +174,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||||
if (isAnchor) {
|
if (isAnchor) {
|
||||||
String[] permissions;
|
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[]{
|
permissions = new String[]{
|
||||||
//Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请
|
//Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请
|
||||||
Manifest.permission.CAMERA,
|
Manifest.permission.CAMERA,
|
||||||
@ -200,7 +205,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
boolean isAnchor = IMLoginManager.get(mContext).getUserInfo().anchorUserType();
|
||||||
if (isAnchor) {
|
if (isAnchor) {
|
||||||
String[] permissions;
|
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[]{
|
permissions = new String[]{
|
||||||
Manifest.permission.READ_MEDIA_IMAGES,
|
Manifest.permission.READ_MEDIA_IMAGES,
|
||||||
Manifest.permission.CAMERA,
|
Manifest.permission.CAMERA,
|
||||||
@ -332,6 +342,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isWifiProxy(Context context) {
|
private boolean isWifiProxy(Context context) {
|
||||||
final boolean IS_ICS_OR_LATER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
final boolean IS_ICS_OR_LATER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
||||||
String proxyAddress;
|
String proxyAddress;
|
||||||
@ -353,6 +364,7 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
boolean isVpnConn = networkInfo == null ? false : networkInfo.isConnected();
|
boolean isVpnConn = networkInfo == null ? false : networkInfo.isConnected();
|
||||||
return isVpnConn;
|
return isVpnConn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
@ -6,6 +6,7 @@ import android.content.Context;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AccelerateInterpolator;
|
import android.view.animation.AccelerateInterpolator;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||||
|
Loading…
Reference in New Issue
Block a user