光环助手V3.5-文章详情优化

This commit is contained in:
kehaoyuan
2018-09-14 18:22:43 +08:00
parent 275da32584
commit 75c332ade1
19 changed files with 517 additions and 488 deletions

View File

@ -12,16 +12,12 @@ import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.common.constant.Config;
import com.gh.common.util.CheckLoginUtils;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.EntranceUtils;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.LoginUtils;
import com.gh.common.util.PostCommentUtils;
import com.gh.common.util.TimestampUtils;
@ -56,7 +52,6 @@ import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
import butterknife.OnTouch;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import retrofit2.HttpException;
@ -73,28 +68,12 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
@BindView(R.id.message_detail_rv)
RecyclerView mMessageDetailRv;
@BindView(R.id.message_detail_user_rl)
RelativeLayout mMessageDetailUserRl;
@BindView(R.id.message_detail_comment_rl)
RelativeLayout mMessageDetailCommentRl;
@BindView(R.id.comment_user_icon)
SimpleDraweeView mMessageDetailIconDv;
@BindView(R.id.comment_user_name)
TextView mMessageDetailUserNameTv;
@BindView(R.id.comment_send)
@BindView(R.id.comment_send_btn)
TextView mMessageDetailCommentSend;
@BindView(R.id.message_detail_comment_et)
@BindView(R.id.comment_et)
EditText mMessageDetailEt;
@BindView(R.id.message_detail_comment_hint_rl)
RelativeLayout mMessageDetailCommentHintRl;
@BindView(R.id.message_detail_sv)
ScrollView mMessageDetailSv;
@BindView(R.id.message_detail_hint_line)
View mMessageDetailLine;
@BindView(R.id.reuse_no_connection)
LinearLayout mNoConnection;
@BindView(R.id.message_detail_close_comment)
View mColseCommentV;
private LinearLayoutManager mLayoutManager;
@ -190,10 +169,6 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
});
mUserInfo = UserManager.getInstance().getUserInfoEntity();
if (mUserInfo != null) {
ImageUtils.display(mMessageDetailIconDv, mUserInfo.getIcon());
mMessageDetailUserNameTv.setText(mUserInfo.getName());
}
if (newsId != null && mConcernEntity == null) {
getConcernDigest();
@ -273,11 +248,9 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
});
}
@OnClick({R.id.message_detail_comment_hint_rl, R.id.reuse_no_connection})
@OnClick({R.id.reuse_no_connection})
public void OnViewClick(View view) {
if (view.getId() == R.id.message_detail_comment_hint_rl) {
setSoftInput(true);
} else if (view.getId() == R.id.reuse_no_connection) {
if (view.getId() == R.id.reuse_no_connection) {
if (newsId != null && mConcernEntity == null) {
showNoConnection(false);
}
@ -289,14 +262,9 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
if (isShow) {
CheckLoginUtils.checkLogin(getContext(), () -> {
Util_System_Keyboard.showSoftKeyboard(getContext(), mMessageDetailEt);
mMessageDetailCommentHintRl.setVisibility(View.GONE);
mMessageDetailLine.setVisibility(View.GONE);
mMessageDetailCommentRl.setVisibility(View.VISIBLE);
mMessageDetailUserRl.setVisibility(View.VISIBLE);
mMessageDetailEt.setFocusable(true);
mMessageDetailEt.setFocusableInTouchMode(true);
mMessageDetailEt.requestFocus();
mColseCommentV.setVisibility(View.VISIBLE);
if (mCommentEntity != null && mCommentEntity.getUser() != null) {
mMessageDetailEt.setHint(getString(R.string.comment_repty_hint, mCommentEntity.getUser().getName()));
@ -306,11 +274,6 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
});
} else {
Util_System_Keyboard.hideSoftKeyboard(getActivity());
mMessageDetailCommentHintRl.setVisibility(View.VISIBLE);
mMessageDetailLine.setVisibility(View.VISIBLE);
mMessageDetailCommentRl.setVisibility(View.GONE);
mMessageDetailUserRl.setVisibility(View.GONE);
mColseCommentV.setVisibility(View.GONE);
if (mCommentEntity != null) {
mCommentEntity = null; // 清空当前评论实体
@ -320,15 +283,7 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
}
}
@OnTouch(R.id.message_detail_close_comment)
public boolean OnRecyclerTouchListener() {
if (mMessageDetailCommentRl.getVisibility() == View.VISIBLE) {
setSoftInput(false);
}
return true;
}
@OnClick(R.id.comment_send)
@OnClick(R.id.comment_send_btn)
public void OnSendCommentListener() {
final String content = mMessageDetailEt.getText().toString();
@ -460,9 +415,6 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
if (newsId != null) {
getConcernDigest();
}
if (mMessageDetailCommentRl.getVisibility() == View.VISIBLE) {
setSoftInput(false);
}
}
}
@ -471,10 +423,6 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
public void onEventMainThread(EBReuse reuse) {
if (reuse.getType().equals(LOGIN_TAG)) { // 登入
mUserInfo = UserManager.getInstance().getUserInfoEntity();
if (mUserInfo != null) {
ImageUtils.display(mMessageDetailIconDv, mUserInfo.getIcon());
mMessageDetailUserNameTv.setText(mUserInfo.getName());
}
}
}