守护团新增红点
This commit is contained in:
@@ -62,7 +62,24 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
public boolean getRedPoint() {
|
||||
return !TextUtils.isEmpty(getString("RedPoint")) || !TextUtils.equals(getString("RedPoint"), "1");
|
||||
}
|
||||
public void setQuickGiftIfFirst() {
|
||||
|
||||
public void setGuardRedPoint() {
|
||||
put("GuardRedPoint", "1");
|
||||
}
|
||||
|
||||
public boolean getGuardRedPoint() {
|
||||
String GuardRedPoint = getString("GuardRedPoint");
|
||||
if (TextUtils.isEmpty(GuardRedPoint)) {
|
||||
return true;
|
||||
}
|
||||
if (!TextUtils.equals(GuardRedPoint, "1")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setQuickGiftIfFirst() {
|
||||
put("quick_gift_if_first", "1");
|
||||
}
|
||||
|
||||
@@ -511,7 +528,8 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
public void updateUserCoin(){
|
||||
|
||||
public void updateUserCoin() {
|
||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
@@ -528,14 +546,15 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
public void updateUserCoin(OnItemClickListener<JSONObject> listener){
|
||||
|
||||
public void updateUserCoin(OnItemClickListener<JSONObject> listener) {
|
||||
HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance")
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
JSONObject obj = JSONObject.parseObject(info[0]);
|
||||
listener.onItemClick(obj,0);
|
||||
listener.onItemClick(obj, 0);
|
||||
String golds = obj.getString("gold");
|
||||
String coins = obj.getString("coin");
|
||||
String yuanbaos = obj.getString("yuanbao");
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.app.Dialog;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.JavascriptInterface;
|
||||
@@ -378,6 +377,13 @@ public class JavascriptInterfaceUtils {
|
||||
RouteUtil.forwardZhuangBanActivity(url);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebViewNew(String url) {
|
||||
Bus.get().post(new JavascriptInterfaceEvent().setMethod("openWebView").setData(url));
|
||||
Constants.isTitle = false;
|
||||
RouteUtil.forwardZhuangBanActivity(CommonAppConfig.HOST + url);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openWebViewTitle(String url) {
|
||||
Constants.isTitle = true;
|
||||
@@ -694,10 +700,11 @@ public class JavascriptInterfaceUtils {
|
||||
public void androidtoCommunityVideo() {
|
||||
RouteUtil.forwardCommunityActivity();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void getRewards(String checkUpgradesJson){
|
||||
public void getRewards(String checkUpgradesJson) {
|
||||
try {
|
||||
CheckUpgradesModel upgradesModel = new Gson().fromJson(checkUpgradesJson,CheckUpgradesModel.class);
|
||||
CheckUpgradesModel upgradesModel = new Gson().fromJson(checkUpgradesJson, CheckUpgradesModel.class);
|
||||
if (!TextUtils.isEmpty(upgradesModel.getLevel()))
|
||||
new XPopup.Builder(mWebView.getContext())
|
||||
.asCustom(new GuardUpgradePopup(mWebView.getContext(), "", upgradesModel))
|
||||
|
||||
@@ -22,11 +22,13 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
public class FunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView funGamePic;
|
||||
private TextView funGameName;
|
||||
private View total_image_red_point;
|
||||
|
||||
public FunGamesChildViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
funGamePic = itemView.findViewById(R.id.fun_game_pic);
|
||||
funGameName = itemView.findViewById(R.id.fun_game_name);
|
||||
total_image_red_point = itemView.findViewById(R.id.total_image_red_point);
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarChildModel model, boolean rigts) {
|
||||
@@ -38,7 +40,11 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
|
||||
funGameName.setText(model.getTitle());
|
||||
|
||||
if (TextUtils.equals(model.getTitle(), WordUtil.getNewString(com.yunbao.common.R.string.guard_guard)) && IMLoginManager.get(itemView.getContext()).getGuardRedPoint()) {
|
||||
total_image_red_point.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
total_image_red_point.setVisibility(View.GONE);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
@@ -59,7 +65,7 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken()) .append("&isZh=")
|
||||
.append(userInfo.getToken()).append("&isZh=")
|
||||
.append(WordUtil.isNewZh() ? "1" : 0);
|
||||
} else {
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
@@ -68,7 +74,7 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
.append("?uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken()) .append("&isZh=")
|
||||
.append(userInfo.getToken()).append("&isZh=")
|
||||
.append(WordUtil.isNewZh() ? "1" : 0);
|
||||
}
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
|
||||
@@ -26,13 +26,14 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView funGameName;
|
||||
private View red_point;
|
||||
private boolean showRed = false;
|
||||
|
||||
private View total_image_red_point;
|
||||
public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed) {
|
||||
super(itemView);
|
||||
this.showRed = showRed;
|
||||
funGamePic = itemView.findViewById(R.id.fun_game_pic);
|
||||
funGameName = itemView.findViewById(R.id.fun_game_name);
|
||||
red_point = itemView.findViewById(R.id.red_point);
|
||||
total_image_red_point = itemView.findViewById(R.id.total_image_red_point);
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarChildModel model, boolean rigts) {
|
||||
@@ -49,7 +50,11 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder {
|
||||
}
|
||||
|
||||
funGameName.setText(model.getTitle());
|
||||
|
||||
if (TextUtils.equals(model.getTitle(), WordUtil.getNewString(com.yunbao.common.R.string.guard_guard)) && IMLoginManager.get(itemView.getContext()).getGuardRedPoint()) {
|
||||
total_image_red_point.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
total_image_red_point.setVisibility(View.GONE);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
@@ -1,16 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fun_game_pic"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:src="@mipmap/live_more_icon_guard" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="40dp"
|
||||
|
||||
android:layout_height="40dp">
|
||||
<!--普通工具合集-->
|
||||
<ImageView
|
||||
android:id="@+id/fun_game_pic"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/live_more_icon_guard" />
|
||||
|
||||
<View
|
||||
android:id="@+id/total_image_red_point"
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="3dp"
|
||||
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/bg_red_point"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fun_game_name"
|
||||
|
||||
@@ -13,11 +13,32 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fun_game_pic"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@mipmap/live_more_icon_guard" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="50dp"
|
||||
|
||||
android:layout_height="50dp">
|
||||
<!--普通工具合集-->
|
||||
<ImageView
|
||||
android:id="@+id/fun_game_pic"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/live_more_icon_guard" />
|
||||
|
||||
<View
|
||||
android:id="@+id/total_image_red_point"
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="3dp"
|
||||
|
||||
android:layout_marginEnd="5dp"
|
||||
|
||||
android:background="@drawable/bg_red_point"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/red_point"
|
||||
|
||||
Reference in New Issue
Block a user