进场动效文案居左,打招呼网络异常文案,打招呼弹窗重复出现,打招呼文案选择bug
This commit is contained in:
@@ -7,6 +7,10 @@ import android.content.res.AssetFileDescriptor;
|
||||
import android.graphics.Color;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.text.Layout;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.StaticLayout;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
@@ -862,8 +866,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
} else if (selectContent == SELECT_ONLINE_LIST) {
|
||||
listFragment.showPage(HomePartyUserListFragment.SHOW_PAGE_ONLINE_LIST);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
selectContent = SELECT_DEFAULT;
|
||||
}
|
||||
@@ -1080,7 +1082,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
.append(targetNicks.get(0), new ForegroundColorSpan(Color.WHITE))
|
||||
.append("进入了房间",new ForegroundColorSpan(Color.WHITE));
|
||||
textView.setText(text.build());
|
||||
playMemberInAnim(targetNicks.get(0)+"进入了房间",memberInSvgaPath(experLevelSeq));
|
||||
playMemberInAnim("【"+targetNicks.get(0)+"】进入了房间",memberInSvgaPath(experLevelSeq));
|
||||
}
|
||||
|
||||
private String memberInSvgaPath(int level){
|
||||
@@ -1115,8 +1117,21 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
textPaint.setColor(Color.WHITE);//字体颜色
|
||||
textPaint.setTextSize(22);//字体大小
|
||||
// textPaint.setShadowLayer(3, 2, 2, 0xff000000);//字体阴影,不需要可以不用设置
|
||||
dynamicEntity.setDynamicText(text, textPaint, "room_text");
|
||||
SVGADrawable drawable = new SVGADrawable(svgaVideoEntity != null ? svgaVideoEntity : null,dynamicEntity);
|
||||
// dynamicEntity.setDynamicText(text, textPaint, "room_text");
|
||||
// SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(text);
|
||||
// spannableStringBuilder.setSpan(new ForegroundColorSpan(0xfff6ff00), 0, 4, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
dynamicEntity.setDynamicText(new StaticLayout(
|
||||
text,
|
||||
0,
|
||||
text.length(),
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_NORMAL,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "room_text");
|
||||
SVGADrawable drawable = new SVGADrawable(svgaVideoEntity,dynamicEntity);
|
||||
mSvgaMemberIn.setImageDrawable(drawable);
|
||||
mSvgaMemberIn.stepToFrame(0, true);
|
||||
mSvgaMemberIn.startAnimation();
|
||||
|
@@ -1,7 +1,11 @@
|
||||
package com.yizhuan.erban.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
@@ -44,6 +48,7 @@ import com.orhanobut.logger.Logger;
|
||||
import com.readystatesoftware.systembartint.SystemBarTintManager;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.yizhuan.erban.MainActivity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.application.XChatApplication;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
@@ -126,6 +131,7 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
|
||||
//import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_PUSH_NOTIFICATION_IN_DYNAMIC_MSG;
|
||||
//import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_PUSH_NOTIFICATION_IN_ROOM;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND;
|
||||
import static com.yizhuan.xchat_android_library.utils.UIUtils.getActivityByContext;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1126,9 +1132,16 @@ public abstract class BaseMvpActivity<V extends IMvpBaseView, P extends Abstract
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onReceiveHello(NewbieHelloDialogEvent event) {
|
||||
showHelloDialog(event.getHelloInfo());
|
||||
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
|
||||
if (am == null)return;
|
||||
ComponentName cn = am.getRunningTasks(1).get(0).topActivity;
|
||||
if (cn == null)return;
|
||||
if(cn.getShortClassName().equals(getActivityByContext(context).getLocalClassName())){
|
||||
showHelloDialog(event.getHelloInfo());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打招呼
|
||||
* @param helloInfo
|
||||
|
@@ -46,6 +46,7 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
||||
private int mStart = 0;
|
||||
private int mUid = 0;
|
||||
private String mMessage = "";
|
||||
private RoomNewbieMessageInfo mMessageInfo;
|
||||
|
||||
public static RoomNewbieMessageFragment newInstance(int uid) {
|
||||
Bundle args = new Bundle();
|
||||
@@ -126,6 +127,7 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
||||
adapter.notifyDataSetChanged();
|
||||
//2.超出一页,滚动至点击条目
|
||||
recyclerView.scrollToPosition(position);
|
||||
mMessage = mMessageInfo.getList().get(p).getMessage();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -141,6 +143,7 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
||||
@Override
|
||||
public void getRoomNewbieMessageSuccess(RoomNewbieMessageInfo info) {
|
||||
hideStatus();
|
||||
p = 0;
|
||||
if (mNewbieMessageAdapter != null) {
|
||||
int page = getMvpPresenter().getStart();
|
||||
if (page <= 1) {
|
||||
@@ -149,13 +152,14 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
||||
if (info == null || info.getList().size() == 0) {
|
||||
showNoData();
|
||||
} else {
|
||||
p = 0;
|
||||
|
||||
for (int i = 0; i < info.getList().size(); i++) {
|
||||
info.getList().get(i).setCheck(i==0?true:false);
|
||||
}
|
||||
mNewbieMessageAdapter.setNewData(info.getList());
|
||||
infoList = info;
|
||||
mStart = info.getStart();
|
||||
mMessageInfo = info;
|
||||
mMessage = info.getList().get(0).getMessage();
|
||||
}
|
||||
}
|
||||
@@ -165,7 +169,7 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
||||
@Override
|
||||
public void getRoomNewbieMessageFails(String error) {
|
||||
hideStatus();
|
||||
|
||||
p = 0;
|
||||
int page = getMvpPresenter().getStart();
|
||||
if (page <= 1) {
|
||||
showNoData();
|
||||
@@ -211,7 +215,7 @@ public class RoomNewbieMessageFragment extends BaseMvpFragment<IRoomNewbieMessag
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
SingleToastUtil.showToastShort(e.getMessage());
|
||||
SingleToastUtil.showToast("网络异常,请重试!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
@@ -117,6 +118,16 @@ public class UIUtils {
|
||||
return Objects.equals(cmpNameTemp, activity);
|
||||
}
|
||||
|
||||
public static Activity getActivityByContext(Context context){
|
||||
while(context instanceof ContextWrapper){
|
||||
if(context instanceof Activity){
|
||||
return (Activity) context;
|
||||
}
|
||||
context = ((ContextWrapper) context).getBaseContext();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setOverflowShowingAlways(Context context) {
|
||||
try {
|
||||
ViewConfiguration config = ViewConfiguration.get(context);
|
||||
|
Reference in New Issue
Block a user