小游戏房公屏点击放大
This commit is contained in:
@@ -195,13 +195,6 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
showRoomIntroduction(false)
|
||||
}
|
||||
})
|
||||
|
||||
messageView.setOnClickListener {
|
||||
messageView.updateLayoutParams<RelativeLayout.LayoutParams> {
|
||||
height = ScreenUtil.dip2px(200f)
|
||||
}
|
||||
}
|
||||
|
||||
gameDelegate = GameDelegate(
|
||||
requireActivity(),
|
||||
gameBinding.flGameContainer,
|
||||
|
@@ -15,6 +15,7 @@ import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -135,9 +136,11 @@ import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.ExtensionUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
import com.yizhuan.xchat_android_library.utils.CommonUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.FormatUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
@@ -203,14 +206,6 @@ public class MessageView extends FrameLayout {
|
||||
private Consumer<String> clickConsumer;
|
||||
private OnClick onClick;
|
||||
|
||||
public void setClickConsumer(Consumer<String> clickConsumer) {
|
||||
this.clickConsumer = clickConsumer;
|
||||
}
|
||||
|
||||
public void setOnClick(OnClick onClick) {
|
||||
this.onClick = onClick;
|
||||
}
|
||||
|
||||
public MessageView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -224,6 +219,14 @@ public class MessageView extends FrameLayout {
|
||||
init(context);
|
||||
}
|
||||
|
||||
public void setClickConsumer(Consumer<String> clickConsumer) {
|
||||
this.clickConsumer = clickConsumer;
|
||||
}
|
||||
|
||||
public void setOnClick(OnClick onClick) {
|
||||
this.onClick = onClick;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
@@ -242,6 +245,7 @@ public class MessageView extends FrameLayout {
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void init(Context context) {
|
||||
whiteColor = ContextCompat.getColor(context, R.color.white);
|
||||
greyColor = ContextCompat.getColor(context, R.color.white_transparent_50);
|
||||
@@ -279,6 +283,19 @@ public class MessageView extends FrameLayout {
|
||||
messageListView.getItemAnimator().setMoveDuration(0);
|
||||
messageListView.getItemAnimator().setRemoveDuration(0);
|
||||
((SimpleItemAnimator) messageListView.getItemAnimator()).setSupportsChangeAnimations(false);
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
messageListView.setOnTouchListener((v, event) -> {
|
||||
if (messageListView.getScrollState() == RecyclerView.SCROLL_STATE_IDLE
|
||||
&& event.getAction() == MotionEvent.ACTION_UP) {
|
||||
ViewGroup.LayoutParams layoutParams = getLayoutParams();
|
||||
int bigHeight = ScreenUtil.dip2px(200);
|
||||
int littleHeight = ScreenUtil.dip2px(80);
|
||||
layoutParams.height = layoutParams.height == littleHeight ? bigHeight : littleHeight;
|
||||
setLayoutParams(layoutParams);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
// 底部有新消息
|
||||
tvBottomTip = new TextView(context);
|
||||
@@ -299,7 +316,6 @@ public class MessageView extends FrameLayout {
|
||||
messageListView.smoothScrollToPosition(mMessageAdapter.getItemCount() - 1);
|
||||
});
|
||||
addView(tvBottomTip);
|
||||
|
||||
messageListView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||
|
@@ -5,15 +5,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
tools:background="#ff0">
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:id="@+id/msg_container"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_marginTop="4dp"-->
|
||||
<!--android:background="@drawable/shape_room_message_bg"-->
|
||||
<!--android:gravity="center_vertical"-->
|
||||
<!--android:orientation="horizontal">-->
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -27,32 +18,4 @@
|
||||
tools:text="这是名字😄"
|
||||
tools:textColor="#000" />
|
||||
|
||||
<!--<ImageView-->
|
||||
<!--android:id="@+id/iv_gift"-->
|
||||
<!--android:layout_width="35dp"-->
|
||||
<!--android:layout_height="35dp"-->
|
||||
<!--android:layout_marginLeft="5dp"-->
|
||||
<!--android:contentDescription="这是礼物"-->
|
||||
<!--tools:background="#000" />-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:id="@+id/tv_gift_number"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_marginLeft="2dp"-->
|
||||
<!--android:includeFontPadding="false"-->
|
||||
<!--android:textColor="@android:color/white"-->
|
||||
<!--android:textSize="12sp" />-->
|
||||
<!--</LinearLayout>-->
|
||||
|
||||
<!--<LinearLayout-->
|
||||
<!--android:id="@+id/face_container"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_marginTop="4dp"-->
|
||||
<!--android:background="@drawable/shape_room_message_bg"-->
|
||||
<!--android:gravity="center_vertical"-->
|
||||
<!--android:orientation="vertical"-->
|
||||
<!--tools:background="#0FF" />-->
|
||||
|
||||
</FrameLayout>
|
Reference in New Issue
Block a user