From cec82501dbc3afed48a63eba0389cf6f1b5b69a9 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 9 Aug 2022 17:56:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveEndViewHolder.java | 27 ++++++------------- .../yunbao/main/activity/SearchActivity.java | 21 +++++++++++++++ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java index d3d3303b1..e1275aec9 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -53,11 +53,6 @@ import org.greenrobot.eventbus.ThreadMode; public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickListener { private ImageView mAvatar1; - private ImageView mAvatar2; - private TextView mName; - public static TextView mDuration;//直播时长 - public static TextView mVotes;//收获映票 - public static TextView mWatchNum;//观看人数 //直播类型 private static LiveOfType type; @@ -92,16 +87,6 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList mAvatar1 = (ImageView) findViewById(R.id.avatar_1); userLiveEnd = (RelativeLayout) findViewById(R.id.user_live_end); anchorLiveEnd = (RelativeLayout) findViewById(R.id.anchor_live_end); -// mAvatar2 = (ImageView) findViewById(R.id.avatar_2); -// mName = (TextView) findViewById(R.id.name); -// mDuration = (TextView) findViewById(R.id.duration); -// mVotes = (TextView) findViewById(R.id.votes); -// mWatchNum = (TextView) findViewById(R.id.watch_num); -// findViewById(R.id.btn_back).setOnClickListener(this); -// TextView votesName = (TextView) findViewById(R.id.votes_name); -// votesName.setText(WordUtil.getString(R.string.live_votes) + CommonAppConfig.getInstance().getVotesName()); - - if (type == LiveOfType.USER) { initViewOfUser(); initDataOfUser(); @@ -210,10 +195,6 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList public static void upData(String votes, String length, int nums, String uname) { Log.e("收", votes + "votes" + length + "length" + nums + "nums"); - -// mVotes.setText(votes); -// mDuration.setText(length); -// mWatchNum.setText(StringUtil.toWan(nums)); if (type == LiveOfType.USER) { liveDurationUser.setText(length); liveNameUser.setText(uname); @@ -346,6 +327,14 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList String json = GsonUtils.toJson(data); LiveBean liveBean = GsonUtils.fromJson(json, LiveBean.class); mCheckLivePresenter.checkLive(liveBean); + if (mContext instanceof LiveAnchorActivity) { + ((LiveAnchorActivity) mContext).superBackPressed(); + } else if (mContext instanceof LiveAudienceActivity) { + ((LiveAudienceActivity) mContext).exitLiveRoom(); + } else if (mContext instanceof LiveRyAnchorActivity) { + ((LiveRyAnchorActivity) mContext).superBackPressed(); + + } } @Override diff --git a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java index 47fdf2ea8..6160f8eb7 100644 --- a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java @@ -3,7 +3,9 @@ package com.yunbao.main.activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.text.Editable; import android.text.TextUtils; +import android.text.TextWatcher; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; @@ -72,7 +74,26 @@ public class SearchActivity extends AbsActivity { mEditText.setText(""); } }); + findViewById(R.id.btn_delete).setVisibility(View.GONE); mEditText.setOnEditorActionListener(onEditorActionListener); + mEditText.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + if (!s.toString().trim().isEmpty()) { + findViewById(R.id.btn_delete).setVisibility(View.VISIBLE); + } + } + + @Override + public void afterTextChanged(Editable s) { + + } + }); //退出检索页面保存搜索记录 findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() { @Override