修复了一些 UI 问题, 1、2、4、5、12 https://gitlab.ghzhushou.com/pm/halo-app-issues/issues/385

This commit is contained in:
chenjuntao
2018-10-31 05:15:28 +08:00
parent e80af77b8d
commit 2c5a21ec2a
7 changed files with 25 additions and 9 deletions

View File

@ -206,8 +206,13 @@ public class DownloadManager implements DownloadStatusListener {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
final SharedPreferences.Editor edit = sp.edit();
if (sp.getBoolean("InstallHint" + PackageUtils.getVersionName(), true)) {
DialogUtils.showInstallHintDialog(context,
() -> edit.putBoolean("InstallHint" + PackageUtils.getVersionName(), false).apply());
try {
DialogUtils.showInstallHintDialog(context,
() -> edit.putBoolean("InstallHint" + PackageUtils.getVersionName(), false).apply());
} catch (Exception exception) {
exception.printStackTrace();
edit.putBoolean("InstallHint" + PackageUtils.getVersionName(), false).apply();
}
}
}

View File

@ -545,12 +545,22 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
// 往位置0添加评论
public void addNormalComment(CommentEntity commentEntity) {
mNormalCommentList.add(0, commentEntity);
mNormalCommentList.add(findTheLastPriorComment(), commentEntity);
}
public void addCommentCount() {
mConcernEntity.setCommentnum(mConcernEntity.getCommentnum() + 1);
notifyItemChanged(0);
mConcernEntity.setCommentnum(mConcernEntity.getCommentnum());
notifyDataSetChanged();
}
public int findTheLastPriorComment() {
int lastPriorityPosition = 0;
for (int i = 0; i < mNormalCommentList.size(); i++) {
if (mNormalCommentList.get(i).getPriority() != 0) {
lastPriorityPosition = i + 1;
}
}
return lastPriorityPosition;
}
public int getHotCommentListSize() {

View File

@ -358,7 +358,7 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa
adapter.addNormalComment(commentEntity);
}
modifyNewsCommentOkhttpCache(0, cacheObject, newsId);
modifyNewsCommentOkhttpCache(adapter.findTheLastPriorComment(), cacheObject, newsId);
} catch (JSONException e) {
e.printStackTrace();
}

View File

@ -1225,7 +1225,7 @@ public interface ApiService {
/**
* 获取社区文章列表
*/
@GET("users/{user_id}/communities/articles")
@GET("users/{user_id}/communities/articles?view=home_page")
Observable<List<ArticleEntity>> getMyArticle(@Path("user_id") String userId, @Query("page") int page);
/**