Commit 72f883b3 by 霍志良

fix:修复BUG:17439。

parent 74a96c87
package com.yidianling.dynamic.event
data class dynamicFocusEvent (
var focusState:String
)
\ No newline at end of file
...@@ -42,6 +42,7 @@ import com.yidianling.dynamic.common.net.DynamicApiUtils; ...@@ -42,6 +42,7 @@ import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.dialog.CancelFocusDialog; import com.yidianling.dynamic.dialog.CancelFocusDialog;
import com.yidianling.dynamic.event.BlackEvent; import com.yidianling.dynamic.event.BlackEvent;
import com.yidianling.dynamic.event.LoginStateEvent; import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.MemberInfoBean; import com.yidianling.dynamic.model.MemberInfoBean;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
...@@ -433,7 +434,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -433,7 +434,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
/** /**
* *
*/ */
@SuppressLint("CheckResult")
private void Focus() { private void Focus() {
showProgressDialog(""); showProgressDialog("");
Command.FocusCmd cmd = new Command.FocusCmd(mem_id, "1"); Command.FocusCmd cmd = new Command.FocusCmd(mem_id, "1");
DynamicApiUtils.focus(cmd) DynamicApiUtils.focus(cmd)
...@@ -450,6 +453,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -450,6 +453,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti + 1) + ""; fans_count = (fans_counti + 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count); members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "1"; focus_state = "1";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
Drawable drawable = getResources().getDrawable(R.drawable.dynamic_ic_expand); Drawable drawable = getResources().getDrawable(R.drawable.dynamic_ic_expand);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
members_top_user_focus_ortion_tv.setCompoundDrawablePadding(20); members_top_user_focus_ortion_tv.setCompoundDrawablePadding(20);
...@@ -461,6 +465,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -461,6 +465,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti - 1) + ""; fans_count = (fans_counti - 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count); members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "2"; focus_state = "2";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
members_top_user_focus_ortion_tv.setCompoundDrawables(null, null, null, null); members_top_user_focus_ortion_tv.setCompoundDrawables(null, null, null, null);
members_top_user_focus_ortion_tv.setText("+ 关注"); members_top_user_focus_ortion_tv.setText("+ 关注");
members_top_user_focus_ortion_tv.setTextColor(getResources().getColor(R.color.dynamic_white)); members_top_user_focus_ortion_tv.setTextColor(getResources().getColor(R.color.dynamic_white));
......
...@@ -24,6 +24,7 @@ import android.text.Html; ...@@ -24,6 +24,7 @@ import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.text.style.ImageSpan; import android.text.style.ImageSpan;
import android.util.EventLog;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
...@@ -72,6 +73,8 @@ import com.yidianling.dynamic.R2; ...@@ -72,6 +73,8 @@ import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity2; import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity2;
import com.yidianling.dynamic.common.emoji.EmoticonPickerView; import com.yidianling.dynamic.common.emoji.EmoticonPickerView;
import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener; import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener;
import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.members.MembersActivity; import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.CommentBean; import com.yidianling.dynamic.model.CommentBean;
import com.yidianling.dynamic.model.Reply; import com.yidianling.dynamic.model.Reply;
...@@ -95,6 +98,7 @@ import java.util.concurrent.TimeUnit; ...@@ -95,6 +98,7 @@ import java.util.concurrent.TimeUnit;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import de.greenrobot.event.EventBus;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
...@@ -374,6 +378,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -374,6 +378,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
setContentView(R.layout.dynamic_activity_trend_details); setContentView(R.layout.dynamic_activity_trend_details);
ButterKnife.bind(this); ButterKnife.bind(this);
initDatas(); initDatas();
...@@ -1451,8 +1456,18 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1451,8 +1456,18 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
if (subscribe != null) { if (subscribe != null) {
subscribe.dispose(); subscribe.dispose();
} }
EventBus.getDefault().unregister(this);
}
public void onEvent(dynamicFocusEvent event) {
// 1已关注 2关注
if (event.getFocusState().equals("1")){
tvGuanzhu.setVisibility(GONE);
tvGuanzhu.setText("已关注");
}else{
tvGuanzhu.setVisibility(VISIBLE);
tvGuanzhu.setText("关注");
}
} }
@NonNull @NonNull
@Override @Override
public ITrendsDetailPresenterImpl createPresenter() { public ITrendsDetailPresenterImpl createPresenter() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment