任务
This commit is contained in:
parent
752fae680c
commit
140e5740e6
@ -8,7 +8,7 @@ public class CustomDrawerPopupEvent extends BaseModel {
|
||||
//权益的名字
|
||||
private String rightsInterests = "";
|
||||
//活动的id
|
||||
private int activityId = -1;
|
||||
private int activityId = 0;
|
||||
//跳转网页地址
|
||||
private String htmlUrl;
|
||||
//是否半屏展示
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -8,9 +9,16 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.DrawerRecommendAdapter;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
/**
|
||||
* 侧边栏推荐布局 任务
|
||||
@ -34,5 +42,29 @@ public class DrawerRecommendViewHolder extends RecyclerView.ViewHolder {
|
||||
sendGoodGift.setText(model.getTitle());
|
||||
subtitle.setText(model.getSubtitle());
|
||||
recommendAdapter.updateData(model.getChild());
|
||||
ViewClicksAntiShake.clicksAntiShake(subtitle, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (TextUtils.isEmpty(model.getSrc())) {
|
||||
ToastUtil.show("SHOWER_ERROR");
|
||||
} else {
|
||||
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
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")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.yunbao.common.views;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@ -12,13 +13,17 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView icon;
|
||||
private TextView title, subtitle, toReceive;
|
||||
private RelativeLayout layout;
|
||||
|
||||
private FrameLayout toReceiveLayout;
|
||||
|
||||
public DrawerTaskChildViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@ -27,6 +32,7 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
|
||||
subtitle = itemView.findViewById(R.id.subtitle);
|
||||
toReceive = itemView.findViewById(R.id.to_receive);
|
||||
layout = itemView.findViewById(R.id.layout);
|
||||
toReceiveLayout = itemView.findViewById(R.id.to_receive_layout);
|
||||
}
|
||||
|
||||
public void setData(CustomSidebarChildModel model) {
|
||||
@ -44,18 +50,29 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
|
||||
if (TextUtils.equals(model.getStatus(), "0")) {
|
||||
layout.setEnabled(false);
|
||||
toReceive.setText(R.string.to_complete);
|
||||
toReceive.setBackgroundResource(R.drawable.bg_drawer_popup_task_status);
|
||||
toReceive.setEnabled(false);
|
||||
toReceiveLayout.setBackgroundResource(R.drawable.bg_drawer_popup_task_status);
|
||||
toReceiveLayout.setEnabled(false);
|
||||
} else if (TextUtils.equals(model.getStatus(), "1")) {
|
||||
layout.setEnabled(false);
|
||||
toReceive.setText(R.string.already_collected);
|
||||
toReceive.setBackgroundResource(R.drawable.bg_drawer_popup_task_status2);
|
||||
toReceiveLayout.setBackgroundResource(R.drawable.bg_drawer_popup_task_status2);
|
||||
toReceive.setTextColor(Color.parseColor("#DDDDDD"));
|
||||
} else if (TextUtils.equals(model.getStatus(), "2")) {
|
||||
toReceive.setBackgroundResource(R.drawable.bg_drawer_popup_task_status);
|
||||
toReceive.setEnabled(true);
|
||||
toReceiveLayout.setBackgroundResource(R.drawable.bg_drawer_popup_task_status);
|
||||
toReceiveLayout.setEnabled(true);
|
||||
layout.setEnabled(true);
|
||||
toReceive.setText(R.string.to_receive);
|
||||
}
|
||||
ViewClicksAntiShake.clicksAntiShake(toReceive, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new CustomDrawerPopupEvent()
|
||||
.setDisMiss(true));
|
||||
|
||||
if (TextUtils.equals(model.getStatus(), "2")) {
|
||||
ToastUtil.show("敬请期待");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,24 @@
|
||||
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;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.DrawerTaskAdapter;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
/**
|
||||
* 侧边栏任务布局
|
||||
@ -19,6 +28,7 @@ public class DrawerTaskViewHolder extends RecyclerView.ViewHolder {
|
||||
private RecyclerView childList;
|
||||
private DrawerTaskAdapter taskAdapter;
|
||||
|
||||
|
||||
public DrawerTaskViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
||||
@ -33,5 +43,29 @@ public class DrawerTaskViewHolder extends RecyclerView.ViewHolder {
|
||||
sendGoodGift.setText(model.getTitle());
|
||||
subtitle.setText(model.getSubtitle());
|
||||
taskAdapter.updateData(model.getChild());
|
||||
ViewClicksAntiShake.clicksAntiShake(subtitle, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (TextUtils.isEmpty(model.getSrc())) {
|
||||
ToastUtil.show("SHOWER_ERROR");
|
||||
} else {
|
||||
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
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")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
<item android:state_enabled="false">
|
||||
<shape>
|
||||
<corners android:radius="7dp" />
|
||||
<solid android:color="#7000" />
|
||||
<solid android:color="#2fff" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -39,16 +39,25 @@
|
||||
android:textColor="#9A9A9A"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/to_receive"
|
||||
<FrameLayout
|
||||
android:id="@+id/to_receive_layout"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:background="@drawable/bg_drawer_popup_task_status"
|
||||
android:gravity="center"
|
||||
android:text="领取"
|
||||
android:textColor="#15151D"
|
||||
android:textSize="12sp" />
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/to_receive"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="领取"
|
||||
android:textColor="#15151D"
|
||||
android:textSize="12sp" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user