[Modify]特权卡提示,礼物面板调整
This commit is contained in:
@@ -190,6 +190,12 @@ class PrivilegeCardFragment : BaseViewBindingFragment<FragmentPrivilegeCardBindi
|
|||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
if(deleteTipDialog?.isShowing == true){
|
||||||
|
deleteTipDialog?.dismiss()
|
||||||
|
}
|
||||||
|
if(failureTipDialog?.isShowing == true){
|
||||||
|
failureTipDialog?.dismiss()
|
||||||
|
}
|
||||||
EventBus.getDefault().unregister(this)
|
EventBus.getDefault().unregister(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -599,42 +599,48 @@ public class MessageFragment extends TFragment implements ModuleProxy, MessageLi
|
|||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
} else {
|
} else {
|
||||||
isChat = privateChatLimitInfo.isChat();
|
isChat = privateChatLimitInfo.isChat();
|
||||||
hintText = "暂未达到可发起私聊等级";
|
int model = privateChatLimitInfo.getModel();
|
||||||
inputPanel.setLimitLevel(privateChatLimitInfo.isChat(), privateChatLimitInfo.getMessage());
|
if(model == 2){
|
||||||
|
hintText = "互相关注成为好友可发起聊天";
|
||||||
|
inputPanel.setLimitLevel(privateChatLimitInfo.isChat(), hintText);
|
||||||
|
tvChatLimit.setText(hintText);
|
||||||
|
tvChatLimit.setVisibility(isChat ? View.GONE : View.VISIBLE);
|
||||||
|
}else {
|
||||||
|
hintText = "暂未达到可发起私聊等级";
|
||||||
|
inputPanel.setLimitLevel(privateChatLimitInfo.isChat(), hintText);
|
||||||
|
String experLevel = "财富等级≥" + privateChatLimitInfo.getWealthLevel();
|
||||||
|
String charmLevel = "魅力等级≥" + privateChatLimitInfo.getCharmLevel();
|
||||||
|
String privacyAgreementDescTip = getContext().getString(R.string.text_chat_limit, experLevel, charmLevel);
|
||||||
|
SpannableString ss = new SpannableString(privacyAgreementDescTip);
|
||||||
|
int experLevelIndex = privacyAgreementDescTip.indexOf(experLevel);
|
||||||
|
int charmLevelIndex = privacyAgreementDescTip.indexOf(charmLevel);
|
||||||
|
|
||||||
String experLevel = "财富等级≥" + privateChatLimitInfo.getWealthLevel();
|
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)), experLevelIndex, experLevelIndex + experLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
String charmLevel = "魅力等级≥" + privateChatLimitInfo.getCharmLevel();
|
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(getContext(), R.color.appColor)) {
|
||||||
String privacyAgreementDescTip = getContext().getString(R.string.text_chat_limit, experLevel, charmLevel);
|
@Override
|
||||||
SpannableString ss = new SpannableString(privacyAgreementDescTip);
|
public void onClick(@NonNull View widget) {
|
||||||
int experLevelIndex = privacyAgreementDescTip.indexOf(experLevel);
|
if (widget instanceof TextView)
|
||||||
int charmLevelIndex = privacyAgreementDescTip.indexOf(charmLevel);
|
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
||||||
|
|
||||||
|
CommonWebViewActivity.start(getContext(), UriProvider.getUserLevelUrl());
|
||||||
|
}
|
||||||
|
}, experLevelIndex, experLevelIndex + experLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
|
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)), charmLevelIndex, charmLevelIndex + charmLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
|
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(getContext(), R.color.appColor)) {
|
||||||
|
@Override
|
||||||
|
public void onClick(@NonNull View widget) {
|
||||||
|
if (widget instanceof TextView)
|
||||||
|
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
||||||
|
|
||||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)), experLevelIndex, experLevelIndex + experLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
CommonWebViewActivity.start(getContext(), UriProvider.getUserLevelUrl());
|
||||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(getContext(), R.color.appColor)) {
|
}
|
||||||
@Override
|
}, charmLevelIndex, charmLevelIndex + experLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
public void onClick(@NonNull View widget) {
|
|
||||||
if (widget instanceof TextView)
|
|
||||||
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
|
||||||
|
|
||||||
CommonWebViewActivity.start(getContext(), UriProvider.getUserLevelUrl());
|
tvChatLimit.setText(ss);
|
||||||
}
|
tvChatLimit.setHighlightColor(Color.TRANSPARENT);
|
||||||
}, experLevelIndex, experLevelIndex + experLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
tvChatLimit.setMovementMethod(new LinkMovementMethod());
|
||||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)), charmLevelIndex, charmLevelIndex + charmLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
tvChatLimit.setVisibility(isChat ? View.GONE : View.VISIBLE);
|
||||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(getContext(), R.color.appColor)) {
|
}
|
||||||
@Override
|
|
||||||
public void onClick(@NonNull View widget) {
|
|
||||||
if (widget instanceof TextView)
|
|
||||||
((TextView) widget).setHighlightColor(getResources().getColor(android.R.color.transparent));
|
|
||||||
|
|
||||||
CommonWebViewActivity.start(getContext(), UriProvider.getUserLevelUrl());
|
|
||||||
}
|
|
||||||
}, charmLevelIndex, charmLevelIndex + experLevel.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
|
||||||
|
|
||||||
tvChatLimit.setText(ss);
|
|
||||||
tvChatLimit.setHighlightColor(Color.TRANSPARENT);
|
|
||||||
tvChatLimit.setMovementMethod(new LinkMovementMethod());
|
|
||||||
tvChatLimit.setVisibility(isChat ? View.GONE : View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
import androidx.constraintlayout.widget.Group;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
@@ -55,6 +56,7 @@ import com.nnbc123.app.ui.utils.ImageLoadUtilsV2;
|
|||||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||||
import com.nnbc123.app.ui.webview.DialogWebViewActivity;
|
import com.nnbc123.app.ui.webview.DialogWebViewActivity;
|
||||||
import com.nnbc123.app.ui.widget.dialog.GiftManualQuantityDialog;
|
import com.nnbc123.app.ui.widget.dialog.GiftManualQuantityDialog;
|
||||||
|
import com.nnbc123.app.ui.widget.dialog.PrivilegeTipDialog;
|
||||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftHelper;
|
import com.nnbc123.app.ui.widget.drawgift.DrawGiftHelper;
|
||||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftView;
|
import com.nnbc123.app.ui.widget.drawgift.DrawGiftView;
|
||||||
import com.nnbc123.app.ui.widget.magicindicator.GiftIndicator;
|
import com.nnbc123.app.ui.widget.magicindicator.GiftIndicator;
|
||||||
@@ -122,7 +124,6 @@ import io.reactivex.disposables.Disposable;
|
|||||||
* @author chenran
|
* @author chenran
|
||||||
* @date 2017/7/27
|
* @date 2017/7/27
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class GiftDialog extends BottomSheetDialog implements View.OnClickListener, GiftAvatarAdapter.OnItemSelectedListener {
|
public class GiftDialog extends BottomSheetDialog implements View.OnClickListener, GiftAvatarAdapter.OnItemSelectedListener {
|
||||||
|
|
||||||
private static final String TAG = "GiftDialog";
|
private static final String TAG = "GiftDialog";
|
||||||
@@ -165,6 +166,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
private EditText etSendMessage;
|
private EditText etSendMessage;
|
||||||
private Button sendGiftButton;
|
private Button sendGiftButton;
|
||||||
private View layoutEmpty;
|
private View layoutEmpty;
|
||||||
|
private TextView tvEmpty;
|
||||||
private View layoutLoading;
|
private View layoutLoading;
|
||||||
private View layoutLoadFiled;
|
private View layoutLoadFiled;
|
||||||
private View loadingView;
|
private View loadingView;
|
||||||
@@ -216,9 +218,14 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
private ConstraintLayout csPrivilege;
|
private ConstraintLayout csPrivilege;
|
||||||
private AppCompatTextView tvNum;
|
private AppCompatTextView tvNum;
|
||||||
private SuperTextView tvPrivilegeGive;
|
private SuperTextView tvPrivilegeGive;
|
||||||
|
private Group groupPrivilege;
|
||||||
|
|
||||||
private int mPrivilegePosition = 0;
|
private int mPrivilegePosition = 0;
|
||||||
|
|
||||||
|
private PrivilegeTipDialog privilegeTipDialog;
|
||||||
|
|
||||||
|
private BaseQuickAdapter<GiftPrivilegeInfo, BaseViewHolder> baseQuickAdapter;
|
||||||
|
|
||||||
public GiftDialog(Context context, int giftId) {
|
public GiftDialog(Context context, int giftId) {
|
||||||
this(context, 0, true, false, true, giftId);
|
this(context, 0, true, false, true, giftId);
|
||||||
}
|
}
|
||||||
@@ -406,6 +413,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
lineTabType = findViewById(R.id.line_tab_type);
|
lineTabType = findViewById(R.id.line_tab_type);
|
||||||
sendGiftButton = findViewById(R.id.btn_send);
|
sendGiftButton = findViewById(R.id.btn_send);
|
||||||
layoutEmpty = findViewById(R.id.layout_empty);
|
layoutEmpty = findViewById(R.id.layout_empty);
|
||||||
|
tvEmpty = findViewById(R.id.tv_empty);
|
||||||
layoutLoading = findViewById(R.id.layout_loading);
|
layoutLoading = findViewById(R.id.layout_loading);
|
||||||
layoutLoadFiled = findViewById(R.id.layout_load_failed);
|
layoutLoadFiled = findViewById(R.id.layout_load_failed);
|
||||||
reloadView = findViewById(R.id.tv_reload);
|
reloadView = findViewById(R.id.tv_reload);
|
||||||
@@ -474,6 +482,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
csPrivilege = findViewById(R.id.cs_privilege);
|
csPrivilege = findViewById(R.id.cs_privilege);
|
||||||
tvNum = findViewById(R.id.tv_num);
|
tvNum = findViewById(R.id.tv_num);
|
||||||
tvPrivilegeGive = findViewById(R.id.tv_privilege_give);
|
tvPrivilegeGive = findViewById(R.id.tv_privilege_give);
|
||||||
|
groupPrivilege = findViewById(R.id.group_privilege);
|
||||||
|
|
||||||
ivWeekStarIcon = findViewById(R.id.iv_week_star_icon);
|
ivWeekStarIcon = findViewById(R.id.iv_week_star_icon);
|
||||||
ivAvatarCharm = findViewById(R.id.iv_avatar_charm);
|
ivAvatarCharm = findViewById(R.id.iv_avatar_charm);
|
||||||
@@ -574,12 +583,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos().subscribe());
|
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos().subscribe());
|
||||||
//更新特权卡礼物
|
//更新特权卡礼物
|
||||||
compositeDisposable.add(GiftModel.get().requestPrivilegeGiftInfos().subscribe((listServiceResult, throwable) -> {
|
compositeDisposable.add(GiftModel.get().requestPrivilegeGiftInfos().subscribe((listServiceResult, throwable) -> {
|
||||||
if (throwable == null) {
|
// if (throwable == null) {
|
||||||
if (listServiceResult.getData() != null && listServiceResult.getData().size() == 0) {
|
// if (listServiceResult.getData() != null && listServiceResult.getData().size() == 0) {
|
||||||
giftIndicator.hidePosition(GiftIndicator.TYPE_PRIVILEGE);
|
// giftIndicator.hidePosition(GiftIndicator.TYPE_PRIVILEGE);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}));
|
}));
|
||||||
initVipPager();
|
initVipPager();
|
||||||
viewNewFeature = findViewById(R.id.view_new_feature);
|
viewNewFeature = findViewById(R.id.view_new_feature);
|
||||||
if (DemoCache.readNewGiftTypeTipIndicator()) {
|
if (DemoCache.readNewGiftTypeTipIndicator()) {
|
||||||
@@ -703,8 +712,50 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
if (position == GiftIndicator.TYPE_PRIVILEGE) {
|
if (position == GiftIndicator.TYPE_PRIVILEGE) {
|
||||||
showPrivilegeEmptyView();
|
showPrivilegeEmptyView();
|
||||||
if (!ListUtils.isListEmpty(currentGiftPrivilegeInfoList)) {
|
if (!ListUtils.isListEmpty(currentGiftPrivilegeInfoList)) {
|
||||||
|
tvPrivilegeGive.setText("赠送");
|
||||||
showPrivilegeView();
|
showPrivilegeView();
|
||||||
|
} else {
|
||||||
|
tvEmpty.setText(context.getText(R.string.text_gift_privilege_empty));
|
||||||
|
layoutEmpty.setVisibility(View.VISIBLE);
|
||||||
|
groupPrivilege.setVisibility(View.GONE);
|
||||||
|
tvPrivilegeGive.setText("说明");
|
||||||
}
|
}
|
||||||
|
tvPrivilegeGive.setOnClickListener(v -> {
|
||||||
|
if (tvPrivilegeGive.getText().toString().equals("说明")) {
|
||||||
|
if (privilegeTipDialog == null) {
|
||||||
|
privilegeTipDialog = new PrivilegeTipDialog(context);
|
||||||
|
privilegeTipDialog.setOnActionListener(new PrivilegeTipDialog.OnActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onOk() {
|
||||||
|
privilegeTipDialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
privilegeTipDialog.show();
|
||||||
|
} else {
|
||||||
|
privilegeTipDialog.show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (currentGiftPrivilegeInfoList.get(mPrivilegePosition).getDailyNum() == 0) {
|
||||||
|
SingleToastUtil.showToast("今日可赠送次数不足");
|
||||||
|
} else {
|
||||||
|
compositeDisposable.add(GiftModel.get()
|
||||||
|
.givePrivilegeCard(String.valueOf(baseQuickAdapter.getItem(mPrivilegePosition).getId()),
|
||||||
|
AvRoomDataManager.get().getRoomUid() + "", AuthModel.get().getCurrentUid() + "")
|
||||||
|
.subscribe((listServiceResult, throwable) -> {
|
||||||
|
if (throwable == null) {
|
||||||
|
GiftPrivilegeInfo giftPrivilegeInfo = currentGiftPrivilegeInfoList.get(mPrivilegePosition);
|
||||||
|
giftPrivilegeInfo.setDailyNum(giftPrivilegeInfo.getDailyNum() - 1);
|
||||||
|
baseQuickAdapter.notifyItemChanged(mPrivilegePosition);
|
||||||
|
tvNum.setText(String.valueOf(giftPrivilegeInfo.getDailyNum()));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
SingleToastUtil.showToast(throwable.getMessage());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (isKnap) {
|
} else if (isKnap) {
|
||||||
tvGiftValue.setVisibility(View.VISIBLE);
|
tvGiftValue.setVisibility(View.VISIBLE);
|
||||||
showEmptyView();
|
showEmptyView();
|
||||||
@@ -785,7 +836,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
private void showPrivilegeView() {
|
private void showPrivilegeView() {
|
||||||
currentGiftPrivilegeInfoList.get(0).setSelected(true);
|
currentGiftPrivilegeInfoList.get(0).setSelected(true);
|
||||||
tvNum.setText(String.valueOf(currentGiftPrivilegeInfoList.get(0).getDailyNum()));
|
tvNum.setText(String.valueOf(currentGiftPrivilegeInfoList.get(0).getDailyNum()));
|
||||||
BaseQuickAdapter<GiftPrivilegeInfo, BaseViewHolder> baseQuickAdapter = new BaseQuickAdapter<>(R.layout.item_gift_privilege, currentGiftPrivilegeInfoList) {
|
baseQuickAdapter = new BaseQuickAdapter<>(R.layout.item_gift_privilege, currentGiftPrivilegeInfoList) {
|
||||||
@Override
|
@Override
|
||||||
protected void convert(BaseViewHolder helper, GiftPrivilegeInfo item) {
|
protected void convert(BaseViewHolder helper, GiftPrivilegeInfo item) {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
@@ -820,27 +871,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
mPrivilegePosition = position;
|
mPrivilegePosition = position;
|
||||||
});
|
});
|
||||||
privilegeView.setAdapter(baseQuickAdapter);
|
privilegeView.setAdapter(baseQuickAdapter);
|
||||||
tvPrivilegeGive.setOnClickListener(v -> {
|
|
||||||
if (currentGiftPrivilegeInfoList.get(mPrivilegePosition).getDailyNum() == 0) {
|
|
||||||
SingleToastUtil.showToast("今日可赠送次数不足");
|
|
||||||
} else {
|
|
||||||
compositeDisposable.add(GiftModel.get()
|
|
||||||
.givePrivilegeCard(String.valueOf(baseQuickAdapter.getItem(mPrivilegePosition).getId()),
|
|
||||||
AvRoomDataManager.get().getRoomUid() + "", AuthModel.get().getCurrentUid() + "")
|
|
||||||
.subscribe((listServiceResult, throwable) -> {
|
|
||||||
if (throwable == null) {
|
|
||||||
GiftPrivilegeInfo giftPrivilegeInfo = currentGiftPrivilegeInfoList.get(mPrivilegePosition);
|
|
||||||
giftPrivilegeInfo.setDailyNum(giftPrivilegeInfo.getDailyNum() - 1);
|
|
||||||
baseQuickAdapter.notifyItemChanged(mPrivilegePosition);
|
|
||||||
tvNum.setText(String.valueOf(giftPrivilegeInfo.getDailyNum()));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
SingleToastUtil.showToast(throwable.getMessage());
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLuckyBagIntro() {
|
private void updateLuckyBagIntro() {
|
||||||
@@ -1040,6 +1070,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
|
|
||||||
private void showEmptyView() {
|
private void showEmptyView() {
|
||||||
//tab对应的礼物列表为空的情况
|
//tab对应的礼物列表为空的情况
|
||||||
|
tvEmpty.setText(context.getText(R.string.text_gift_knapsack_empty));
|
||||||
layoutEmpty.setVisibility(View.VISIBLE);
|
layoutEmpty.setVisibility(View.VISIBLE);
|
||||||
layoutLoadFiled.setVisibility(View.GONE);
|
layoutLoadFiled.setVisibility(View.GONE);
|
||||||
layoutLoading.setVisibility(View.GONE);
|
layoutLoading.setVisibility(View.GONE);
|
||||||
@@ -1641,6 +1672,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
compositeDisposable.dispose();
|
compositeDisposable.dispose();
|
||||||
compositeDisposable = null;
|
compositeDisposable = null;
|
||||||
}
|
}
|
||||||
|
if (privilegeTipDialog != null && privilegeTipDialog.isShowing()) {
|
||||||
|
privilegeTipDialog.dismiss();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
@@ -0,0 +1,57 @@
|
|||||||
|
package com.nnbc123.app.ui.widget.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.nnbc123.app.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author jack
|
||||||
|
* @Description
|
||||||
|
* @Date 2019/1/21
|
||||||
|
*/
|
||||||
|
public class PrivilegeTipDialog extends BaseDialog {
|
||||||
|
|
||||||
|
public PrivilegeTipDialog(Context context) {
|
||||||
|
super(context, R.style.dialog);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
this.setCancelable(true);
|
||||||
|
this.setCanceledOnTouchOutside(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.layout_privilege_dialog);
|
||||||
|
|
||||||
|
TextView ok = findViewById(R.id.btn_ok);
|
||||||
|
if (ok != null) {
|
||||||
|
ok.setOnClickListener(v -> {
|
||||||
|
this.dismiss();
|
||||||
|
if (l != null) {
|
||||||
|
l.onOk();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnActionListener l;
|
||||||
|
|
||||||
|
public void setOnActionListener(OnActionListener l) {
|
||||||
|
this.l = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnActionListener {
|
||||||
|
default void onOk() {
|
||||||
|
}
|
||||||
|
|
||||||
|
default void onCancel() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@@ -506,7 +506,7 @@
|
|||||||
android:layout_marginEnd="@dimen/dp_10"
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
app:spanCount="2"/>
|
app:spanCount="2" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layout_empty"
|
android:id="@+id/layout_empty"
|
||||||
@@ -522,6 +522,7 @@
|
|||||||
android:src="@drawable/ic_knap_gift_empty" />
|
android:src="@drawable/ic_knap_gift_empty" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_empty"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
@@ -657,52 +658,59 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tv_remainder_today"
|
android:id="@+id/tv_remainder_today"
|
||||||
android:text="今日剩余赠送次数:"
|
|
||||||
android:textSize="@dimen/sp_12"
|
|
||||||
android:textColor="@color/color_CED1DB"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_14"
|
android:layout_marginStart="@dimen/dp_14"
|
||||||
|
android:text="今日剩余赠送次数:"
|
||||||
|
android:textColor="@color/color_CED1DB"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/tv_num"
|
android:id="@+id/tv_num"
|
||||||
android:text="0"
|
|
||||||
android:textSize="@dimen/sp_12"
|
|
||||||
android:textColor="@color/color_FFDA24"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:text="0"
|
||||||
|
android:textColor="@color/color_FFDA24"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/tv_remainder_today"
|
app:layout_constraintStart_toEndOf="@+id/tv_remainder_today"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:text="次"
|
android:id="@+id/tv_time"
|
||||||
android:textSize="@dimen/sp_12"
|
|
||||||
android:textColor="@color/color_CED1DB"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:text="次"
|
||||||
|
android:textColor="@color/color_CED1DB"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/tv_num"/>
|
app:layout_constraintStart_toEndOf="@+id/tv_num"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.coorchice.library.SuperTextView
|
<com.coorchice.library.SuperTextView
|
||||||
android:id="@+id/tv_privilege_give"
|
android:id="@+id/tv_privilege_give"
|
||||||
android:text="赠送"
|
|
||||||
android:textSize="@dimen/sp_13"
|
|
||||||
android:textColor="@color/color_2B2D33"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_width="@dimen/dp_60"
|
android:layout_width="@dimen/dp_60"
|
||||||
android:layout_height="@dimen/dp_28"
|
android:layout_height="@dimen/dp_28"
|
||||||
android:layout_marginEnd="@dimen/dp_14"
|
android:layout_marginEnd="@dimen/dp_14"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="赠送"
|
||||||
|
android:textColor="@color/color_2B2D33"
|
||||||
|
android:textSize="@dimen/sp_13"
|
||||||
|
android:textStyle="bold"
|
||||||
app:corner="@dimen/dp_14"
|
app:corner="@dimen/dp_14"
|
||||||
app:solid="@color/color_FFDA24"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
app:solid="@color/color_FFDA24" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Group
|
||||||
|
android:id="@+id/group_privilege"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:constraint_referenced_ids="tv_remainder_today,tv_num,tv_time" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
@@ -31,15 +31,15 @@
|
|||||||
android:id="@+id/message"
|
android:id="@+id/message"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:gravity="center"
|
||||||
android:layout_marginBottom="@dimen/dp_32"
|
android:layout_marginBottom="@dimen/dp_32"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
|
||||||
android:lineSpacingMultiplier="1.2"
|
android:lineSpacingMultiplier="1.2"
|
||||||
android:paddingStart="20dp"
|
android:paddingStart="20dp"
|
||||||
android:paddingEnd="20dp"
|
android:paddingEnd="20dp"
|
||||||
android:textColor="@color/color_333333"
|
android:textColor="@color/color_333333"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:text="购买成功,是否立即驾驶sd水电费水电费?sfasdfasdfasdfasdfasdf" />
|
tools:text="购买成功,是否立即驾驶sd水电费水电费?" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
74
app/src/main/res/layout/layout_privilege_dialog.xml
Normal file
74
app/src/main/res/layout/layout_privilege_dialog.xml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?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="308dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:background="@drawable/shape_white_16dp_round"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:background="@color/black_transparent_10">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_28" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_16"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingStart="@dimen/dp_32"
|
||||||
|
android:paddingEnd="@dimen/dp_32"
|
||||||
|
android:text="关于特权卡"
|
||||||
|
android:textColor="@color/color_2B2D33"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="@dimen/dp_32"
|
||||||
|
android:paddingEnd="@dimen/dp_32"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="1."
|
||||||
|
android:textColor="@color/color_2B2D33"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="特权卡是用户在房间内身份的象征,送出特权卡可增加用户之间互动。"
|
||||||
|
android:textColor="@color/color_2B2D33"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
|
android:layout_marginBottom="@dimen/dp_20"
|
||||||
|
android:paddingStart="@dimen/dp_32"
|
||||||
|
android:paddingEnd="@dimen/dp_32"
|
||||||
|
android:text="2.特权卡由房主和房间管理员发放。"
|
||||||
|
android:textColor="@color/color_2B2D33"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/btn_ok"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_40"
|
||||||
|
android:layout_marginStart="@dimen/dp_32"
|
||||||
|
android:layout_marginEnd="@dimen/dp_32"
|
||||||
|
android:layout_marginBottom="@dimen/dp_24"
|
||||||
|
android:background="@drawable/bg_common_confirm"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="知道了"
|
||||||
|
android:textColor="@color/color_2B2D33"
|
||||||
|
android:textSize="@dimen/sp_14" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@@ -748,6 +748,7 @@
|
|||||||
<string name="text_gift_avatar_room_owner">房主位</string>
|
<string name="text_gift_avatar_room_owner">房主位</string>
|
||||||
<string name="tips_gift_loading">加载中,请稍候</string>
|
<string name="tips_gift_loading">加载中,请稍候</string>
|
||||||
<string name="text_gift_knapsack_empty">暂时木有礼物~</string>
|
<string name="text_gift_knapsack_empty">暂时木有礼物~</string>
|
||||||
|
<string name="text_gift_privilege_empty">暂时木有特权卡~</string>
|
||||||
<string name="text_need_update">请更新应用</string>
|
<string name="text_need_update">请更新应用</string>
|
||||||
<string name="tips_need_charge">余额不足,是否充值</string>
|
<string name="tips_need_charge">余额不足,是否充值</string>
|
||||||
<string name="tips_gift_load_failed">加载失败,请重新加载</string>
|
<string name="tips_gift_load_failed">加载失败,请重新加载</string>
|
||||||
|
@@ -7,6 +7,7 @@ public class PrivateChatLimitInfo implements Serializable {
|
|||||||
private String message;
|
private String message;
|
||||||
private int wealthLevel;
|
private int wealthLevel;
|
||||||
private int charmLevel;
|
private int charmLevel;
|
||||||
|
private int model;
|
||||||
|
|
||||||
//<editor-fold defaultstate="collapsed" desc="delombok">
|
//<editor-fold defaultstate="collapsed" desc="delombok">
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@@ -53,6 +54,14 @@ public class PrivateChatLimitInfo implements Serializable {
|
|||||||
this.charmLevel = charmLevel;
|
this.charmLevel = charmLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getModel() {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModel(int model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
@@ -63,9 +72,11 @@ public class PrivateChatLimitInfo implements Serializable {
|
|||||||
if (this.isChat() != other.isChat()) return false;
|
if (this.isChat() != other.isChat()) return false;
|
||||||
if (this.getWealthLevel() != other.getWealthLevel()) return false;
|
if (this.getWealthLevel() != other.getWealthLevel()) return false;
|
||||||
if (this.getCharmLevel() != other.getCharmLevel()) return false;
|
if (this.getCharmLevel() != other.getCharmLevel()) return false;
|
||||||
|
if (this.getModel() != other.getModel()) return false;
|
||||||
final Object this$message = this.getMessage();
|
final Object this$message = this.getMessage();
|
||||||
final Object other$message = other.getMessage();
|
final Object other$message = other.getMessage();
|
||||||
if (this$message == null ? other$message != null : !this$message.equals(other$message)) return false;
|
if (this$message == null ? other$message != null : !this$message.equals(other$message))
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +93,7 @@ public class PrivateChatLimitInfo implements Serializable {
|
|||||||
result = result * PRIME + (this.isChat() ? 79 : 97);
|
result = result * PRIME + (this.isChat() ? 79 : 97);
|
||||||
result = result * PRIME + this.getWealthLevel();
|
result = result * PRIME + this.getWealthLevel();
|
||||||
result = result * PRIME + this.getCharmLevel();
|
result = result * PRIME + this.getCharmLevel();
|
||||||
|
result = result * PRIME + this.getModel();
|
||||||
final Object $message = this.getMessage();
|
final Object $message = this.getMessage();
|
||||||
result = result * PRIME + ($message == null ? 43 : $message.hashCode());
|
result = result * PRIME + ($message == null ? 43 : $message.hashCode());
|
||||||
return result;
|
return result;
|
||||||
@@ -90,7 +102,7 @@ public class PrivateChatLimitInfo implements Serializable {
|
|||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PrivateChatLimitInfo(chat=" + this.isChat() + ", message=" + this.getMessage() + ", wealthLevel=" + this.getWealthLevel() + ", charmLevel=" + this.getCharmLevel() + ")";
|
return "PrivateChatLimitInfo(chat=" + this.isChat() + ", message=" + this.getMessage() + ", wealthLevel=" + this.getWealthLevel() + ", charmLevel=" + this.getCharmLevel() + ", model=" + this.getModel() + ")";
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
}
|
}
|
||||||
|
@@ -121,9 +121,10 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
|
|||||||
|
|
||||||
private volatile boolean disable;
|
private volatile boolean disable;
|
||||||
|
|
||||||
|
|
||||||
private boolean isChat;
|
private boolean isChat;
|
||||||
|
|
||||||
|
private String hintText;
|
||||||
|
|
||||||
public InputPanel(Container container, View view, List<BaseAction> actions, boolean isTextAudioSwitchShow) {
|
public InputPanel(Container container, View view, List<BaseAction> actions, boolean isTextAudioSwitchShow) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.view = view;
|
this.view = view;
|
||||||
@@ -952,14 +953,15 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
|
|||||||
container.proxy.sendMessage(customMessage);
|
container.proxy.sendMessage(customMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLimitLevel(boolean isChat, String msg) {
|
public void setLimitLevel(boolean isChat, String hintText) {
|
||||||
this.isChat = isChat;
|
this.isChat = isChat;
|
||||||
|
this.hintText = hintText;
|
||||||
setEditTextState();
|
setEditTextState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setEditTextState() {
|
private void setEditTextState() {
|
||||||
if (!isChat) {
|
if (!isChat) {
|
||||||
messageEditText.setHint("暂未达到可发起私聊等级");
|
messageEditText.setHint(hintText);
|
||||||
messageEditText.setFocusable(false);
|
messageEditText.setFocusable(false);
|
||||||
messageEditText.setFocusableInTouchMode(false);
|
messageEditText.setFocusableInTouchMode(false);
|
||||||
messageEditText.setEnabled(false);
|
messageEditText.setEnabled(false);
|
||||||
|
Reference in New Issue
Block a user