Merge branch 'dev' of gitlab.ghzhushou.com:halo/assistant-android into dev
This commit is contained in:
@ -12,6 +12,7 @@ import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.entity.CommunityEntity
|
||||
import com.gh.gamecenter.manager.UserManager
|
||||
import com.gh.gamecenter.mvvm.Resource
|
||||
import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity
|
||||
import com.gh.gamecenter.qa.entity.ArticleDetailEntity
|
||||
import com.gh.gamecenter.qa.entity.ArticleDraftEntity
|
||||
import com.gh.gamecenter.qa.questions.edit.QuestionEditViewModel
|
||||
@ -38,6 +39,8 @@ class ArticleEditViewModel(application: Application) : AndroidViewModel(applicat
|
||||
|
||||
val FILE_HOST = "file:///"
|
||||
|
||||
private var mPostDraftsCount: Int = 0
|
||||
|
||||
val MIN_ARTICLE_TEXT_LENGTH = 6
|
||||
|
||||
val processDialog = MediatorLiveData<WaitingDialogFragment.WaitingDialogData>()
|
||||
@ -261,7 +264,13 @@ class ArticleEditViewModel(application: Application) : AndroidViewModel(applicat
|
||||
.subscribe(object : Response<ResponseBody>() {
|
||||
override fun onResponse(response: ResponseBody?) {
|
||||
if (isExit) postArticleDrafts.postValue(true)
|
||||
Utils.toast(getApplication(), "文章已保存到草稿箱")
|
||||
|
||||
if (mPostDraftsCount >= AnswerEditActivity.SAVE_DRAFTS_TOAST_COUNT) {
|
||||
mPostDraftsCount = 0
|
||||
Utils.toast(getApplication(), "回答已保存到草稿箱")
|
||||
} else {
|
||||
mPostDraftsCount++
|
||||
}
|
||||
|
||||
val string = response?.string()
|
||||
if (!string.isNullOrEmpty() && draftEntity?.id == null) {
|
||||
|
||||
@ -109,10 +109,11 @@ public class AnswerViewHolder extends BaseRecyclerViewHolder<AnswerEntity> {
|
||||
mQuestionTitle.setVisibility(View.VISIBLE);
|
||||
mQuestionTitle.setText(entity.getQuestions().getTitle());
|
||||
mVotecount.setText(mVotecount.getContext().getString(R.string.ask_vote_count, NumberUtils.transSimpleCount(entity.getVote())));
|
||||
mCommentCount.setText(String.format("%s 评论", NumberUtils.transSimpleCount(entity.getCommentCount())));
|
||||
// 3.6.3 产品说把右下角的社区名字换成时间
|
||||
// 3.6.3 产品说把右下角的社区名字换成时间, 评论隐藏掉
|
||||
mCommunityName.setVisibility(View.VISIBLE);
|
||||
mCommunityName.setText(NewsUtils.getFormattedTime(entity.getTime()));
|
||||
mCommentCount.setVisibility(View.GONE);
|
||||
// mCommentCount.setText(String.format("%s 评论", NumberUtils.transSimpleCount(entity.getCommentCount())));
|
||||
// mCommunityName.setText(entity.getCommunityName());
|
||||
UserEntity user = entity.getUser();
|
||||
mUsername.setText(user.getName());
|
||||
|
||||
@ -181,15 +181,26 @@ public class QuestionsDetailAdapter extends ListAdapter<AnswerEntity> {
|
||||
|
||||
private void initQuestionsDetailItemViewHolder(QuestionsDetailItemViewHolder holder) {
|
||||
List<String> images = mQuestionsDetailEntity.getImages();
|
||||
if (mQuestionsDetailEntity.getImages().size() == 0) {
|
||||
holder.mPic2.setVisibility(View.INVISIBLE);
|
||||
} else if (mQuestionsDetailEntity.getImages().size() == 1) {
|
||||
holder.mPic2.setVisibility(View.INVISIBLE);
|
||||
holder.mPic3.setVisibility(View.INVISIBLE);
|
||||
holder.mPic3Desc.setVisibility(View.GONE);
|
||||
holder.mPic3Mask.setVisibility(View.GONE);
|
||||
}
|
||||
for (int i = 0; i < images.size(); i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
holder.mPic1.setVisibility(View.VISIBLE);
|
||||
ImageUtils.display(holder.mPic1, images.get(i));
|
||||
break;
|
||||
case 1:
|
||||
holder.mPic2.setVisibility(View.VISIBLE);
|
||||
ImageUtils.display(holder.mPic2, images.get(i));
|
||||
break;
|
||||
case 2:
|
||||
holder.mPic3.setVisibility(View.VISIBLE);
|
||||
ImageUtils.display(holder.mPic3, images.get(i));
|
||||
if (images.size() > 3) {
|
||||
holder.mPic3Mask.setVisibility(View.VISIBLE);
|
||||
|
||||
@ -24,7 +24,7 @@ class OpenedViewModel(application: Application) : ListViewModel<AskGameSelectEnt
|
||||
for (game in selectList) {
|
||||
var thisGameIsInstalled = false
|
||||
for (installGame in PackageRepository.gameInstalled) {
|
||||
if (installGame.id == game.id) {
|
||||
if (installGame.id == game.game.id) {
|
||||
thisGameIsInstalled = true
|
||||
break
|
||||
}
|
||||
|
||||
@ -115,6 +115,7 @@
|
||||
android:text = "@{data.count.comment + ` 评论`}"
|
||||
android:textColor = "@color/hint"
|
||||
android:textSize = "11sp"
|
||||
android:visibility = "gone"
|
||||
app:layout_constraintLeft_toRightOf = "@id/vote_count"
|
||||
app:layout_constraintTop_toBottomOf = "@id/image" />
|
||||
|
||||
|
||||
@ -553,7 +553,7 @@
|
||||
<string name = "share_invite_url" >http://www.ghzs.com/question/%1$s?invite=%2$s</string >
|
||||
<string name = "share_questions_url" >http://www.ghzs.com/question/%1$s</string >
|
||||
<string name = "share_answers_url" >http://www.ghzs.com/question/%1$s?answer=%2$s</string >
|
||||
<string name = "question_edit_hint" >3.配图最多上传3张,不得出现恶心、低俗等图片</string >
|
||||
<string name = "question_edit_hint" >3.配图最多上传30张,不得出现恶心、低俗等图片</string >
|
||||
<string name = "login_failure" >登录失败</string >
|
||||
<string name = "questionsdetail_max_tag_hint" >最多只能选择5个标签</string >
|
||||
<string name = "answer_edit_max_img_hint" >最多只能上传50张图片</string >
|
||||
|
||||
Reference in New Issue
Block a user