This commit is contained in:
zlzw 2022-11-08 13:53:24 +08:00
parent 34dd3ca883
commit 96f21643b4
5 changed files with 120 additions and 4 deletions

View File

@ -19,6 +19,8 @@ import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.LayoutRes;
import com.yunbao.common.R; import com.yunbao.common.R;
import java.util.ArrayList; import java.util.ArrayList;
@ -320,6 +322,7 @@ public class DialogUitl {
private int mLength; private int mLength;
private SimpleCallback mClickCallback; private SimpleCallback mClickCallback;
private SimpleCallback3 mClickCallback3; private SimpleCallback3 mClickCallback3;
private int mView = 0;
public Builder(Context context) { public Builder(Context context) {
mContext = context; mContext = context;
@ -385,9 +388,18 @@ public class DialogUitl {
return this; return this;
} }
public Builder setView(@LayoutRes int layoutRes) {
mView = layoutRes;
return this;
}
public Dialog build() { public Dialog build() {
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2); final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
if (mView != 0) {
dialog.setContentView(mView);
} else {
dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple); dialog.setContentView(mInput ? R.layout.dialog_input : R.layout.dialog_simple);
}
dialog.setCancelable(mCancelable); dialog.setCancelable(mCancelable);
dialog.setCanceledOnTouchOutside(mCancelable); dialog.setCanceledOnTouchOutside(mCancelable);
TextView titleView = (TextView) dialog.findViewById(R.id.title); TextView titleView = (TextView) dialog.findViewById(R.id.title);

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="100dp" android:height="36dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffc621" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog"
android:gravity="center_horizontal"
android:orientation="vertical"
>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:gravity="center_horizontal"
android:text="@string/dialog_tip"
android:textColor="@color/textColor"
android:textSize="15sp"
/>
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:gravity="center_horizontal"
android:textColor="#161616"
android:textSize="14sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:gravity="center"
android:layout_marginBottom="22dp"
android:layout_height="40dp">
<TextView
android:id="@+id/btn_cancel"
android:layout_width="87dp"
android:layout_height="33dp"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#FFC621"
android:layout_marginRight="7dp"
android:textSize="14sp"
android:background="@drawable/bg_dialog_unfollow_cancel"
/>
<TextView
android:id="@+id/btn_confirm"
android:layout_width="87dp"
android:layout_height="33dp"
android:gravity="center"
android:layout_marginLeft="7dp"
android:text="@string/confirm"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:background="@mipmap/tipbox_btn_orange"
/>
</LinearLayout>
</LinearLayout>

View File

@ -94,6 +94,8 @@
<string name="edit_nick_name_price_msg">溫馨提示可以免費修改昵稱一次之後修改需要鑽石1800一次</string> <string name="edit_nick_name_price_msg">溫馨提示可以免費修改昵稱一次之後修改需要鑽石1800一次</string>
<string name="follow">關注</string> <string name="follow">關注</string>
<string name="unfollow"> 主播哪裡做的不好~\n哥哥確定要取消關注嗎?</string> <string name="unfollow"> 主播哪裡做的不好~\n哥哥確定要取消關注嗎?</string>
<string name="unfollow_confrim">繼續關注</string>
<string name="unfollow_cancel">不再關注</string>
<string name="following">已關注</string> <string name="following">已關注</string>
<string name="follow_my_follow">我的關注</string> <string name="follow_my_follow">我的關注</string>
<string name="my_black">我的黑名單</string> <string name="my_black">我的黑名單</string>

View File

@ -47,6 +47,7 @@ import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveReportActivity; import com.yunbao.live.activity.LiveReportActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.bean.GuardUserBean; import com.yunbao.live.bean.GuardUserBean;
import com.yunbao.live.bean.ImpressBean; import com.yunbao.live.bean.ImpressBean;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
@ -382,13 +383,32 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
* 关注 * 关注
*/ */
private void setAttention() { private void setAttention() {
if(mFollowing) { if (mFollowing) {
//DialogUitl.showSimpleDialog(mContext,WordUtil.getString(R.string.unfollow)); DialogUitl.Builder builder = new DialogUitl.Builder(mContext)
.setContent(WordUtil.getString(R.string.unfollow))
.setConfrimString(WordUtil.getString(R.string.unfollow_confrim))
.setCancelString(WordUtil.getString(R.string.unfollow_cancel))
.setView(R.layout.dialog_live_unfollow)
.setClickCallback3(new DialogUitl.SimpleCallback3() {
@Override
public void onConfirmClick(Dialog dialog) {
dialog.dismiss();
}
@Override
public void onCancel() {
attention();
}
});
builder.build().show();
return; return;
} }
attention(); attention();
} }
private void attention(){
private void attention() {
CommonHttpUtil.setAttention(mToUid, new CommonCallback<Integer>() { CommonHttpUtil.setAttention(mToUid, new CommonCallback<Integer>() {
@Override @Override
@ -442,6 +462,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
report(); report();
} else if (i == R.id.avatar) { } else if (i == R.id.avatar) {
forwardHomePage(); forwardHomePage();
} else if (i == R.id.btn_guard) {
((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity);
} }
} }
} }