From 4dcb12eb4f1394b64407bbe10787630ef92fb204 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 21 Dec 2022 14:50:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BAAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/bean/HttpCallbackModel.java | 10 +- .../yunbao/common/bean/LiveAiRobotBean.java | 108 +++++++++++++++ .../com/yunbao/common/http/PDLiveApi.java | 61 ++++++--- .../common/http/live/LiveNetManager.java | 129 +++++++++++++++++- .../LiveRobotSettingDialogFragment.java | 5 - 5 files changed, 287 insertions(+), 26 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java diff --git a/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java b/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java index c2369455f..da77d56e5 100644 --- a/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java +++ b/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java @@ -1,10 +1,18 @@ package com.yunbao.common.bean; -public class HttpCallbackModel extends BaseModel{ +public class HttpCallbackModel extends BaseModel { private int code; private String msg; + public HttpCallbackModel() { + } + + public HttpCallbackModel(int code, String msg) { + this.code = code; + this.msg = msg; + } + public int getCode() { return code; } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java b/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java new file mode 100644 index 000000000..d94c60bb0 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java @@ -0,0 +1,108 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; +import com.yunbao.common.bean.BaseModel; + +public class LiveAiRobotBean extends BaseModel { + @SerializedName("ai_name") + private String name; + @SerializedName("ai_state") + private int status; + @SerializedName("ai_time") + private int time; + @SerializedName("ai_sayhi") + private int autoSeyHiNumber; + @SerializedName("ai_gz") + private int autoRequestFollowNumber; + + public LiveAiRobotBean() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getTime() { + return time; + } + + public void setTime(int time) { + this.time = time; + } + + public int getAutoSeyHiNumber() { + return autoSeyHiNumber; + } + + public void setAutoSeyHiNumber(int autoSeyHiNumber) { + this.autoSeyHiNumber = autoSeyHiNumber; + } + + public int getAutoRequestFollowNumber() { + return autoRequestFollowNumber; + } + + public void setAutoRequestFollowNumber(int autoRequestFollowNumber) { + this.autoRequestFollowNumber = autoRequestFollowNumber; + } + + public static class Body { + public static final int TYPE_SAY_HI=1; + public static final int TYPE_FOLLOW=3; + @SerializedName("id") + private int id; + @SerializedName("uid") + private int uid; + @SerializedName("type") + private int type; + @SerializedName("content") + private String content; + + public Body() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + } +} diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index ba403f483..1427d6157 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -9,8 +9,10 @@ import com.yunbao.common.bean.CustomSidebarInfoModel; import com.yunbao.common.bean.EnterRoomNewModel; import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.HourRank; +import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LinkMicUserBeanV2; +import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.MsgSwitchDetailModel; @@ -354,42 +356,51 @@ public interface PDLiveApi { /** * 设置随机PK开关 + * * @param pk 1=开,0=关 */ @GET("/api/public/?service=Livepk.setRandomPKType") Observable>> changeRandomPkSwitch(@Query("random_pk") int pk); + /** * 获取自由PK次数 */ @GET("/api/public/?service=Livepk.getActivePkNum") Observable> getFreePkNumber(); + /** * 发起随机PK */ @GET("/api/public/?service=Livepk.setRandomPK") Observable> randomPK(); + /** * 随机PK后调用接口给后台记录 */ @GET("/api/public/?service=Livepk.startRandomPK") - Observable> startRandomPK(@Query("pkuid")String pkuid); + Observable> startRandomPK(@Query("pkuid") String pkuid); + /** * 自由PK开始后调用接口扣掉次数 */ @GET("/api/public/?service=Livepk.setActivePkNum") Observable> setFreePkNum(); + /** * 随机PK搜索用户 + * * @param cs 简体关键字/uid * @param ct 繁体关键字/uid */ @GET("/api/public/?service=Livepk.searchUser") - Observable>> randomPkSearchUser(@Query("jian_key")String cs,@Query("fan_key")String ct); + Observable>> randomPkSearchUser(@Query("jian_key") String cs, @Query("fan_key") String ct); + /** * 拒绝随机PK */ @GET("/api/public/?service=Livepk.setBanRandomPK") Observable> setBanRandomPK(); + /** * 拒绝随机PK */ @@ -403,6 +414,7 @@ public interface PDLiveApi { Observable> getAnchorPrankTurntable( @Query("anchor_id") String anchor_id ); + /** * 提交整蛊 */ @@ -418,6 +430,7 @@ public interface PDLiveApi { @Query("turntable_six") String turntable_six, @Query("status") String status ); + /** * 转盘整蛊结束后调用的接口 */ @@ -431,7 +444,7 @@ public interface PDLiveApi { * 获取整蛊列表 */ @GET("/api/public/?service=Prank.prankList") - Observable>> prankList( @Query("anchor_id") String anchor_id); + Observable>> prankList(@Query("anchor_id") String anchor_id); /** * 设置礼物整蛊 @@ -443,6 +456,7 @@ public interface PDLiveApi { @Query("gift_num") String gift_num, @Query("prank_content") String prank_content ); + /** * 删除礼物整蛊 */ @@ -451,58 +465,67 @@ public interface PDLiveApi { @Query("anchor_id") String anchor_id, @Query("prank_index") String prank_index ); + /** * 设置机器人开关 */ @GET("/api/public/?service=Live.setAnchorAiState") - Observable>> setAnchorAiState( + Observable> setAnchorAiState( @Query("ai_state") String ai_state ); + /** * 获取机器人信息 */ @GET("/api/public/?service=Live.getAnchorAiState") - Observable>> getAnchorAiState( + Observable> getAnchorAiState( ); + /** * 修改机器人信息 */ @GET("/api/public/?service=Live.setAnchorAiState") - Observable>> getAnchorAiState( + Observable> setAnchorAiState( @Query("name") String name, @Query("value") String value ); - /** + + /** * 获取机器人自定义话术 - * @param type 1(自定义打招呼) 3(自定义求关注) + * + * @param type 1(自定义打招呼) 3(自定义求关注) */ @GET("/api/public/?service=Live.getAiAutomaticSpeech") - Observable>> getAiAutomaticSpeech( + Observable>> getAiAutomaticSpeech( @Query("type") String type ); + /** * 机器人添加话术 */ @GET("/api/public/?service=Live.addAiAutomaticSpeech") - Observable>> addAiAutomaticSpeech( + Observable> addAiAutomaticSpeech( @Query("type") String type, @Query("content") String content ); + /** * 机器人删除话术 */ @GET("/api/public/?service=Live.delAiAutomaticSpeech ") - Observable>> delAiAutomaticSpeech ( - @Query("type") String type, - @Query("id") String id - ); - /** - * 机器人修改话术 - */ - @GET("/api/public/?service=Live.updateAiAutomaticSpeech ") - Observable>> updateAiAutomaticSpeech ( + Observable> delAiAutomaticSpeech( @Query("type") String type, @Query("id") String id ); + /** + * 机器人修改话术 + */ + @GET("/api/public/?service=Live.updateAiAutomaticSpeech ") + Observable> updateAiAutomaticSpeech( + @Query("type") String type, + @Query("id") String id, + @Query("content") String content + ); + } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index b5ff172fb..54ee7fcf6 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -14,6 +14,7 @@ import com.yunbao.common.bean.EnterRoomNewModel; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LinkMicUserBeanV2; +import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.NobleRankHideUserListModel; @@ -879,7 +880,7 @@ public class LiveNetManager { /** * 整蛊结束 */ - public void endPrankTurntable(String mLiveUid,HttpCallback callback){ + public void endPrankTurntable(String mLiveUid, HttpCallback callback) { API.get().pdLiveApi(mContext) .endPrankTurntable(mLiveUid) .subscribeOn(Schedulers.io()) @@ -898,6 +899,132 @@ public class LiveNetManager { } + public void getAiRobotStatus(HttpCallback callback) { + API.get().pdLiveApi(mContext) + .getAnchorAiState() + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(responseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + + public void setAiRobotStatus(String status, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .setAnchorAiState(status) + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(null); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + + public void setAiRobotDate(String name, String value, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .setAnchorAiState(name, value) + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(null); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + + public void getAiRobotBody(int type, HttpCallback> callback) { + API.get().pdLiveApi(mContext) + .getAiAutomaticSpeech(type + "") + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(responseModel.getData().getInfo()); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + + public void addAiRobotBody(int type, String content, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .addAiAutomaticSpeech(type + "", content) + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg())); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + + public void updateAiRobotBody(int type, int id, String content, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .updateAiAutomaticSpeech(type + "", id + "", content) + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg())); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + + public void delAiRobotBody(int type, int id, HttpCallback callback) { + API.get().pdLiveApi(mContext) + .delAiAutomaticSpeech(type + "", id + "") + .subscribeOn(Schedulers.io()) + .subscribe(responseModel -> { + if (callback != null) { + callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg())); + } + }, new Consumer() { + @Override + public void accept(Throwable throwable) throws Exception { + if (callback != null) { + callback.onError(throwable.getMessage()); + } + } + }).isDisposed(); + } + /** * 直播间取消网络请求 */ diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java index 13eeae167..5ef74897b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java @@ -46,11 +46,6 @@ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - Bundle bundle = getArguments(); - if (bundle == null) { - return; - } - } From 7639a70887adf6d4c4f1d7e232182684f0ebc71b Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 22 Dec 2022 09:58:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update=20=E6=9C=BA=E5=99=A8=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FaceUnity/src/main/res/values/strings.xml | 2 +- .../yunbao/common/bean/LiveAiRobotBean.java | 48 +++++++++--- .../com/yunbao/common/http/PDLiveApi.java | 2 +- .../common/http/live/LiveNetManager.java | 4 +- .../LiveRobotSettingDialogFragment.java | 62 +++++++++++++++- .../res/layout/dialog_live_robot_setting.xml | 74 +++++++++++++++++-- .../yunbao/main/views/MainHomeViewHolder.java | 7 ++ 7 files changed, 179 insertions(+), 20 deletions(-) diff --git a/FaceUnity/src/main/res/values/strings.xml b/FaceUnity/src/main/res/values/strings.xml index 799a50e10..e0f66a9b3 100644 --- a/FaceUnity/src/main/res/values/strings.xml +++ b/FaceUnity/src/main/res/values/strings.xml @@ -299,7 +299,7 @@ Hip Head shrink Thin leg - No body tracking + No message tracking Body driver Bust driver diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java b/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java index d94c60bb0..44e8b9f95 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java @@ -1,19 +1,23 @@ package com.yunbao.common.bean; -import com.google.gson.annotations.SerializedName; -import com.yunbao.common.bean.BaseModel; +import androidx.annotation.NonNull; +import com.google.gson.annotations.SerializedName; + +/** + * 机器人bean + */ public class LiveAiRobotBean extends BaseModel { @SerializedName("ai_name") private String name; @SerializedName("ai_state") - private int status; + private int status;//1=开 0=关 @SerializedName("ai_time") private int time; @SerializedName("ai_sayhi") - private int autoSeyHiNumber; + private int autoSeyHiNumber;// 自动打招呼已配置数量 @SerializedName("ai_gz") - private int autoRequestFollowNumber; + private int autoRequestFollowNumber;//自动求关注已配置数量 public LiveAiRobotBean() { } @@ -58,9 +62,24 @@ public class LiveAiRobotBean extends BaseModel { this.autoRequestFollowNumber = autoRequestFollowNumber; } - public static class Body { - public static final int TYPE_SAY_HI=1; - public static final int TYPE_FOLLOW=3; + @NonNull + @Override + public String toString() { + return "LiveAiRobotBean{" + + "name='" + name + '\'' + + ", status=" + status + + ", time=" + time + + ", autoSeyHiNumber=" + autoSeyHiNumber + + ", autoRequestFollowNumber=" + autoRequestFollowNumber + + '}'; + } + + /** + * 机器人消息 + */ + public static class Message { + public static final int TYPE_SAY_HI=1;//自动打招呼 + public static final int TYPE_FOLLOW=3;//自动求关注 @SerializedName("id") private int id; @SerializedName("uid") @@ -70,7 +89,7 @@ public class LiveAiRobotBean extends BaseModel { @SerializedName("content") private String content; - public Body() { + public Message() { } public int getId() { @@ -104,5 +123,16 @@ public class LiveAiRobotBean extends BaseModel { public void setContent(String content) { this.content = content; } + + @NonNull + @Override + public String toString() { + return "Message{" + + "id=" + id + + ", uid=" + uid + + ", type=" + type + + ", content='" + content + '\'' + + '}'; + } } } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 1427d6157..576df8487 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -496,7 +496,7 @@ public interface PDLiveApi { * @param type 1(自定义打招呼) 3(自定义求关注) */ @GET("/api/public/?service=Live.getAiAutomaticSpeech") - Observable>> getAiAutomaticSpeech( + Observable>> getAiAutomaticSpeech( @Query("type") String type ); diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 54ee7fcf6..4e6e91a91 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -22,7 +22,6 @@ import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankHttpTurntableBean; -import com.yunbao.common.bean.PrankTurntableBean; import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.bean.SetAttentsModel; @@ -40,7 +39,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; -import retrofit2.http.Query; /** @@ -953,7 +951,7 @@ public class LiveNetManager { }).isDisposed(); } - public void getAiRobotBody(int type, HttpCallback> callback) { + public void getAiRobotBody(int type, HttpCallback> callback) { API.get().pdLiveApi(mContext) .getAiAutomaticSpeech(type + "") .subscribeOn(Schedulers.io()) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java index 5ef74897b..6f413f971 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java @@ -2,23 +2,29 @@ package com.yunbao.live.dialog; import android.app.ActionBar; import android.os.Bundle; +import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.Window; import android.view.WindowManager; +import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.live.R; import androidx.annotation.Nullable; +import java.util.List; + /** * 机器人设置 */ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements View.OnClickListener { - + private static String TAG = "AI机器人"; @Override protected int getLayoutId() { @@ -43,10 +49,64 @@ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements params.gravity = Gravity.BOTTOM; window.setAttributes(params); } + @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); + initDate(); + } + private void initDate() { + LiveNetManager.get(mContext) + .getAiRobotStatus(new HttpCallback() { + @Override + public void onSuccess(LiveAiRobotBean data) { + Log.i(TAG, "onSuccess: " + data.toString()); + initListType1(); + } + + @Override + public void onError(String error) { + + } + }); + } + + private void initListType1() { + LiveNetManager.get(mContext) + .getAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, new HttpCallback>() { + @Override + public void onSuccess(List data) { + Log.i(TAG, "onSuccess: " + data.size()); + for (LiveAiRobotBean.Message message : data) { + Log.i(TAG, "onSuccess: message=" + message.toString()); + } + initListType2(); + } + + @Override + public void onError(String error) { + + } + }); + } + + private void initListType2() { + LiveNetManager.get(mContext) + .getAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, new HttpCallback>() { + @Override + public void onSuccess(List data) { + Log.i(TAG, "onSuccess: " + data.size()); + for (LiveAiRobotBean.Message message : data) { + Log.i(TAG, "onSuccess: message=" + message.toString()); + } + } + + @Override + public void onError(String error) { + + } + }); } @Override diff --git a/live/src/main/res/layout/dialog_live_robot_setting.xml b/live/src/main/res/layout/dialog_live_robot_setting.xml index d7ba7721e..8d8001e4a 100644 --- a/live/src/main/res/layout/dialog_live_robot_setting.xml +++ b/live/src/main/res/layout/dialog_live_robot_setting.xml @@ -1,11 +1,75 @@ - + android:layout_height="400dp" + android:background="#000"> + - \ No newline at end of file + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 4e4e1eeec..3517a8fbd 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -7,7 +7,9 @@ import android.widget.ImageView; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.WordUtil; +import com.yunbao.live.dialog.LiveRobotSettingDialogFragment; import com.yunbao.main.R; +import com.yunbao.main.activity.MainActivity; /** * Created by cxf on 2018/9/22. @@ -36,6 +38,11 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { img_trophy = (ImageView) findViewById(R.id.img_trophy); ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy); + + img_trophy.setOnClickListener(v -> { + LiveRobotSettingDialogFragment fragment=new LiveRobotSettingDialogFragment(); + fragment.show(((MainActivity)mContext).getSupportFragmentManager(),"LiveRobotSettingDialogFragment"); + }); } @Override