|
@@ -11,6 +11,7 @@ import android.view.View;
|
|
|
import android.view.ViewStub;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.jixin.im.AppConstant;
|
|
@@ -23,6 +24,7 @@ import com.jixin.im.helper.DialogHelper;
|
|
|
import com.jixin.im.helper.PaySecureHelper;
|
|
|
import com.jixin.im.ui.base.EasyFragment;
|
|
|
import com.jixin.im.ui.me.redpacket.ChangePayPasswordActivity;
|
|
|
+import com.jixin.im.ui.me.redpacket.SendRedPacketActivity;
|
|
|
import com.jixin.im.ui.message.ChatActivity;
|
|
|
import com.jixin.im.util.Constants;
|
|
|
import com.jixin.im.util.PreferenceUtils;
|
|
@@ -49,10 +51,12 @@ public abstract class BaseRedPacketFragment extends EasyFragment {
|
|
|
private String mChatType;
|
|
|
protected int mRedPacketType = 2;
|
|
|
protected EditText mEdtPacketMoney;
|
|
|
+ protected int mGroupMemberNumber;
|
|
|
protected EditText mEdtRemark;
|
|
|
protected TextView tvSendRedPacket;
|
|
|
protected TextView tvRedPacketType;
|
|
|
private ImageView ivIconPin;
|
|
|
+ protected LinearLayout lytRemark;
|
|
|
protected String mRedPacketAcceptorId; //红包接收对象id 可以是roomId,也可以是userId
|
|
|
|
|
|
private int mRedPacketCount = 1; //默认红包个数
|
|
@@ -75,6 +79,9 @@ public abstract class BaseRedPacketFragment extends EasyFragment {
|
|
|
protected void onActivityCreated(Bundle savedInstanceState, boolean createView) {
|
|
|
if (createView) {
|
|
|
initView();
|
|
|
+ if (isGroupChatType() && getArguments()!=null){
|
|
|
+ mGroupMemberNumber = getArguments().getInt(SendRedPacketActivity.INTENT_GROUP_MEMBER_NUMBER);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -83,7 +90,7 @@ public abstract class BaseRedPacketFragment extends EasyFragment {
|
|
|
mEdtPacketMoney = findViewById(R.id.edt_input_money);
|
|
|
tvRedPacketType = findViewById(R.id.tv_red_packet_type);
|
|
|
ivIconPin = findViewById(R.id.iv_icon_pin);
|
|
|
-
|
|
|
+ lytRemark = findViewById(R.id.ll_remark);
|
|
|
mEdtRemark = findViewById(R.id.edt_input_remark);
|
|
|
tvSendRedPacket = findViewById(R.id.tv_send_red_packet);
|
|
|
|
|
@@ -144,6 +151,22 @@ public abstract class BaseRedPacketFragment extends EasyFragment {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ protected int parseIntMemberCount(String inputText){
|
|
|
+ int inputNum = 0;
|
|
|
+ try {
|
|
|
+ inputNum = Integer.parseInt(inputText);
|
|
|
+ }catch (Exception e){
|
|
|
+ inputNum =0;
|
|
|
+ }
|
|
|
+ return inputNum;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ protected boolean checkMemberCount(String inputText){
|
|
|
+ int inputNum = parseIntMemberCount(inputText);
|
|
|
+ return inputNum <= mGroupMemberNumber && inputNum > 0;
|
|
|
+ }
|
|
|
+
|
|
|
protected boolean isGroupChatType() {
|
|
|
if (ChatType.CHAT_GROUP.equals(mChatType)) {
|
|
|
return true;
|
|
@@ -206,6 +229,13 @@ public abstract class BaseRedPacketFragment extends EasyFragment {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ protected void setRemarkViewVisible(boolean visible){
|
|
|
+ if (visible){
|
|
|
+ lytRemark.setVisibility(View.VISIBLE);
|
|
|
+ }else {
|
|
|
+ lytRemark.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
protected void setSendRedPacketButtonStatus(boolean isNormal) {
|
|
|
tvSendRedPacket.setSelected(isNormal);
|