新增设置联系方式相关UI

This commit is contained in:
zlzw 2023-03-24 10:52:44 +08:00
parent f4d23c57df
commit 0c6eac2936
22 changed files with 941 additions and 69 deletions

View File

@ -8,6 +8,7 @@ import android.os.Looper;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import com.yunbao.common.BuildConfig;
import com.yunbao.common.bean.CrashSaveBean; import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.utils.FileUtil; import com.yunbao.common.utils.FileUtil;
import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.SpUtil;
@ -101,7 +102,9 @@ public class NeverCrashUtils {
Log.e(TAG, "未捕获的主线程异常行为", e); Log.e(TAG, "未捕获的主线程异常行为", e);
} }
e.printStackTrace(); e.printStackTrace();
//Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show(); if(BuildConfig.DEBUG) {
Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show();
}
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log"); FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e); getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
// return; // return;

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@color/white"
android:paddingTop="24dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/titleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/textColor" />
<ImageView
android:id="@+id/img_more"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/btn_more_black"
android:tint="@color/textColor"
android:visibility="gone" />
<TextView
android:id="@+id/rView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="13sp"
android:layout_marginRight="25dp"
android:text="充值未到账?"
android:visibility="gone"
android:textStyle="bold" />
</RelativeLayout>
</FrameLayout>

View File

@ -0,0 +1,262 @@
package com.yunbao.live.adapter;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.dialog.GiftPopDialog;
import com.yunbao.live.dialog.LiveAnchorEditCallMeEditAppDialog;
import java.util.ArrayList;
import java.util.List;
public class LiveAnchorEditCallMeAdapter extends RecyclerView.Adapter<LiveAnchorEditCallMeAdapter.BaseViewHolder> {
public static final int TYPE_GIFT = 0;
public static final int TYPE_LETTER = 1;
public static final int TYPE_APP_WECHAT = 2;
public static final int TYPE_APP_LINE = 3;
public static final int TYPE_APP_WHATSAPP = 4;
private Context mContext;
private OnItemClickListener<TmpData> onItemClickListener;
private List<TmpData> list = new ArrayList<>();
private String mLiveUid = "98275";
private View mParent;
public LiveAnchorEditCallMeAdapter(Context mContext, View parent) {
this.mContext = mContext;
this.mParent = parent;
}
public void setList(List<TmpData> list) {
this.list = list;
notifyDataSetChanged();
}
public void setOnItemClickListener(OnItemClickListener<TmpData> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
@Override
public int getItemViewType(int position) {
return list.get(position).getType();
}
@NonNull
@Override
public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
BaseViewHolder holder;
switch (viewType) {
case TYPE_GIFT:
holder = new GiftViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_call_me_gift, parent, false));
break;
case TYPE_LETTER:
holder = new LetterViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_call_me_letter, parent, false));
break;
default:
holder = new AppViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_call_me_app, parent, false));
}
return holder;
}
@Override
public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
holder.setData(list.get(position), position);
}
@Override
public int getItemCount() {
return list.size();
}
public static class TmpData {
private String value;
private int status;
private int type;
public TmpData() {
}
public TmpData(String value, int status, int type) {
this.value = value;
this.status = status;
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
public class BaseViewHolder extends RecyclerView.ViewHolder {
public BaseViewHolder(@NonNull View itemView) {
super(itemView);
}
public void setData(TmpData data, int position) {
}
}
public class GiftViewHolder extends BaseViewHolder {
private View select;
private ImageView giftIcon;
public GiftViewHolder(@NonNull View itemView) {
super(itemView);
select = itemView.findViewById(R.id.select);
giftIcon = itemView.findViewById(R.id.gift_icon);
select.setOnClickListener(v -> {
initGiftData();
});
}
@Override
public void setData(TmpData data, int position) {
super.setData(data, position);
}
private void initGiftData() {
new GiftPopDialog(mContext, new GiftPopDialog.ActionListener() {
@Override
public void onSelectGift(PrankGiftBean bean) {
if (bean != null) {
ImgLoader.display(mContext, bean.getIcon(), giftIcon);
}
}
@Override
public void onDismiss() {
}
})
.setShowNumber(false)
.setTitle("選擇禮物")
.showDialog()
;
}
}
public class LetterViewHolder extends BaseViewHolder {
TextView letter;
View edit;
public LetterViewHolder(@NonNull View itemView) {
super(itemView);
letter = itemView.findViewById(R.id.letterText);
edit = itemView.findViewById(R.id.edit);
edit.setOnClickListener(v -> {
new LiveAnchorEditCallMeEditAppDialog(mContext, LiveAnchorEditCallMeEditAppDialog.TYPE_LETTER).setOnValueListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
letter.setText(bean);
}
}).showDialog();
});
}
@Override
public void setData(TmpData data, int position) {
super.setData(data, position);
letter.setText(data.getValue());
}
}
public class AppViewHolder extends BaseViewHolder {
TextView contact;
View edit;
ImageView status;
ImageView icon;
public AppViewHolder(@NonNull View itemView) {
super(itemView);
contact = itemView.findViewById(R.id.contact);
edit = itemView.findViewById(R.id.app_edit);
status = itemView.findViewById(R.id.app_switch);
icon = itemView.findViewById(R.id.gift_icon);
itemView.setOnClickListener(v -> {
if (onItemClickListener != null) {
onItemClickListener.onItemClick(list.get(getAbsoluteAdapterPosition()), getAbsoluteAdapterPosition());
}
});
}
@Override
public void setData(TmpData data, int position) {
super.setData(data, position);
if (StringUtil.isEmpty(data.getValue())) {
contact.setText("未填写");
contact.setTextColor(Color.parseColor("#80FFFFFF"));
} else {
contact.setText(data.getValue());
contact.setTextColor(Color.WHITE);
}
if (data.getStatus() == 0) {
status.setImageResource(R.mipmap.special_icon_off);
} else if (data.getStatus() == 1) {
status.setImageResource(R.mipmap.special_icon_on);
}
edit.setOnClickListener(v -> {
new LiveAnchorEditCallMeEditAppDialog(mContext, data.getType()).setOnValueListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
contact.setText(bean);
}
}).showDialog();
});
switch (data.getType()) {
case TYPE_APP_WECHAT:
icon.setImageResource(R.mipmap.icon_wechat_x);
break;
case TYPE_APP_LINE:
icon.setImageResource(R.mipmap.icon_line_x);
break;
case TYPE_APP_WHATSAPP:
icon.setImageResource(R.mipmap.icon_whatsapp_x);
break;
}
}
}
}

View File

@ -17,8 +17,10 @@ import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
@ -34,15 +36,14 @@ import com.yunbao.live.http.LiveHttpUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
public class GiftPopDialog extends PopupWindow implements ActionListener, View.OnClickListener { public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListener, View.OnClickListener {
private View mParent;
private Context mContext; private Context mContext;
private View mContentView;
private LiveGiftPagerAdapter mLiveGiftPagerAdapter; private LiveGiftPagerAdapter mLiveGiftPagerAdapter;
private GiftPopDialog.ActionListener mActionListener; private GiftPopDialog.ActionListener mActionListener;
private View mLoading; private View mLoading;
@ -60,16 +61,27 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
private int prangNum; private int prangNum;
private InputMethodManager imm; private InputMethodManager imm;
private List<PrankGiftBean> giftBeans; private List<PrankGiftBean> giftBeans;
private boolean showNumber = true;
private View numberView;
private String title;
private TextView mTitle;
private void initView(View mRootView) {
mLoading = mRootView.findViewById(R.id.loading); public GiftPopDialog(@NonNull Context context) {
items = (RecyclerView) mRootView.findViewById(R.id.items); super(context);
mViewPager = (ViewPager) mRootView.findViewById(R.id.viewPager); }
mRadioGroup = (RadioGroup) mRootView.findViewById(R.id.radio_group);
mBtnSend = mRootView.findViewById(R.id.btn_send); private void initView() {
mBtnContext = mRootView.findViewById(R.id.btn_context); mLoading = findViewById(R.id.loading);
mBtn = mRootView.findViewById(R.id.gift_btn); items = (RecyclerView) findViewById(R.id.items);
mBack = mRootView.findViewById(R.id.gift_back); mViewPager = (ViewPager) findViewById(R.id.viewPager);
mRadioGroup = (RadioGroup) findViewById(R.id.radio_group);
mBtnSend = findViewById(R.id.btn_send);
mBtnContext = findViewById(R.id.btn_context);
mBtn = findViewById(R.id.gift_btn);
mBack = findViewById(R.id.gift_back);
mTitle = findViewById(R.id.title);
numberView = findViewById(R.id.btn_send_group);
final LinearLayoutManager manager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false); final LinearLayoutManager manager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false);
items.setLayoutManager(manager); items.setLayoutManager(manager);
mViewPager.setOffscreenPageLimit(5); mViewPager.setOffscreenPageLimit(5);
@ -112,52 +124,41 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
} }
}); });
if (!showNumber) {
numberView.setVisibility(View.GONE);
prangNum = 1;
prangContext = "null";
}
if (!StringUtil.isEmpty(title)) {
mTitle.setText(title);
}
} }
public GiftPopDialog(Context mContext, View parent, GiftPopDialog.ActionListener actionListener) { public GiftPopDialog(Context mContext, GiftPopDialog.ActionListener actionListener) {
super(mContext);
this.mContext = mContext; this.mContext = mContext;
mParent = parent;
mActionListener = actionListener; mActionListener = actionListener;
mContentView = LayoutInflater.from(mContext).inflate(R.layout.dialog_live_select_gift_wrap, null); // setAnimationStyle(R.style.leftToRightAnim);
ViewParent viewParent = mContentView.getParent();
if (viewParent != null) {
((ViewGroup) viewParent).removeView(mContentView);
} }
setContentView(mContentView);
setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
setBackgroundDrawable(new ColorDrawable());
setOutsideTouchable(true);
setFocusable(true);
setAnimationStyle(R.style.leftToRightAnim);
setOnDismissListener(new OnDismissListener() {
@Override @Override
public void onDismiss() { protected void onCreate() {
if (mActionListener != null) { super.onCreate();
if (bean == null || StringUtil.isEmpty(prangContext) || prangNum == 0) { initView();
mActionListener.onDismiss();
return;
}
PrankGiftBean giftBean = new PrankGiftBean();
giftBean.setGiftId(bean.getId() + "");
giftBean.setNum(prangNum);
giftBean.setIcon(bean.getIcon());
giftBean.setTitle(prangContext);
giftBean.setName(bean.getName());
mActionListener.onSelectGift(giftBean);
System.out.println("gift.bean = " + bean);
}
ViewParent viewParent = mContentView.getParent();
if (viewParent != null) {
((ViewGroup) viewParent).removeView(mContentView);
}
mContentView = null;
}
});
initView(mContentView);
initDate(); initDate();
} }
public GiftPopDialog setShowNumber(boolean showNumber) {
this.showNumber = showNumber;
return this;
}
public GiftPopDialog setTitle(String title) {
this.title = title;
return this;
}
private void initDate() { private void initDate() {
LiveHttpUtil.getNewGiftList(new HttpCallback() { LiveHttpUtil.getNewGiftList(new HttpCallback() {
@Override @Override
@ -214,10 +215,6 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
} }
} }
public void show() {
showAtLocation(mParent, Gravity.CENTER, 0, 0);
}
@Override @Override
public void onItemChecked(LiveGiftBean bean) { public void onItemChecked(LiveGiftBean bean) {
@ -298,6 +295,14 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
} }
} }
dismiss(); dismiss();
PrankGiftBean giftBean = new PrankGiftBean();
giftBean.setGiftId(bean.getId() + "");
giftBean.setNum(prangNum);
giftBean.setIcon(bean.getIcon());
giftBean.setTitle(prangContext);
giftBean.setName(bean.getName());
mActionListener.onSelectGift(giftBean);
} else if (id == R.id.gift_back) { } else if (id == R.id.gift_back) {
dismiss(); dismiss();
} }
@ -307,6 +312,16 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
this.giftBeans = giftBeans; this.giftBeans = giftBeans;
} }
@Override
public void buildDialog(XPopup.Builder builder) {
builder.enableDrag(false);
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_select_gift_wrap;
}
public interface ActionListener { public interface ActionListener {
void onSelectGift(PrankGiftBean bean); void onSelectGift(PrankGiftBean bean);

View File

@ -0,0 +1,73 @@
package com.yunbao.live.dialog;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.adapter.LiveAnchorEditCallMeAdapter;
import com.yunbao.live.adapter.LivePrankRecyclerAdapter;
import java.util.ArrayList;
import java.util.List;
public class LiveAnchorEditCallMeDialog extends AbsDialogPopupWindow {
String mLiveUid = "98275";
RecyclerView list;
LiveAnchorEditCallMeAdapter adapter;
public LiveAnchorEditCallMeDialog(@NonNull Context context) {
super(context);
}
@Override
public void buildDialog(XPopup.Builder builder) {
builder.enableDrag(false);
builder.autoFocusEditText(false);
}
@Override
public int bindLayoutId() {
return R.layout.dialog_anchor_call_me;
}
@Override
protected void onCreate() {
super.onCreate();
initView();
initData();
}
private void initData() {
List<LiveAnchorEditCallMeAdapter.TmpData> data = new ArrayList<>();
data.add(new LiveAnchorEditCallMeAdapter.TmpData(null, 1, LiveAnchorEditCallMeAdapter.TYPE_GIFT));
data.add(new LiveAnchorEditCallMeAdapter.TmpData("测试测试", 1, LiveAnchorEditCallMeAdapter.TYPE_LETTER));
data.add(new LiveAnchorEditCallMeAdapter.TmpData("13333333333", 1, LiveAnchorEditCallMeAdapter.TYPE_APP_WECHAT));
data.add(new LiveAnchorEditCallMeAdapter.TmpData("13333333333", 0, LiveAnchorEditCallMeAdapter.TYPE_APP_LINE));
data.add(new LiveAnchorEditCallMeAdapter.TmpData(null, 0, LiveAnchorEditCallMeAdapter.TYPE_APP_WHATSAPP));
adapter.setList(data);
}
private void initView() {
list = findViewById(R.id.anchor_call_list);
adapter = new LiveAnchorEditCallMeAdapter(getContext(),getRootView());
list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
list.setAdapter(adapter);
}
}

View File

@ -0,0 +1,107 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.live.R;
public class LiveAnchorEditCallMeEditAppDialog extends AbsDialogPopupWindow {
public static final int TYPE_LETTER = 0;
public static final int TYPE_APP_WECHAT = 2;
public static final int TYPE_APP_LINE = 3;
public static final int TYPE_APP_WHATSAPP = 4;
OnItemClickListener<String> clickListener;
private int type;
private String defValue;
private TextView titleView;
private TextView title;
private EditText edit;
public LiveAnchorEditCallMeEditAppDialog(@NonNull Context context) {
super(context);
this.type = TYPE_LETTER;
}
public LiveAnchorEditCallMeEditAppDialog(@NonNull Context context, int type) {
super(context);
this.type = type;
}
@Override
public void buildDialog(XPopup.Builder builder) {
builder.autoFocusEditText(false);
builder.moveUpToKeyboard(false);
builder.enableDrag(false);
}
@Override
public int bindLayoutId() {
return R.layout.dialog_anchor_call_edit_app;
}
public void setDefValue(String defValue) {
this.defValue = defValue;
}
public LiveAnchorEditCallMeEditAppDialog setOnValueListener(OnItemClickListener<String> clickListener) {
this.clickListener = clickListener;
return this;
}
@Override
protected void onCreate() {
super.onCreate();
initView();
initData();
switch (type) {
case TYPE_LETTER:
titleView.setText("填寫信內容");
edit.setHint("我能想到最浪漫的事,就是和你一起慢慢變老,一路上收藏點點滴滴的歡笑,留到以後坐著搖椅慢慢聊。");
title.setText("信內容");
break;
case TYPE_APP_WECHAT:
titleView.setText("填寫聯系方式");
edit.setHint("请输入");
title.setText("Wechat账号");
break;
case TYPE_APP_LINE:
titleView.setText("填寫聯系方式");
edit.setHint("请输入");
title.setText("Line账号");
break;
case TYPE_APP_WHATSAPP:
titleView.setText("填寫聯系方式");
edit.setHint("请输入");
title.setText("WhatsApp账号");
break;
}
}
private void initData() {
if (!StringUtil.isEmpty(defValue)) {
edit.setText(defValue);
}
}
void initView() {
titleView = findViewById(R.id.titleView);
title = findViewById(R.id.title);
edit = findViewById(R.id.edit);
findViewById(R.id.btn_back).setOnClickListener(v -> dismiss());
findViewById(R.id.submit).setOnClickListener(v -> {
clickListener.onItemClick(edit.getText().toString(), 0);
dismiss();
});
}
}

View File

@ -141,7 +141,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
ToastUtil.show("可添加禮物數量達到上限"); ToastUtil.show("可添加禮物數量達到上限");
return; return;
} }
GiftPopDialog dialog = new GiftPopDialog(mContext, mRootView, new GiftPopDialog.ActionListener() { GiftPopDialog dialog = new GiftPopDialog(mContext, new GiftPopDialog.ActionListener() {
@Override @Override
public void onSelectGift(PrankGiftBean bean) { public void onSelectGift(PrankGiftBean bean) {
@ -156,7 +156,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
}); });
dialog.setList(giftBeans); dialog.setList(giftBeans);
dialog.show(); dialog.showDialog();
} else { } else {
setPrankConfig(); setPrankConfig();
} }

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="189dp" android:height="42dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffc621" android:endColor="#ffffae05" android:angle="135" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent">
<include
android:id="@+id/include"
layout="@layout/live_anchor_call_me_edit_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="#FAFAFA"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:text="信內容"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="#FAFAFA"
android:ellipsize="none"
android:gravity="top"
android:ems="10"
android:hint="我能想到最浪漫的事,就是和你一起慢慢變老,一路上收藏點點滴滴的歡笑,留到以後坐著搖椅慢慢聊。"
android:textColor="#999999"
android:textColorHint="#999999"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/submit"
android:layout_width="0dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_live_ready_btn2"
android:text="保存"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout3" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/background_e6000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="編輯聯系方式"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/live_close" />
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="#1affffff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/anchor_call_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider"
tools:listitem="@layout/item_anchor_call_me_app"
/>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/black2"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:gravity="center|start"
android:text="聯系方式開關"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<ImageView
android:id="@+id/say_switch"
android:layout_width="40dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/special_icon_off" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -74,9 +74,9 @@
android:autofillHints="" android:autofillHints=""
android:background="@drawable/bg_item_random_pk_type_1" android:background="@drawable/bg_item_random_pk_type_1"
android:ems="10" android:ems="10"
android:hint="请輸入女神想說的話限12個字哦。" android:hint="请輸入女神想說的話限16個字哦。"
android:inputType="textPersonName" android:inputType="textPersonName"
android:maxLength="12" android:maxLength="16"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textColorHint="#80FFFFFF" android:textColorHint="#80FFFFFF"

View File

@ -40,6 +40,7 @@
</TextView> </TextView>
<TextView <TextView
android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_anchor_say"
android:layout_marginTop="10dp">
<ImageView
android:id="@+id/gift_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="未填写"
android:textSize="16sp"
android:textColor="#80FFFFFF"
app:layout_constraintStart_toEndOf="@+id/gift_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/app_switch"
android:layout_width="44dp"
android:layout_height="24dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/special_icon_off" />
<ImageView
android:id="@+id/app_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toStartOf="@+id/app_switch"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/ic_live_anchor_edit_call_me_edit" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="68dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_anchor_say"
android:layout_marginTop="10dp">
<ImageView
android:id="@+id/gift_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:layout_marginBottom="14dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/select"
android:layout_width="92dp"
android:layout_height="28dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:background="@drawable/background_33ffffff"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:text="選擇禮物"
android:textColor="@color/white"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="6dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/ic_live_anchor_edit_call_me_r" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:background="@drawable/bg_anchor_say"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:text="信內容"
android:textColor="@color/white"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/ic_live_anchor_edit_call_me_edit" />
<TextView
android:id="@+id/letterText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:ellipsize="none"
android:text="我能想到最浪漫的事,就是和你一起慢慢變老,一路上收藏點點滴滴的歡笑,留到以後坐著搖椅慢慢聊。"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edit" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

View File

@ -1,19 +1,14 @@
package com.yunbao.main.views; package com.yunbao.main.views;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.dialog.LiveAnchorSayPopDialog; import com.yunbao.live.dialog.LiveAnchorEditCallMeDialog;
import com.yunbao.live.dialog.LiveRobotSettingDialogFragment;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.activity.TestActivity;
/** /**
* Created by cxf on 2018/9/22. * Created by cxf on 2018/9/22.
@ -45,7 +40,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy); ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
img_trophy.setOnLongClickListener(v -> { img_trophy.setOnLongClickListener(v -> {
new LiveAnchorSayPopDialog(mContext).showDialog(); new LiveAnchorEditCallMeDialog(mContext).showDialog();
return false; return false;
}); });