Compare commits
30 Commits
release2.2
...
peko_relea
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3da5533ddc | ||
![]() |
df96cfe5d4 | ||
![]() |
213efcba31 | ||
![]() |
9e36225b77 | ||
![]() |
da3d72ebff | ||
![]() |
fd3dc7cb3c | ||
![]() |
eebe231a45 | ||
![]() |
276f2002f9 | ||
![]() |
2942e2f0bb | ||
![]() |
406077b43b | ||
![]() |
55a8d037e0 | ||
![]() |
ba58b0bd40 | ||
![]() |
151b1c37d0 | ||
![]() |
4a7af141aa | ||
![]() |
cec6e00e09 | ||
![]() |
bf6ef26eca | ||
![]() |
07845b5e60 | ||
![]() |
097ead1327 | ||
![]() |
2b45d35d40 | ||
![]() |
e6f4b40e66 | ||
![]() |
c46f19f03f | ||
![]() |
37196025cc | ||
![]() |
9096a9b57f | ||
![]() |
c46c49715c | ||
![]() |
31b785c511 | ||
![]() |
6f01c5ddad | ||
![]() |
306f15f7f9 | ||
![]() |
0babbedeb9 | ||
![]() |
d09e60d206 | ||
![]() |
e37796286b |
@@ -148,7 +148,7 @@ android {
|
||||
|
||||
buildTypes {
|
||||
def server_url_debug = '"http://beta.api.pekolive.com/"'
|
||||
def server_url_release = '"https://api.pekolive.com/"'
|
||||
def server_url_release = '"https://api.hfighting.com/"'
|
||||
|
||||
debug {
|
||||
println("minifyEnabled = " + minify_enabled)
|
||||
@@ -275,7 +275,7 @@ dependencies {
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
api 'com.tencent.vasdolly:helper:3.0.6'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
|
||||
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
|
||||
@@ -303,6 +303,7 @@ dependencies {
|
||||
implementation 'com.contrarywind:wheelview:4.1.0'
|
||||
|
||||
implementation 'tech.sud.mgp:SudMGP-static:1.3.3.1158'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
}
|
||||
|
||||
channel {
|
||||
|
@@ -829,6 +829,10 @@
|
||||
<activity
|
||||
android:name=".ui.webview.DatingRuleWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
<activity
|
||||
android:name=".ui.webview.room_banner.RoomBannerWebDialogActivity"
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".ui.webview.TarotPayWebViewActivity"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
|
1
app/src/main/assets/hot_region.json
Normal file
1
app/src/main/assets/hot_region.json
Normal file
@@ -0,0 +1 @@
|
||||
[{"name":"Taiwan","abbr":"TW","mcc":"466","code":"886"},{"name":"Hong Kong","abbr":"HK","mcc":"454","code":"852"},{"name":"Singapore","abbr":"SG","mcc":"525","code":"65"},{"name":"Malaysia","abbr":"MY","mcc":"502","code":"60"},{"name":"China","abbr":"CN","mcc":"460","code":"86"}]
|
1
app/src/main/assets/region.json
Normal file
1
app/src/main/assets/region.json
Normal file
File diff suppressed because one or more lines are too long
@@ -410,6 +410,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
}
|
||||
onParseIntent();
|
||||
handleNimIntent();
|
||||
InitialModel.get().regionCheck();
|
||||
}
|
||||
|
||||
private void onParseIntent() {
|
||||
@@ -519,6 +520,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLoadLoginUserInfoEvent(LoadLoginUserInfoEvent event) {
|
||||
firstLoadedUserInfo();
|
||||
InitialModel.get().regionCheck();
|
||||
}
|
||||
|
||||
public void onLogout() {
|
||||
|
@@ -16,6 +16,8 @@ import android.util.Log;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.chuhai.utils.LanguageUtils;
|
||||
import com.chuhai.utils.ServiceTime;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.facebook.stetho.Stetho;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
@@ -114,6 +116,9 @@ import io.realm.RealmConfiguration;
|
||||
public class XChatApplication extends BaseApp {
|
||||
public static final String TAG = "XChatApplication";
|
||||
public static Application gContext;
|
||||
|
||||
// 接收到退出登录事件(跳转到登录页了)
|
||||
private static long logoutEventTime = 0;
|
||||
private static final MessageNotifierCustomization messageNotifierCustomization = new MessageNotifierCustomization() {
|
||||
@Override
|
||||
public String makeNotifyContent(String nick, IMMessage message) {
|
||||
@@ -202,10 +207,11 @@ public class XChatApplication extends BaseApp {
|
||||
|
||||
String channel = "";
|
||||
channel = ChannelReaderUtil.getChannel(instance);
|
||||
Log.d(TAG, "localChannel:" + channel);
|
||||
if (TextUtils.isEmpty(channel)) {
|
||||
channel = Constants.GOOGLE;
|
||||
}
|
||||
|
||||
Log.d(TAG, "finalChannel:" + channel);
|
||||
BasicConfig.INSTANCE.setOriginalChannel(channel);
|
||||
|
||||
BasicConfig.INSTANCE.setChannel(channel);
|
||||
@@ -244,6 +250,13 @@ public class XChatApplication extends BaseApp {
|
||||
SingleToastUtil.showToast(serviceResult.getMessage());
|
||||
EventBus.getDefault().post(new NeedCompleteInfoEvent());
|
||||
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
|
||||
} else if (serviceResult.getCode() == 401) {
|
||||
if ((ServiceTime.INSTANCE.getTime() - logoutEventTime) > 800) {
|
||||
logoutEventTime = ServiceTime.INSTANCE.getTime();
|
||||
SingleToastUtil.showToast(serviceResult.getMessage());
|
||||
AuthModel.get().cleanLogInfo();
|
||||
}
|
||||
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -403,6 +416,7 @@ public class XChatApplication extends BaseApp {
|
||||
httpParams.put("deviceId", DeviceUuidFactory.getDeviceId(context));
|
||||
httpParams.put("androidId", MD5Utils.getMD5String(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)));
|
||||
httpParams.put("channel", AppMetaDataUtil.getChannelID());
|
||||
httpParams.put("lang", LanguageUtils.INSTANCE.getSystemLanguage().toLanguageTag());
|
||||
RxNet.init(context)
|
||||
.debug(BuildConfig.DEBUG)
|
||||
.setBaseUrl(url)
|
||||
|
@@ -225,6 +225,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
private SingleRoomTipDialog singleRoomTipDialog;
|
||||
// 通过红包进来时,有该参数
|
||||
private RedPackageNotifyInfo redPackageNotifyInfo;
|
||||
|
||||
// 是否禁用VP滑动(true:不允许滑动;false:某些条件下可以滑动)
|
||||
private boolean viewPagerInputDisable;
|
||||
|
||||
public static void start(Context context, long roomUid) {
|
||||
startForFromType(context, roomUid, FROM_TYPE_NORMAL, null, null);
|
||||
}
|
||||
@@ -396,7 +400,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
public void setCurrentItem(int item) {
|
||||
dismissLoadingDialog();
|
||||
if (viewpager != null) {
|
||||
viewpager.setUserInputEnabled(true);
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(item, false);
|
||||
}
|
||||
}
|
||||
@@ -411,7 +415,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
Object notifyInfo = intent.getSerializableExtra("notifyInfo");
|
||||
if (notifyInfo instanceof RedPackageNotifyInfo) {
|
||||
redPackageNotifyInfo = (RedPackageNotifyInfo) notifyInfo;
|
||||
}else{
|
||||
} else {
|
||||
redPackageNotifyInfo = null;
|
||||
}
|
||||
if (mRoomInfo != null) {
|
||||
@@ -445,7 +449,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
viewpager.setOffscreenPageLimit(2);
|
||||
viewpager.setOrientation(ViewPager2.ORIENTATION_VERTICAL);
|
||||
viewpager.getChildAt(0).setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
viewpager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
@@ -472,11 +476,11 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
if (state == 0 && viewpager.getCurrentItem() == 2) {
|
||||
showLoadingDialog();
|
||||
((FakeSingleRoomFragment) mAdapter.getItem(2)).tryJumpRoom();
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
} else if (state == 0 && viewpager.getCurrentItem() == 0) {
|
||||
showLoadingDialog();
|
||||
((FakeSingleRoomBackFragment) mAdapter.getItem(0)).tryJumpRoom();
|
||||
viewpager.setUserInputEnabled(false);
|
||||
disableViewPagerInput();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -663,7 +667,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
*/
|
||||
private void showRoomFragment(boolean isRoomMin) {
|
||||
mCurrentFragment = (HomePartyFragment) mAdapter.getItem(1);
|
||||
viewpager.setUserInputEnabled(AvRoomDataManager.get().isSingleRoom());
|
||||
tryEnabledViewPagerInput();
|
||||
viewpager.setCurrentItem(1, false);
|
||||
if (isRoomMin) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -1427,4 +1431,41 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onReceiveChatRoomEvent(RoomEvent roomEvent) {
|
||||
super.onReceiveChatRoomEvent(roomEvent);
|
||||
switch (roomEvent.getEvent()) {
|
||||
case RoomEvent.UP_MIC:
|
||||
case RoomEvent.DOWN_MIC:
|
||||
resetViewPagerInputEnabled();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用VP滑动
|
||||
*/
|
||||
private void disableViewPagerInput() {
|
||||
this.viewPagerInputDisable = true;
|
||||
resetViewPagerInputEnabled();
|
||||
}
|
||||
|
||||
private void tryEnabledViewPagerInput() {
|
||||
this.viewPagerInputDisable = false;
|
||||
resetViewPagerInputEnabled();
|
||||
}
|
||||
|
||||
private void resetViewPagerInputEnabled() {
|
||||
if (viewPagerInputDisable) {
|
||||
viewpager.setUserInputEnabled(false);
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isSingleRoom() && !AvRoomDataManager.get().isOwnerOnMic()) {
|
||||
// 个播+没在麦位=可以滑动
|
||||
viewpager.setUserInputEnabled(true);
|
||||
} else {
|
||||
viewpager.setUserInputEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -355,6 +355,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
updateRemoteMuteBtn()
|
||||
openOrCloseGiftValue(true)
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
onEnterRoom()
|
||||
}
|
||||
|
||||
RoomEvent.ADD_BLACK_LIST -> onChatRoomMemberBlackAdd(roomEvent.account)
|
||||
@@ -513,9 +514,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
//設置透明度
|
||||
rollPagerView.setAnimationDurtion(500)
|
||||
bannerAdapter.notifyDataSetChanged()
|
||||
bannerAdapter.setRoomActClickListener { url ->
|
||||
DialogWebViewActivity.start(mContext, url)
|
||||
}
|
||||
|
||||
// 模擬指示器在viewpager底部效果
|
||||
val viewPager = rollPagerView.viewPager
|
||||
@@ -1365,4 +1363,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
inputEdit.requestFocus()
|
||||
KeyBoardUtils.showKeyBoard(context, inputEdit)
|
||||
}
|
||||
|
||||
protected open fun onEnterRoom(){
|
||||
|
||||
}
|
||||
}
|
@@ -120,16 +120,10 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateFansTeamInfo(initInfo: FansTeamInitInfo) {
|
||||
var clickListener: View.OnClickListener? = null
|
||||
if (!AvRoomDataManager.get().isRoomOwner && !initInfo.isAnchorFans && initInfo.hasFansTeamCurrentRoom) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.isVisible = false
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
}
|
||||
|
||||
if (initInfo.hasFansTeamCurrentRoom) {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "粉絲團(${initInfo.anchorFansNum})"
|
||||
clickListener = View.OnClickListener {
|
||||
DialogWebViewActivity.start(
|
||||
@@ -139,12 +133,16 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
} else {
|
||||
if (initInfo.isAnchorFans) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text =
|
||||
"粉絲LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinedActivity.start(requireContext())
|
||||
}
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.isVisible = false
|
||||
clickListener = View.OnClickListener {
|
||||
FansTeamJoinActivity.start(requireContext())
|
||||
}
|
||||
@@ -152,6 +150,8 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "開通粉絲團"
|
||||
clickListener = View.OnClickListener {
|
||||
CommonWebViewActivity.start(
|
||||
@@ -160,6 +160,8 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
)
|
||||
}
|
||||
} else {
|
||||
gameBinding.flFansTeamJoinTip.isVisible = false
|
||||
gameBinding.tvFansTeamOpt.isVisible = true
|
||||
gameBinding.tvFansTeamOpt.text = "該主播暫未開通粉絲團"
|
||||
}
|
||||
}
|
||||
@@ -230,6 +232,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun onEnterRoom() {
|
||||
super.onEnterRoom()
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleRoomPKMicroViewAdapter) {
|
||||
|
@@ -34,7 +34,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
private val TAG = "GameDelegate"
|
||||
private var APP_CODE = ""
|
||||
|
||||
private val mRoomID = AvRoomDataManager.get().roomUid.toString()
|
||||
private val mRoomID :String get() = AvRoomDataManager.get().roomUid.toString()
|
||||
private val mLanguage = "zh-TW" //語言
|
||||
|
||||
//調用遊戲SDK的接口,成功加載遊戲後可用:
|
||||
@@ -84,7 +84,10 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
}
|
||||
|
||||
fun updateGame(mgId: Long?) {
|
||||
if (mgId == null || mgId == 0L || mgId == mMGID || iSudFSTAPP == null) return
|
||||
if (mgId == null || mgId == 0L) return
|
||||
if (mgId == mMGID && iSudFSTAPP != null) {
|
||||
return
|
||||
}
|
||||
mMGID = mgId
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||
loadMG(activity, mUid, mRoomID, APP_CODE, mMGID, mLanguage)
|
||||
|
@@ -120,7 +120,6 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
exitRoom();
|
||||
}
|
||||
AvRoomDataManager.get().updateServiceRoomInfo(roomInfo);
|
||||
initAnotherPKData();
|
||||
mAvRoomModel.enterRoom(roomInfo.getRoomId(), 3, fromType, fromNick, fromUid)
|
||||
.flatMap(this::dealServerMicInfo)
|
||||
.map(this::dealMicMemberFromIMNet)
|
||||
@@ -143,6 +142,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
.subscribe((stringServiceResult) -> EventBus.getDefault().post(new AudioPartyOpenEvent()));
|
||||
mAvRoomModel.loadMessageHistory(AvRoomDataManager.get().clearScreenTime);
|
||||
IMNetEaseManager.get().joinAvRoom();
|
||||
initAnotherPKData();
|
||||
}, this::dealEnterRoomError);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,12 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
RoomPKModel.INSTANCE.getRoomPKData(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomPkBean -> AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean));
|
||||
.subscribe(roomPkBean -> {
|
||||
AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean);
|
||||
if (AvRoomDataManager.get().isSingleRoom()){
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -70,10 +70,20 @@ public class RoomManagerPresenter extends BaseMvpPresenter<IRoomManagerView> {
|
||||
Iterator<ChatRoomMember> iterator = paramList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ChatRoomMember member = iterator.next();
|
||||
if (member != null
|
||||
&& !TextUtils.isEmpty(member.getAccount())
|
||||
&& map.containsKey(member.getAccount())) {
|
||||
iterator.remove();
|
||||
if (member != null && !TextUtils.isEmpty(member.getAccount())) {
|
||||
if (map.containsKey(member.getAccount())) {
|
||||
iterator.remove();
|
||||
} else {
|
||||
if (member.getNick() == null || member.getAvatar() == null) {
|
||||
for (UserInfo info : userInfos) {
|
||||
if (String.valueOf(info.getUid()).equals(member.getAccount())) {
|
||||
member.setNick(info.getNick());
|
||||
member.setAvatar(info.getAvatar());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return paramList;
|
||||
|
@@ -17,8 +17,10 @@ import com.yizhuan.erban.ui.user.activity.UserInfoActivity
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SingleRoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -30,7 +32,7 @@ class SingleRoomPKBoardView @JvmOverloads constructor(
|
||||
) : FrameLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private val binding = LayoutSingleRoomPkBoardViewBinding.inflate(LayoutInflater.from(context))
|
||||
private val observer = Observer<RoomPkBean> { updateView(it) }
|
||||
private val observer = Observer<RoomPkBean?> { updateView(it) }
|
||||
private var disposable: Disposable? = null
|
||||
private var roomPkBean: RoomPkBean? = null
|
||||
|
||||
@@ -55,6 +57,20 @@ class SingleRoomPKBoardView @JvmOverloads constructor(
|
||||
SingleRoomPkRuleDialog.newInstance().show(context)
|
||||
}
|
||||
|
||||
binding.ivMuteAnother.setOnClickListener {
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
roomPkBean?.let {
|
||||
if (it.roundId == null) {
|
||||
return@let
|
||||
}
|
||||
SingleRoomPKModel
|
||||
.muteSingleRoomPkOtherMic(it.roundId, it.aMicStatus xor 1)
|
||||
.subscribe()
|
||||
}
|
||||
} else {
|
||||
"主播已關閉對方房間的聲音".toast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
@@ -118,7 +134,13 @@ class SingleRoomPKBoardView @JvmOverloads constructor(
|
||||
binding.ivPkResult.isVisible = true
|
||||
binding.ivPkResult.setImageResource(R.drawable.single_room_pk_ic_result_win)
|
||||
}
|
||||
|
||||
if (roomPkBean?.aMicStatus == 0) {
|
||||
binding.ivMuteAnother.isVisible = true
|
||||
binding.ivMuteAnother.setImageResource(R.drawable.single_room_pk_ic_another_mic_close)
|
||||
} else {
|
||||
binding.ivMuteAnother.setImageResource(R.drawable.single_room_pk_ic_another_mic_open)
|
||||
binding.ivMuteAnother.isVisible = AvRoomDataManager.get().isRoomOwner
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -230,7 +230,7 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
|
||||
RoomEvent.ROOM_PK_NOTIFY -> addRoomPKNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.SINGLE_ROOM_PK_NOTIFY -> addSingleRoomPKNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY -> showRoomRankNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY -> showSingleRoomRankNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.ROOM_RANK_TOP_NOTIFY -> showRoomRankNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.ROOM_CAR_EFFECT_HIDE -> {
|
||||
isHideCarEffect = true
|
||||
@@ -1907,6 +1907,27 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
|
||||
private fun showSingleRoomRankNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
binding.clNotify.visibility = VISIBLE
|
||||
}
|
||||
val roomPkBean = (chatRoomMessage.attachment as SingleRoomRankAttachment).msgBean
|
||||
val rootView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.layout_single_room_rank_notify, null)
|
||||
(rootView.findViewById<View>(R.id.tv_nick) as TextView).text =
|
||||
roomPkBean.nick.subAndReplaceDot(6)
|
||||
(rootView.findViewById<View>(R.id.tv_desc) as TextView).text = roomPkBean.desc
|
||||
rootView.findViewById<ImageView>(R.id.iv_avatar).load(roomPkBean.avatar)
|
||||
rootView.setOnClickListener { AVRoomActivity.start(context, roomPkBean.uid) }
|
||||
binding.flSingleRoomRankNotify.addView(rootView)
|
||||
animationLuckyGift = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
rootView.startAnimation(animationLuckyGift)
|
||||
binding.flSingleRoomRankNotify.postDelayed({
|
||||
binding.flSingleRoomRankNotify.removeView(
|
||||
rootView
|
||||
)
|
||||
}, SHOW_TIME.toLong())
|
||||
}
|
||||
|
||||
private fun showRoomRankNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
|
@@ -15,7 +15,7 @@ import java.lang.reflect.ParameterizedType
|
||||
abstract class BaseDialog<T : ViewBinding> : RxDialogFragment() {
|
||||
|
||||
val isViewLoaded: Boolean get() = _binding != null
|
||||
private var _binding: T? = null
|
||||
protected var _binding: T? = null
|
||||
private var onDismissListener: (() -> Unit)? = null
|
||||
val binding get() = _binding!!
|
||||
open var width = ScreenUtil.getDialogWidth()
|
||||
|
@@ -2,33 +2,24 @@ package com.yizhuan.erban.common.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Bitmap.Config;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.Outline;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.ImageView;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.shape.CornerFamily;
|
||||
import com.google.android.material.shape.ShapeAppearanceModel;
|
||||
import com.yizhuan.erban.R;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义View,实现圆角,圆形等效果
|
||||
*
|
||||
* @author zhy
|
||||
*/
|
||||
public class RectRoundImageView extends ImageView {
|
||||
public class RectRoundImageView extends ShapeableImageView {
|
||||
|
||||
/**
|
||||
* TYPE_CIRCLE / TYPE_ROUND
|
||||
@@ -37,42 +28,11 @@ public class RectRoundImageView extends ImageView {
|
||||
public static final int TYPE_CIRCLE = 0;
|
||||
public static final int TYPE_ROUND = 1;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private Bitmap mSrc;
|
||||
|
||||
/**
|
||||
* 圆角的大小
|
||||
*/
|
||||
private int mRadius = 8;
|
||||
|
||||
/**
|
||||
* 控件的宽度
|
||||
*/
|
||||
private int mWidth;
|
||||
/**
|
||||
* 控件的高度
|
||||
*/
|
||||
private int mHeight;
|
||||
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getmRadius() {
|
||||
return mRadius;
|
||||
}
|
||||
|
||||
public void setmRadius(int mRadius) {
|
||||
this.mRadius = mRadius;
|
||||
}
|
||||
|
||||
public RectRoundImageView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
@@ -98,17 +58,6 @@ public class RectRoundImageView extends ImageView {
|
||||
for (int i = 0; i < n; i++) {
|
||||
int attr = a.getIndex(i);
|
||||
switch (attr) {
|
||||
case R.styleable.RectRoundImageView_src:
|
||||
// mSrc = BitmapFactory.decodeResource(getResources(),
|
||||
// a.getResourceId(attr, 0));
|
||||
InputStream is = getResources().openRawResource(a.getResourceId(attr, 0));
|
||||
BitmapFactory.Options opts = new BitmapFactory.Options();
|
||||
opts.inTempStorage = new byte[100 * 1024];
|
||||
opts.inPreferredConfig = Config.RGB_565;
|
||||
opts.inPurgeable = true;
|
||||
opts.inSampleSize = 4;
|
||||
mSrc = BitmapFactory.decodeStream(is, null, opts);
|
||||
break;
|
||||
case R.styleable.RectRoundImageView_type:
|
||||
type = a.getInt(attr, 0);// 默认为Circle
|
||||
break;
|
||||
@@ -121,197 +70,25 @@ public class RectRoundImageView extends ImageView {
|
||||
}
|
||||
setScaleType(ScaleType.CENTER_CROP);
|
||||
a.recycle();
|
||||
setup(type, mRadius);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算控件的高度和宽度
|
||||
*/
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
Drawable drawable = getDrawable();
|
||||
if (null != drawable) {
|
||||
mSrc = drawableToBitmap(getDrawable());
|
||||
}
|
||||
/**
|
||||
* 设置宽度
|
||||
*/
|
||||
int specMode = MeasureSpec.getMode(widthMeasureSpec);
|
||||
int specSize = MeasureSpec.getSize(widthMeasureSpec);
|
||||
|
||||
if (specMode == MeasureSpec.EXACTLY)// match_parent , accurate
|
||||
{
|
||||
mWidth = specSize;
|
||||
} else {
|
||||
// 由图片决定的宽
|
||||
int desireByImg = getPaddingLeft() + getPaddingRight()
|
||||
+ mSrc.getWidth();
|
||||
if (specMode == MeasureSpec.AT_MOST)// wrap_content
|
||||
{
|
||||
mWidth = Math.min(desireByImg, specSize);
|
||||
} else
|
||||
mWidth = desireByImg;
|
||||
}
|
||||
|
||||
/***
|
||||
* 设置高度
|
||||
*/
|
||||
|
||||
specMode = MeasureSpec.getMode(heightMeasureSpec);
|
||||
specSize = MeasureSpec.getSize(heightMeasureSpec);
|
||||
if (specMode == MeasureSpec.EXACTLY)// match_parent , accurate
|
||||
{
|
||||
mHeight = specSize;
|
||||
} else {
|
||||
int desire = getPaddingTop() + getPaddingBottom()
|
||||
+ mSrc.getHeight();
|
||||
|
||||
if (specMode == MeasureSpec.AT_MOST)// wrap_content
|
||||
{
|
||||
mHeight = Math.min(desire, specSize);
|
||||
} else
|
||||
mHeight = desire;
|
||||
}
|
||||
|
||||
setMeasuredDimension(mWidth, mHeight);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制
|
||||
*/
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
|
||||
switch (type) {
|
||||
// 如果是TYPE_CIRCLE绘制圆形
|
||||
case TYPE_CIRCLE:
|
||||
int min = Math.min(mWidth, mHeight);
|
||||
/**
|
||||
* 长度如果不一致,按小的值进行压缩
|
||||
*/
|
||||
if (null != mSrc) {
|
||||
mSrc = Bitmap.createScaledBitmap(mSrc, min, min, false);
|
||||
canvas.drawBitmap(createCircleImage(mSrc, min), 0, 0, null);
|
||||
private void setup(int type, int cornerSize) {
|
||||
if (type == TYPE_CIRCLE) {
|
||||
setOutlineProvider(new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
int min = Math.min(view.getWidth(), view.getHeight());
|
||||
int left = (view.getWidth() - min) / 2;
|
||||
int top = (view.getHeight() - min) / 2;
|
||||
outline.setOval(left, top, min, min);
|
||||
}
|
||||
break;
|
||||
case TYPE_ROUND:
|
||||
canvas.drawBitmap(createFramedPhoto(mWidth, mHeight, mSrc, mRadius), 0, 0, null);
|
||||
break;
|
||||
});
|
||||
setClipToOutline(true);
|
||||
} else if (type == TYPE_ROUND) {
|
||||
setShapeAppearanceModel(ShapeAppearanceModel.builder()
|
||||
.setAllCorners(CornerFamily.ROUNDED, cornerSize)
|
||||
.build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Drawable → Bitmap
|
||||
*
|
||||
* @param drawable
|
||||
* @return
|
||||
*/
|
||||
|
||||
public static Bitmap drawableToBitmap(Drawable drawable) {
|
||||
|
||||
|
||||
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
|
||||
|
||||
drawable.getIntrinsicHeight(),
|
||||
|
||||
drawable.getOpacity() != PixelFormat.OPAQUE ? Config.ARGB_8888
|
||||
|
||||
: Config.RGB_565);
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
|
||||
//canvas.setBitmap(bitmap);
|
||||
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
|
||||
drawable.draw(canvas);
|
||||
|
||||
return bitmap;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据原图和变长绘制圆形图片
|
||||
*
|
||||
* @param source
|
||||
* @param min
|
||||
* @return
|
||||
*/
|
||||
private Bitmap createCircleImage(Bitmap source, int min) {
|
||||
final Paint paint = new Paint();
|
||||
paint.setAntiAlias(true);
|
||||
Bitmap target = Bitmap.createBitmap(min, min, Config.RGB_565);
|
||||
/**
|
||||
* 产生一个同样大小的画布
|
||||
*/
|
||||
Canvas canvas = new Canvas(target);
|
||||
/**
|
||||
* 首先绘制圆形
|
||||
*/
|
||||
canvas.drawCircle(min / 2, min / 2, min / 2, paint);
|
||||
/**
|
||||
* 使用SRC_IN,参考上面的说明
|
||||
*/
|
||||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
/**
|
||||
* 绘制图片
|
||||
*/
|
||||
canvas.drawBitmap(source, 0, 0, paint);
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据原图添加圆角
|
||||
*
|
||||
* @param source
|
||||
* @return
|
||||
*/
|
||||
private Bitmap createRoundConerImage(Bitmap source) {
|
||||
final Paint paint = new Paint();
|
||||
paint.setAntiAlias(true);
|
||||
Bitmap target = Bitmap.createBitmap(mWidth, mHeight, Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(target);
|
||||
RectF rect = new RectF(0, 0, source.getWidth(), source.getHeight());
|
||||
canvas.drawRoundRect(rect, mRadius, mRadius, paint);
|
||||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
canvas.drawBitmap(source, 0, 0, paint);
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param x 图像的宽度
|
||||
* @param y 图像的高度
|
||||
* @param image 源图片
|
||||
* @param outerRadiusRat 圆角的大小
|
||||
* @return 圆角图片
|
||||
*/
|
||||
Bitmap createFramedPhoto(int x, int y, Bitmap image, float outerRadiusRat) {
|
||||
//根据源文件新建一个darwable对象
|
||||
Drawable imageDrawable = new BitmapDrawable(image);
|
||||
// 新建一个新的输出图片
|
||||
Bitmap output = Bitmap.createBitmap(x, y, Config.ARGB_8888);
|
||||
|
||||
Canvas canvas = new Canvas(output);
|
||||
|
||||
// 新建一个矩形
|
||||
RectF outerRect = new RectF(0, 0, x, y);
|
||||
|
||||
// 产生一个红色的圆角矩形
|
||||
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
paint.setColor(Color.RED);
|
||||
canvas.drawRoundRect(outerRect, outerRadiusRat, outerRadiusRat, paint);
|
||||
|
||||
// 将源图片绘制到这个圆角矩形上
|
||||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||
imageDrawable.setBounds(0, 0, x, y);
|
||||
canvas.saveLayer(outerRect, paint, Canvas.ALL_SAVE_FLAG);
|
||||
imageDrawable.draw(canvas);
|
||||
canvas.restore();
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ class FansTeamJoinActivity : BaseViewBindingActivity<ActivityFansTeamJoinBinding
|
||||
?.let { privilegeConfig ->
|
||||
binding.ivJoinLogo.load(privilegeConfig.icon)
|
||||
binding.tvJoin.text = privilegeConfig.name
|
||||
binding.tvJoin.setOnClickListener {
|
||||
binding.bgJoin.setOnClickListener {
|
||||
privilegeConfig.giftVo?.let { giftInfo ->
|
||||
GiftModel.get().sendFansTeamGift(
|
||||
giftInfo.giftId,
|
||||
|
@@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||
import com.yizhuan.xchat_android_core.fansteam.*
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
|
||||
class FansTeamViewModel : BaseViewModel() {
|
||||
@@ -37,6 +38,9 @@ class FansTeamViewModel : BaseViewModel() {
|
||||
}
|
||||
|
||||
fun loadFansTeamInitInfo() {
|
||||
if (AvRoomDataManager.get().roomUid == 0L) {
|
||||
return
|
||||
}
|
||||
safeLaunch {
|
||||
_fansTeamInitInfoLiveData.value = FansTeamModel.getFansTeamInitInfo()
|
||||
}
|
||||
|
@@ -1,95 +0,0 @@
|
||||
package com.yizhuan.erban.home.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.treasurefairy.HomeFairyActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomActAdapter extends StaticPagerAdapter {
|
||||
|
||||
private Context mContext;
|
||||
private List<BannerInfo> data;
|
||||
private RoomActClickListener listener;
|
||||
|
||||
public RoomActAdapter(Context context, List<BannerInfo> data) {
|
||||
this.data = data;
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(ViewGroup container, int position) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.item_room_act, container, false);
|
||||
ImageView ivCover = view.findViewById(R.id.iv_cover);
|
||||
BannerInfo bannerInfo = data.get(position);
|
||||
String actId = String.valueOf(bannerInfo.getBannerId());
|
||||
ivCover.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
if (bannerInfo.isFairy()) {
|
||||
ivCover.setImageResource(R.drawable.ic_fairy_entrance);
|
||||
} else if (bannerInfo.isFirstCharge()) {
|
||||
ivCover.setImageResource(R.drawable.ic_first_charge_enter);
|
||||
} else if (bannerInfo.isBox()) {
|
||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(ivCover);
|
||||
} else if (bannerInfo.isRadish()) {
|
||||
ivCover.setImageResource(R.drawable.ic_radish_entrance);
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(mContext, bannerInfo.getBannerPic(), ivCover, R.drawable.default_cover);
|
||||
}
|
||||
ivCover.setOnClickListener(v -> {
|
||||
if (bannerInfo.isFairy()) {
|
||||
HomeFairyActivity.start(mContext);
|
||||
} else if (bannerInfo.isFirstCharge()) {
|
||||
FirstChargeDialog.start(mContext);
|
||||
} else if (bannerInfo.isBox()) {
|
||||
GoldBoxHelper.handleBoxClick(mContext);
|
||||
} else if (bannerInfo.isRadish()) {
|
||||
PullRadishActivity.start(mContext);
|
||||
} else {
|
||||
AvRoomModel.get().activityClickLog("2", actId).subscribe();
|
||||
if (bannerInfo.getSkipType() == 3 && bannerInfo.getShowType() != 1) {
|
||||
if (listener != null) {
|
||||
listener.onWebClick(bannerInfo.getSkipUri());
|
||||
}
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(mContext, bannerInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (data != null) {
|
||||
return data.size();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setRoomActClickListener(RoomActClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public interface RoomActClickListener {
|
||||
void onWebClick(String url);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,80 @@
|
||||
package com.yizhuan.erban.home.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import com.netease.nim.uikit.support.glide.GlideApp
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.treasurefairy.HomeFairyActivity
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.erban.ui.webview.room_banner.RoomBannerWebDialogActivity
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig
|
||||
import okhttp3.internal.filterList
|
||||
|
||||
class RoomActAdapter(private val mContext: Context, private val data: List<BannerInfo>) :
|
||||
StaticPagerAdapter() {
|
||||
override fun getView(container: ViewGroup, position: Int): View {
|
||||
val view = LayoutInflater.from(mContext).inflate(R.layout.item_room_act, container, false)
|
||||
val ivCover = view.findViewById<ImageView>(R.id.iv_cover)
|
||||
val bannerInfo = data[position]
|
||||
val actId = bannerInfo.bannerId.toString()
|
||||
ivCover.scaleType = ImageView.ScaleType.CENTER_CROP
|
||||
if (bannerInfo.isFairy) {
|
||||
ivCover.setImageResource(R.drawable.ic_fairy_entrance)
|
||||
} else if (bannerInfo.isFirstCharge) {
|
||||
ivCover.setImageResource(R.drawable.ic_first_charge_enter)
|
||||
} else if (bannerInfo.isBox) {
|
||||
GlideApp.with(BasicConfig.INSTANCE.appContext)
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(ivCover)
|
||||
} else if (bannerInfo.isRadish) {
|
||||
ivCover.setImageResource(R.drawable.ic_radish_entrance)
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
bannerInfo.bannerPic,
|
||||
ivCover,
|
||||
R.drawable.default_cover
|
||||
)
|
||||
}
|
||||
ivCover.setOnClickListener { v: View? ->
|
||||
if (bannerInfo.isFairy) {
|
||||
HomeFairyActivity.start(mContext)
|
||||
} else if (bannerInfo.isFirstCharge) {
|
||||
FirstChargeDialog.start(mContext)
|
||||
} else if (bannerInfo.isBox) {
|
||||
GoldBoxHelper.handleBoxClick(mContext)
|
||||
} else if (bannerInfo.isRadish) {
|
||||
PullRadishActivity.start(mContext)
|
||||
} else {
|
||||
AvRoomModel.get().activityClickLog("2", actId).subscribe()
|
||||
if (bannerInfo.skipType == 3) {
|
||||
val list = data.filterList {
|
||||
skipType == 3
|
||||
}
|
||||
val newPosition = list.indexOfFirst {
|
||||
it == bannerInfo
|
||||
}
|
||||
RoomBannerWebDialogActivity.start(mContext, newPosition, list)
|
||||
} else {
|
||||
CommonJumpHelper.bannerJump(mContext, bannerInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
return view
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return data.size
|
||||
}
|
||||
}
|
@@ -3,17 +3,19 @@ package com.yizhuan.erban.ui.login
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chuhai.utils.UiUtils
|
||||
import com.chuhai.utils.ktx.getColorById
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivityAreaCodeBinding
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.auth.bean.AreaInfoBean
|
||||
import com.yizhuan.xchat_android_core.utils.Logger
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
import com.yizhuan.erban.ui.widget.SideBarView
|
||||
import com.yizhuan.xchat_android_core.region.RegionHelper
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
/**
|
||||
* 区号
|
||||
@@ -22,7 +24,9 @@ import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
*/
|
||||
class AreaCodeActivity : BaseViewBindingActivity<ActivityAreaCodeBinding>() {
|
||||
|
||||
private val mCountries = ArrayList<AreaInfoBean>()
|
||||
private val regionRepository = RegionHelper()
|
||||
|
||||
private val adapter = RegionListAdapter()
|
||||
|
||||
companion object {
|
||||
const val COUNTRY_NUMBER = "country_number"
|
||||
@@ -39,55 +43,51 @@ class AreaCodeActivity : BaseViewBindingActivity<ActivityAreaCodeBinding>() {
|
||||
|
||||
override fun init() {
|
||||
initTitleBar(getString(R.string.select_area_code))
|
||||
initCountryData()
|
||||
initListView()
|
||||
initSideBar()
|
||||
loadData()
|
||||
}
|
||||
|
||||
private fun initCountryData() {
|
||||
val countryList = resources.getStringArray(R.array.country_code_list_ch)
|
||||
for (s in countryList) {
|
||||
val country = s.split("*").toTypedArray()
|
||||
val countryName = country[0]
|
||||
val countryNumber = country[1]
|
||||
val c = AreaInfoBean(
|
||||
name = countryName,
|
||||
phoneAreaCode = countryNumber
|
||||
)
|
||||
mCountries.add(c)
|
||||
private fun initSideBar() {
|
||||
binding.sideBarView.setTextColor(context.getColorById(R.color.color_5caaff))
|
||||
binding.sideBarView.setTextSize(UiUtils.dip2px(12f).toFloat())
|
||||
binding.sideBarView.setListener(object : SideBarView.Listener {
|
||||
override fun onSideBarScroll(word: String) {
|
||||
val index = adapter.data.indexOfFirst {
|
||||
it.itemType == RegionListAdapter.ITEM_TYPE_GROUP && it.groupName?.toString() == word
|
||||
}
|
||||
if (index >= 0) {
|
||||
binding.mRecyclerView.scrollToPosition(index)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSideBarScrollEnd() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun loadData() {
|
||||
lifecycleScope.launch {
|
||||
val list = regionRepository.getRegionSelectorList(RegionListAdapter.ITEM_TYPE_GROUP)
|
||||
withContext(Dispatchers.Main) {
|
||||
adapter.setNewData(list)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initListView() {
|
||||
val mAdapter = object :
|
||||
BaseQuickAdapter<AreaInfoBean, BaseViewHolder>(R.layout.item_country) {
|
||||
override fun convert(helper: BaseViewHolder, item: AreaInfoBean) {
|
||||
helper.setText(R.id.tv_name, item.name)
|
||||
helper.setText(R.id.tv_country_code, "+${item.phoneAreaCode}")
|
||||
}
|
||||
}
|
||||
binding.mRecyclerView.adapter = mAdapter
|
||||
mAdapter.setNewData(mCountries)
|
||||
binding.mRecyclerView.adapter = adapter
|
||||
//返回国家
|
||||
mAdapter.setOnItemClickListener { adapter: BaseQuickAdapter<*, *>?, view: View?, position: Int ->
|
||||
val country = mAdapter.data[position]
|
||||
adapter.setOnItemClickListener { adapter: BaseQuickAdapter<*, *>?, view: View?, position: Int ->
|
||||
val region = this.adapter.getItem(position)
|
||||
if (region?.code.isNullOrEmpty()) {
|
||||
return@setOnItemClickListener
|
||||
}
|
||||
val intent = Intent()
|
||||
intent.putExtra(COUNTRY_NUMBER, "+${country.phoneAreaCode}")
|
||||
intent.putExtra(COUNTRY_NUMBER, region?.fullCode)
|
||||
setResult(RESULT_OK, intent)
|
||||
finish()
|
||||
}
|
||||
|
||||
AuthModel.get()
|
||||
.areaCodeList
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(object : BeanObserver<List<AreaInfoBean>>() {
|
||||
override fun onErrorMsg(error: String) {
|
||||
Logger.error("areaCode", error)
|
||||
}
|
||||
|
||||
override fun onSuccess(list: List<AreaInfoBean>) {
|
||||
mAdapter.setNewData(list)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun needSteepStateBar() = true
|
||||
@@ -97,5 +97,4 @@ class AreaCodeActivity : BaseViewBindingActivity<ActivityAreaCodeBinding>() {
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
}
|
@@ -16,9 +16,9 @@ import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivityBindPhoneBinding
|
||||
import com.yizhuan.erban.ui.login.BindPhoneActivity
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.code.CodeType
|
||||
import com.yizhuan.xchat_android_core.region.RegionHelper
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_library.utils.NetworkUtils
|
||||
@@ -50,6 +50,7 @@ class BindPhoneActivity : BaseViewBindingActivity<ActivityBindPhoneBinding>(),
|
||||
override fun init() {
|
||||
initTitleBar(getString(R.string.text_bind_phone))
|
||||
initListener()
|
||||
RegionHelper().loadRecommendRegion(lifecycle, binding.tvAreaCode)
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
|
@@ -35,7 +35,7 @@ import com.yizhuan.xchat_android_core.code.CodeType;
|
||||
import com.yizhuan.xchat_android_library.common.SpConstants;
|
||||
import com.yizhuan.xchat_android_library.common.util.SPUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper;
|
||||
|
||||
import com.yizhuan.xchat_android_core.region.RegionHelper;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@@ -90,6 +90,7 @@ public class LoginPasswordActivity extends BaseActivity {
|
||||
setContentView(R.layout.activity_login_password);
|
||||
EventBus.getDefault().register(this);
|
||||
initView();
|
||||
new RegionHelper().loadRecommendRegion(getLifecycle(), tvAreaCode);
|
||||
}
|
||||
|
||||
private void checkInput() {
|
||||
|
@@ -16,6 +16,7 @@ import com.yizhuan.erban.databinding.ActivityLoginPhoneBinding
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.auth.event.LoginEvent
|
||||
import com.yizhuan.xchat_android_core.code.CodeType
|
||||
import com.yizhuan.xchat_android_core.region.RegionHelper
|
||||
import io.reactivex.SingleObserver
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -43,6 +44,7 @@ class LoginPhoneActivity : BaseViewBindingActivity<ActivityLoginPhoneBinding>(),
|
||||
override fun init() {
|
||||
EventBus.getDefault().register(this)
|
||||
initListener()
|
||||
RegionHelper().loadRecommendRegion(lifecycle, binding.tvAreaCode)
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
|
@@ -0,0 +1,32 @@
|
||||
package com.yizhuan.erban.ui.login
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.xchat_android_core.region.bean.RegionBean
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/12/7 19:34
|
||||
* Desc:
|
||||
**/
|
||||
class RegionListAdapter() :
|
||||
BaseMultiItemQuickAdapter<RegionBean, BaseViewHolder>(ArrayList<RegionBean>()) {
|
||||
|
||||
companion object {
|
||||
const val ITEM_TYPE_GROUP = 1
|
||||
}
|
||||
|
||||
init {
|
||||
addItemType(0, R.layout.region_item_def)
|
||||
addItemType(ITEM_TYPE_GROUP, R.layout.region_item_group)
|
||||
}
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: RegionBean?) {
|
||||
if (helper.itemViewType == ITEM_TYPE_GROUP) {
|
||||
helper.setText(R.id.tv_group, item?.groupName?.toString() ?: "")
|
||||
}
|
||||
helper.setText(R.id.tv_name, item?.name ?: "")
|
||||
helper.setText(R.id.tv_country_code, "+${item?.code}")
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
package com.yizhuan.erban.ui.search;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
@@ -15,6 +16,7 @@ import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.friend.action.AbstractSelectFriendAction;
|
||||
import com.yizhuan.erban.ui.user.activity.UserInfoActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.NobleAvatarView;
|
||||
import com.yizhuan.erban.utils.RegexUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.SearchRoomInfo;
|
||||
@@ -112,16 +114,17 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
holder.mNobleAvatarView.setData(item.getAvatar(), item.nobleUsers);
|
||||
holder.erbanNo.setText(context.getString(R.string.me_user_id, item.getErbanNo()));
|
||||
|
||||
if (item.getGender() == 1) {
|
||||
holder.mIvSex.setVisibility(View.VISIBLE);
|
||||
holder.mIvSex.setImageResource(R.drawable.ic_gender_male);
|
||||
} else if (item.getGender() == 2) {
|
||||
holder.mIvSex.setVisibility(View.VISIBLE);
|
||||
holder.mIvSex.setImageResource(R.drawable.ic_gender_female);
|
||||
} else {
|
||||
holder.mIvSex.setVisibility(View.GONE);
|
||||
holder.wealthLevelView.setVisibility(View.GONE);
|
||||
if (item.getUserLevelVo() != null && !TextUtils.isEmpty(item.getUserLevelVo().getExperUrl())) {
|
||||
holder.wealthLevelView.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(mContext, item.getUserLevelVo().getExperUrl(), holder.wealthLevelView);
|
||||
}
|
||||
|
||||
holder.charmLevelView.setVisibility(View.GONE);
|
||||
if (item.getUserLevelVo() != null && !TextUtils.isEmpty(item.getUserLevelVo().getCharmUrl())) {
|
||||
holder.charmLevelView.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(mContext, item.getUserLevelVo().getCharmUrl(), holder.charmLevelView);
|
||||
}
|
||||
}
|
||||
|
||||
static class ViewHolder extends BaseViewHolder {
|
||||
@@ -132,7 +135,8 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
private ImageView ivLive;
|
||||
RelativeLayout container;
|
||||
private NobleAvatarView mNobleAvatarView;
|
||||
private ImageView mIvSex;
|
||||
private ImageView wealthLevelView;
|
||||
private ImageView charmLevelView;
|
||||
private SuperTextView stvOp;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
@@ -142,7 +146,8 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
erbanNo = itemView.findViewById(R.id.erban_no);
|
||||
container = itemView.findViewById(R.id.container);
|
||||
mNobleAvatarView = itemView.findViewById(R.id.noble_avatar_view);
|
||||
mIvSex = itemView.findViewById(R.id.sex);
|
||||
wealthLevelView = itemView.findViewById(R.id.iv_user_level);
|
||||
charmLevelView = itemView.findViewById(R.id.iv_user_charm);
|
||||
ivLive = itemView.findViewById(R.id.iv_living);
|
||||
tvOnlineNum = itemView.findViewById(R.id.tv_online_num);
|
||||
stvOp = itemView.findViewById(R.id.stv_op);
|
||||
|
@@ -20,6 +20,7 @@ import com.yizhuan.erban.ui.login.BindPhoneActivity
|
||||
import com.yizhuan.erban.ui.login.helper.LogoutHelper
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.code.CodeType
|
||||
import com.yizhuan.xchat_android_core.region.RegionHelper
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper
|
||||
@@ -59,6 +60,7 @@ class ResetPasswordActivity : BaseViewBindingActivity<ActivityResetLoginPwdBindi
|
||||
// binding.etAccount.isEnabled = false
|
||||
// }
|
||||
initListener()
|
||||
RegionHelper().loadRecommendRegion(lifecycle, binding.tvAreaCode)
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
|
@@ -218,7 +218,11 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
|
||||
|
||||
private fun debug() {
|
||||
// RedPackageOpenDialog2().show(this)
|
||||
val json = "{\"first\":3,\"second\":32,\"data\":{\"recvUserUid\":2735,\"recvUserAvatar\":\"https://img.pekolive.com/default_avatar.png\",\"recvUserNick\":\"66丢丢丢丢丢多多多的hhhh\",\"sendUserNick\":\"11的ass\",\"sendUserAvatar\":\"http://beta.img.pekolive.com/Fk7aur-1RBqKXC-qqBwMTjivZ3lV?imageslim\",\"sendUserUid\":2737,\"giftUrl\":\"http://beta.img.pekolive.com/Fn6h_gPFD5MwA-Ql_kcWqNpKp0JM?imageslim\",\"giftName\":\"幽靈糖果\",\"giftId\":2075,\"giftNum\":${Random.nextInt(1,1000)},\"giftGolds\":33440,\"notifyStaySecond\":5,\"isHomeShow\":true,\"isSkipRoom\":true,\"isFullScreen\":false,\"isSendMsg\":false,\"roomUid\":2737,\"roomErbanNo\":11,\"roomTitle\":\"11的工会\",\"levelNum\":${Random.nextInt(1,4)}}}"
|
||||
onReceivedNimBroadcastMessage(json)
|
||||
// val json = "{\"first\":3,\"second\":32,\"data\":{\"recvUserUid\":2735,\"recvUserAvatar\":\"https://img.pekolive.com/default_avatar.png\",\"recvUserNick\":\"66丢丢丢丢丢多多多的hhhh\",\"sendUserNick\":\"11的ass\",\"sendUserAvatar\":\"http://beta.img.pekolive.com/Fk7aur-1RBqKXC-qqBwMTjivZ3lV?imageslim\",\"sendUserUid\":2737,\"giftUrl\":\"http://beta.img.pekolive.com/Fn6h_gPFD5MwA-Ql_kcWqNpKp0JM?imageslim\",\"giftName\":\"幽靈糖果\",\"giftId\":2075,\"giftNum\":${Random.nextInt(1,1000)},\"giftGolds\":33440,\"notifyStaySecond\":5,\"isHomeShow\":true,\"isSkipRoom\":true,\"isFullScreen\":false,\"isSendMsg\":false,\"roomUid\":2737,\"roomErbanNo\":11,\"roomTitle\":\"11的工会\",\"levelNum\":${Random.nextInt(1,4)}}}"
|
||||
// onReceivedNimBroadcastMessage(json)
|
||||
// val json = "{\"first\":85,\"second\":855,\"data\":{\"nick\":\"66丢丢丢丢丢多多多的hhhh\",\"preVipName\":\"子爵\",\"floatPic\":\"https://image.hfighting.com/Fq3JtbK2acO3FN-3vWZo8ldtHfse\",\"uid\":2735,\"currVipName\":\"侯爵\",\"erbanNo\":66,\"roomUid\":2734,\"avatar\":\"https://img.pekolive.com/default_avatar.png\",\"currVipLevel\":5}}"
|
||||
// onReceivedNimBroadcastMessage(json)
|
||||
// CommonWebViewActivity.start(this,"https://api.anan.chat/anan_vestBag/modules/rank/index.html#/rank")
|
||||
// CommonWebViewActivity.start(this,"https://api.anan.chat/anan_vestBag/modules/myincome/index.html#/DiamondLog")
|
||||
}
|
||||
}
|
@@ -19,6 +19,7 @@ import com.yizhuan.erban.ui.login.BindPhoneActivity
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.code.CodeType
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.region.RegionHelper
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
@@ -53,6 +54,7 @@ class VerifyPhoneActivity : BaseViewBindingActivity<ActivityVerifyPhoneBinding>(
|
||||
resetPwd = intent.getBooleanExtra("resetPwd", false)
|
||||
|
||||
initListener()
|
||||
RegionHelper().loadRecommendRegion(lifecycle, binding.tvAreaCode)
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
|
@@ -9,11 +9,11 @@ import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.webkit.SslErrorHandler;
|
||||
@@ -59,7 +59,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -99,32 +98,6 @@ public class CommonWebViewActivity extends BaseActivity implements ShareDialog.O
|
||||
private static final String POSITION = "position";
|
||||
private int mPosition;
|
||||
|
||||
private int mProgress;
|
||||
|
||||
private Handler mHandler = new Handler();
|
||||
|
||||
private ProgressRunnable mProgressRunnable = new ProgressRunnable(this);
|
||||
|
||||
private static class ProgressRunnable implements Runnable {
|
||||
private WeakReference<CommonWebViewActivity> mWeakReference;
|
||||
|
||||
ProgressRunnable(CommonWebViewActivity activity) {
|
||||
mWeakReference = new WeakReference<>(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
CommonWebViewActivity activity = mWeakReference.get();
|
||||
if (activity == null) return;
|
||||
if (activity.mProgress < 96) {
|
||||
activity.mProgress += 3;
|
||||
activity.mProgressBar.setProgress(activity.mProgress);
|
||||
activity.mHandler.postDelayed(activity.mProgressRunnable, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void start(Context context, String url) {
|
||||
Intent intent = new Intent(context, CommonWebViewActivity.class);
|
||||
intent.putExtra("url", url);
|
||||
@@ -222,7 +195,6 @@ public class CommonWebViewActivity extends BaseActivity implements ShareDialog.O
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
private void initData() {
|
||||
mHandler.post(mProgressRunnable);
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
webView.getSettings().setUseWideViewPort(true);
|
||||
webView.getSettings().setLoadWithOverviewMode(true);
|
||||
@@ -290,9 +262,20 @@ public class CommonWebViewActivity extends BaseActivity implements ShareDialog.O
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
super.onPageFinished(view, url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
//获取webviewtitle作为titlebar的title
|
||||
wvcc = new WebChromeClient() {
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
mProgressBar.setProgress(newProgress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
@@ -520,11 +503,6 @@ public class CommonWebViewActivity extends BaseActivity implements ShareDialog.O
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mHandler != null) {
|
||||
mHandler.removeCallbacks(mProgressRunnable);
|
||||
mProgressRunnable = null;
|
||||
mHandler = null;
|
||||
}
|
||||
EventBus.getDefault().unregister(this);
|
||||
|
||||
if (webViewCallBack != null) {
|
||||
|
@@ -3,8 +3,8 @@ package com.yizhuan.erban.ui.webview;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
@@ -28,8 +28,18 @@ public class DialogWebViewActivity extends CommonWebViewActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, ScreenUtil.screenHeight / 3 * 2);
|
||||
getWindow().setGravity(Gravity.BOTTOM);
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
);
|
||||
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||
View topView = findViewById(R.id.v_top);
|
||||
topView.setOnClickListener(v -> finish());
|
||||
ViewGroup.LayoutParams params = topView.getLayoutParams();
|
||||
params.height = ScreenUtil.screenHeight / 3;
|
||||
topView.setLayoutParams(params);
|
||||
showTitleBar = getIntent().getBooleanExtra("showTitleBar", true);
|
||||
if (!showTitleBar) {
|
||||
layoutTitleBar.setVisibility(View.GONE);
|
||||
|
@@ -0,0 +1,47 @@
|
||||
package com.yizhuan.erban.ui.webview.room_banner
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.core.view.isInvisible
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/17 12:30
|
||||
* Desc:
|
||||
**/
|
||||
class RoomBannerTabAdapter :
|
||||
BaseQuickAdapter<BannerInfo, BaseViewHolder>(R.layout.room_banner_item_tab) {
|
||||
|
||||
private var selectedPosition = -1
|
||||
override fun convert(helper: BaseViewHolder, item: BannerInfo?) {
|
||||
helper.getView<ImageView>(R.id.iv_content).load(item?.bannerUrl)
|
||||
convertState(helper, item)
|
||||
}
|
||||
|
||||
override fun convertPayloads(
|
||||
helper: BaseViewHolder,
|
||||
item: BannerInfo?,
|
||||
payloads: MutableList<Any>
|
||||
) {
|
||||
super.convertPayloads(helper, item, payloads)
|
||||
convertState(helper, item)
|
||||
}
|
||||
|
||||
private fun convertState(helper: BaseViewHolder, item: BannerInfo?) {
|
||||
helper.getView<View>(R.id.v_selector).isInvisible =
|
||||
helper.absoluteAdapterPosition != selectedPosition
|
||||
}
|
||||
|
||||
fun getSelectedPosition(): Int {
|
||||
return selectedPosition
|
||||
}
|
||||
|
||||
fun select(position: Int) {
|
||||
this.selectedPosition = position
|
||||
notifyItemRangeChanged(0, itemCount, true)
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
package com.yizhuan.erban.ui.webview.room_banner
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chuhai.utils.UiUtils
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/17 11:38
|
||||
* Desc:房间内-Banner-WEB展示页面
|
||||
**/
|
||||
class RoomBannerWebDialogActivity : CommonWebViewActivity() {
|
||||
|
||||
private var recyclerView: RecyclerView? = null
|
||||
private var adapter: RoomBannerTabAdapter? = null
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, position: Int, list: List<BannerInfo>) {
|
||||
val newList = ArrayList<BannerInfo>()
|
||||
newList.addAll(list)
|
||||
val intent = Intent(context, RoomBannerWebDialogActivity::class.java)
|
||||
intent.putExtra("position", position)
|
||||
intent.putExtra("list", newList)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.room_banner_dialog
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
|
||||
window.setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
WindowManager.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
val topView = findViewById<View>(R.id.v_top)
|
||||
topView.setOnClickListener { v: View? -> finish() }
|
||||
val params = topView.layoutParams
|
||||
params.height = UiUtils.dip2px(168f)
|
||||
topView.layoutParams = params
|
||||
webView.setBackgroundColor(Color.parseColor("#C9CBD1"))
|
||||
recyclerView = findViewById(R.id.recyclerView)
|
||||
val position = 0.coerceAtLeast(intent.getIntExtra("position", 0))
|
||||
val list = intent.getSerializableExtra("list") as? ArrayList<BannerInfo>
|
||||
// if ((list?.size ?: 0) <= 1) {
|
||||
// recyclerView?.isVisible = false
|
||||
// }
|
||||
adapter = RoomBannerTabAdapter().apply {
|
||||
setOnItemClickListener { adapter, view, position ->
|
||||
if (this@RoomBannerWebDialogActivity.adapter?.getSelectedPosition() == position) {
|
||||
return@setOnItemClickListener
|
||||
}
|
||||
switchTab(position)
|
||||
}
|
||||
}
|
||||
recyclerView?.adapter = adapter
|
||||
adapter?.setNewData(list)
|
||||
switchTab(position)
|
||||
}
|
||||
|
||||
private fun switchTab(position: Int) {
|
||||
val url = adapter?.getItem(position)?.skipUri
|
||||
showWebView(url)
|
||||
adapter?.select(position)
|
||||
recyclerView?.post {
|
||||
recyclerView?.scrollToPosition(position)
|
||||
}
|
||||
}
|
||||
|
||||
override fun showWebView(url: String?) {
|
||||
if (url.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
super.showWebView(url)
|
||||
}
|
||||
}
|
146
app/src/main/java/com/yizhuan/erban/ui/widget/SideBarView.kt
Normal file
146
app/src/main/java/com/yizhuan/erban/ui/widget/SideBarView.kt
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.yizhuan.erban.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Typeface
|
||||
import android.util.AttributeSet
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewParent
|
||||
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/12/8 10:43
|
||||
* Desc:字母索引
|
||||
**/
|
||||
class SideBarView : View {
|
||||
private var selectIndex = 0
|
||||
private var textSize = 0f
|
||||
private var textColor = 0
|
||||
private var textSizeFocus = 0f
|
||||
private var textColorFocus = 0
|
||||
|
||||
//标记 避免重复调用
|
||||
private var isDown = false
|
||||
|
||||
//这里也可以传入数组方式
|
||||
private var list = listOf(
|
||||
"A", "B", "C", "D", "E", "F", "G", "H", "I",
|
||||
"J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
|
||||
"W", "X", "Y", "Z", "#"
|
||||
)
|
||||
private var paint = Paint()
|
||||
|
||||
private var listener: Listener? = null
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
fun setTextColor(textColor: Int, focusTextColor: Int = textColor) {
|
||||
this.textColor = textColor
|
||||
this.textColorFocus = focusTextColor
|
||||
}
|
||||
|
||||
fun setTextSize(textSize: Float, focusTextSize: Float = textSize) {
|
||||
this.textSize = textSize
|
||||
this.textSizeFocus = focusTextSize
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
super.onDraw(canvas)
|
||||
paintText(canvas)
|
||||
}
|
||||
|
||||
private fun paintText(canvas: Canvas?) {
|
||||
//计算每一个字母的高度,总告诉除以字母集合的高度就可以
|
||||
val height: Int = height / list.size
|
||||
for (i in list.indices) {
|
||||
if (i == selectIndex) {
|
||||
paint.color = textColorFocus
|
||||
paint.textSize = textSizeFocus
|
||||
} else {
|
||||
paint.color = textColor
|
||||
paint.textSize = textSize
|
||||
}
|
||||
paint.isAntiAlias = true //设置抗锯齿
|
||||
paint.typeface = Typeface.DEFAULT_BOLD
|
||||
//计算每一个字母x轴
|
||||
val paintX = width / 2f - paint.measureText(list[i]) / 2
|
||||
//计算每一个字母Y轴
|
||||
val paintY = height * i + height
|
||||
//绘画出来这个TextView
|
||||
canvas?.drawText(list[i], paintX, paintY.toFloat(), paint)
|
||||
//画完一个以后重置画笔
|
||||
paint.reset()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
val parent: ViewParent?
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN, MotionEvent.ACTION_MOVE -> {
|
||||
val index = (event.y / height * list.size).toInt()
|
||||
if (index >= 0 && index < list.size && selectIndex != index) {
|
||||
listener?.onSideBarScroll(list[index])
|
||||
selectIndex = index
|
||||
invalidate()
|
||||
//改变标记状态
|
||||
isDown = true
|
||||
}
|
||||
parent = getParent()
|
||||
parent?.requestDisallowInterceptTouchEvent(true)
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
|
||||
listener?.onSideBarScrollEnd()
|
||||
//改变标记状态
|
||||
isDown = false
|
||||
parent = getParent()
|
||||
parent?.requestDisallowInterceptTouchEvent(false)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
interface Listener {
|
||||
//滚动位置
|
||||
fun onSideBarScroll(word: String)
|
||||
|
||||
//隐藏提示文本
|
||||
fun onSideBarScrollEnd()
|
||||
}
|
||||
|
||||
fun setListener(listener: Listener?) {
|
||||
this.listener = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* Item滚动 更新侧边栏字母
|
||||
*
|
||||
* @param word 字母
|
||||
*/
|
||||
fun onUpdateSideBarText(word: String?) {
|
||||
//手指没触摸才调用
|
||||
if (!isDown) {
|
||||
for (i in list.indices) {
|
||||
if (list[i] == word && selectIndex != i) {
|
||||
selectIndex = i
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@ import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.chuhai.utils.ServiceTime;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGADynamicEntity;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
@@ -41,6 +42,8 @@ public class AllServiceVipLevelUPDialog extends BaseDialog {
|
||||
|
||||
private final VipMessageInfo vipMessageInfo;
|
||||
private DialogVipAllServiceLevelUpBinding binding;
|
||||
private long startTime = 0;
|
||||
private int frameCount = 0;
|
||||
|
||||
public AllServiceVipLevelUPDialog(Context context, @NonNull VipMessageInfo vipMessageInfo) {
|
||||
super(context, R.style.FullScreenDialog);
|
||||
@@ -77,7 +80,7 @@ public class AllServiceVipLevelUPDialog extends BaseDialog {
|
||||
.append(ResUtil.getString(R.string.widget_dialog_allserviceviplevelupdialog_01), new ForegroundColorSpan(Color.WHITE))
|
||||
.append("-", new CircleImageSpan(new ColorDrawable(Color.TRANSPARENT), vipMessageInfo.getAvatar(), 50, 50))
|
||||
.append(" " + StringExtensionKt.sub(vipMessageInfo.getNick(), 6) + " ", new ForegroundColorSpan(getContext().getResources().getColor(R.color.notice_nick)))
|
||||
.append(ResUtil.getString(R.string.widget_dialog_allserviceviplevelupdialog_02) + vipMessageInfo.getCurrVipName(), new ForegroundColorSpan(Color.WHITE)+"!");
|
||||
.append(ResUtil.getString(R.string.widget_dialog_allserviceviplevelupdialog_02) + vipMessageInfo.getCurrVipName(), new ForegroundColorSpan(Color.WHITE) + "!");
|
||||
|
||||
SVGAImageView svgaImageView = new SVGAImageView(getContext());
|
||||
svgaImageView.setLoops(1);
|
||||
@@ -87,7 +90,19 @@ public class AllServiceVipLevelUPDialog extends BaseDialog {
|
||||
svgaImageView.setCallback(new SimpleSvgaCallback() {
|
||||
@Override
|
||||
public void onFinished() {
|
||||
closeSelf();
|
||||
long offset = ServiceTime.INSTANCE.getTime() - startTime;
|
||||
if (offset < 6000) {
|
||||
int centerFrame = frameCount / 2;
|
||||
if (centerFrame > 0) {
|
||||
// 目前的SVGA资源最后一帧是半透明的,这里强制跳到中间帧,最大程度避免这种情况
|
||||
svgaImageView.stepToFrame(centerFrame, false);
|
||||
}
|
||||
svgaImageView.postDelayed(() -> {
|
||||
closeSelf();
|
||||
}, 6000 - offset);
|
||||
} else {
|
||||
closeSelf();
|
||||
}
|
||||
}
|
||||
});
|
||||
binding.flSvgaVipNotify.addView(svgaImageView);
|
||||
@@ -95,6 +110,8 @@ public class AllServiceVipLevelUPDialog extends BaseDialog {
|
||||
SVGAParser.Companion.shareParser().decodeFromURL(new URL(vipMessageInfo.getFloatPic()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NonNull SVGAVideoEntity svgaVideoEntity) {
|
||||
frameCount = svgaVideoEntity.getFrames();
|
||||
startTime = ServiceTime.INSTANCE.getTime();
|
||||
SVGADynamicEntity dynamicEntity = new SVGADynamicEntity();
|
||||
TextPaint textPaint = new TextPaint();
|
||||
textPaint.setColor(Color.WHITE);//字体颜色
|
||||
|
@@ -57,8 +57,10 @@ class VipUpgradeDialog : BaseDialog<DialogVipUpgradeBinding>() {
|
||||
.decodeFromURL(URL(vipInfo.vipLogo), object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
val drawable = SVGADrawable(videoItem)
|
||||
binding?.ivVipIcon?.setImageDrawable(drawable)
|
||||
binding?.ivVipIcon?.startAnimation()
|
||||
if (isViewLoaded) {
|
||||
_binding?.ivVipIcon?.setImageDrawable(drawable)
|
||||
_binding?.ivVipIcon?.startAnimation()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/fans_team_ic_room_entrance.webp
Normal file
BIN
app/src/main/res/drawable-xxhdpi/fans_team_ic_room_entrance.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@@ -2,9 +2,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FF87152D" />
|
||||
<solid android:color="#FF49157D" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFFED77" />
|
||||
android:color="#FFFE9FFF" />
|
||||
<corners android:radius="8.5dp" />
|
||||
</shape>
|
@@ -2,9 +2,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#FF49157D" />
|
||||
<solid android:color="#87152D" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFFE9FFF" />
|
||||
android:color="#FFED77" />
|
||||
<corners android:radius="8.5dp" />
|
||||
</shape>
|
17
app/src/main/res/drawable/progress_drawable_room_banner.xml
Normal file
17
app/src/main/res/drawable/progress_drawable_room_banner.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@android:id/background"
|
||||
android:drawable="@color/transparent" />
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
6
app/src/main/res/drawable/shape_9168fa_4.xml
Normal file
6
app/src/main/res/drawable/shape_9168fa_4.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">
|
||||
<solid android:color="#9168fa" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
@@ -19,6 +19,7 @@
|
||||
android:id="@+id/mRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
@@ -27,4 +28,13 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_bar" />
|
||||
|
||||
<com.yizhuan.erban.ui.widget.SideBarView
|
||||
android:id="@+id/sideBarView"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginVertical="@dimen/dp_150"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -1,95 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout 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="match_parent"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="0dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<View
|
||||
android:id="@+id/v_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_left" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_close_black" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_left" />
|
||||
android:id="@+id/img_share"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_share_white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_close_black" />
|
||||
<TextView
|
||||
android:id="@+id/tv_title_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_activity_dialog_web_view_01" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_drawable" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="18sp" />
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_share"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_share_white"
|
||||
android:visibility="gone" />
|
||||
</WebView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_activity_dialog_web_view_01" />
|
||||
</FrameLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_drawable" />
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</WebView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
@@ -2,7 +2,7 @@
|
||||
<LinearLayout 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="@dimen/dp_room_user_dialog_width"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical"
|
||||
|
@@ -7,8 +7,8 @@
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_width="105dp"
|
||||
android:layout_height="35dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
|
@@ -72,6 +72,14 @@
|
||||
app:layout_constraintStart_toStartOf="@id/iv_blue_avatar"
|
||||
tools:src="@drawable/single_room_pk_ic_result_win" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_mute_another"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/single_room_pk_ic_another_mic_open"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_blue_avatar"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_blue_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_blue_nickname"
|
||||
android:layout_width="wrap_content"
|
||||
|
@@ -5,54 +5,74 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/room_bg_rank_notice"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="4dp"
|
||||
tools:layout_height="60dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/layout_layout_single_room_rank_notify_01"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:includeFontPadding="false"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="#FFFFFC4C"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="@string/layout_layout_single_room_rank_notify_02" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="@string/layout_layout_single_room_rank_notify_03" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="65dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="TOP1"
|
||||
android:textColor="#FFFFFC4C"
|
||||
android:textSize="13sp" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/layout_layout_single_room_rank_notify_01"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:includeFontPadding="false"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFFFFC4C"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
tools:text="@string/layout_layout_single_room_rank_notify_03" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:singleLine="true"
|
||||
android:text="TOP1"
|
||||
android:textColor="#FFFFFC4C"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_go_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/room_bg_rank_go_room" />
|
||||
|
||||
</LinearLayout>
|
@@ -31,17 +31,29 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:maxWidth="120dp"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="15sp"
|
||||
tools:text="@string/layout_list_item_search_01" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:src="@drawable/ic_gender_female" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="visible"
|
||||
tools:src="@mipmap/ic_user_level" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="visible"
|
||||
tools:src="@drawable/ic_user_charm_level" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
46
app/src/main/res/layout/region_item_group.xml
Normal file
46
app/src/main/res/layout/region_item_group.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="A" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="14sp"
|
||||
tools:text="AAAAAA" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_country_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:text=""
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="14sp"
|
||||
tools:text="+1" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
118
app/src/main/res/layout/room_banner_dialog.xml
Normal file
118
app/src/main/res/layout/room_banner_dialog.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/v_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardBackgroundColor="@color/color_262629"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_left" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_close_black" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_share"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_share_white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_activity_dialog_web_view_01" />
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_drawable_room_banner" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
25
app/src/main/res/layout/room_banner_item_tab.xml
Normal file
25
app/src/main/res/layout/room_banner_item_tab.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="5dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/v_selector"
|
||||
android:layout_width="@dimen/dp_93"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/shape_9168fa_4" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_content"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_corner_radius="4dp"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
</FrameLayout>
|
@@ -67,175 +67,4 @@
|
||||
<item>夢幻花園CP位</item>
|
||||
<item>永恆愛情城堡CP位\n永恆CP頭飾\n永恆CP銘牌</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="country_code_list_ch" translatable="false">
|
||||
<item>Taiwan*886</item>
|
||||
<item>Hongkong*852</item>
|
||||
<item>Macao*853</item>
|
||||
<item>Malaysia*60</item>
|
||||
<item>Singapore*65</item>
|
||||
<item>India*91</item>
|
||||
<item>Indonesia*62</item>
|
||||
<item>ישראל *972</item>
|
||||
<item>الأردن *962</item>
|
||||
<item>البحرين *973</item>
|
||||
<item>الجزائر *213</item>
|
||||
<item>العراق *964</item>
|
||||
<item>الكويت *965</item>
|
||||
<item>المغرب *212</item>
|
||||
<item>المملكة,العربية,السعودية *966</item>
|
||||
<item>پاکستان *92</item>
|
||||
<item>عُمان *968</item>
|
||||
<item>قطر *974</item>
|
||||
<item>مصر *20</item>
|
||||
<item>Brasil*55</item>
|
||||
<item>Colombia*57</item>
|
||||
<item>Philippines*63</item>
|
||||
<item>افغانستان *93</item>
|
||||
<item>Shqipëri*355</item>
|
||||
<item>American samoa*1684</item>
|
||||
<item>Andorra*376</item>
|
||||
<item>Angola*244</item>
|
||||
<item>Anguilla*1264</item>
|
||||
<item>Antigua and Barbuda*1268</item>
|
||||
<item>Argentina*54</item>
|
||||
<item>Հայաստան*374</item>
|
||||
<item>Aruba*297</item>
|
||||
<item>Ascension,Island*247</item>
|
||||
<item>Australia*61</item>
|
||||
<item>Österreich*43</item>
|
||||
<item>Azərbaycan*994</item>
|
||||
<item>Bahamas*1242</item>
|
||||
<item>বাংলাদেশ*880</item>
|
||||
<item>Barbados*1246</item>
|
||||
<item>Беларусь*375</item>
|
||||
<item>België*32</item>
|
||||
<item>Belize*501</item>
|
||||
<item>Bénin*229</item>
|
||||
<item>Bermuda Is.*1441</item>
|
||||
<item>Bolivia*591</item>
|
||||
<item>Botswana*267</item>
|
||||
<item>Brunei*673</item>
|
||||
<item>България*359</item>
|
||||
<item>Burkina,Faso*226</item>
|
||||
<item>Myanmar*95</item>
|
||||
<item>Burundi*257</item>
|
||||
<item>China*86</item>
|
||||
<item>Cameroon*237</item>
|
||||
<item>Canada*1</item>
|
||||
<item>Kabu Verdi*238</item>
|
||||
<item>Cayman Islands*1345</item>
|
||||
<item>Central African Republic*236</item>
|
||||
<item>Chad*235</item>
|
||||
<item>Chile*56</item>
|
||||
<item>Congo*242</item>
|
||||
<item>Jamhuri ya Kidemokrasia ya Kongo*249</item>
|
||||
<item>Cook Is.*682</item>
|
||||
<item>Costa Rica*506</item>
|
||||
<item>Hrvatska*385</item>
|
||||
<item>Cuba*53</item>
|
||||
<item>Curacao*599</item>
|
||||
<item>Cyprus*357</item>
|
||||
<item>Czech Republic*420</item>
|
||||
<item>Denmark*45</item>
|
||||
<item>Djibouti*253</item>
|
||||
<item>Dominica*1767</item>
|
||||
<item>Dominica Rep.*1809</item>
|
||||
<item>Ecuador*593</item>
|
||||
<item>EI Salvador*503</item>
|
||||
<item>Guinea Ecuatorial*240</item>
|
||||
<item>Estonia*372</item>
|
||||
<item>Ethiopia*251</item>
|
||||
<item>Fiji*679</item>
|
||||
<item>Finland*358</item>
|
||||
<item>France*33</item>
|
||||
<item>French Guiana*594</item>
|
||||
<item>French Polynesia*689</item>
|
||||
<item>Gabon*241</item>
|
||||
<item>Gambia*220</item>
|
||||
<item>Georgia*995</item>
|
||||
<item>Germany*49</item>
|
||||
<item>Ghana*233</item>
|
||||
<item>Gibraltar*350</item>
|
||||
<item>Greece*30</item>
|
||||
<item>Kalaallit Nunaat*299</item>
|
||||
<item>Grenada*1473</item>
|
||||
<item>Guam*1671</item>
|
||||
<item>Guatemala*502</item>
|
||||
<item>Guinea*224</item>
|
||||
<item>Guyana*592</item>
|
||||
<item>Haiti*509</item>
|
||||
<item>Honduras*504</item>
|
||||
<item>Hungary*36</item>
|
||||
<item>Iceland*354</item>
|
||||
<item>ایران *98</item>
|
||||
<item>Ireland*353</item>
|
||||
<item>Italy*39</item>
|
||||
<item>Jamaica*1876</item>
|
||||
<item>Japan*81</item>
|
||||
<item>កម្ពុជា*855</item>
|
||||
<item>Kazakstan*327</item>
|
||||
<item>Kenya*254</item>
|
||||
<item>Kiribati*686</item>
|
||||
<item>Korea*82</item>
|
||||
<item>Kazakstan*996</item>
|
||||
<item>Laos*856</item>
|
||||
<item>Latvia*371</item>
|
||||
<item>لبنان *961</item>
|
||||
<item>Lesotho*266</item>
|
||||
<item>Liberia*231</item>
|
||||
<item>ليبيا *218</item>
|
||||
<item>Liechtenstein*423</item>
|
||||
<item>Lithuania*370</item>
|
||||
<item>Luxembourg*352</item>
|
||||
<item>Madagascar*261</item>
|
||||
<item>Malawi*265</item>
|
||||
<item>Maldives*960</item>
|
||||
<item>Mali*223</item>
|
||||
<item>Malta*356</item>
|
||||
<item>Mauritius*230</item>
|
||||
<item>Mexico*52</item>
|
||||
<item>Moldova, Republic of*373</item>
|
||||
<item>Monaco*377</item>
|
||||
<item>Mongolia*976</item>
|
||||
<item>Mozambique*258</item>
|
||||
<item>Namibia*264</item>
|
||||
<item>Nepal*977</item>
|
||||
<item>Netherlands*31</item>
|
||||
<item>New Zealand*64</item>
|
||||
<item>Nicaragua*505</item>
|
||||
<item>Nijar*227</item>
|
||||
<item>Nigeria*234</item>
|
||||
<item>Norway*47</item>
|
||||
<item>Panama*507</item>
|
||||
<item>Papua New Cuinea*675</item>
|
||||
<item>Paraguay*595</item>
|
||||
<item>Peru*51</item>
|
||||
<item>Poland*48</item>
|
||||
<item>Portugal*351</item>
|
||||
<item>Puerto Rico*1787</item>
|
||||
<item>Romania*40</item>
|
||||
<item>St.Lucia*1758</item>
|
||||
<item>San Marino*378</item>
|
||||
<item>Sao Tome and Principe*239</item>
|
||||
<item>Senegal*221</item>
|
||||
<item>Seychelles*248</item>
|
||||
<item>Sierra Leone*232</item>
|
||||
<item>Slovakia*421</item>
|
||||
<item>Slovenia*386</item>
|
||||
<item>Solomon Is*677</item>
|
||||
<item>Somali*252</item>
|
||||
<item>South Africa*27</item>
|
||||
<item>Spain*34</item>
|
||||
<item>Sri Lanka*94</item>
|
||||
<item>Sudan*249</item>
|
||||
<item>Suriname*597</item>
|
||||
<item>Swaziland*268</item>
|
||||
<item>Sweden*46</item>
|
||||
<item>Switzerland*41</item>
|
||||
<item>Syria*963</item>
|
||||
<item>Vanuatu*678</item>
|
||||
<item>British Virgin Islands*1284</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
@@ -711,5 +711,6 @@
|
||||
<color name="color_FFF87A">#FFFFF87A</color>
|
||||
<color name="color_ffffff_30">#4CFFFFFF</color>
|
||||
<color name="color_FFE468">#FFFFE468</color>
|
||||
<color name="color_C9CBD1">#C9CBD1</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -4578,7 +4578,7 @@
|
||||
<string name="layout_fragment_mini_world_category_my_empty_01">還沒加入世界哦 前往世界廣場逛逛吧</string>
|
||||
<string name="layout_fragment_mini_world_category_my_empty_02">發現世界</string>
|
||||
<string name="layout_fragment_single_room_01">主播榜</string>
|
||||
<string name="layout_fragment_single_room_02">加入我的粉絲團吧~</string>
|
||||
<string name="layout_fragment_single_room_02">加入粉絲團</string>
|
||||
<string name="layout_fragment_single_room_03">該主播暫未開通粉絲團</string>
|
||||
<string name="layout_fragment_single_room_04">小時榜</string>
|
||||
<string name="layout_fragment_single_room_05">首充紅包</string>
|
||||
|
@@ -220,6 +220,11 @@ public class ModuleHallActivity extends BaseMvpActivity<IModuleHallView, ModuleH
|
||||
HallInfo hallInfo = clanAndHallInfo.getHall();
|
||||
clanInfo = clanAndHallInfo.getClan();
|
||||
setManegeOption((HallDataManager.get().isManager() && isSelfHall) || clanAndHallInfo.isManageHall());
|
||||
int roleType = 0;
|
||||
if (hallInfo != null) {
|
||||
roleType = hallInfo.getRoleType();
|
||||
}
|
||||
binding.tvManageSetup.setVisibility(roleType == RoleType.OWNER ? View.VISIBLE : View.INVISIBLE);
|
||||
//高管是没有修改公会名称权限的,只有房主和超管才有
|
||||
setSettingOption((HallDataManager.get().getRoleType() == RoleType.OWNER && isSelfHall) || clanAndHallInfo.isManageHall());
|
||||
if (hallInfo != null && hallInfo.getHallId() != 0) {
|
||||
|
@@ -16,6 +16,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager
|
||||
import com.yizhuan.erban.databinding.FragmentAssociationRoomBinding
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity
|
||||
import com.yizhuan.erban.module_hall.hall.adapter.AssociationRoomAdapter
|
||||
@@ -39,8 +40,8 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
}
|
||||
}
|
||||
|
||||
private var associationRoomAdapter: AssociationRoomAdapter ?= null
|
||||
private var rvDelegate: RVDelegate<HallListInfo> ?= null
|
||||
private var associationRoomAdapter: AssociationRoomAdapter? = null
|
||||
private var rvDelegate: RVDelegate<HallListInfo>? = null
|
||||
|
||||
private var list: MutableList<HallListInfo> = ArrayList()
|
||||
|
||||
@@ -51,7 +52,7 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
if (!TextUtils.isEmpty(binding.etSearch.text.toString())) {
|
||||
val hallList = list
|
||||
val list = hallList.filter {
|
||||
it.hallName.contains(binding.etSearch.text.toString()) || it.hallId.toString()
|
||||
it.hallName.contains(binding.etSearch.text.toString()) || it.ownerErbanNo.toString()
|
||||
.contains(binding.etSearch.text.toString())
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
@@ -124,25 +125,19 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
}
|
||||
if (it.hallBtnStatus == 3) {
|
||||
NimP2PMessageActivity.startRecord(
|
||||
mContext, bean.hallMessageUid.toString(),
|
||||
bean.hallRecordId.toString()
|
||||
mContext, it.hallMessageUid.toString(),
|
||||
it.hallRecordId.toString()
|
||||
)
|
||||
return@let
|
||||
}
|
||||
dialogManager.showProgressDialog(context)
|
||||
HallModel.get().applyJoinHall(it.hallId)
|
||||
.compose(RxHelper.bindFragment(this))
|
||||
.subscribe(object : BeanObserver<String?>() {
|
||||
override fun onErrorMsg(error: String) {
|
||||
dialogManager.dismissDialog()
|
||||
toast(error)
|
||||
}
|
||||
|
||||
override fun onSuccess(s: String) {
|
||||
dialogManager.dismissDialog()
|
||||
it.hallBtnStatus = 2
|
||||
associationRoomAdapter?.notifyItemChanged(position)
|
||||
toast(getString(R.string.apply_success_wait_to_join_room))
|
||||
dialogManager.showOkCancelWithTitleDialog(ResUtil.getString(R.string.join_organization_tips),
|
||||
it.hallName ?: "",
|
||||
ResUtil.getString(R.string.join_organization_ok),
|
||||
ResUtil.getString(R.string.join_organization_no),
|
||||
object : DialogManager.OkCancelDialogListener {
|
||||
override fun onCancel() {}
|
||||
override fun onOk() {
|
||||
applyJoin(it, position)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -167,6 +162,25 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
associationViewModel.getHallList()
|
||||
}
|
||||
|
||||
private fun applyJoin(item: HallListInfo, position: Int) {
|
||||
dialogManager.showProgressDialog(context)
|
||||
HallModel.get().applyJoinHall(item.hallId)
|
||||
.compose(RxHelper.bindFragment(this))
|
||||
.subscribe(object : BeanObserver<String?>() {
|
||||
override fun onErrorMsg(error: String) {
|
||||
dialogManager.dismissDialog()
|
||||
toast(error)
|
||||
}
|
||||
|
||||
override fun onSuccess(s: String) {
|
||||
dialogManager.dismissDialog()
|
||||
item.hallBtnStatus = 2
|
||||
associationRoomAdapter?.notifyItemChanged(position)
|
||||
toast(getString(R.string.apply_success_wait_to_join_room))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun hideSoftInput() {
|
||||
val imm = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.hideSoftInputFromWindow(
|
||||
|
@@ -146,6 +146,7 @@
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/tv_manage_setup"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@@ -27,4 +27,7 @@
|
||||
<string name="lu_hteam_has_mute_num">已禁言人數 : %d人</string>
|
||||
<string name="lu_hteam_manager_num">群管理人數 : %d人</string>
|
||||
|
||||
<string name="join_organization_tips">確認加入公會</string>
|
||||
<string name="join_organization_ok">是</string>
|
||||
<string name="join_organization_no">否</string>
|
||||
</resources>
|
@@ -46,37 +46,39 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/contribute_list">
|
||||
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/fl_fans_team_join_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
android:background="@drawable/bg_fans_team_entrance"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_fans_team_entrance"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="30dp"
|
||||
android:text="@string/layout_fragment_single_room_02"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="37dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/fans_team_ic_room_entrance" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fans_team_opt"
|
||||
|
@@ -7,4 +7,5 @@
|
||||
<color name="color_FF9C7E">#FF9C7E</color>
|
||||
<color name="color_FE6974">#FE6974</color>
|
||||
<color name="color_45C21A">#45C21A</color>
|
||||
<color name="color_262629">#262629</color>
|
||||
</resources>
|
@@ -103,11 +103,9 @@ public class GoldBoxHelper {
|
||||
}
|
||||
|
||||
public static boolean isShowFairy() {
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
FairyOpenInfo fairyOpenInfo = InitialModel.get().getFairyOpenInfo();
|
||||
if (fairyOpenInfo == null || userInfo == null) return false;
|
||||
|
||||
return fairyOpenInfo.isOpen() && userInfo.getUserLevelVo().getExperLevelSeq() >= fairyOpenInfo.getLevelLimit();
|
||||
if (fairyOpenInfo == null) return false;
|
||||
return fairyOpenInfo.isOpen();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ buildscript {
|
||||
classpath "io.realm:realm-gradle-plugin:10.16.1"
|
||||
// android 资源混淆插件
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.tencent.vasdolly:plugin:3.0.3'
|
||||
classpath 'com.tencent.vasdolly:plugin:3.0.6'
|
||||
classpath "com.mob.sdk:MobSDK:2018.0319.1724"
|
||||
classpath 'com.google.gms:google-services:4.3.13'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||
|
@@ -72,6 +72,10 @@ public class XChatConstants {
|
||||
* 聲網 key
|
||||
*/
|
||||
public static final String AGORA_KEY = "f8713b6ec98c4c01adaf34cb4fa091b1"; //已更換
|
||||
/**
|
||||
* 聲網 key
|
||||
*/
|
||||
public static final String AGORA_KEY_DEBUG = "7ae1a8dabe7a44a9a67c829faa409e70";
|
||||
|
||||
/**
|
||||
* 阿裏雲日誌空間名字
|
||||
@@ -229,7 +233,7 @@ public class XChatConstants {
|
||||
/**
|
||||
* Referer (RELEASE)
|
||||
*/
|
||||
public static final String KEY_REFERER_RELEASE = "https://api.pekolive.com/";
|
||||
public static final String KEY_REFERER_RELEASE = "https://api.hfighting.com/";
|
||||
public static final String APP_MARK = "peko";
|
||||
/**
|
||||
* 聊天室文本消息易盾反垃圾業務id
|
||||
|
@@ -13,8 +13,8 @@ public class UriProvider {
|
||||
/**
|
||||
* 默认以下生产环境地址
|
||||
*/
|
||||
public static String JAVA_WEB_URL = "https://api.pekolive.com/";
|
||||
public static String IM_SERVER_URL = "https://api.pekolive.com/";
|
||||
public static String JAVA_WEB_URL = "https://api.hfighting.com/";
|
||||
public static String IM_SERVER_URL = "https://api.hfighting.com/";
|
||||
|
||||
/**
|
||||
* 初始化URL
|
||||
|
@@ -61,6 +61,7 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
private boolean isRadish;
|
||||
private boolean isFairy;
|
||||
|
||||
private String bannerUrl;
|
||||
public BannerInfo(){
|
||||
|
||||
}
|
||||
@@ -71,6 +72,7 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
bannerPic = in.readString();
|
||||
skipType = in.readInt();
|
||||
skipUri = in.readString();
|
||||
bannerUrl = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,6 +82,7 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
dest.writeString(bannerPic);
|
||||
dest.writeInt(skipType);
|
||||
dest.writeString(skipUri);
|
||||
dest.writeString(bannerUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -206,6 +206,7 @@ import io.reactivex.SingleSource;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.functions.Predicate;
|
||||
import io.reactivex.processors.PublishProcessor;
|
||||
@@ -232,6 +233,9 @@ public final class IMNetEaseManager {
|
||||
public RoomQueueInfo mCacheRoomQueueInfo;
|
||||
private Disposable datingDisposable;
|
||||
|
||||
// 用于网络重连的判断
|
||||
private boolean isNetBroken = false;
|
||||
|
||||
private IMNetEaseManager() {
|
||||
roomProcessor = PublishProcessor.create();
|
||||
relationShipProcessor = PublishProcessor.create();
|
||||
@@ -421,9 +425,20 @@ public final class IMNetEaseManager {
|
||||
}).subscribe();
|
||||
}
|
||||
|
||||
|
||||
private void registerOnlineStatusChange() {
|
||||
Observer<ChatRoomStatusChangeData> onlineStatus = (Observer<ChatRoomStatusChangeData>) this::dealChatRoomOnlineStatus;
|
||||
Observer<ChatRoomStatusChangeData> onlineStatus = chatRoomStatusChangeData -> {
|
||||
if (chatRoomStatusChangeData.status == StatusCode.NET_BROKEN) {
|
||||
isNetBroken = true;
|
||||
}
|
||||
boolean reconnection = false;
|
||||
if (chatRoomStatusChangeData.status == StatusCode.LOGINED) {
|
||||
if (isNetBroken) {
|
||||
reconnection = true;
|
||||
}
|
||||
isNetBroken = false;
|
||||
}
|
||||
dealChatRoomOnlineStatus(chatRoomStatusChangeData, reconnection);
|
||||
};
|
||||
NIMChatRoomSDK.getChatRoomServiceObserve().observeOnlineStatus(onlineStatus, true);
|
||||
}
|
||||
|
||||
@@ -481,9 +496,11 @@ public final class IMNetEaseManager {
|
||||
msgStatusObserver, true);
|
||||
}
|
||||
|
||||
|
||||
private void dealChatRoomOnlineStatus(ChatRoomStatusChangeData chatRoomStatusChangeData) {
|
||||
private void dealChatRoomOnlineStatus(ChatRoomStatusChangeData chatRoomStatusChangeData, boolean reconnection) {
|
||||
if (filterAnotherChatRoom(chatRoomStatusChangeData)) return;
|
||||
if (reconnection) {
|
||||
tryCheckKickState();
|
||||
}
|
||||
long currentUid = AuthModel.get().getCurrentUid();
|
||||
if (chatRoomStatusChangeData.status == StatusCode.CONNECTING) {
|
||||
MLog.info(TAG, ResUtil.getString(R.string.xchat_android_core_manager_imneteasemanager_06));
|
||||
@@ -543,6 +560,38 @@ public final class IMNetEaseManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 尝试检测被踢状态(离线时被踢,重连后需要退出)
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void tryCheckKickState() {
|
||||
String currentUid = AuthModel.get().getCurrentUid() + "";
|
||||
if (currentUid.isEmpty() || currentUid.equals("0")) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
model.getKickList().subscribe(strings -> {
|
||||
if (strings.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
long roomUid = currentRoomInfo.getRoomUid();
|
||||
for (String uid : strings) {
|
||||
if (uid != null && uid.equals(currentUid)) {
|
||||
noticeKickOutChatMember(new ChatRoomKickOutEvent(roomUid + "", ChatRoomKickOutEvent.ChatRoomKickOutReason.KICK_OUT_BY_MANAGER.getValue(), null), currentUid);
|
||||
// 清空緩存數據
|
||||
AvRoomDataManager.get().release();
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean needToHideEnterMessage(ChatRoomMessage chatRoomMessage) {
|
||||
String resource = NobleUtil.getResource(NobleResourceType.KEY_ENTER_HIDE, chatRoomMessage);
|
||||
if (resource.toLowerCase().equals("0")) {
|
||||
@@ -1275,6 +1324,15 @@ public final class IMNetEaseManager {
|
||||
AvRoomDataManager.get().pkBeginTime = roomPkBean.getBeginTime();
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_ORDER);
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_SINGLE_ROOM_PK_MUTE_MIC:
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
RoomPkBean currRoomPkBean = AvRoomDataManager.get().roomPkLiveData.getValue();
|
||||
if (currRoomPkBean != null) {
|
||||
currRoomPkBean.setAMicStatus(roomPkBean.getAMicStatus());
|
||||
AvRoomDataManager.get().roomPkLiveData.postValue(currRoomPkBean);
|
||||
}
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_MUTE_MIC);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_VIP:
|
||||
@@ -2410,6 +2468,7 @@ public final class IMNetEaseManager {
|
||||
@Override
|
||||
public void onSuccess(Void param) {
|
||||
e.onSuccess("踢人出房間回調成功");
|
||||
model.kickUser(account).subscribe();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -16,6 +16,7 @@ import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.manager.BaseEngine;
|
||||
import com.yizhuan.xchat_android_core.music.db.bean.LocalMusicBean;
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel;
|
||||
import com.yizhuan.xchat_android_library.common.application.Env;
|
||||
import com.yizhuan.xchat_android_library.common.file.FileHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class RtcEngineManager extends BaseEngine {
|
||||
Logger.t(TAG).d("enterChannel channelId:%d", channelId);
|
||||
if (mRtcEngine == null) {
|
||||
try {
|
||||
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), XChatConstants.AGORA_KEY, mEngineEventHandler);
|
||||
mRtcEngine = RtcEngine.create(BasicConfig.INSTANCE.getAppContext(), Env.isDebug() ? XChatConstants.AGORA_KEY_DEBUG : XChatConstants.AGORA_KEY, mEngineEventHandler);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(
|
||||
"NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
|
||||
|
@@ -20,7 +20,6 @@ import com.netease.nimlib.sdk.msg.MsgService;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_core.DemoCache;
|
||||
import com.yizhuan.xchat_android_core.R;
|
||||
import com.yizhuan.xchat_android_core.auth.bean.AreaInfoBean;
|
||||
import com.yizhuan.xchat_android_core.auth.entity.AccountInfo;
|
||||
import com.yizhuan.xchat_android_core.auth.entity.ThirdUserInfo;
|
||||
import com.yizhuan.xchat_android_core.auth.entity.TicketInfo;
|
||||
@@ -219,20 +218,9 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
if (currentAccountInfo == null || TextUtils.isEmpty(currentAccountInfo.getAccess_token())) {
|
||||
return Single.error(new Throwable(""));//没有账号信息
|
||||
}
|
||||
return requestTicket().flatMap(ticketResult -> {
|
||||
if (!ticketResult.isSuccess()) {
|
||||
return Single.error(new Throwable(ticketResult.getMessage()));
|
||||
}
|
||||
ticketInfo = ticketResult.getData();
|
||||
DemoCache.saveTicketInfo(ticketInfo);
|
||||
return Single.just(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_01));
|
||||
})
|
||||
return imLogin(currentAccountInfo)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.flatMap((Function<String, SingleSource<String>>) s -> {
|
||||
Log.i("IMLogin", "apply");
|
||||
return imLogin(currentAccountInfo);
|
||||
})
|
||||
.doOnSuccess(s -> {
|
||||
EventBus.getDefault().post(new LoginEvent());
|
||||
});
|
||||
@@ -781,7 +769,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void cleanLogInfo() {
|
||||
public void cleanLogInfo() {
|
||||
reset();//这里先重置状态,后调用IM登出,因为这里观察了IM的在线状态
|
||||
NIMClient.getService(AuthService.class).logout();
|
||||
EventBus.getDefault().post(new LogoutEvent());
|
||||
@@ -1012,17 +1000,6 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 区号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Single<List<AreaInfoBean>> getAreaCodeList() {
|
||||
return api.getAreaCodeList()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
*
|
||||
@@ -1284,14 +1261,6 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
@POST("phone/auth/bound")
|
||||
Single<ServiceResult<String>> boundAuthCode(@Field("authCode") String authCode);
|
||||
|
||||
/**
|
||||
* 获取地区码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("areaInfo/list")
|
||||
Single<ServiceResult<List<AreaInfoBean>>> getAreaCodeList();
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
*
|
||||
|
@@ -1,15 +0,0 @@
|
||||
package com.yizhuan.xchat_android_core.auth.bean
|
||||
|
||||
import lombok.Data
|
||||
|
||||
@Data
|
||||
class AreaInfoBean(
|
||||
val id: Long = 0L,
|
||||
val name: String? = null,
|
||||
val abbr: String? = null,
|
||||
val phoneAreaCode: String? = null,
|
||||
val seq: Int = 0,
|
||||
val status: Int = 0,
|
||||
val createTime: Long = 0L,
|
||||
val updateTime: Long = 0L
|
||||
)
|
@@ -386,6 +386,7 @@ public class CustomAttachment implements MsgAttachment {
|
||||
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_RESULT = 8311;// 个播pk结果通知
|
||||
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_NOTIFY = 8312;// 个播pk结束触发的飘屏通知
|
||||
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_FINISH = 8313;// 个播pk结束通知
|
||||
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_MUTE_MIC = 8316;// 个播pk禁用对方麦克风
|
||||
/**
|
||||
* 贵族
|
||||
*/
|
||||
|
@@ -114,6 +114,11 @@ public class RoomPkBean implements Serializable {
|
||||
* PK预约字段
|
||||
*/
|
||||
private long beginTime;
|
||||
// 0:屏蔽 1:开启
|
||||
/**
|
||||
* 个播PK匹配新增字段
|
||||
*/
|
||||
private int aMicStatus;
|
||||
|
||||
@Data
|
||||
public static class RankBean implements Serializable {
|
||||
|
@@ -78,4 +78,5 @@ public interface IInitialModel extends IModel {
|
||||
@Nullable
|
||||
FairyOpenInfo getFairyOpenInfo();
|
||||
|
||||
void regionCheck();
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.yizhuan.xchat_android_core.initial;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -14,6 +15,8 @@ import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.bumptech.glide.request.FutureTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.chuhai.utils.LanguageUtils;
|
||||
import com.chuhai.utils.TelephonyUtils;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.xchat_android_core.R;
|
||||
import com.yizhuan.xchat_android_core.DemoCache;
|
||||
@@ -30,6 +33,8 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleDataManager;
|
||||
import com.yizhuan.xchat_android_core.public_chat_hall.manager.PublicChatHallDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.face.DynamicFaceModel;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
@@ -49,11 +54,14 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.SingleSource;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
@@ -131,6 +139,8 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
@Nullable
|
||||
private InitInfo cacheInitInfo;
|
||||
|
||||
private Disposable regionCheckTimer;
|
||||
|
||||
private InitialModel() {
|
||||
api = RxNet.create(Api.class);
|
||||
loadMainTabInfoList();
|
||||
@@ -514,6 +524,38 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
/**
|
||||
* 地区检测
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void regionCheck() {
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar())) {
|
||||
return;
|
||||
}
|
||||
String operatorCode;
|
||||
if (TelephonyUtils.INSTANCE.isChinaOperator()) {
|
||||
operatorCode = "460";
|
||||
} else {
|
||||
operatorCode = TelephonyUtils.INSTANCE.getOperatorFirstSim();
|
||||
}
|
||||
api.regionCheck(LanguageUtils.INSTANCE.getSystemLanguage().toLanguageTag(), operatorCode)
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.doOnSuccess(longServiceResult -> {
|
||||
if (regionCheckTimer != null && !regionCheckTimer.isDisposed()) {
|
||||
regionCheckTimer.dispose();
|
||||
}
|
||||
if (longServiceResult.isSuccess() && longServiceResult.getData() != null && longServiceResult.getData() > 0) {
|
||||
regionCheckTimer = Observable.timer(Math.max(longServiceResult.getData(), 30 * 1000), TimeUnit.MILLISECONDS).subscribe(aLong -> {
|
||||
regionCheck();
|
||||
});
|
||||
}
|
||||
}).subscribe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTeenagerMode() {
|
||||
@@ -591,5 +633,16 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
@GET("act/seize-treasure/status")
|
||||
Single<ServiceResult<FairyOpenInfo>> getFairyOpenInfo();
|
||||
|
||||
/**
|
||||
* 地区检测
|
||||
*
|
||||
* @param lang 语言
|
||||
* @param mcc 运营商码
|
||||
* @return
|
||||
*/
|
||||
@POST("/ipRegion/check")
|
||||
@FormUrlEncoded
|
||||
Single<ServiceResult<Long>> regionCheck(@Field("lang") String lang, @Field("mcc") String mcc);
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.chuhai.utils.TelephonyUtils;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.utils.APIEncryptUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.OaidUtil;
|
||||
@@ -34,6 +35,12 @@ public class ParamsInterceptor implements Interceptor {
|
||||
|
||||
private Map<String, String> mHttpParams;
|
||||
|
||||
// 运营商码
|
||||
private String operatorCode;
|
||||
|
||||
// 运营商码的获取时间
|
||||
private long operatorCodeTime;
|
||||
|
||||
public ParamsInterceptor(Map<String, String> params) {
|
||||
this.mHttpParams = params;
|
||||
}
|
||||
@@ -124,9 +131,8 @@ public class ParamsInterceptor implements Interceptor {
|
||||
// Log.e("ParamsInterceptor", " url: " + oldRequest.url()+ " final params Map : " + paramsMap.toString());
|
||||
// Log.e("ParamsInterceptor", "timestamp:"+timestamp + " url: " + oldRequest.url()+ " sign : " + signStr);
|
||||
|
||||
|
||||
Headers headers = oldRequest.headers().newBuilder()
|
||||
.add("pub_ticket", ticket)
|
||||
.add("pub_ticket", ticket == null ? "" : ticket)
|
||||
.add("pub_uid", uid == 0 ? "" : String.valueOf(uid))
|
||||
.build();
|
||||
HttpUrl.Builder builder = oldRequest.url().newBuilder()
|
||||
@@ -137,6 +143,7 @@ public class ParamsInterceptor implements Interceptor {
|
||||
}
|
||||
builder.addQueryParameter("pub_timestamp", timestamp);
|
||||
builder.addQueryParameter("pub_sign", signStr);
|
||||
addHeaderWithOperator(builder);
|
||||
Request newRequest = oldRequest.newBuilder()
|
||||
.method(oldRequest.method(), oldRequest.body())
|
||||
.headers(headers)
|
||||
@@ -146,5 +153,19 @@ public class ParamsInterceptor implements Interceptor {
|
||||
|
||||
}
|
||||
|
||||
private void addHeaderWithOperator(HttpUrl.Builder builder) {
|
||||
if ((System.currentTimeMillis() - operatorCodeTime) > (1000 * 60 * 10)) {
|
||||
loadOperatorCode();
|
||||
}
|
||||
builder.addQueryParameter("mcc", operatorCode);
|
||||
}
|
||||
|
||||
private void loadOperatorCode() {
|
||||
if (TelephonyUtils.INSTANCE.isChinaOperator()) {
|
||||
operatorCode = "460";
|
||||
} else {
|
||||
operatorCode = TelephonyUtils.INSTANCE.getOperatorFirstSim();
|
||||
}
|
||||
operatorCodeTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
@@ -97,7 +97,6 @@ public final class AvRoomDataManager {
|
||||
*/
|
||||
@NonNull
|
||||
public final List<ChatRoomMember> roomSuperAdminList = new ArrayList<>();
|
||||
@NonNull
|
||||
public final MutableLiveData<RoomPkBean> roomPkLiveData = new MutableLiveData<>();
|
||||
/**
|
||||
* 是否需要关麦,用户自己的行为,不受房主管理员的管理,与闭麦状态相同,当闭麦这个值就是ture;
|
||||
|
@@ -215,6 +215,7 @@ public class RoomEvent {
|
||||
public static final int ROOM_PK_ACCEPT = 74;
|
||||
public static final int ROOM_PK_FINISH = 75;
|
||||
public static final int ROOM_PK_NOTIFY = 76;
|
||||
public static final int ROOM_PK_MUTE_MIC = 78;
|
||||
|
||||
/**
|
||||
* 请求上麦
|
||||
|
@@ -0,0 +1,118 @@
|
||||
package com.yizhuan.xchat_android_core.region
|
||||
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.coroutineScope
|
||||
import com.chuhai.utils.AppUtils
|
||||
import com.chuhai.utils.TelephonyUtils
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.yizhuan.xchat_android_core.region.bean.RegionBean
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.InputStream
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/12/7 18:23
|
||||
* Desc:地区
|
||||
**/
|
||||
class RegionHelper {
|
||||
|
||||
fun loadRecommendRegion(lifecycle: Lifecycle, textView: TextView){
|
||||
lifecycle.coroutineScope.launch {
|
||||
RegionHelper().getCurrentOrDefRegion().let {
|
||||
textView.text = it.fullCode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDefaultRegion(): RegionBean {
|
||||
return RegionBean(name = "Taiwan", abbr = "TW", mcc = "466", code = "886")
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前地区或默认
|
||||
*/
|
||||
private suspend fun getCurrentOrDefRegion(): RegionBean {
|
||||
return withContext(Dispatchers.IO) {
|
||||
var operator = TelephonyUtils.getNetWorkOperator()
|
||||
if (operator.isNullOrEmpty()) {
|
||||
operator = TelephonyUtils.getSimOperator()
|
||||
}
|
||||
val mcc = operator?.take(3)
|
||||
val region = getAllRegionList().firstOrNull {
|
||||
it.mcc == mcc
|
||||
}
|
||||
region ?: getDefaultRegion()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地区选择器列表
|
||||
*/
|
||||
suspend fun getRegionSelectorList(groupItemType: Int): List<RegionBean> {
|
||||
return withContext(Dispatchers.IO) {
|
||||
val list = ArrayList<RegionBean>()
|
||||
list.addAll(getHotRegionList())
|
||||
var lastGroup: Char? = null
|
||||
list.addAll(getAllRegionList()
|
||||
.map {
|
||||
val firstName = it.name?.firstOrNull()?.uppercaseChar() ?: '#'
|
||||
if (firstName in 'A'..'Z') {
|
||||
it.groupName = firstName
|
||||
it.sortedBy = "$firstName${it.name?.uppercase()}"
|
||||
} else {
|
||||
it.groupName = '#'
|
||||
it.sortedBy = "${'Z' + 1}${it.name?.uppercase()}"
|
||||
}
|
||||
it
|
||||
}
|
||||
.sortedBy {
|
||||
it.sortedBy
|
||||
}.map {
|
||||
val groupName = it.groupName ?: '#'
|
||||
if (groupName != lastGroup) {
|
||||
it.itemType = groupItemType
|
||||
}
|
||||
lastGroup = groupName
|
||||
it
|
||||
}
|
||||
)
|
||||
list
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热门地区
|
||||
*/
|
||||
suspend fun getHotRegionList(): List<RegionBean> {
|
||||
return getRegionListFromAssets("hot_region.json")
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部地区
|
||||
*/
|
||||
suspend fun getAllRegionList(): List<RegionBean> {
|
||||
return getRegionListFromAssets("region.json")
|
||||
}
|
||||
|
||||
/**
|
||||
* 从资源文件中获取地区列表
|
||||
*/
|
||||
private fun getRegionListFromAssets(fileName: String): MutableList<RegionBean> {
|
||||
//获取IO流
|
||||
try {
|
||||
val inputStream: InputStream =
|
||||
AppUtils.getApp().applicationContext.assets.open(fileName)
|
||||
val json: String
|
||||
inputStream.use {
|
||||
json = it.bufferedReader().readText()
|
||||
}
|
||||
return Gson().fromJson(json, object : TypeToken<MutableList<RegionBean>>() {}.type)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return mutableListOf()
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.yizhuan.xchat_android_core.region.bean
|
||||
|
||||
import com.chad.library.adapter.base.entity.MultiItemEntity
|
||||
import com.netease.nim.uikit.business.ait.selector.model.ItemType
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/12/7 18:48
|
||||
* Desc:地区
|
||||
**/
|
||||
data class RegionBean(
|
||||
// 名称(英文)
|
||||
val name: String?,
|
||||
// 简称
|
||||
val abbr: String?,
|
||||
// 区号
|
||||
val code: String?,
|
||||
// MCC
|
||||
val mcc: String?
|
||||
) : MultiItemEntity {
|
||||
|
||||
val fullCode: String?
|
||||
get() {
|
||||
if (code == null) {
|
||||
return null
|
||||
}
|
||||
return if (code.startsWith("+")) {
|
||||
code
|
||||
} else {
|
||||
"+$code"
|
||||
}
|
||||
}
|
||||
|
||||
// 本地分组用到
|
||||
var groupName: Char? = null
|
||||
|
||||
// 本地排序用到
|
||||
var sortedBy: String? = null
|
||||
|
||||
private var itemType: Int = 0
|
||||
|
||||
fun setItemType(itemType: Int) {
|
||||
this.itemType = itemType
|
||||
}
|
||||
|
||||
override fun getItemType(): Int {
|
||||
return itemType
|
||||
}
|
||||
}
|
@@ -104,6 +104,17 @@ object SingleRoomPKModel {
|
||||
.compose(RxHelper.handleStringData())
|
||||
}
|
||||
|
||||
/**
|
||||
* 对方麦位屏蔽
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun muteSingleRoomPkOtherMic(roundId: String, micStatus: Int): Single<String> {
|
||||
return api.muteSingleRoomPkOtherMic(AvRoomDataManager.get().roomUid, roundId, micStatus)
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
.compose(RxHelper.handleStringData())
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
* 发起挑战
|
||||
@@ -172,6 +183,20 @@ object SingleRoomPKModel {
|
||||
fun getSingleRoomPkRule(
|
||||
@Field("roomUid") roomUid: Long?
|
||||
): Single<ServiceResult<String>>
|
||||
|
||||
/**
|
||||
*对方麦位屏蔽
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/crossroompkround/otherMic")
|
||||
fun muteSingleRoomPkOtherMic(
|
||||
@Field("roomUid") roomUid: Long?,
|
||||
@Field("roundId") roundId: String,
|
||||
@Field("micStatus") micStatus: Int
|
||||
): Single<ServiceResult<String>>
|
||||
}
|
||||
|
||||
}
|
@@ -701,4 +701,26 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取踢人列表
|
||||
* @return
|
||||
*/
|
||||
public Single<List<String>> getKickList() {
|
||||
return mRoomService.getKickList(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 踢人
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
public Single<String> kickUser(long uid) {
|
||||
return mRoomService.kickUser(AvRoomDataManager.get().getRoomUid(),uid)
|
||||
.compose(RxHelper.handleStringData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
}
|
||||
|
@@ -1188,6 +1188,25 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
@POST("/roomFirstChargeWindow/update")
|
||||
Single<ServiceResult<String>> postFirstCharge(@Field("roomUid") long roomUid);
|
||||
|
||||
/**
|
||||
* 踢人
|
||||
*
|
||||
* @param roomUid
|
||||
* @return
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/room/kick/")
|
||||
Single<ServiceResult<String>> kickUser(@Field("roomUid") long roomUid, @Field("uid") long uid);
|
||||
|
||||
/**
|
||||
* 获取踢人列表
|
||||
*
|
||||
* @param roomUid
|
||||
* @return
|
||||
*/
|
||||
@GET("/room/kick/")
|
||||
Single<ServiceResult<List<String>>> getKickList(@Query("roomUid") long roomUid);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -107,8 +107,10 @@ public class SAdminOptUtil {
|
||||
}
|
||||
ChatRoomMessage message = SaAttachmentFactory.createBlackOrKickOutChatRoomMsg(kickUid, nick, 3);
|
||||
IMNetEaseManager.get().sendChatRoomMessage(message, false)
|
||||
.doOnSuccess(chatRoomMessage ->
|
||||
KickModel.get().onSendRoomMessageSuccess(chatRoomMessage))
|
||||
.doOnSuccess(chatRoomMessage ->{
|
||||
KickModel.get().onSendRoomMessageSuccess(chatRoomMessage);
|
||||
AvRoomModel.get().kickUser(JavaUtil.str2long(kickUid)).subscribe();
|
||||
})
|
||||
.subscribe();
|
||||
return true;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx4096M" -XX\:MaxPermSize\=4096m
|
||||
org.gradle.jvmargs=-Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx4096M" -XX\:MaxMetaspaceSize\=4096m
|
||||
|
||||
org.gradle.daemon=true
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
|
@@ -63,13 +63,14 @@ public final class RxNetManager {
|
||||
|
||||
if (RxNetLog.DEBUG) {
|
||||
//正式环境千万不要加这玩意,为了方便日志查看,拦截器里面加了synchronized关键字,接口请求是串行的
|
||||
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
|
||||
@Override
|
||||
public void log(String message) {
|
||||
RxNetLog.d("OKHttp-------%s", message);
|
||||
}
|
||||
});
|
||||
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
// HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
|
||||
// @Override
|
||||
// public void log(String message) {
|
||||
// RxNetLog.d("OKHttp-------%s", message);
|
||||
// }
|
||||
// });
|
||||
okhttp3.logging.HttpLoggingInterceptor loggingInterceptor = new okhttp3.logging.HttpLoggingInterceptor();
|
||||
loggingInterceptor.setLevel(okhttp3.logging.HttpLoggingInterceptor.Level.BODY);
|
||||
mBuilder.addInterceptor(loggingInterceptor);
|
||||
|
||||
mBuilder.addNetworkInterceptor(new StethoInterceptor());
|
||||
|
@@ -0,0 +1,19 @@
|
||||
package com.chuhai.utils
|
||||
|
||||
import android.os.Build
|
||||
import android.os.LocaleList
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/17 16:12
|
||||
* Desc:
|
||||
**/
|
||||
object LanguageUtils {
|
||||
fun getSystemLanguage(): Locale {
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
LocaleList.getDefault()[0]
|
||||
} else {
|
||||
Locale.getDefault()
|
||||
}
|
||||
}
|
||||
}
|
148
library/src/module_utils/java/com/chuhai/utils/TelephonyUtils.kt
Normal file
148
library/src/module_utils/java/com/chuhai/utils/TelephonyUtils.kt
Normal file
@@ -0,0 +1,148 @@
|
||||
package com.chuhai.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.telephony.TelephonyManager
|
||||
import com.chuhai.utils.log.ILog
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/14 10:17
|
||||
* Desc:TelephonyManager 相关工具
|
||||
**/
|
||||
object TelephonyUtils : ILog {
|
||||
|
||||
/**
|
||||
* 是否为中国运营商(任意卡属于中国就为true)
|
||||
*/
|
||||
fun isChinaOperator(): Boolean {
|
||||
try {
|
||||
val tm =
|
||||
AppUtils.getApp().getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager
|
||||
?: return false
|
||||
if (tm.simState == TelephonyManager.SIM_STATE_READY) {
|
||||
if (!tm.simOperator.isNullOrEmpty() && tm.simOperator.startsWith("460")) {
|
||||
return true
|
||||
}
|
||||
if (isChainOperator(tm.simOperatorName)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if (!tm.networkOperator.isNullOrEmpty() && tm.networkOperator.startsWith("460")) {
|
||||
return true
|
||||
}
|
||||
if (isChainOperator(tm.networkOperatorName)) {
|
||||
return true
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运营商(优先SIM)
|
||||
*/
|
||||
fun getOperatorFirstSim(): String? {
|
||||
val operator = getSimOperator()
|
||||
return if (operator.isNullOrEmpty()) {
|
||||
getNetWorkOperator()
|
||||
} else {
|
||||
operator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取SIM运营商名称
|
||||
*/
|
||||
fun getSimOperator(): String? {
|
||||
try {
|
||||
val tm =
|
||||
AppUtils.getApp().getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager
|
||||
?: return null
|
||||
if (tm.simState != TelephonyManager.SIM_STATE_READY) {
|
||||
logD("SIM状态不对:${tm.simState}")
|
||||
return null
|
||||
}
|
||||
val simOperator = tm.simOperator
|
||||
logD("getSimOperator()获取的MCC+MNC为:$simOperator")
|
||||
logD("getOperatorName()方法获取的运营商名称为:${tm.simOperatorName} ")
|
||||
logD("通过getSimOperator()人为判断的运营商名称是: ${getOperatorName(simOperator)}")
|
||||
return simOperator
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取网络运营商
|
||||
*/
|
||||
fun getNetWorkOperator(): String? {
|
||||
try {
|
||||
val tm =
|
||||
AppUtils.getApp().getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager
|
||||
?: return null
|
||||
//用于判断拨号那张卡的运营商
|
||||
val networkOperator = tm.networkOperator
|
||||
logD("getNetWorkOperator() 获取的MCC+MNC为:$networkOperator")
|
||||
logD("getNetWorkOperator() phoneType:${tm.phoneType}")
|
||||
logD("getNetworkOperatorName()方法获取的网络类型名称是: ${tm.networkOperatorName}")
|
||||
logD("通过getNetWorkOperator()人为判断的运营商名称是: ${getOperatorName(networkOperator)}")
|
||||
return tm.networkOperator
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否中国运营商
|
||||
*/
|
||||
private fun isChainOperator(operatorName: String?): Boolean {
|
||||
if (operatorName == null) return false
|
||||
if (operatorName == "CUCC"
|
||||
|| operatorName == "CMCC"
|
||||
|| operatorName == "CTCC"
|
||||
|| operatorName == "CTT"
|
||||
|| operatorName.contains("中国")
|
||||
|| operatorName.contains("中國")
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 运营商类型
|
||||
*/
|
||||
private fun getOperatorName(simOperator: String?): String? {
|
||||
if (simOperator == null) {
|
||||
return null
|
||||
}
|
||||
return when (simOperator) {
|
||||
"46001", "46006", "46009" -> {
|
||||
// 联通
|
||||
"CUCC"
|
||||
}
|
||||
|
||||
"46000", "46002", "46004", "46007" -> {
|
||||
// 移动
|
||||
"CMCC"
|
||||
}
|
||||
|
||||
"46003", "46005", "46011" -> {
|
||||
// 电信
|
||||
"CTCC"
|
||||
}
|
||||
|
||||
"46020" -> {
|
||||
// 铁通
|
||||
"CTT"
|
||||
}
|
||||
|
||||
else -> {
|
||||
"OHTER"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user