update 送礼
This commit is contained in:
parent
6d495d11fd
commit
fd377b5280
@ -10,6 +10,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
import com.shayu.onetoone.activity.message.ChatActivity;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.shayu.onetoone.provider.CustomConversationProvider;
|
||||
import com.shayu.onetoone.provider.MessageChatReceiveGiftItemProvider;
|
||||
@ -78,6 +79,7 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
ArrayList<Class<? extends MessageContent>> myMessages = new ArrayList<>();
|
||||
myMessages.add(MessageChatTipsContent.class);
|
||||
myMessages.add(MessageChatGiftContent.class);
|
||||
RongIMClient.registerMessageType(myMessages);
|
||||
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||
|
@ -1,30 +1,23 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowInsets;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.dialog.GiftDialog;
|
||||
import com.shayu.onetoone.dialog.TipsDialog;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
@ -45,12 +38,7 @@ import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imkit.manager.AudioPlayManager;
|
||||
import io.rong.imkit.manager.AudioRecordManager;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.utils.PermissionCheckUtil;
|
||||
import io.rong.imkit.utils.RongOperationPermissionUtils;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
|
@ -48,6 +48,10 @@ public class GiftListAdapter extends RecyclerView.Adapter<GiftListAdapter.ViewHo
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public GiftBean getItem() {
|
||||
return list.get(selectPosition);
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftIcon;
|
||||
private TextView giftName;
|
||||
|
@ -97,7 +97,6 @@ public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
|
||||
@Override
|
||||
public int compare(BaseUiConversation baseUiConversation, BaseUiConversation t1) {
|
||||
System.out.println(" " + t1.mCore.getSentTime() + "|" + baseUiConversation.mCore.getSentTime() + " " + baseUiConversation.mCore.getConversationTitle() + "|" + t1.mCore.getConversationTitle());
|
||||
return (int) (t1.mCore.getSentTime() - baseUiConversation.mCore.getSentTime());
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import io.rong.common.ParcelUtils;
|
||||
import io.rong.imlib.MessageTag;
|
||||
@ -16,9 +17,9 @@ import io.rong.imlib.model.MessageContent;
|
||||
|
||||
@MessageTag(value = "MessageChatGiftContent", flag = MessageTag.ISPERSISTED)
|
||||
public class MessageChatGiftContent extends MessageContent implements Parcelable {
|
||||
private String content;
|
||||
private String title;
|
||||
private String imageUrl;
|
||||
private String gift;
|
||||
private String number;
|
||||
private String sendUid;
|
||||
|
||||
private MessageChatGiftContent() {
|
||||
}
|
||||
@ -28,13 +29,7 @@ public class MessageChatGiftContent extends MessageContent implements Parcelable
|
||||
return;
|
||||
}
|
||||
String jsonStr = null;
|
||||
try {
|
||||
jsonStr = new String(data, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
}
|
||||
if (jsonStr == null) {
|
||||
return;
|
||||
}
|
||||
jsonStr = new String(data, StandardCharsets.UTF_8);
|
||||
|
||||
try {
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
@ -47,53 +42,57 @@ public class MessageChatGiftContent extends MessageContent implements Parcelable
|
||||
setMentionedInfo(parseJsonToMentionInfo(jsonObj.getJSONObject("mentionedInfo")));
|
||||
}
|
||||
// 将所有自定义变量从收到的 json 解析并赋值
|
||||
if (jsonObj.has("content")) {
|
||||
content = jsonObj.optString("content");
|
||||
title = jsonObj.optString("title");
|
||||
imageUrl = jsonObj.optString("imageUrl");
|
||||
if (jsonObj.has("gift")) {
|
||||
gift = jsonObj.optString("gift");
|
||||
number = jsonObj.optString("number");
|
||||
sendUid = jsonObj.optString("sendUid");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setContent(String content) {
|
||||
this.content = content;
|
||||
public MessageChatGiftContent setGift(String gift) {
|
||||
this.gift = gift;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setTitle(String title) {
|
||||
this.title = title;
|
||||
public MessageChatGiftContent setNumber(String number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
public String getSendUid() {
|
||||
return sendUid;
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setSendUid(String sendUid) {
|
||||
this.sendUid = sendUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
public String getGift() {
|
||||
return gift;
|
||||
}
|
||||
|
||||
protected MessageChatGiftContent(Parcel in) {
|
||||
setExtra(ParcelUtils.readFromParcel(in));
|
||||
setContent(ParcelUtils.readFromParcel(in));
|
||||
setGift(ParcelUtils.readFromParcel(in));
|
||||
setNumber(ParcelUtils.readFromParcel(in));
|
||||
setSendUid(ParcelUtils.readFromParcel(in));
|
||||
}
|
||||
|
||||
// 快速构建消息对象方法
|
||||
public static MessageChatGiftContent obtain(String title, String content, String imageUrl) {
|
||||
public static MessageChatGiftContent obtain(String gift, String number, String sendUid) {
|
||||
MessageChatGiftContent msg = new MessageChatGiftContent();
|
||||
msg.content = content;
|
||||
msg.title = title;
|
||||
msg.imageUrl = imageUrl;
|
||||
msg.gift = gift;
|
||||
msg.number = number;
|
||||
msg.sendUid = sendUid;
|
||||
return msg;
|
||||
}
|
||||
|
||||
@ -123,17 +122,15 @@ public class MessageChatGiftContent extends MessageContent implements Parcelable
|
||||
jsonObj.putOpt("mentionedInfo", getJsonMentionInfo());
|
||||
}
|
||||
// 将所有自定义消息的内容,都序列化至 json 对象中
|
||||
jsonObj.put("content", this.content);
|
||||
jsonObj.put("title", this.title);
|
||||
jsonObj.put("imageUrl", this.imageUrl);
|
||||
jsonObj.put("gift", gift);
|
||||
jsonObj.put("number", number);
|
||||
jsonObj.put("sendUid", sendUid);
|
||||
System.out.println("发送礼物JSON:"+ jsonObj.toString());
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
return jsonObj.toString().getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
}
|
||||
return null;
|
||||
return jsonObj.toString().getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,8 +141,8 @@ public class MessageChatGiftContent extends MessageContent implements Parcelable
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
ParcelUtils.writeToParcel(dest, getExtra());
|
||||
ParcelUtils.writeToParcel(dest, content);
|
||||
ParcelUtils.writeToParcel(dest, title);
|
||||
ParcelUtils.writeToParcel(dest, imageUrl);
|
||||
ParcelUtils.writeToParcel(dest, gift);
|
||||
ParcelUtils.writeToParcel(dest, number);
|
||||
ParcelUtils.writeToParcel(dest, sendUid);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,15 @@ import java.util.UUID;
|
||||
public class SendMessageManager {
|
||||
private static final Map<String, SendData> cache = new HashMap<>();
|
||||
|
||||
public static void sendMessageForGift(String toUid,String giftId,OnSendMessageListener listener){
|
||||
SendData sendData = new SendData(Integer.parseInt(toUid),
|
||||
3,
|
||||
giftId,
|
||||
"礼物消息",
|
||||
"1",
|
||||
1);
|
||||
send(sendData, listener);
|
||||
}
|
||||
public static void sendMessageForAudio(String toUid,OnSendMessageListener listener){
|
||||
SendData sendData = new SendData(Integer.parseInt(toUid),
|
||||
1,
|
||||
|
@ -2,30 +2,42 @@ package com.shayu.onetoone.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.conversation.messgelist.provider.BaseMessageItemProvider;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
|
||||
/**
|
||||
* 聊天送礼适配器
|
||||
*/
|
||||
public class MessageChatReceiveGiftItemProvider extends BaseMessageItemProvider<MessageChatGiftContent> {
|
||||
private Context mContext;
|
||||
|
||||
public MessageChatReceiveGiftItemProvider(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
mConfig.showPortrait = false;
|
||||
mConfig.showPortrait = true;
|
||||
mConfig.showSummaryWithName = false;
|
||||
mConfig.showContentBubble = false;
|
||||
mConfig.centerInHorizontal = true;
|
||||
mConfig.centerInHorizontal = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -33,11 +45,47 @@ public class MessageChatReceiveGiftItemProvider extends BaseMessageItemProvider<
|
||||
return ViewHolder.createViewHolder(mContext, parent, R.layout.view_message_chat_receive_gift);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindViewHolder(ViewHolder holder, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
if (holder instanceof MessageViewHolder) {
|
||||
try {
|
||||
MessageContent content = uiMessage.getMessage().getContent();
|
||||
if (content instanceof MessageChatGiftContent) {
|
||||
MessageChatGiftContent messageChatGiftContent = (MessageChatGiftContent) content;
|
||||
if (messageChatGiftContent.getSendUid().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
uiMessage.getMessage().setMessageDirection(Message.MessageDirection.SEND);
|
||||
} else {
|
||||
uiMessage.getMessage().setMessageDirection(Message.MessageDirection.RECEIVE);
|
||||
}
|
||||
}
|
||||
} catch (ClassCastException var10) {
|
||||
RLog.e("BaseMessageItemProvider", "bindViewHolder MessageContent cast Exception, e:" + var10);
|
||||
}
|
||||
}
|
||||
super.bindViewHolder(holder, uiMessage, position, list, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, MessageChatGiftContent messageChatGiftContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
holder.setText(R.id.title, messageChatGiftContent.getTitle());
|
||||
holder.setText(R.id.description, messageChatGiftContent.getContent());
|
||||
ImgLoader.display(mContext, messageChatGiftContent.getImageUrl(), holder.getView(R.id.giftIcon));
|
||||
GiftBean item = JSONObject.parseObject(messageChatGiftContent.getGift(), GiftBean.class);
|
||||
|
||||
holder.setText(R.id.description, item.getGiftname() + " x" + messageChatGiftContent.getNumber());
|
||||
ImgLoader.display(mContext, item.getGifticon(), holder.getView(R.id.giftIcon));
|
||||
LinearLayout holderView = holder.getView(R.id.layout_root);
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
|
||||
if (messageChatGiftContent.getSendUid().equals(IMLoginManager.get(mContext).getUserInfo().getId() + "")) {
|
||||
params.gravity = Gravity.END;
|
||||
uiMessage.setMessageDirection(Message.MessageDirection.SEND);
|
||||
} else {
|
||||
uiMessage.setMessageDirection(Message.MessageDirection.RECEIVE);
|
||||
params.gravity = Gravity.START;
|
||||
}
|
||||
try {
|
||||
holderView.setLayoutParams(params);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,29 +5,46 @@ import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.adapter.GiftListAdapter;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.widget.PagerConfig;
|
||||
import com.shayu.onetoone.widget.PagerGridLayoutManager;
|
||||
import com.shayu.onetoone.widget.PagerGridSnapHelper;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import io.rong.imkit.conversation.extension.RongExtension;
|
||||
|
||||
public class MsgInputPanelForGift extends AbsInputPanel{
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.conversation.extension.RongExtension;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.SendMessageOption;
|
||||
import kotlinx.coroutines.channels.Send;
|
||||
|
||||
public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
RecyclerView gifList;
|
||||
GiftListAdapter mAdapter;
|
||||
TextView money;
|
||||
Button topUpBtn;
|
||||
Button sendBtn;
|
||||
String token;
|
||||
|
||||
public MsgInputPanelForGift(String targetId, FragmentActivity fragmentActivity, RongExtension mRongExtension) {
|
||||
super(targetId, fragmentActivity, mRongExtension, R.layout.view_message_input_gift);
|
||||
@ -43,7 +60,7 @@ public class MsgInputPanelForGift extends AbsInputPanel{
|
||||
gifList = viewGroup.findViewById(R.id.gift_list);
|
||||
money = viewGroup.findViewById(R.id.money);
|
||||
topUpBtn = viewGroup.findViewById(R.id.top_up_btn);
|
||||
sendBtn =viewGroup.findViewById(R.id.send_btn);
|
||||
sendBtn = viewGroup.findViewById(R.id.send_btn);
|
||||
mAdapter = new GiftListAdapter(mContext);
|
||||
PagerGridLayoutManager manager = new PagerGridLayoutManager(2, 4, PagerGridLayoutManager.HORIZONTAL);
|
||||
gifList.setLayoutManager(manager);
|
||||
@ -53,17 +70,66 @@ public class MsgInputPanelForGift extends AbsInputPanel{
|
||||
PagerConfig.setMillisecondsPreInch(150);
|
||||
gifList.setAdapter(mAdapter);
|
||||
initData();
|
||||
sendBtn.setOnClickListener(v -> {
|
||||
GiftBean item = mAdapter.getItem();
|
||||
SendMessageManager.sendMessageForGift(targetId, item.getId() + "", new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token) {
|
||||
super.onSuccess(token);
|
||||
MsgInputPanelForGift.this.token = token;
|
||||
sendGift(item);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void sendGift(GiftBean item) {
|
||||
MessageChatGiftContent bean = MessageChatGiftContent.obtain(JSONObject.toJSONString(item), "1", IMLoginManager.get(mContext).getUserInfo().getId() + "");
|
||||
IMCenter.getInstance().sendMessage(Message.obtain(targetId, Conversation.ConversationType.PRIVATE, bean),
|
||||
null,
|
||||
null,
|
||||
new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
SendMessageManager.onCallSuccess(token, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||
System.out.println("失败:" + errorCode.getMessage());
|
||||
System.out.println("失败:" + errorCode.getValue());
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getGiftList(new HttpCallback<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GiftBean> data) {
|
||||
List<GiftBean> list=new ArrayList<>();
|
||||
List<GiftBean> list = new ArrayList<>();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
list.addAll(data);
|
||||
}
|
||||
mAdapter.setList(list);
|
||||
mAdapter.setList(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,45 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layout_root"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/bg_chat_gift">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="送給你" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textColor="#888888"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/giftIcon"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
tools:text="「戀愛小氣球」✖️1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/giftIcon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/apple" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:background="@drawable/bg_chat_gift">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:text="送給你"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textColor="#888888"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/giftIcon"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
tools:text="「戀愛小氣球」✖️1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/giftIcon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/apple" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="210dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/gift_list"
|
||||
@ -25,8 +25,6 @@
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_list">
|
||||
|
Loading…
x
Reference in New Issue
Block a user