完善个人资料,离开修改页面提示弹窗,完成领取弹窗
This commit is contained in:
@@ -67,13 +67,13 @@ public class UserBean implements Parcelable {
|
||||
//随机天梯排位赛PK img,仅在主播PK时使用
|
||||
private String mRankPkImgUrl;
|
||||
//是否填写完整资料
|
||||
private String user_info_complete;
|
||||
private int user_info_complete;
|
||||
|
||||
public String getUserInfoComplete() {
|
||||
public int getUserInfoComplete() {
|
||||
return user_info_complete;
|
||||
}
|
||||
|
||||
public UserBean seUserInfoComplete(String userInfoComplete) {
|
||||
public UserBean seUserInfoComplete(int userInfoComplete) {
|
||||
this.user_info_complete = userInfoComplete;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -694,4 +694,10 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=User.setLogOff")
|
||||
Observable<ResponseModel<List<Object>>> setLogOff();
|
||||
|
||||
/**
|
||||
* 领取完善资料奖励
|
||||
*/
|
||||
@GET("/api/public/?service=Task.userInfoTask")
|
||||
Observable<ResponseModel<List<Object>>> userInfoTask();
|
||||
}
|
||||
|
||||
@@ -1427,6 +1427,28 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void userInfoTask(HttpCallback<String> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.userInfoTask()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<Object>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<Object>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getMsg());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class CompleteInformationPopup extends CenterPopupView {
|
||||
|
||||
private TextView completeInformationHint, completeInformation2;
|
||||
private ImageView iconLive, expression;
|
||||
private boolean isLeave;
|
||||
private CompleteInformationCallBack callBack;
|
||||
|
||||
public CompleteInformationPopup(@NonNull Context context, boolean isLeave, CompleteInformationCallBack callBack) {
|
||||
super(context);
|
||||
this.isLeave = isLeave;
|
||||
this.callBack = callBack;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局离开
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.view_complete_information;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
completeInformationHint = findViewById(R.id.complete_information_hint);
|
||||
completeInformation2 = findViewById(R.id.complete_information2);
|
||||
iconLive = findViewById(R.id.icon_live);
|
||||
expression = findViewById(R.id.expression);
|
||||
if (isLeave) {
|
||||
completeInformationHint.setText(R.string.complete_information_hint3);
|
||||
completeInformation2.setText(R.string.you_guide_me);
|
||||
iconLive.setVisibility(GONE);
|
||||
ImgLoader.display(getContext(), R.mipmap.icon_cry_face, expression);
|
||||
} else {
|
||||
ImgLoader.display(getContext(), R.mipmap.icon_smiling_face, expression);
|
||||
completeInformation2.setText(R.string.complete_information_hint2);
|
||||
completeInformationHint.setText(R.string.complete_information_hint);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
if (callBack != null) {
|
||||
callBack.onCancel();
|
||||
}
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_ok), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
if (callBack != null) {
|
||||
callBack.onSure();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface CompleteInformationCallBack {
|
||||
void onCancel();
|
||||
|
||||
void onSure();
|
||||
}
|
||||
}
|
||||
97
common/src/main/res/layout/view_complete_information.xml
Normal file
97
common/src/main/res/layout/view_complete_information.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="274dp"
|
||||
android:layout_height="168.5dp"
|
||||
app:cardCornerRadius="15dp"
|
||||
app:cardElevation="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/complete_information_hint"
|
||||
android:layout_width="124.5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="25.5dp"
|
||||
android:layout_marginTop="30.5dp"
|
||||
android:text="@string/complete_information_hint"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<!--表情-->
|
||||
<ImageView
|
||||
android:id="@+id/expression"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="22.5dp"
|
||||
android:src="@mipmap/icon_smiling_face" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/complete_information2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="18.5dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/complete_information_hint2"
|
||||
android:textColor="#666666"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_live"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="2dp"
|
||||
android:src="@mipmap/icon_live" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/live_open_cancel"
|
||||
android:layout_width="111dp"
|
||||
android:layout_height="37dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="@drawable/backgroud_live_open_lfet"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#FFC621"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/live_open_ok"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/backgroud_live_open_right"
|
||||
android:gravity="center"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/icon_cry_face.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_cry_face.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_live.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_live.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/icon_smiling_face.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_smiling_face.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
@@ -1157,4 +1157,8 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="love_powder_medal">真愛粉\n勛章(7天)</string>
|
||||
<string name="man_student">男生</string>
|
||||
<string name="girl_student">女生</string>
|
||||
<string name="complete_information_hint">已將獎勵發送至您的背包,請注意查看。</string>
|
||||
<string name="complete_information_hint3">離開會讓您失去獎勵,您確認離開嗎?</string>
|
||||
<string name="complete_information_hint2">愛你,愛你</string>
|
||||
<string name="you_guide_me">指導下我好嗎</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user