diff --git a/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt b/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt index 28ef2aa86..594336c51 100644 --- a/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt +++ b/app/src/main/java/com/yizhuan/erban/avroom/widget/RoomEffectView.kt @@ -738,7 +738,7 @@ class RoomEffectView @JvmOverloads constructor( ForegroundColorSpan(resources.getColor(R.color.notice_nick)) ) .append( - ResUtil.getString(R.string.avroom_widget_roomeffectview_09) + attachment.boxTypeStr + ResUtil.getString( + ResUtil.getString(R.string.treasure_in_find_love) + ResUtil.getString( R.string.avroom_widget_roomeffectview_010 ), ForegroundColorSpan(Color.WHITE) ) diff --git a/app/src/main/java/com/yizhuan/erban/ui/user/fragment/UserInfoInfoFragment.kt b/app/src/main/java/com/yizhuan/erban/ui/user/fragment/UserInfoInfoFragment.kt index 7d2bebe15..c139481fe 100644 --- a/app/src/main/java/com/yizhuan/erban/ui/user/fragment/UserInfoInfoFragment.kt +++ b/app/src/main/java/com/yizhuan/erban/ui/user/fragment/UserInfoInfoFragment.kt @@ -85,7 +85,11 @@ class UserInfoInfoFragment : BaseViewBindingFragment 0) { + binding.llAssociation.visibility = View.VISIBLE + } else { + binding.llAssociation.visibility = View.GONE + } } } diff --git a/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/activity/TreasureBoxActivity.java b/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/activity/TreasureBoxActivity.java index d99568c3b..180891ae3 100644 --- a/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/activity/TreasureBoxActivity.java +++ b/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/activity/TreasureBoxActivity.java @@ -32,12 +32,14 @@ import com.yizhuan.treasure_box.model.BoxModel; import com.yizhuan.treasure_box.model.IBoxModel; import com.yizhuan.xchat_android_core.DemoCache; import com.yizhuan.xchat_android_core.exception.FailReasonException; +import com.yizhuan.xchat_android_core.manager.AvRoomDataManager; import com.yizhuan.xchat_android_core.manager.IMNetEaseManager; import com.yizhuan.xchat_android_core.manager.RoomEvent; import com.yizhuan.xchat_android_core.pay.PayModel; import com.yizhuan.xchat_android_core.pay.bean.WalletInfo; import com.yizhuan.xchat_android_core.utils.StringUtils; import com.yizhuan.xchat_android_library.annatation.ActLayoutRes; +import com.yizhuan.xchat_android_library.common.util.SoftKeyboardStateHelper; import com.yizhuan.xchat_android_library.utils.FormatUtils; import com.yizhuan.xchat_android_library.utils.ResUtil; import com.yizhuan.xchat_android_library.utils.SingleToastUtil; @@ -111,16 +113,27 @@ public class TreasureBoxActivity extends BaseBindingActivity { - sendMessageSwitchLevel = keyInfo.getSendMessageSwitchLevel(); - }); + sendMessageSwitchLevel = AvRoomDataManager.get().mFindLoveSwitchVo.getSendMsgLevel(); } @Override @@ -169,9 +182,9 @@ public class TreasureBoxActivity extends BaseBindingActivity { DialogWebViewActivity.start(context, UriProvider.getBoxHelp(), false); closeDialog(); }); - binding.tvGetKey.setOnClickListener(v -> { - DialogWebViewActivity.start(context, UriProvider.getBoxKey()); - closeDialog(); - }); boolean canSwitch = sendMessageSwitchLevel != 0 && UserUtils.getExpLevel() >= sendMessageSwitchLevel; diff --git a/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/TreasureBoxDialog.kt b/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/TreasureBoxDialog.kt index 99d8a746a..bc36cda8b 100644 --- a/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/TreasureBoxDialog.kt +++ b/app/src/module_treasure_box/java/com/yizhuan/erban/treasure_box/widget/dialog/TreasureBoxDialog.kt @@ -30,7 +30,7 @@ class TreasureBoxDialog : BaseDialog() { } else { CommonWebViewActivity.start( context, UriProvider.getOfficialPay( - 10, + 4, getDeviceId(context) ) ) diff --git a/app/src/module_treasure_box/res/layout/dialog_box_more.xml b/app/src/module_treasure_box/res/layout/dialog_box_more.xml index 003e695e6..7875eebf3 100644 --- a/app/src/module_treasure_box/res/layout/dialog_box_more.xml +++ b/app/src/module_treasure_box/res/layout/dialog_box_more.xml @@ -28,16 +28,6 @@ android:textColor="#ff333333" android:textSize="16sp" /> - - CREATOR = new Creator() { + @Override + public FindLoveSwitchVo createFromParcel(Parcel in) { + return new FindLoveSwitchVo(in); + } + + @Override + public FindLoveSwitchVo[] newArray(int size) { + return new FindLoveSwitchVo[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + + @Override + public String toString() { + return "BoxInfo{" + + "open=" + open + + ", openLevel=" + openLevel + + ", sendMsgLevel='" + sendMsgLevel + '\'' + + '}'; + } +} \ No newline at end of file diff --git a/core/src/main/java/com/yizhuan/xchat_android_core/room/bean/RoomInfo.java b/core/src/main/java/com/yizhuan/xchat_android_core/room/bean/RoomInfo.java index 5f3f01948..7f344a20f 100644 --- a/core/src/main/java/com/yizhuan/xchat_android_core/room/bean/RoomInfo.java +++ b/core/src/main/java/com/yizhuan/xchat_android_core/room/bean/RoomInfo.java @@ -108,6 +108,8 @@ public class RoomInfo implements Parcelable,Serializable { public BoxSwitchVo boxSwitchVo; + public FindLoveSwitchVo findLoveDrawSwitchVo; + private String singingMusicName; // 限制类型 public static final String LOCK = "lock";//密码可进 @@ -178,6 +180,7 @@ public class RoomInfo implements Parcelable,Serializable { isOpenKTV = in.readByte() != 0; isOpenGame = in.readByte() != 0; boxSwitchVo = in.readParcelable(BoxSwitchVo.class.getClassLoader()); + findLoveDrawSwitchVo = in.readParcelable(FindLoveSwitchVo.class.getClassLoader()); singingMusicName = in.readString(); limitType = in.readString(); introduction = in.readString(); @@ -240,6 +243,7 @@ public class RoomInfo implements Parcelable,Serializable { dest.writeByte((byte) (isOpenKTV ? 1 : 0)); dest.writeByte((byte) (isOpenGame ? 1 : 0)); dest.writeParcelable(boxSwitchVo, flags); + dest.writeParcelable(findLoveDrawSwitchVo, flags); dest.writeString(singingMusicName); dest.writeString(limitType); dest.writeString(introduction); diff --git a/core/src/main/java/com/yizhuan/xchat_android_core/room/treasure_box/bean/TreasureRankingInfo.kt b/core/src/main/java/com/yizhuan/xchat_android_core/room/treasure_box/bean/TreasureRankingInfo.kt index 98d431051..a3772fc8c 100644 --- a/core/src/main/java/com/yizhuan/xchat_android_core/room/treasure_box/bean/TreasureRankingInfo.kt +++ b/core/src/main/java/com/yizhuan/xchat_android_core/room/treasure_box/bean/TreasureRankingInfo.kt @@ -7,6 +7,6 @@ data class TreasureRankingInfo( val erbanNo: Int = 0, val nick: String = "", val avatar: String = "", - val amount: Int = 0, + val diamonds: Int = 0, val ranking: Int = 0 ): Serializable \ No newline at end of file diff --git a/library/src/module_common/java/com/yizhuan/xchat_android_library/common/util/SoftKeyboardStateHelper.java b/library/src/module_common/java/com/yizhuan/xchat_android_library/common/util/SoftKeyboardStateHelper.java new file mode 100644 index 000000000..f5d4c34b7 --- /dev/null +++ b/library/src/module_common/java/com/yizhuan/xchat_android_library/common/util/SoftKeyboardStateHelper.java @@ -0,0 +1,89 @@ +package com.yizhuan.xchat_android_library.common.util; + +import android.graphics.Rect; +import android.view.View; +import android.view.ViewTreeObserver; + +import java.util.LinkedList; +import java.util.List; + +public class SoftKeyboardStateHelper implements ViewTreeObserver.OnGlobalLayoutListener { + + public interface SoftKeyboardStateListener { + void onSoftKeyboardOpened(int keyboardHeightInPx); + void onSoftKeyboardClosed(); + } + + private final List listeners = new LinkedList(); + private final View activityRootView; + private int lastSoftKeyboardHeightInPx; + private boolean isSoftKeyboardOpened; + + public SoftKeyboardStateHelper(View activityRootView) { + this(activityRootView, false); + } + + public SoftKeyboardStateHelper(View activityRootView, boolean isSoftKeyboardOpened) { + this.activityRootView = activityRootView; + this.isSoftKeyboardOpened = isSoftKeyboardOpened; + activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(this); + } + + @Override + public void onGlobalLayout() { + final Rect r = new Rect(); + //r will be populated with the coordinates of your view that area still visible. + activityRootView.getWindowVisibleDisplayFrame(r); + + final int heightDiff = activityRootView.getRootView().getHeight() - (r.bottom - r.top); + if (!isSoftKeyboardOpened && heightDiff > 100) { // if more than 100 pixels, its probably a keyboard... + isSoftKeyboardOpened = true; + notifyOnSoftKeyboardOpened(heightDiff); + } else if (isSoftKeyboardOpened && heightDiff < 100) { + isSoftKeyboardOpened = false; + notifyOnSoftKeyboardClosed(); + } + } + + public void setIsSoftKeyboardOpened(boolean isSoftKeyboardOpened) { + this.isSoftKeyboardOpened = isSoftKeyboardOpened; + } + + public boolean isSoftKeyboardOpened() { + return isSoftKeyboardOpened; + } + + /** + * Default value is zero (0) + * @return last saved keyboard height in px + */ + public int getLastSoftKeyboardHeightInPx() { + return lastSoftKeyboardHeightInPx; + } + + public void addSoftKeyboardStateListener(SoftKeyboardStateListener listener) { + listeners.add(listener); + } + + public void removeSoftKeyboardStateListener(SoftKeyboardStateListener listener) { + listeners.remove(listener); + } + + private void notifyOnSoftKeyboardOpened(int keyboardHeightInPx) { + this.lastSoftKeyboardHeightInPx = keyboardHeightInPx; + + for (SoftKeyboardStateListener listener : listeners) { + if (listener != null) { + listener.onSoftKeyboardOpened(keyboardHeightInPx); + } + } + } + + private void notifyOnSoftKeyboardClosed() { + for (SoftKeyboardStateListener listener : listeners) { + if (listener != null) { + listener.onSoftKeyboardClosed(); + } + } + } +}