Merge remote-tracking branch 'origin/yinyou_permission' into yinyou_develop
# Conflicts: # app/src/main/AndroidManifest.xml # app/src/main/java/com/yizhuan/erban/avroom/activity/AVRoomActivity.java # app/src/main/java/com/yizhuan/erban/ui/user/UserInfoActivity.java # app/src/main/res/layout/activity_chat_room.xml
@@ -250,9 +250,9 @@ dependencies {
|
||||
|
||||
// 易盾一键登录
|
||||
implementation(name: 'quicklogin_libary-external-release', ext: 'aar')
|
||||
implementation(name: 'CMCCSSOSDK-WY', ext: 'aar')
|
||||
implementation(name: 'Ui-factory_oauth_mobile_3.8.3.1', ext: 'aar')
|
||||
implementation(name: 'CTAccount_sdk_api_v3.7.0_all', ext: 'aar')
|
||||
implementation(name: 'CMCCSSOSDK-wy-release', ext: 'aar')
|
||||
implementation(name: 'Ui-factory_oauth_mobile_3.9.1.7_external', ext: 'aar')
|
||||
implementation(name: 'CTAccount_sdk_api_v3.8.3_all', ext: 'aar')
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
implementation files('libs/msa_mdid_1.0.13.aar')
|
||||
|
BIN
app/quick-pass-libs/CMCCSSOSDK-wy-release.aar
Normal file
BIN
app/quick-pass-libs/CTAccount_sdk_api_v3.8.3_all.aar
Normal file
BIN
app/quick-pass-libs/Ui-factory_oauth_mobile_3.9.1.7_external.aar
Normal file
6
app/src/common/res/drawable/bg_f6f7f9_8_radius.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
<solid android:color="#F6F7F9" />
|
||||
</shape>
|
@@ -1233,6 +1233,14 @@
|
||||
android:name=".avroom.firstcharge.FirstChargeDialog"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.setting.GrantedPermissionsActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.setting.PermissionGuideActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".vip.VipMainActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
@@ -37,7 +37,7 @@ public class UpMicAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
this.consumer = consumer;
|
||||
this.upUid = upUid;
|
||||
List<String> list = new ArrayList<>();
|
||||
int size = AvRoomDataManager.get().isCpRoom() ? 2 : 9;
|
||||
int size = AvRoomDataManager.get().isCpRoom() ? 2 : (AvRoomDataManager.get().isOpenGame() ? 6 : 9);
|
||||
for (int i = 0; i < size; i++) {
|
||||
list.add("");
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ public class TitleBar extends ViewGroup implements View.OnClickListener {
|
||||
setBackgroundColor(mBackgroundColor);
|
||||
}
|
||||
|
||||
private int mBackgroundColor = getResources().getColor(R.color.translucent);
|
||||
private int mBackgroundColor = getResources().getColor(R.color.transparent);
|
||||
|
||||
public TitleBar(Context context) {
|
||||
super(context);
|
||||
|
@@ -157,6 +157,12 @@ public class MeFragment extends BaseFragment implements View.OnClickListener {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initUserDate();
|
||||
// 每次页面重新可见的时候,如果处于审核状态,都尝试刷新拿取最新信息
|
||||
// 不算是一个多好的做法,但是 it works
|
||||
// 不算频繁,可以接受
|
||||
if (mUserInfo != null && mUserInfo.isReview()) {
|
||||
requestUpdateUserInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void initUserDate() {
|
||||
|
@@ -0,0 +1,102 @@
|
||||
package com.yizhuan.erban.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseActivity
|
||||
import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.ui.setting.bean.PermissionEntity
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.erban.ui.widget.DividerItemDecoration
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.yizhuan.erban.utils.PermissionUtil
|
||||
import io.reactivex.Completable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class GrantedPermissionsActivity : BaseActivity() {
|
||||
private lateinit var recyclerView: RecyclerView
|
||||
private lateinit var rvDelegate: RVDelegate<PermissionEntity>
|
||||
private var isResumedFromSetting = false
|
||||
|
||||
companion object {
|
||||
fun start(context: Context) {
|
||||
val intent = Intent(context, GrantedPermissionsActivity::class.java)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_granted_permissions)
|
||||
initTitleBar("系统权限管理")
|
||||
initView()
|
||||
rvDelegate = RVDelegate.Builder<PermissionEntity>()
|
||||
.setLayoutManager(LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false))
|
||||
.setRecyclerView(recyclerView)
|
||||
.setEmptyView(EmptyViewHelper.createEmptyView(this, "未有已授权的系统权限"))
|
||||
.setAdapter(PermissionAdapter())
|
||||
.build()
|
||||
}
|
||||
|
||||
override fun onResume() {//修改系统权限设置返回立即读取会有黑屏问题
|
||||
super.onResume()
|
||||
if (isResumedFromSetting) {
|
||||
isResumedFromSetting = false
|
||||
Completable.timer(1500, TimeUnit.MILLISECONDS)
|
||||
.compose(bindUntilEvent<Void>(ActivityEvent.DESTROY))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnSubscribe { dialogManager.showProgressDialog(context, false) }
|
||||
.doOnComplete {
|
||||
rvDelegate.setNewData(PermissionUtil.instance.getGrantedPermissions(context))
|
||||
dialogManager.dismissDialog()
|
||||
}
|
||||
.doOnError { dialogManager.dismissDialog() }
|
||||
.subscribe()
|
||||
} else {
|
||||
rvDelegate.setNewData(PermissionUtil.instance.getGrantedPermissions(context))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
isResumedFromSetting = true
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
recyclerView = findViewById(R.id.recycler_view)
|
||||
recyclerView.addItemDecoration(
|
||||
DividerItemDecoration(
|
||||
this, LinearLayoutManager.VERTICAL,
|
||||
UIUtil.dip2px(this, 16.toDouble()),
|
||||
R.color.transparent
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
fun jumpToSystemSetting(view: View) {
|
||||
PermissionUtil.instance.jumpToSetting(this)
|
||||
}
|
||||
|
||||
class PermissionAdapter :
|
||||
BaseQuickAdapter<PermissionEntity, BaseViewHolder>(R.layout.item_permission_granted) {
|
||||
override fun convert(helper: BaseViewHolder, item: PermissionEntity?) {
|
||||
item?.let {
|
||||
helper.getView<TextView>(R.id.tv_name)?.text = it.alias
|
||||
helper.getView<TextView>(R.id.tv_desc)?.text = it.description
|
||||
helper.getView<ImageView>(R.id.icon)?.setImageResource(it.icon)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
package com.yizhuan.erban.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.yizhuan.erban.BuildConfig
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseActivity
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivityPermissionGuideBinding
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.erban.utils.PermissionUtil
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
|
||||
class PermissionGuideActivity : BaseViewBindingActivity<ActivityPermissionGuideBinding>(),
|
||||
View.OnClickListener {
|
||||
|
||||
companion object {
|
||||
fun start(context: Context) {
|
||||
val intent = Intent(context, PermissionGuideActivity::class.java)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
initTitleBar("个人信息与权限")
|
||||
binding.click = this
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.tv_system_permission -> GrantedPermissionsActivity.start(this)
|
||||
R.id.tv_jump_setting -> PermissionUtil.instance.jumpToSetting(this)
|
||||
R.id.tv_privacy_guide -> CommonWebViewActivity.start(
|
||||
this,UriProvider.getPrivacyUrl()
|
||||
)
|
||||
R.id.tv_sdk_permission -> CommonWebViewActivity.start(
|
||||
this,
|
||||
UriProvider.getSDKPermissionUrl()
|
||||
)
|
||||
R.id.tv_device_permission -> CommonWebViewActivity.start(
|
||||
this,
|
||||
UriProvider.getDeivcePermissionUrl()
|
||||
)
|
||||
R.id.tv_personal_permission -> CommonWebViewActivity.start(
|
||||
this,
|
||||
UriProvider.getPersonalInfoUrl()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@@ -228,6 +228,9 @@ public class SettingActivity extends BaseActivity implements View.OnClickListene
|
||||
case R.id.tv_notice_setting:
|
||||
NoticeSettingActivity.start(context);
|
||||
break;
|
||||
case R.id.rly_permission:
|
||||
PermissionGuideActivity.Companion.start(context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,71 @@
|
||||
package com.yizhuan.erban.ui.setting.bean
|
||||
|
||||
import android.Manifest
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
|
||||
enum class PermissionEntity(
|
||||
val alias: String,
|
||||
val description: String,
|
||||
var icon: Int = R.drawable.icon_permission_common,
|
||||
val permissionName: Array<String>
|
||||
) {
|
||||
|
||||
|
||||
PHONE(
|
||||
"电话",
|
||||
"读取通话状态、移动网络信息和设备信息",
|
||||
R.drawable.icon_permission_phone,
|
||||
arrayOf(Manifest.permission.READ_PHONE_STATE)
|
||||
),
|
||||
LOCATOIN(
|
||||
"位置",
|
||||
"访问大致位置(通过网络定位)",
|
||||
R.drawable.icon_permission_location,
|
||||
arrayOf(
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
)
|
||||
|
||||
),
|
||||
CONTACT(
|
||||
"联系人",
|
||||
"获取系统中通讯录信息",
|
||||
R.drawable.icon_permission_common,
|
||||
arrayOf(
|
||||
Manifest.permission.READ_CONTACTS,
|
||||
Manifest.permission.WRITE_CONTACTS,
|
||||
Manifest.permission.GET_ACCOUNTS
|
||||
)
|
||||
),
|
||||
MICROPHONE(
|
||||
"录音",
|
||||
"录制音频",
|
||||
R.drawable.icon_permission_mic,
|
||||
arrayOf(Manifest.permission.RECORD_AUDIO)
|
||||
),
|
||||
CAMERA(
|
||||
"相机",
|
||||
"拍摄相片或录制视频",
|
||||
R.drawable.icon_permission_camera,
|
||||
arrayOf(Manifest.permission.CAMERA)
|
||||
),
|
||||
STORAGE(
|
||||
"存储", "读取手机存储,修改/删除手机储存", R.drawable.icon_permission_storage,
|
||||
arrayOf(
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||
)
|
||||
);
|
||||
|
||||
companion object {
|
||||
fun fetchPermission(name: String): PermissionEntity? {
|
||||
if (TextUtils.isEmptyText(name)) return null
|
||||
|
||||
values().forEach {
|
||||
if (it.permissionName.contains(name)) return it
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
package com.yizhuan.erban.ui.user;
|
||||
|
||||
import static com.yizhuan.erban.ui.user.UserInfoActivity.IdentityState.OWN;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -19,6 +21,9 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity;
|
||||
import com.yizhuan.erban.ui.user.adapter.SelfPhotoAdapter;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.TextHintView;
|
||||
import com.netease.nim.uikit.impl.cache.NimUserInfoCache;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
@@ -113,9 +118,10 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
private TextView attentionLayout;
|
||||
private ImageView ivOfficialMask;
|
||||
private TextView tvOfficialMask;
|
||||
|
||||
private long mRoomUid;
|
||||
private GiftAdapter giftAdapter;
|
||||
private UserInfoPhotoAdapter bannerAdapter;
|
||||
private StaticPagerAdapterWrapper bannerAdapter;
|
||||
private UserInfoDynamicAdapter dynamicAdapter;
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -146,7 +152,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
|
||||
private void initAttentionView() {
|
||||
if (AuthModel.get().getCurrentUid() == userId) {
|
||||
identityState = IdentityState.OWN;
|
||||
identityState = OWN;
|
||||
mBinding.tvFansCount.setOnClickListener(this);
|
||||
mBinding.ivWhere.setVisibility(View.GONE);
|
||||
if (bottomViewLayout != null)
|
||||
@@ -468,7 +474,8 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
hintView.setTextSize(SizeUtils.dp2px(this, 4));
|
||||
hintView.setTextColor(getResources().getColor(R.color.blue));
|
||||
mBinding.rollView.setHintView(hintView);
|
||||
bannerAdapter = new UserInfoPhotoAdapter(list, this);
|
||||
bannerAdapter = identityState == OWN ? new SelfPhotoAdapter(list, this)
|
||||
: new UserInfoPhotoAdapter(list, this);
|
||||
mBinding.rollView.setAdapter(bannerAdapter);
|
||||
//设置透明度
|
||||
mBinding.rollView.setAnimationDurtion(500);
|
||||
@@ -520,7 +527,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void setEditButton(int identityState, boolean isExpanded) {
|
||||
if (identityState == IdentityState.OWN) {
|
||||
if (identityState == OWN) {
|
||||
mBinding.ivEdit.setVisibility(View.GONE);
|
||||
mBinding.tvEdit.setVisibility(View.VISIBLE);
|
||||
} else if (identityState == IdentityState.OTHER) {
|
||||
@@ -539,6 +546,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
if (position > 0) {
|
||||
showUserPhoto(position - 1);
|
||||
} else {
|
||||
|
||||
UIHelper.showModifyPhotosAct(this, userId);
|
||||
}
|
||||
} else {
|
||||
@@ -564,7 +572,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
}
|
||||
|
||||
private void editClick(int identityState) {
|
||||
if (identityState == IdentityState.OWN) {
|
||||
if (identityState == OWN) {
|
||||
UIHelper.showUserInfoModifyAct(this, REQUEST_CODE_UPDATE_VOICE, userId);
|
||||
} else if (identityState == IdentityState.OTHER) {
|
||||
if (userInfo != null) {
|
||||
|
@@ -6,8 +6,10 @@ import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -19,15 +21,18 @@ import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nim.uikit.common.util.sys.TimeUtil;
|
||||
import com.sleepbot.datetimepicker.time.RadialPickerLayout;
|
||||
import com.sleepbot.datetimepicker.time.TimePickerDialog;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.yizhuan.erban.ErbanTakePhotoActivity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.audio.RecordingVoiceActivity;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.common.permission.PermissionActivity;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.ui.login.ModifyInfoActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.erban.ui.widget.dialog.CommonMessageDialog;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.file.FileModel;
|
||||
@@ -40,7 +45,9 @@ import com.yizhuan.xchat_android_library.utils.log.MLog;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
@@ -65,6 +72,9 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
private String audioFileUrl;
|
||||
private RecyclerView photosRecyclerView;
|
||||
|
||||
private boolean showAvatarAuditing;
|
||||
private ImageView ivAvatarAuditiong;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -93,7 +103,8 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
private void initData(UserInfo userInfo) {
|
||||
if (null != userInfo) {
|
||||
audioFileUrl = userInfo.getUserVoice();
|
||||
ImageLoadUtils.loadAvatar(this, userInfo.getAvatar(), civAvatar);
|
||||
ImageLoadUtils.loadAvatar(this, !TextUtils.isEmpty(userInfo.getNewAvatar()) ? userInfo.getNewAvatar() : userInfo.getAvatar(), civAvatar);
|
||||
ivAvatarAuditiong.setVisibility(userInfo.isReview() ? View.VISIBLE : View.GONE);
|
||||
String birth = TimeUtil.getDateTimeString(userInfo.getBirth(), "yyyy-MM-dd");
|
||||
tvBirth.setText(birth);
|
||||
tvNick.setText(RegexUtil.getPrintableString(userInfo.getNick()));
|
||||
@@ -129,6 +140,7 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
LinearLayoutManager mLayoutManager =
|
||||
new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true);
|
||||
photosRecyclerView.setLayoutManager(mLayoutManager);
|
||||
ivAvatarAuditiong = findViewById(R.id.iv_avatar_auditing);
|
||||
|
||||
}
|
||||
|
||||
@@ -263,6 +275,10 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.layout_avatar:
|
||||
if (mUserInfo != null && mUserInfo.isReview()) {
|
||||
toast("头像正在审核中");
|
||||
return;
|
||||
}
|
||||
ButtonItem buttonItem = new ButtonItem("拍照上传", this::checkPermissionAndStartCamera);
|
||||
ButtonItem buttonItem1 = new ButtonItem("本地相册", () -> {
|
||||
ErbanTakePhotoActivity.startToSelectPhoto(this, this);
|
||||
@@ -299,7 +315,7 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
case R.id.rl_audio_record:
|
||||
checkPermission(() -> {
|
||||
// 点击跳转到我的声音页面
|
||||
UIHelper.showMyVoiceAct(UserInfoModifyActivity.this, Method.AUDIO,"编辑资料");
|
||||
UIHelper.showMyVoiceAct(UserInfoModifyActivity.this, Method.AUDIO, "编辑资料");
|
||||
isAvatar = false;
|
||||
}, R.string.ask_again,
|
||||
Manifest.permission.RECORD_AUDIO);
|
||||
@@ -319,6 +335,7 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
UserInfo user = new UserInfo();
|
||||
user.setUid(AuthModel.get().getCurrentUid());
|
||||
user.setAvatar(url);
|
||||
showAvatarAuditing = true;
|
||||
UserModel.get().requestUpdateUserInfo(user).subscribe(userInfoUpdateObserver);
|
||||
}
|
||||
}
|
||||
@@ -382,6 +399,10 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
initData(mUserInfo);
|
||||
}
|
||||
getDialogManager().dismissDialog();
|
||||
if (showAvatarAuditing) {
|
||||
showAvatarAuditing = false;
|
||||
showAvatarAuditingDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -401,4 +422,17 @@ public class UserInfoModifyActivity extends BaseActivity
|
||||
StatusBarUtil.transparencyBar(this);
|
||||
StatusBarUtil.StatusBarLightMode(this);
|
||||
}
|
||||
|
||||
private void showAvatarAuditingDialog() {
|
||||
toast(R.string.avatar_auditing);
|
||||
//延迟3秒重新获取用户信息更新状态
|
||||
ivAvatarAuditiong.setVisibility(View.VISIBLE);
|
||||
Completable.timer(3000, TimeUnit.MILLISECONDS)
|
||||
.compose(bindUntilEvent(ActivityEvent.STOP))
|
||||
.doOnComplete(() -> {
|
||||
UserModel.get().updateCurrentUserInfo().subscribe(userInfoUpdateObserver);
|
||||
}).doOnError(throwable -> {
|
||||
throwable.printStackTrace();
|
||||
}).subscribe();
|
||||
}
|
||||
}
|
||||
|
@@ -200,6 +200,7 @@ public class UserModifyPhotosActivity extends TakePhotoActivity implements UserM
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo info) {
|
||||
toast("相片已送审,审核成功后自动上传相片");
|
||||
isChanged = true;
|
||||
getDialogManager().dismissDialog();
|
||||
if (info.getUid() == userId) {
|
||||
|
@@ -0,0 +1,48 @@
|
||||
package com.yizhuan.erban.ui.user.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo
|
||||
|
||||
class SelfPhotoAdapter(
|
||||
photoBeans: List<UserDetailInfo.DataBean.PrivatePhotoBean>,
|
||||
context: Context
|
||||
) : StaticPagerAdapterWrapper<UserDetailInfo.DataBean.PrivatePhotoBean>(photoBeans, context) {
|
||||
private val origin by lazy {
|
||||
UserInfoPhotoAdapter(photoBeans, context)
|
||||
}
|
||||
|
||||
override fun getView(container: ViewGroup?, position: Int): View {
|
||||
val originView = origin.getView(container, position)
|
||||
val flContainer = FrameLayout(context)
|
||||
flContainer.layoutParams = FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
flContainer.addView(originView)
|
||||
//overlay
|
||||
val statusView = ImageView(context)
|
||||
statusView.setImageResource(R.drawable.ic_album_auditing)
|
||||
statusView.scaleType = ImageView.ScaleType.CENTER_INSIDE
|
||||
val statusViewLayoutParams =
|
||||
FrameLayout.LayoutParams(UIUtil.dip2px(context, 86.0), UIUtil.dip2px(context, 51.0))
|
||||
statusViewLayoutParams.gravity = Gravity.RIGHT
|
||||
flContainer.addView(statusView, statusViewLayoutParams)
|
||||
|
||||
val isVisit = (dataList.getOrNull(position)?.isReview == true)
|
||||
statusView.visibility = if (isVisit) View.VISIBLE else View.GONE
|
||||
return flContainer
|
||||
}
|
||||
|
||||
override fun setData(dataList: MutableList<UserDetailInfo.DataBean.PrivatePhotoBean>?) {
|
||||
super.setData(dataList)
|
||||
origin.setData(dataList)
|
||||
}
|
||||
}
|
@@ -10,7 +10,7 @@ import android.widget.ImageView;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.user.ShowPhotoActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapterWrapper;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserPhoto;
|
||||
|
||||
@@ -22,47 +22,33 @@ import java.util.List;
|
||||
* @date 2017/8/7
|
||||
*/
|
||||
|
||||
public class UserInfoPhotoAdapter extends StaticPagerAdapter {
|
||||
private Context context;
|
||||
private List<UserDetailInfo.DataBean.PrivatePhotoBean> photoBeanList;
|
||||
public class UserInfoPhotoAdapter extends StaticPagerAdapterWrapper<UserDetailInfo.DataBean.PrivatePhotoBean> {
|
||||
private LayoutInflater mInflater;
|
||||
|
||||
public UserInfoPhotoAdapter(List<UserDetailInfo.DataBean.PrivatePhotoBean> photoBeans, Context context) {
|
||||
this.context = context;
|
||||
this.photoBeanList = photoBeans;
|
||||
super(photoBeans, context);
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View getView(ViewGroup container, int position) {
|
||||
UserDetailInfo.DataBean.PrivatePhotoBean photoInfo = photoBeanList.get(position);
|
||||
UserDetailInfo.DataBean.PrivatePhotoBean photoInfo = dataList.get(position);
|
||||
ImageView imgBanner = (ImageView) mInflater.inflate(R.layout.banner_userinfo_photo_item, container, false);
|
||||
if (photoInfo == null) return imgBanner;
|
||||
ImageLoadUtils.loadImage(context, photoInfo.getPhotoUrl(), imgBanner);
|
||||
imgBanner.setOnClickListener(v -> {
|
||||
showUserPhoto(position);
|
||||
});
|
||||
ImageLoadUtils.loadImage(context, photoInfo.getPhotoUrl(), imgBanner);
|
||||
imgBanner.setOnClickListener(v -> {
|
||||
showUserPhoto(position);
|
||||
});
|
||||
return imgBanner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return photoBeanList == null ? 0 : photoBeanList.size();
|
||||
|
||||
}
|
||||
|
||||
public void setData(List<UserDetailInfo.DataBean.PrivatePhotoBean> bannerInfos) {
|
||||
this.photoBeanList = bannerInfos;
|
||||
}
|
||||
|
||||
|
||||
private void showUserPhoto(int position) {
|
||||
//创建一个集合拿来做用户所有照片信息
|
||||
ArrayList<UserPhoto> userPhotos = new ArrayList<>();
|
||||
for (int i = 0 ; i < photoBeanList.size() ; i++) {
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
UserPhoto newPhoto = new UserPhoto();
|
||||
newPhoto.setPhotoUrl(photoBeanList.get(i).getPhotoUrl());
|
||||
newPhoto.setPhotoUrl(dataList.get(i).getPhotoUrl());
|
||||
userPhotos.add(newPhoto);
|
||||
}
|
||||
Intent intent = new Intent(context, ShowPhotoActivity.class);
|
||||
|
@@ -0,0 +1,4 @@
|
||||
package com.yizhuan.erban.ui.utils.sys
|
||||
|
||||
class PermissionUtil {
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.yizhuan.erban.ui.widget.dialog
|
||||
|
||||
import android.content.Context
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogCommonMessageBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_common_message)
|
||||
class CommonMessageDialog(context: Context, theme: Int) :
|
||||
BaseBindingDialog<DialogCommonMessageBinding>(context, theme) {
|
||||
constructor(context: Context) : this(context, R.style.dialog)
|
||||
|
||||
override fun init() {
|
||||
setCancelable(true)
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
package com.yizhuan.erban.ui.widget.rollviewpager.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class StaticPagerAdapterWrapper<T> extends StaticPagerAdapter {
|
||||
|
||||
protected Context context;
|
||||
protected List<T> dataList;
|
||||
|
||||
|
||||
public StaticPagerAdapterWrapper(List<T> dataList, Context context) {
|
||||
this.context = context;
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
public void setData(List<T> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return dataList == null ? 0 : dataList.size();
|
||||
}
|
||||
}
|
126
app/src/main/java/com/yizhuan/erban/utils/PermissionUtil.kt
Normal file
@@ -0,0 +1,126 @@
|
||||
package com.yizhuan.erban.utils
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import com.microquation.linkedme.android.v4.ContextCompatLKMe
|
||||
import com.yizhuan.erban.BuildConfig
|
||||
import com.yizhuan.erban.ui.setting.bean.PermissionEntity
|
||||
import java.lang.Exception
|
||||
|
||||
class PermissionUtil {
|
||||
companion object {
|
||||
val instance = PermissionUtil()
|
||||
}
|
||||
|
||||
fun getGrantedPermissions(context: Context): List<PermissionEntity> {
|
||||
val packageInfo = context.packageManager.getPackageInfo(
|
||||
context.packageName,
|
||||
PackageManager.GET_PERMISSIONS,
|
||||
)
|
||||
val permissions = packageInfo.requestedPermissions
|
||||
val list = permissions?.filter { str -> str.startsWith("android.permission") }?.let {
|
||||
if (Build.VERSION.SDK_INT < 23) {
|
||||
it
|
||||
} else {
|
||||
it.filter { s ->
|
||||
ContextCompatLKMe.checkSelfPermission(context, s) ==
|
||||
PackageManager.PERMISSION_GRANTED
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val permissionList = ArrayList<PermissionEntity>()
|
||||
list?.forEach {
|
||||
PermissionEntity.fetchPermission(it)
|
||||
?.let { permission ->
|
||||
if (!permissionList.contains(permission)) permissionList.add(permission)
|
||||
}
|
||||
}
|
||||
return permissionList
|
||||
}
|
||||
|
||||
fun jumpToSetting(context: Context) {
|
||||
when (Build.BRAND?.toLowerCase()) {
|
||||
"redmi", "xiaomi" -> toXiaomiPermission(context)
|
||||
"huawei", "honor" -> toHuaWeiPermission(context)
|
||||
"meizu" -> toMeizuPermission(context)
|
||||
else -> toCommonPermission(context)
|
||||
}
|
||||
}
|
||||
|
||||
private fun toHuaWeiPermission(context: Context) {
|
||||
try {
|
||||
val intent = Intent()
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
val comp = ComponentName(
|
||||
"com.huawei.systemmanager",
|
||||
"com.huawei.permissionmanager.ui.MainActivity"
|
||||
)//华为权限管理
|
||||
intent.component = comp
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
toCommonPermission(context)
|
||||
}
|
||||
}
|
||||
|
||||
private fun toXiaomiPermission(context: Context) {
|
||||
try { // MIUI 8
|
||||
val localIntent = Intent("miui.intent.action.APP_PERM_EDITOR")
|
||||
localIntent.setClassName(
|
||||
"com.miui.securitycenter",
|
||||
"com.miui.permcenter.permissions.PermissionsEditorActivity"
|
||||
)
|
||||
localIntent.putExtra("extra_pkgname", context.packageName)
|
||||
context.startActivity(localIntent)
|
||||
} catch (e: Exception) {
|
||||
try { // MIUI 5/6/7
|
||||
val localIntent = Intent("miui.intent.action.APP_PERM_EDITOR")
|
||||
localIntent.setClassName(
|
||||
"com.miui.securitycenter",
|
||||
"com.miui.permcenter.permissions.AppPermissionsEditorActivity"
|
||||
)
|
||||
localIntent.putExtra("extra_pkgname", context.packageName)
|
||||
context.startActivity(localIntent)
|
||||
} catch (e1: Exception) { // 否则跳转到应用详情
|
||||
toCommonPermission(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun toMeizuPermission(context: Context) {
|
||||
try {
|
||||
val intent = Intent("com.meizu.safe.security.SHOW_APPSEC")
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT)
|
||||
intent.putExtra("packageName", BuildConfig.APPLICATION_ID)
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
toCommonPermission(context)
|
||||
}
|
||||
}
|
||||
|
||||
private fun toCommonPermission(context: Context) {
|
||||
val localIntent = Intent()
|
||||
localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
if (Build.VERSION.SDK_INT >= 9) {
|
||||
localIntent.action = "android.settings.APPLICATION_DETAILS_SETTINGS"
|
||||
localIntent.data = Uri.fromParts("package", context.packageName, null)
|
||||
} else if (Build.VERSION.SDK_INT <= 8) {
|
||||
localIntent.action = Intent.ACTION_VIEW
|
||||
localIntent.setClassName(
|
||||
"com.android.settings",
|
||||
"com.android.settings.InstalledAppDetails"
|
||||
)
|
||||
localIntent.putExtra(
|
||||
"com.android.settings.ApplicationPkgName",
|
||||
context.packageName
|
||||
)
|
||||
}
|
||||
context.startActivity(localIntent)
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/ic_album_auditing.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_avatar_auditing.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_dialog_auditing.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_permission_camera.png
Normal file
After Width: | Height: | Size: 850 B |
BIN
app/src/main/res/drawable-xhdpi/icon_permission_common.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_permission_location.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_permission_mic.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_permission_phone.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/icon_permission_storage.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/quick_pass_checked.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/quick_pass_uncheck.png
Normal file
After Width: | Height: | Size: 770 B |
@@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="45"
|
||||
android:endColor="@color/translucent"
|
||||
android:endColor="@color/transparent"
|
||||
android:startColor="@color/bg_secondary_2a2a39"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
|
10
app/src/main/res/drawable/shape_circle_33_white.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<size
|
||||
android:width="@dimen/dp_30"
|
||||
android:height="@dimen/dp_30" />
|
||||
<solid android:color="@color/color_33FFFFFF" />
|
||||
|
||||
</shape>
|
88
app/src/main/res/layout/activity_granted_permissions.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
<com.yizhuan.erban.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/color_transparent10_0A333333" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="none"
|
||||
android:fillViewport="true"
|
||||
android:overScrollMode="never"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_16"
|
||||
android:layout_weight="1"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_gravity="center_horizontal"
|
||||
|
||||
>
|
||||
<View
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/color_grey_999999"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="jumpToSystemSetting"
|
||||
android:text="仅展示能查询到的已授权系统权限"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
<View
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/color_grey_999999"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_35"
|
||||
android:onClick="jumpToSystemSetting"
|
||||
android:text="前往系统设置>"
|
||||
android:textColor="#7154EE"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
124
app/src/main/res/layout/activity_permission_guide.xml
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<data>
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/white"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<com.yizhuan.erban.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/color_transparent10_0A333333" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:id="@+id/tv_system_permission"
|
||||
style="@style/permission_text_style"
|
||||
android:text="系统权限管理"
|
||||
android:onClick="@{click}"
|
||||
tools:ignore="MissingConstraints" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:id="@+id/tv_privacy_guide"
|
||||
style="@style/permission_text_style"
|
||||
android:text="隐私保护指引"
|
||||
android:onClick="@{click}"
|
||||
tools:ignore="MissingConstraints" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:id="@+id/tv_sdk_permission"
|
||||
style="@style/permission_text_style"
|
||||
android:text="第三方SDK目录"
|
||||
android:onClick="@{click}"
|
||||
tools:ignore="MissingConstraints" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:id="@+id/tv_personal_permission"
|
||||
style="@style/permission_text_style"
|
||||
android:text="个人信息收集清单"
|
||||
android:onClick="@{click}"
|
||||
tools:ignore="MissingConstraints" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:id="@+id/tv_device_permission"
|
||||
style="@style/permission_text_style"
|
||||
android:text="设备权限清单"
|
||||
android:onClick="@{click}"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_jump_setting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:onClick="@{click}"
|
||||
android:text="前往系统设置>"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="#7154EE"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tip"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="jumpToSystemSetting"
|
||||
android:text="仅展示能查询到的已授权系统权限"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:textColor="@color/color_999999"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_jump_setting"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/color_grey_999999"
|
||||
app:layout_constraintRight_toLeftOf="@id/tv_tip"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_tip"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_tip"
|
||||
/>
|
||||
|
||||
<View
|
||||
app:layout_constraintTop_toTopOf="@id/tv_tip"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_tip"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="0.5dp"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_tip"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/color_grey_999999"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
@@ -308,6 +308,37 @@
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
android:background="@color/line_height_201F27" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rly_permission"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:onClick="@{click}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/text_setting_permission"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="10dp"
|
||||
|
@@ -33,6 +33,7 @@
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="@dimen/font_normal" />
|
||||
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/civ_avatar"
|
||||
android:layout_width="55dp"
|
||||
@@ -41,6 +42,19 @@
|
||||
android:layout_toStartOf="@+id/iv_arrow"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:layout_width="55dp"
|
||||
android:id="@+id/iv_avatar_auditing"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@id/civ_avatar"
|
||||
android:layout_alignRight="@id/civ_avatar"
|
||||
android:layout_alignBottom="@id/civ_avatar"
|
||||
android:visibility="visible"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_avatar_auditing"
|
||||
/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
|
50
app/src/main/res/layout/dialog_common_message.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="193dp"
|
||||
android:background="@drawable/dialog_background"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
|
||||
<ImageView
|
||||
android:id="@id/iv_icon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@drawable/ic_dialog_auditing"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:textColor="@color/color_black_333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_icon"
|
||||
tools:text="审核中" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_9"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
android:text="咻,收到小可爱的新头像了呢~\n请耐心等待审核哦~" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -5,6 +5,8 @@
|
||||
|
||||
<data>
|
||||
|
||||
<import type="com.yizhuan.xchat_android_core.utils.TextUtils" />
|
||||
|
||||
<variable
|
||||
name="userInfo"
|
||||
type="com.yizhuan.xchat_android_core.user.bean.UserInfo" />
|
||||
@@ -67,7 +69,7 @@
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_user_head"
|
||||
avatarUrl="@{userInfo.avatar}"
|
||||
avatarUrl="@{TextUtils.isEmptyText(userInfo.newAvatar)?userInfo.avatar:userInfo.newAvatar}"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
@@ -77,6 +79,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_avatar_auditing"
|
||||
android:visibility="@{userInfo.isReview() ?View.VISIBLE:View.GONE}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_user_head"
|
||||
app:layout_constraintRight_toRightOf="@id/iv_user_head" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_avatar_head_wear"
|
||||
android:layout_width="67dp"
|
||||
|
@@ -54,8 +54,8 @@
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_bg_leave_mode"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_width="@dimen/dp_room_boss_mic_radius"
|
||||
android:layout_height="@dimen/dp_room_boss_mic_radius"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -52,6 +52,13 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="2dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_game_status"
|
||||
android:layout_width="40dp"
|
||||
|
44
app/src/main/res/layout/item_permission_granted.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_16"
|
||||
android:background="@drawable/bg_f6f7f9_8_radius">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="@dimen/dp_23"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/icon_permission_common" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
android:textColor="@color/color_black_333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintLeft_toRightOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="存储" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:textColor="@color/color_grey_999999"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_name"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name"
|
||||
tools:text="读取手机存储,修改/删除手机储存" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -587,4 +587,8 @@
|
||||
|
||||
<!-- 大鹅开黑UI规范 end-->
|
||||
|
||||
<!--60透明度-->
|
||||
<color name="color_60_FFFFFF">#99FFFFFF</color>
|
||||
<color name="color_10_FFFFFF">#1AFFFFFF</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -683,6 +683,7 @@
|
||||
<string name="text_setting_about">关于&app_name;</string>
|
||||
<string name="text_setting_check_for_update">检查版本</string>
|
||||
<string name="text_setting_lab">实验室</string>
|
||||
<string name="text_setting_permission">个人信息与权限</string>
|
||||
<string name="text_setting_logout">退出当前账号</string>
|
||||
<string name="text_setting_clear_cache">清除缓存</string>
|
||||
|
||||
@@ -908,4 +909,6 @@
|
||||
<string name="room_pk_rule">1)只有牌照房房主和超管才可以发起跨房pk,一次只能选择一个牌照房发起;\n 2)只有房主和超管才可以接受或拒绝跨房pk请求,若10秒内不点击pk邀请弹窗,弹窗消失,视为自动拒绝;\n 3)发起pk时需选择pk时间和pk对象,自定义时间下限为5,上限为180,只能填写整数;\n 4)pk发起后,未到pk时间无法自行结束,若有特殊情况需提前结束可联系客服,但本场pk不算胜负。</string>
|
||||
<string name="first_charge_help">1.每人仅可获得1次首充福利\n2.每个手机号,设备,实名认证等如已参与过首充,则无法获得奖励。</string>
|
||||
<string name="home_like_hint">关注的人和收藏的房间都会出现在这里\n暂无关注的人和收藏的房间哦</string>
|
||||
<string name="avatar_auditing">头像已送审,审核成功后自动应用头像</string>
|
||||
|
||||
</resources>
|
||||
|
@@ -546,4 +546,19 @@
|
||||
<item name="android:windowExitAnimation">@anim/anim_message_tip_out</item>
|
||||
</style>
|
||||
|
||||
<style name="permission_text_style">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">@dimen/dp_44</item>
|
||||
<item name="android:background">@drawable/bg_f6f7f9_8_radius</item>
|
||||
<item name="android:layout_marginTop">@dimen/dp_16</item>
|
||||
<item name="android:layout_marginLeft">@dimen/dp_16</item>
|
||||
<item name="android:layout_marginRight">@dimen/dp_16</item>
|
||||
<item name="android:textSize">@dimen/sp_14</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingLeft">@dimen/dp_12</item>
|
||||
<item name="android:paddingRight">@dimen/dp_17</item>
|
||||
<item name="android:drawableRight">@drawable/setting_right</item>
|
||||
<item name="android:textColor">@color/color_black_333333</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 287 B |
@@ -43,7 +43,7 @@
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textColorHint="@color/text_secondary_4f516a"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
@@ -7,7 +7,7 @@ import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.netease.nis.quicklogin.helper.UnifyUiConfig;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.PreferencesUtils;
|
||||
|
||||
/**
|
||||
* Created by hzhuqi on 2019/12/31
|
||||
@@ -27,6 +27,7 @@ public class QuickLoginUiConfig {
|
||||
|
||||
int X_OFFSET = 0;
|
||||
int BOTTOM_OFFSET = 0;
|
||||
final boolean privacyState = PreferencesUtils.readPrivacyState();
|
||||
UnifyUiConfig uiConfig = new UnifyUiConfig.Builder()
|
||||
// 状态栏
|
||||
.setStatusBarDarkColor(false)
|
||||
@@ -80,20 +81,23 @@ public class QuickLoginUiConfig {
|
||||
*/
|
||||
// .setPrivacyXOffset(43)
|
||||
|
||||
.setPrivacyState(false)
|
||||
.setPrivacyState(privacyState)
|
||||
.setPrivacySize(12)
|
||||
// .setPrivacyTopYOffset(510)
|
||||
.setPrivacyBottomYOffset(20)
|
||||
.setPrivacyXOffset(20)
|
||||
.setPrivacyMarginRight(20)
|
||||
.setCheckedImageName("quick_pass_checked")
|
||||
.setUnCheckedImageName("quick_pass_uncheck")
|
||||
// 协议详情页导航栏
|
||||
.setProtocolPageNavTitle("服务条款")
|
||||
.setProtocolPageNavBackIcon("quick_pass_back")
|
||||
.setProtocolPageNavColor(Color.WHITE)
|
||||
|
||||
// .setBackgroundImage("bg1")
|
||||
// 自定义控件
|
||||
// .addCustomView(otherLoginRel, "relative", UnifyUiConfig.POSITION_IN_BODY, null)
|
||||
.setClickEventListener((viewType, code) -> {
|
||||
if (viewType == 2) {
|
||||
PreferencesUtils.savePrivacyState(code == 1);
|
||||
}
|
||||
})
|
||||
.build(context);
|
||||
return uiConfig;
|
||||
}
|
||||
|
@@ -177,7 +177,6 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
login.onePass(new QuickLoginTokenListener() {
|
||||
@Override
|
||||
public void onGetTokenSuccess(String s, String s1) {
|
||||
getDialogManager().showProgressDialog(QuickPassLoginAct.this);
|
||||
setClickEnable(false);
|
||||
AuthModel.get().quickPassLogin(s, s1, "", "")
|
||||
.compose(bindToLifecycle())
|
||||
@@ -192,15 +191,13 @@ public class QuickPassLoginAct extends BaseLoginAct implements View.OnClickListe
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
setClickEnable(false);
|
||||
getDialogManager().dismissDialog();
|
||||
finish();
|
||||
login.quitActivity();
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_ONE_CLICK_LOGIN_SUCCEED, "一键登录成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
getDialogManager().dismissDialog();
|
||||
dealWithLoginError(e);
|
||||
setClickEnable(true);
|
||||
StatisticManager.Instance().onEvent(
|
||||
|
@@ -348,4 +348,35 @@ public class UriProvider {
|
||||
return IM_SERVER_URL.concat("/yinyou/modules/room_rank/index.html?roomUid="+ AvRoomDataManager.get().getRoomUid());
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方SDK协议
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getSDKPermissionUrl() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/rule/sdk.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐私协议设备权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getDeivcePermissionUrl() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/rule/permissions.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐私协议-个人信息
|
||||
*/
|
||||
public static String getPersonalInfoUrl() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/rule/personal-info.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐私指引
|
||||
*/
|
||||
public static String getPrivacyUrl() {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/rule/privacy-wap.html");
|
||||
}
|
||||
}
|
||||
|
@@ -1,634 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.ktv.event.RemoteVideoEvent;
|
||||
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo;
|
||||
import com.yizhuan.xchat_android_core.statistic.LogFactory;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.LogProtocol;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.agora.ktvkit.IKTVKitEventHandler;
|
||||
import io.agora.ktvkit.KTVKit;
|
||||
import io.agora.rtc.Constants;
|
||||
import io.agora.rtc.IRtcEngineEventHandler;
|
||||
import io.agora.rtc.RtcEngine;
|
||||
import io.agora.rtc.video.VideoCanvas;
|
||||
|
||||
import static io.agora.rtc.Constants.AUDIO_PROFILE_MUSIC_STANDARD;
|
||||
import static io.agora.rtc.Constants.AUDIO_RECORDING_QUALITY_LOW;
|
||||
import static io.agora.rtc.Constants.AUDIO_SCENARIO_GAME_STREAMING;
|
||||
|
||||
/**
|
||||
* <p> 声网管理类 </p>
|
||||
*
|
||||
* @author jiahui
|
||||
* @date 2017/12/12
|
||||
*/
|
||||
public final class RtcEngineManager {
|
||||
|
||||
@Nullable
|
||||
private RtcEngine mRtcEngine;
|
||||
|
||||
/**
|
||||
* 队列说话列表
|
||||
*/
|
||||
private List<Integer> speakQueueMembersPosition;
|
||||
private String uid;
|
||||
public boolean isAudienceRole;
|
||||
/**
|
||||
* 麦上是否闭麦,true:闭麦,false:开麦
|
||||
*/
|
||||
public boolean isMute;
|
||||
/**
|
||||
* 听筒是否关闭
|
||||
*/
|
||||
public boolean isRemoteMute;
|
||||
private boolean needRecord;
|
||||
private boolean isOpenAVRoomActivity;
|
||||
private boolean isOpenVoiceMatchActivity;
|
||||
//是否在房间,判断是切换品质还是第一次进
|
||||
private boolean inRoom;
|
||||
private EngineEventHandler eventHandler;
|
||||
|
||||
private static final class Helper {
|
||||
private static final RtcEngineManager INSTANCE = new RtcEngineManager();
|
||||
}
|
||||
|
||||
private RtcEngineManager() {
|
||||
System.out.println("hehehehe" + RtcEngine.getSdkVersion());
|
||||
speakQueueMembersPosition = new ArrayList<>();
|
||||
}
|
||||
|
||||
public static RtcEngineManager get() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
|
||||
public void startRtcEngine(long uid) {
|
||||
RoomInfo curRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
joinChannel(curRoomInfo.getRoomId(), uid);
|
||||
if (curRoomInfo.getUid() == uid && curRoomInfo.getType() != RoomInfo.ROOMTYPE_HOME_PARTY) {
|
||||
//设置用户角色为主播,轰趴房不能默认设置房主为主播
|
||||
setRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
} else {
|
||||
setRole(Constants.CLIENT_ROLE_AUDIENCE);
|
||||
}
|
||||
}
|
||||
|
||||
public void joinChannel(long channelId, long uid) {
|
||||
initRtcEngine(channelId, uid, AUDIO_PROFILE_MUSIC_STANDARD, AUDIO_SCENARIO_GAME_STREAMING);
|
||||
}
|
||||
|
||||
private void initRtcEngine(long channelId, long uid, int quality, int audioShowRoom) {
|
||||
this.uid = uid + "";
|
||||
this.isMute = false;
|
||||
this.isRemoteMute = false;
|
||||
enterChannel(channelId, (int) uid, quality, audioShowRoom);
|
||||
}
|
||||
|
||||
private void enterChannel(long channelId, int uid, int quality, int audioShowRoom) {
|
||||
if (eventHandler == null) {
|
||||
eventHandler = new EngineEventHandler(this);
|
||||
}
|
||||
eventHandler.isEnter = true;
|
||||
if (mRtcEngine == null) {
|
||||
try {
|
||||
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), XChatConstants.AGORA_KEY, eventHandler);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
|
||||
}
|
||||
//设置频道模式为直播
|
||||
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_LIVE_BROADCASTING);
|
||||
mRtcEngine.setAudioProfile(quality, audioShowRoom);
|
||||
mRtcEngine.enableAudioVolumeIndication(600, 3,false);
|
||||
mRtcEngine.setDefaultAudioRoutetoSpeakerphone(true);
|
||||
mRtcEngine.setExternalVideoSource(true, false, true);
|
||||
mRtcEngine.setRecordingAudioFrameParameters(48000, 2, 2, 960);
|
||||
mRtcEngine.setVideoProfile(Constants.VIDEO_PROFILE_360P, false);
|
||||
mRtcEngine.enableDualStreamMode(true);
|
||||
mRtcEngine.setParameters(String.format(Locale.US, "{\"che.audio.headset.monitoring,true\"}"));
|
||||
mRtcEngine.setParameters(String.format(Locale.US, "{\"che.audio.enable.androidlowlatencymode,true\"}"));
|
||||
mRtcEngine.setLogFile(Environment.getExternalStorageDirectory()
|
||||
+ File.separator + BasicConfig.INSTANCE.getAppContext().getPackageName() + "/log/agora-rtc.log");
|
||||
}
|
||||
//创建并加入频道
|
||||
mRtcEngine.joinChannel(null, String.valueOf(channelId), null, uid);
|
||||
}
|
||||
|
||||
|
||||
public int stopAudioMixing() {
|
||||
if (mRtcEngine != null) {
|
||||
return mRtcEngine.stopAudioMixing();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void leaveChannel() {
|
||||
if (mRtcEngine != null) {
|
||||
stopAudioMixing();
|
||||
mRtcEngine.leaveChannel();
|
||||
mRtcEngine = null;
|
||||
}
|
||||
if (handler != null)
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
isMute = false;
|
||||
isRemoteMute = false;
|
||||
needRecord = false;
|
||||
inRoom = false;
|
||||
}
|
||||
|
||||
public void setOpenAVRoomActivity(boolean openAVRoomActivity) {
|
||||
isOpenAVRoomActivity = openAVRoomActivity;
|
||||
setRemoteMute(isRemoteMute);
|
||||
setMute(isMute);
|
||||
}
|
||||
|
||||
public void setOpenVoiceMatchActivity(boolean openVoiceMatchActivity) {
|
||||
isOpenVoiceMatchActivity = openVoiceMatchActivity;
|
||||
setRemoteMute(isRemoteMute);
|
||||
setMute(isMute);
|
||||
}
|
||||
|
||||
//设置静音
|
||||
public void setRemoteMute(boolean mute) {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.muteAllRemoteAudioStreams(mute || (isOpenVoiceMatchActivity && !isOpenAVRoomActivity));
|
||||
if (result == 0) {
|
||||
isRemoteMute = mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setRemoteMute(int uid, boolean mute) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.muteRemoteAudioStream(uid, mute);
|
||||
}
|
||||
}
|
||||
|
||||
public void setRemoteMute(MicMemberInfo chatRoomMember, boolean mute) {
|
||||
if (chatRoomMember != null && !TextUtils.isEmpty(chatRoomMember.getAccount())) {
|
||||
String account = chatRoomMember.getAccount();
|
||||
Integer uid = Integer.valueOf(account);
|
||||
if (uid != 0)
|
||||
AudioEngineManager.get().setRemoteMute(uid, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置角色,上麦,下麦(调用)
|
||||
*
|
||||
* @param role CLIENT_ROLE_AUDIENCE: 听众 ,CLIENT_ROLE_BROADCASTER: 主播
|
||||
*/
|
||||
public void setRole(int role) {
|
||||
if (mRtcEngine != null) {
|
||||
//先已是否静音为准
|
||||
mRtcEngine.setClientRole(role);
|
||||
isAudienceRole = role != Constants.CLIENT_ROLE_BROADCASTER;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否能说话,静音,人自己的行为
|
||||
*
|
||||
* @param mute true:静音,false:不静音
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
public void setMute(boolean mute) {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.muteLocalAudioStream(mute || (isOpenVoiceMatchActivity && !isOpenAVRoomActivity));
|
||||
if (result == 0) {
|
||||
isMute = mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Handler handler = new RtcEngineHandler(this);
|
||||
|
||||
private static class RtcEngineHandler extends Handler {
|
||||
private WeakReference<RtcEngineManager> mReference;
|
||||
|
||||
RtcEngineHandler(RtcEngineManager manager) {
|
||||
mReference = new WeakReference<>(manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
RtcEngineManager rtcEngineManager = mReference.get();
|
||||
if (rtcEngineManager == null) return;
|
||||
if (msg.what == 0) {
|
||||
if (!RtcEngineManager.get().inRoom) {
|
||||
IMNetEaseManager.get().joinAvRoom();
|
||||
}
|
||||
|
||||
RtcEngineManager.get().inRoom = true;
|
||||
if (rtcEngineManager.needRecord && rtcEngineManager.mRtcEngine != null) {
|
||||
rtcEngineManager.mRtcEngine.startAudioRecording(Environment.getExternalStorageDirectory()
|
||||
+ File.separator + BasicConfig.INSTANCE.getAppContext().getPackageName()
|
||||
+ "/audio/" + System.currentTimeMillis() + ".aac", AUDIO_RECORDING_QUALITY_LOW);
|
||||
}
|
||||
|
||||
} else if (msg.what == 1) {//onAudioVolumeIndication 说话声音音量提示回调
|
||||
IRtcEngineEventHandler.AudioVolumeInfo[] speakers = (IRtcEngineEventHandler.AudioVolumeInfo[]) msg.obj;
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (rtcEngineManager.speakQueueMembersPosition.size() > 0) {
|
||||
rtcEngineManager.speakQueueMembersPosition.clear();
|
||||
}
|
||||
if (speakers == null || speakers.length == 0) return;
|
||||
for (IRtcEngineEventHandler.AudioVolumeInfo speaker : speakers) {
|
||||
// 0 代表的是房主,其他代表的是uid
|
||||
int uid = speaker.uid == 0 ? Integer.valueOf(rtcEngineManager.uid) : speaker.uid;
|
||||
int micPosition = AvRoomDataManager.get().getMicPosition(uid);
|
||||
// 如果是房主的话,并且房主的mic位置没有的啊,则把房主的位置设置为-1(兼容ios轻聊房光晕)
|
||||
if (uid == AvRoomDataManager.get().mCurrentRoomInfo.getUid() &&
|
||||
AvRoomDataManager.get().mCurrentRoomInfo.getType() == RoomInfo.ROOMTYPE_LIGHT_CHAT
|
||||
&& micPosition == Integer.MIN_VALUE) {
|
||||
micPosition = -1;
|
||||
}
|
||||
if (micPosition == Integer.MIN_VALUE &&
|
||||
uid == AuthModel.get().getCurrentUid()) {
|
||||
// 如果麦上没有自己,并且自己在说话,要把自己变成听众
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_AUDIENCE);
|
||||
} else if (micPosition == Integer.MIN_VALUE &&
|
||||
uid != AuthModel.get().getCurrentUid()) {
|
||||
// 如果麦上没有这个人,要把他静音
|
||||
AudioEngineManager.get().setRemoteMute(uid, true);
|
||||
}
|
||||
if (micPosition == Integer.MIN_VALUE) continue;
|
||||
rtcEngineManager.speakQueueMembersPosition.add(micPosition);
|
||||
}
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.SPEAK_STATE_CHANGE)
|
||||
.setMicPositionList(rtcEngineManager.speakQueueMembersPosition)
|
||||
);
|
||||
} else if (msg.what == 2) {//onUserMuteAudio 用户静音回调
|
||||
Integer uid = (Integer) msg.obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
private WeakReference<RtcEngineManager> mReference;
|
||||
private boolean isEnter;
|
||||
|
||||
EngineEventHandler(RtcEngineManager manager) {
|
||||
mReference = new WeakReference<>(manager);
|
||||
isEnter = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
|
||||
super.onJoinChannelSuccess(channel, uid, elapsed);
|
||||
//声网进入频道成功日志
|
||||
StatisticManager.Instance().sendAliyunLog(LogFactory.create(
|
||||
LogProtocol.LogLevel.LEVEL_VERBOSE,
|
||||
LogProtocol.Topic.TOPIC_AUDIO_LOG,
|
||||
LogProtocol.Event.EVENT_AUDIO_CHANNEL
|
||||
)
|
||||
.append("uid", String.valueOf(AuthModel.get().getCurrentUid()))
|
||||
.append("type", "1")
|
||||
.append("room_id", channel));
|
||||
if (mReference.get() != null && isEnter) {
|
||||
isEnter = false;
|
||||
mReference.get().handler.sendEmptyMessage(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRejoinChannelSuccess(String channel, int uid, int elapsed) {
|
||||
super.onRejoinChannelSuccess(channel, uid, elapsed);
|
||||
//声网重新链接频道成功日志
|
||||
StatisticManager.Instance().sendAliyunLog(LogFactory.create(
|
||||
LogProtocol.LogLevel.LEVEL_VERBOSE,
|
||||
LogProtocol.Topic.TOPIC_AUDIO_LOG,
|
||||
LogProtocol.Event.EVENT_AUDIO_CHANNEL
|
||||
)
|
||||
.append("uid", String.valueOf(AuthModel.get().getCurrentUid()))
|
||||
.append("type", "3")
|
||||
.append("room_id", channel));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeaveChannel(RtcStats stats) {
|
||||
super.onLeaveChannel(stats);
|
||||
//声网离开频道成功日志
|
||||
StatisticManager.Instance().sendAliyunLog(LogFactory.create(
|
||||
LogProtocol.LogLevel.LEVEL_VERBOSE,
|
||||
LogProtocol.Topic.TOPIC_AUDIO_LOG,
|
||||
LogProtocol.Event.EVENT_AUDIO_CHANNEL
|
||||
)
|
||||
.append("uid", String.valueOf(AuthModel.get().getCurrentUid()))
|
||||
.append("type", "2"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserJoined(int uid, int elapsed) {
|
||||
super.onUserJoined(uid, elapsed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActiveSpeaker(int uid) {
|
||||
super.onActiveSpeaker(uid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLastmileQuality(int quality) {
|
||||
super.onLastmileQuality(quality);
|
||||
if (quality >= 3) {
|
||||
IMNetEaseManager.postRoomEvent(new RoomEvent().setEvent(RoomEvent.RTC_ENGINE_NETWORK_BAD)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionInterrupted() {
|
||||
super.onConnectionInterrupted();
|
||||
IMNetEaseManager.postRoomEvent(new RoomEvent().setEvent(RoomEvent.RTC_ENGINE_NETWORK_CLOSE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionLost() {
|
||||
super.onConnectionLost();
|
||||
IMNetEaseManager.postRoomEvent(new RoomEvent().setEvent(RoomEvent.RTC_ENGINE_NETWORK_CLOSE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioVolumeIndication(AudioVolumeInfo[] speakers, int totalVolume) {
|
||||
super.onAudioVolumeIndication(speakers, totalVolume);
|
||||
RtcEngineManager manager = mReference.get();
|
||||
if (manager != null) {
|
||||
Message message = manager.handler.obtainMessage();
|
||||
message.what = 1;
|
||||
message.obj = speakers;
|
||||
manager.handler.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserMuteAudio(int uid, boolean muted) {
|
||||
super.onUserMuteAudio(uid, muted);
|
||||
RtcEngineManager manager = mReference.get();
|
||||
if (manager != null) {
|
||||
if (muted) {
|
||||
Message message = manager.handler.obtainMessage();
|
||||
message.what = 2;
|
||||
message.obj = uid;
|
||||
manager.handler.sendMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClientRoleChanged(int oldRole, int newRole) {
|
||||
super.onClientRoleChanged(oldRole, newRole);
|
||||
if (newRole==1)
|
||||
get().setMute(get().isMute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioMixingFinished() {//伴奏播放已结束回调
|
||||
super.onAudioMixingFinished();
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(
|
||||
new RoomEvent().setEvent(RoomEvent.METHOD_ON_AUDIO_MIXING_FINISHED)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstRemoteVideoDecoded(final int uid, int width, int height, int elapsed) {
|
||||
RxBus.get().post(new RemoteVideoEvent(uid));
|
||||
get().remoteUid = uid;
|
||||
}
|
||||
}
|
||||
|
||||
//音乐播放相关---------------begin--------------------------
|
||||
|
||||
public void adjustAudioMixingVolume(int volume) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.adjustAudioMixingVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
public void adjustRecordingSignalVolume(int volume) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.adjustRecordingSignalVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
public int resumeAudioMixing() {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.resumeAudioMixing();
|
||||
return result;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int pauseAudioMixing() {
|
||||
if (mRtcEngine != null) {
|
||||
int result = mRtcEngine.pauseAudioMixing();
|
||||
return result;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
public int startAudioMixing(String filePath, boolean loopback, int cycle) {
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.stopAudioMixing();
|
||||
int result = 0;
|
||||
try {
|
||||
result = mRtcEngine.startAudioMixing(filePath, loopback, false, cycle);
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int getAudioMixingCurrentPosition() {
|
||||
return mRtcEngine.getAudioMixingCurrentPosition();
|
||||
}
|
||||
|
||||
public int getAudioMixingDuration() {
|
||||
return mRtcEngine.getAudioMixingDuration();
|
||||
}
|
||||
//音乐播放相关---------------end--------------------------
|
||||
|
||||
|
||||
//ktv相关---------------begin--------------------------
|
||||
private boolean isPlaying;
|
||||
private boolean isAccompany = true;
|
||||
private boolean isPush;
|
||||
private boolean isOpenKtv;
|
||||
private boolean isLive;
|
||||
private int remoteUid;
|
||||
private double accompanyVoice = 0.5;
|
||||
private double personVoice = 0.5;
|
||||
@Nullable
|
||||
private KTVKit ktvKit;
|
||||
|
||||
public synchronized void openKtvModel() {
|
||||
if (mRtcEngine == null || isOpenKtv) return;
|
||||
try {
|
||||
ktvKit = KTVKit.create(mRtcEngine, BasicConfig.INSTANCE.getAppContext(), new IKTVKitEventHandler() {
|
||||
@Override
|
||||
public void onPlayerError(int error) {
|
||||
SingleToastUtil.showToast("MV播放出现未知错误,可以点击报错向我们反馈哦~~");
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mRtcEngine.enableVideo();
|
||||
mRtcEngine.enableLocalVideo(false);
|
||||
isOpenKtv = true;
|
||||
}
|
||||
|
||||
public synchronized void closeKtvModel() {
|
||||
if (!isOpenKtv) return;
|
||||
stopPush();
|
||||
isPlaying = false;
|
||||
isOpenKtv = false;
|
||||
isLive = false;
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.disableVideo();
|
||||
}
|
||||
if (ktvKit != null) {
|
||||
KTVKit.destroy();
|
||||
ktvKit = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void stopPush() {
|
||||
if (isPush){
|
||||
isPush = false;
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.muteLocalVideoStream(true);
|
||||
mRtcEngine.enableLocalVideo(false);
|
||||
// mRtcEngine.enableInEarMonitoring(false);
|
||||
}
|
||||
if (ktvKit != null) ktvKit.stopPlayVideoFile();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void startMv(String url) {
|
||||
if (ktvKit == null || mRtcEngine == null || !isOpenKtv || !AvRoomDataManager.get().isOwnerOnMic())
|
||||
return;
|
||||
mRtcEngine.enableLocalVideo(true);
|
||||
mRtcEngine.muteLocalVideoStream(false);
|
||||
ktvKit.openAndPlayVideoFile(url);
|
||||
setAccompanyVoice(accompanyVoice);
|
||||
setPersonVoice(personVoice);
|
||||
isPlaying = true;
|
||||
isPush = true;
|
||||
isLive = true;
|
||||
}
|
||||
|
||||
public synchronized void setupRemoteVideo(VideoCanvas canvas, int remoteUid) {
|
||||
if (mRtcEngine != null && isOpenKtv) {
|
||||
isPlaying = true;
|
||||
isLive = true;
|
||||
mRtcEngine.setupRemoteVideo(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void playOrPause() {
|
||||
if (ktvKit != null) ktvKit.pause();
|
||||
isPlaying = !isPlaying;
|
||||
}
|
||||
|
||||
public void changeAudioStream() {
|
||||
if (ktvKit != null) ktvKit.switchAudioTrack();
|
||||
isAccompany = !isAccompany;
|
||||
}
|
||||
|
||||
public void setAccompanyVoice(double progress) {
|
||||
if (progress < 0 || progress > 1) {
|
||||
return;
|
||||
}
|
||||
accompanyVoice = progress;
|
||||
if (ktvKit != null) ktvKit.adjustAccompanyVolume(progress);
|
||||
}
|
||||
|
||||
public void setPersonVoice(double progress) {
|
||||
if (progress < 0 || progress > 1) {
|
||||
return;
|
||||
}
|
||||
personVoice = progress;
|
||||
if (ktvKit != null) ktvKit.adjustVoiceVolume(personVoice);
|
||||
}
|
||||
|
||||
public boolean isPlaying() {
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
public boolean isPush() {
|
||||
return isPush;
|
||||
}
|
||||
|
||||
public boolean isAccompany() {
|
||||
return isAccompany;
|
||||
}
|
||||
|
||||
public boolean isOpenKtv() {
|
||||
return isOpenKtv;
|
||||
}
|
||||
|
||||
public boolean isLive() {
|
||||
return isLive;
|
||||
}
|
||||
|
||||
public void setLive(boolean live) {
|
||||
isLive = live;
|
||||
}
|
||||
|
||||
public int getRemoteUid() {
|
||||
return remoteUid;
|
||||
}
|
||||
|
||||
public double getAccompanyVoice() {
|
||||
return accompanyVoice;
|
||||
}
|
||||
|
||||
public double getPersonVoice() {
|
||||
return personVoice;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public KTVKit getKtvKit() {
|
||||
return ktvKit;
|
||||
}
|
||||
|
||||
public double getPlayPos() {
|
||||
return ktvKit == null ? 0 : ktvKit.getCurrentPosition();
|
||||
}
|
||||
|
||||
public int getPlayDuration() {
|
||||
return ktvKit == null ? 0 : ktvKit.getDuration();
|
||||
}
|
||||
|
||||
//ktv相关---------------end--------------------------
|
||||
}
|
@@ -299,16 +299,6 @@ public class TRTCEngineAdapter extends BaseAdapterImpl {
|
||||
if (setLiveTransCodingFlag) {
|
||||
sInstance.setLiveTranscoding(currentTranscodingConfig);
|
||||
}
|
||||
if (bDefaultMuteAllRemoteAudioStreams) {
|
||||
trtcCloud.muteRemoteAudio(userId, true);
|
||||
} else {
|
||||
trtcCloud.muteRemoteAudio(userId, false);
|
||||
}
|
||||
if (bDefaultMuteAllRemoteVideoStreams) {
|
||||
trtcCloud.muteRemoteVideoStream(userId, true);
|
||||
} else {
|
||||
trtcCloud.muteRemoteVideoStream(userId, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -139,8 +139,8 @@ public class TRtcEngineManager extends BaseEngine {
|
||||
@Override
|
||||
public void setRemoteMute(long uid, boolean mute) {
|
||||
Logger.t(TAG).d("setRemoteMute uid:%s mute:%s", uid, mute);
|
||||
|
||||
if (mRtcEngine != null) {
|
||||
//调用这个方法会影导致muteAllRemoteAudioStreams(true)失效!
|
||||
if (mRtcEngine != null && !isRemoteMute) {
|
||||
mRtcEngine.muteRemoteAudioStream((int) uid, mute);
|
||||
}
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ public class PreferencesUtils {
|
||||
private static final String KEY_ACCOUNT_INFO = "AccountInfo";
|
||||
private static final String KEY_NOTI_TOGGLE = "NotiToggle";
|
||||
private static final String KEY_NOTI_CONFIG = "StatusBarNotificationConfig";
|
||||
private static final String KEY_AGREE_PRIVACY = "key_agree_privacy";
|
||||
|
||||
|
||||
public static void saveTicketInfo(TicketInfo ticketInfo) {
|
||||
@@ -77,6 +78,7 @@ public class PreferencesUtils {
|
||||
public static void setFristSendGold(boolean isOpen) {
|
||||
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_FRIST_SEED_GOLD, isOpen);
|
||||
}
|
||||
|
||||
public static boolean readFristQQ() {
|
||||
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_FRIST_QQ, true);
|
||||
}
|
||||
@@ -84,6 +86,7 @@ public class PreferencesUtils {
|
||||
public static void setFristQQ(boolean isOpen) {
|
||||
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_FRIST_QQ, isOpen);
|
||||
}
|
||||
|
||||
public static boolean readFristUser() {
|
||||
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_FRIST_USER, true);
|
||||
}
|
||||
@@ -93,7 +96,6 @@ public class PreferencesUtils {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void saveStatusBarNotificationConfig(StatusBarNotificationConfig notificationConfig) {
|
||||
ObjectPref.instance(BasicConfig.INSTANCE.getAppContext()).put(KEY_NOTI_CONFIG, notificationConfig);
|
||||
}
|
||||
@@ -109,4 +111,12 @@ public class PreferencesUtils {
|
||||
saveTicketInfo(new TicketInfo());
|
||||
saveLoginInfo(new LoginInfo("", ""));
|
||||
}
|
||||
|
||||
public static void savePrivacyState(boolean privacy) {
|
||||
ObjectPref.instance(BasicConfig.INSTANCE.getAppContext()).put(KEY_AGREE_PRIVACY, privacy);
|
||||
}
|
||||
|
||||
public static boolean readPrivacyState() {
|
||||
return (boolean) ObjectPref.instance(BasicConfig.INSTANCE.getAppContext()).get(KEY_AGREE_PRIVACY, false);
|
||||
}
|
||||
}
|
||||
|
@@ -53,6 +53,7 @@ public class UserDetailInfo implements Serializable {
|
||||
* userGiftWall : [{"uid":935007,"giftPrice":100,"giftId":1362,"giftName":"棒棒糖","picUrl":"http://image.doudouyuyin.com/FutM6ydZBdAn6Iz_ro7mgen1Cmph?imageslim","reciveCount":152}]
|
||||
* dynamicInfo : [{"uid":935007,"worldId":-1,"content":"人生不如意之事 十之八九\n放下才是解脱","likeCount":1,"commentCount":2,"dynamicId":1339,"publishTime":1587726740000,"playCount":0,"type":2,"dynamicResList":[{"id":950,"resUrl":"https://image.zhongjialx.com/FhWRCGNLYybra8--ItDfuN3lpCIX?imageslim","resDuration":0,"format":"jpeg","width":2000,"height":1500}],"status":1,"isLike":false,"nick":"大幽魂上衣","avatar":"https://image.zhongjialx.com/rotate_picture_1587010848888.jpg?imageslim"},{"uid":935007,"worldId":-1,"content":"努力,才能保证你的价值🌹🌷💐🥀🍂🍁🌼🌸🌺🍃🌾🌱🌾🎍🌵🌵🌿🍀🌳🌳💐🌻🌷🌻","likeCount":1,"commentCount":1,"dynamicId":1337,"publishTime":1587726053000,"playCount":0,"type":2,"dynamicResList":[{"id":948,"resUrl":"https://image.zhongjialx.com/FhwRh_iAaqRkgsOZdHK3n3TM75Zq?imageslim","resDuration":0,"format":"jpeg","width":2000,"height":1500}],"status":1,"isLike":false,"nick":"大幽魂上衣","avatar":"https://image.zhongjialx.com/rotate_picture_1587010848888.jpg?imageslim"},{"uid":935007,"worldId":-1,"content":"盘他","likeCount":1,"commentCount":1,"dynamicId":1330,"publishTime":1587721604000,"playCount":0,"type":2,"dynamicResList":[{"id":947,"resUrl":"https://image.zhongjialx.com/FpthMLmgrkDHfEatTBKb0h05mnXj?imageslim","resDuration":0,"format":"jpeg","width":1080,"height":1672}],"status":1,"isLike":false,"nick":"大幽魂上衣","avatar":"https://image.zhongjialx.com/rotate_picture_1587010848888.jpg?imageslim"},{"uid":935007,"worldId":-1,"content":"铁汁,奥力给,没毛病吧?!","likeCount":1,"commentCount":3,"dynamicId":1329,"publishTime":1587720609000,"playCount":0,"type":2,"dynamicResList":[{"id":946,"resUrl":"https://image.zhongjialx.com/FtV48sdlmrKkc69OSft43J-S7wDk?imageslim","resDuration":0,"format":"png","width":1080,"height":1920}],"status":1,"isLike":false,"nick":"大幽魂上衣","avatar":"https://image.zhongjialx.com/rotate_picture_1587010848888.jpg?imageslim"},{"uid":935007,"worldId":-1,"content":"上热门🦆","likeCount":5,"commentCount":7,"dynamicId":1327,"publishTime":1587711821000,"playCount":0,"type":2,"dynamicResList":[{"id":938,"resUrl":"https://image.zhongjialx.com/FgInE7evjBy8lL33uHkmvORMlC1_?imageslim","resDuration":0,"format":"jpeg","width":1296,"height":1728}],"status":1,"isLike":false,"nick":"大幽魂上衣","avatar":"https://image.zhongjialx.com/rotate_picture_1587010848888.jpg?imageslim"}]
|
||||
* privatePhoto : [{"photoUrl":"https://image.zhongjialx.com/rotate_picture_1587010848888.jpg?imageslim","seqNo":0}]
|
||||
isReview boolean
|
||||
*/
|
||||
|
||||
private int uid;
|
||||
@@ -375,6 +376,7 @@ public class UserDetailInfo implements Serializable {
|
||||
|
||||
private String photoUrl;
|
||||
private int seqNo;
|
||||
private boolean isReview;
|
||||
|
||||
public String getPhotoUrl() {
|
||||
return photoUrl;
|
||||
@@ -391,6 +393,14 @@ public class UserDetailInfo implements Serializable {
|
||||
public void setSeqNo(int seqNo) {
|
||||
this.seqNo = seqNo;
|
||||
}
|
||||
|
||||
public boolean isReview() {
|
||||
return isReview;
|
||||
}
|
||||
|
||||
public void setReview(boolean review) {
|
||||
isReview = review;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -48,6 +48,10 @@ public class UserInfo implements Serializable {
|
||||
private String nick;
|
||||
//头像
|
||||
private String avatar;
|
||||
//isReview头像是否在审核中
|
||||
private boolean isReview;
|
||||
//新的头像
|
||||
private String newAvatar;
|
||||
//性别 1:男 2:女 0 :未知
|
||||
private int gender;
|
||||
//生日
|
||||
@@ -350,6 +354,8 @@ public class UserInfo implements Serializable {
|
||||
this.phone = userInfo.phone;
|
||||
this.isBindPhone = userInfo.isBindPhone;
|
||||
this.bindType = userInfo.bindType;
|
||||
this.isReview = userInfo.isReview;
|
||||
this.newAvatar = userInfo.newAvatar;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -537,6 +543,22 @@ public class UserInfo implements Serializable {
|
||||
return remainDay;
|
||||
}
|
||||
|
||||
public void setNewAvatar(String newAvatar) {
|
||||
this.newAvatar = newAvatar;
|
||||
}
|
||||
|
||||
public String getNewAvatar() {
|
||||
return newAvatar;
|
||||
}
|
||||
|
||||
public void setReview(boolean review) {
|
||||
isReview = review;
|
||||
}
|
||||
|
||||
public boolean isReview() {
|
||||
return isReview;
|
||||
}
|
||||
|
||||
public void setRemainDay(int remainDay) {
|
||||
this.remainDay = remainDay;
|
||||
}
|
||||
|
@@ -61,6 +61,7 @@
|
||||
|
||||
<!-- setting -->
|
||||
<color name="color_black_ff333333">#ff333333</color>
|
||||
<color name="color_transparent10_0A333333">#0A333333</color>
|
||||
<color name="color_black_ff666666">#ff666666</color>
|
||||
<color name="color_black_ff999999">#ff999999</color>
|
||||
<color name="color_gray_bfc2c5">#bfc2c5</color>
|
||||
|