完善个人资料,我的页面修改,红点提示逻辑

This commit is contained in:
18401019693 2023-05-10 13:09:46 +08:00
parent f99bef4ac8
commit 229c8e72cf
14 changed files with 170 additions and 60 deletions

View File

@ -50,7 +50,7 @@ public class UserBean implements Parcelable {
private String fans_pic;
private String gifticon;
private String department_name;
private String token_rong="";
private String token_rong = "";
private String noble_end_time;
private String slide;
private String users_type;
@ -66,6 +66,17 @@ public class UserBean implements Parcelable {
private boolean randomPk;
//随机天梯排位赛PK img仅在主播PK时使用
private String mRankPkImgUrl;
//是否填写完整资料
private String user_info_complete;
public String getUserInfoComplete() {
return user_info_complete;
}
public UserBean seUserInfoComplete(String userInfoComplete) {
this.user_info_complete = userInfoComplete;
return this;
}
public boolean isRandomPk() {
return randomPk;
@ -117,8 +128,8 @@ public class UserBean implements Parcelable {
}
public String getIs_bind() {
if(StringUtil.isEmpty(is_bind)){
is_bind="0";
if (StringUtil.isEmpty(is_bind)) {
is_bind = "0";
}
return is_bind;
}

View File

@ -0,0 +1,16 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
public class CompleteInformationEvent extends BaseModel {
private boolean completeInformation = false;
public boolean isCompleteInformation() {
return completeInformation;
}
public CompleteInformationEvent setCompleteInformation(boolean completeInformation) {
this.completeInformation = completeInformation;
return this;
}
}

View File

@ -92,27 +92,34 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
ViewClicksAntiShake.clicksAntiShake(toReceive, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (TextUtils.equals(model.getStatus(), "2")) {
LiveNetManager.get(itemView.getContext())
.sendTaskGift(model.getFlag(), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
if (listener != null) {
listener.giftSuccess(model, index);
}
}
@Override
public void onError(String error) {
ToastUtil.show(R.string.net_error);
}
});
} else {
if (TextUtils.equals(model.getSrc(), "to_me_information")) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true));
.setDisMiss(true)
.setHtmlUrl(model.getSrc())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}else {
if (TextUtils.equals(model.getStatus(), "2")) {
LiveNetManager.get(itemView.getContext())
.sendTaskGift(model.getFlag(), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
if (listener != null) {
listener.giftSuccess(model, index);
}
}
@Override
public void onError(String error) {
ToastUtil.show(R.string.net_error);
}
});
} else {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true));
}
}
}
});
}

View File

@ -2,7 +2,6 @@ package com.yunbao.common.views;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -49,27 +48,35 @@ public class DrawerTaskViewHolder extends RecyclerView.ViewHolder {
if (TextUtils.isEmpty(model.getSrc())) {
ToastUtil.show("SHOWER_ERROR");
} else {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
if (TextUtils.equals(model.getSrc(), "to_me_information")) {
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(model.getSrc())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}//资料
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
} else {
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(model.getSrc())
.append("?uid=")
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken());
}//资料
Bus.get().post(new CustomDrawerPopupEvent()
.setDisMiss(true)
.setHtmlUrl(htmlUrl.toString())
.setScreen(TextUtils.equals(model.getShowType(), "2")));
}
}

View File

@ -1143,4 +1143,5 @@ Limited ride And limited avatar frame</string>
<string name="delete_account1">Do you want to delete the account</string>
<string name="delete_account2">After clicking delete, it will take effect immediately and cannot be restored. Are you sure you want to continue?</string>
<string name="delete_account3">Confirm deletion</string>
<string name="complete_information">完整填寫領大禮</string>
</resources>

View File

@ -1144,4 +1144,5 @@
<string name="delete_account1">是否刪除賬號</string>
<string name="delete_account2">點擊刪除後即刻生效,且不可恢復,您確認要繼續嗎?</string>
<string name="delete_account3">確認刪除</string>
<string name="complete_information">完整填寫領大禮</string>
</resources>

View File

@ -1150,4 +1150,5 @@ Limited ride And limited avatar frame</string>
<string name="delete_account1">Do you want to delete the account</string>
<string name="delete_account2">After clicking delete, it will take effect immediately and cannot be restored. Are you sure you want to continue?</string>
<string name="delete_account3">Confirm deletion</string>
<string name="complete_information">完整填寫領大禮</string>
</resources>

View File

@ -859,7 +859,10 @@ public class LiveAudienceActivity extends LiveActivity {
public void showerHtml(String htmlUrl, boolean screen) {
if (TextUtils.equals(htmlUrl, "recharge")) {
RouteUtil.forwardMyCoin(mContext);
} else {
} else if (TextUtils.equals(htmlUrl, "to_me_information")){
onBackPressed();
Constants.isShowPage = 3;
}else {
if (!screen) {
ZhuangBanActivity.forward(mContext, htmlUrl, false);
} else {

View File

@ -76,6 +76,7 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LoginData;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.CompleteInformationEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.http.main.MainNetManager;
@ -86,7 +87,6 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R;
@ -117,7 +117,7 @@ public class EntryActivity extends AppCompatActivity {
private LinearLayout btn_google;
public static Activity activity;
private static String mLoginType = Constants.MOB_PHONE;//登录方式
public String mPromoCode = "",UserID="";//推广码
public String mPromoCode = "", UserID = "";//推广码
private String mUuidDevice = "";//手机唯一标识符
private static boolean mFirstLogin;//是否是第一次登录
@ -276,7 +276,7 @@ public class EntryActivity extends AppCompatActivity {
@Override
public void onError(String error) {
ToastUtil.show( R.string.net_error);
ToastUtil.show(R.string.net_error);
}
});
@ -564,7 +564,7 @@ public class EntryActivity extends AppCompatActivity {
if (appData.getData() != null && !appData.getData().equals("")) {
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
}else {
} else {
JSONObject data = JSON.parseObject(appData.getData());
mPromoCode = data.getString("admin_id") + "";
UserID = data.getString("user_id") + "";
@ -601,7 +601,7 @@ public class EntryActivity extends AppCompatActivity {
if (CommonAppConfig.IS_GOOGLE_PLAY == true) {
mPromoCode = "";
}
MainHttpUtil.loginByThird(UserID,data.getOpenID(), mPromoCode, mUuidDevice, data.getNickName(), data.getAvatar(), data.getType(), new HttpCallback() {
MainHttpUtil.loginByThird(UserID, data.getOpenID(), mPromoCode, mUuidDevice, data.getNickName(), data.getAvatar(), data.getType(), new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
onLoginSuccess(code, msg, info);
@ -664,7 +664,8 @@ public class EntryActivity extends AppCompatActivity {
home_zdy_img_cn = obj.getString("home_zdy_img_cn");
}
if (obj.containsKey("home_zdy_pop")) {
NoviceInstructorManager.get(activity).setHomeZdyPop(obj.getString("home_zdy_pop"));
NoviceInstructorManager.get(activity).setHomeZdyPop(obj.getString(
"home_zdy_pop"));
}
} else {
@ -716,7 +717,7 @@ public class EntryActivity extends AppCompatActivity {
if (mBtnClick) {
return;
}
loginLoadingDialog = DialogUitl.loadingDialog(EntryActivity.this,getString(R.string.login_wait));
loginLoadingDialog = DialogUitl.loadingDialog(EntryActivity.this, getString(R.string.login_wait));
loginLoadingDialog.show();
new Timer().schedule(new TimerTask() {
@Override

View File

@ -63,9 +63,11 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveSvgGiftBean;
import com.yunbao.common.bean.UpdataListBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.custom.TabButtonGroup;
import com.yunbao.common.dialog.HintDialog;
import com.yunbao.common.dialog.InstructorOperationDialog;
import com.yunbao.common.event.CompleteInformationEvent;
import com.yunbao.common.event.InstructorOperationEvent;
import com.yunbao.common.event.LiveFloatEvent;
import com.yunbao.common.event.MainHomeCommunityToChatEvent;
@ -91,7 +93,6 @@ import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.SpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.VersionUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.APKUpdateCustomPopup;
import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.floatingview.APPEasyFloat;
@ -200,7 +201,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
protected void create() {
super.create();
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1,0.4f,new DecelerateInterpolator()));
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
}
@ -497,6 +498,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
//获取指导员账号
ConversationIMListManager.get(this).getUserInstructor(this);
checkVersion();
//是否完善个人资料
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
@Override
public void callback(UserBean bean) {
if (!TextUtils.equals(bean.getUserInfoComplete(), "1")) {
v_table_redpoint_me.setVisibility(View.VISIBLE);
} else {
v_table_redpoint_me.setVisibility(View.GONE);
}
}
});
}
@Override
@ -701,7 +713,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
public void callback(ConfigBean configBean) {
if (configBean != null) {
if (configBean.getMaintainSwitch() == 1) {//开启维护
DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.main_maintain_notice), configBean.getMaintainTips());
DialogUitl.showSimpleTipDialog(mContext, mContext.getString(R.string.main_maintain_notice), configBean.getMaintainTips());
}
if (!VersionUtil.isLatest(configBean.getVersion())) {
if (!APKManager.get().getApkVerNew()) {
@ -724,7 +736,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
* 填写邀请码
*/
private void showInvitationCode() {
DialogUitl.showSimpleInputDialog(mContext,mContext.getString(R.string.main_input_invatation_code), new DialogUitl.SimpleCallback() {
DialogUitl.showSimpleInputDialog(mContext, mContext.getString(R.string.main_input_invatation_code), new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(final Dialog dialog, final String content) {
if (TextUtils.isEmpty(content)) {
@ -1042,7 +1054,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
public final int CHOOSE_ANDROID_5 = 200;//Android 5.0以上的
public void startActivityMain(Intent intent, int CHOOSE) {
startActivityForResult(Intent.createChooser(intent,mContext.getString(R.string.choose_flie)), CHOOSE);
startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE);
}
public void startActivityMain2(Intent intent, int CHOOSE_ANDROID_5) {
@ -1236,6 +1248,16 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
// }
}
//红点(我的)
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCompleteInformationEvent(CompleteInformationEvent event) {
if (event.isCompleteInformation()) {
v_table_redpoint_me.setVisibility(View.VISIBLE);
} else {
v_table_redpoint_me.setVisibility(View.GONE);
}
}
/**
* 用户被踢下线
*

View File

@ -185,6 +185,12 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
}
});
redPoint.setVisibility(APKManager.get().getApkVerNew() ? View.GONE : View.VISIBLE);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.complete_information), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
}
});
}
@Override
@ -373,7 +379,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
tv_level.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String url = CommonAppConfig.HOST + "/h5/Grade/index.html?" + "token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid()+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
String url = CommonAppConfig.HOST + "/h5/Grade/index.html?" + "token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
ZhuangBanActivity.forward(mContext, url);
}
});
@ -415,6 +421,13 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
}
Constants.myUid = u.getGoodnum();
Constants.myAvatar = u.getAvatar();
if (TextUtils.equals(u.getUserInfoComplete(), "1")) {
findViewById(R.id.complete_information_radius).setVisibility(View.INVISIBLE);
findViewById(R.id.complete_information).setVisibility(View.INVISIBLE);
} else {
findViewById(R.id.complete_information_radius).setVisibility(View.VISIBLE);
findViewById(R.id.complete_information).setVisibility(View.VISIBLE);
}
}
@Override

View File

@ -127,9 +127,10 @@
android:id="@+id/v_table_redpoint_me"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginRight="18dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="20dp"
android:background="@drawable/background_ff5075"
android:visibility="gone" />
android:visibility="visible" />
</LinearLayout>
</LinearLayout>

View File

@ -49,12 +49,38 @@
android:gravity="center|left"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/complete_information_radius"
android:layout_width="7dp"
android:layout_height="7dp"
android:layout_marginStart="115.9dp"
android:layout_marginEnd="4dp"
app:cardBackgroundColor="#FF5730"
app:cardCornerRadius="20dp" />
<RelativeLayout
android:id="@+id/complete_information"
android:layout_width="107.9dp"
android:layout_height="25.25dp"
android:layout_marginStart="21dp"
android:layout_marginTop="-5dp"
android:background="@mipmap/icon_complete_information">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/complete_information"
android:textColor="@color/white"
android:textSize="12.44sp" />
</RelativeLayout>
<!--完善资料-->
<LinearLayout
android:id="@+id/lt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="21dp"
android:layout_marginTop="24dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:orientation="horizontal">

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB