Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62740ffcb6 | |||
| 727616c764 | |||
| 1b6fd03ba3 | |||
| 53bb1dee01 | |||
| 467950ae2c | |||
| 5248ad3b6a | |||
| 3e41af7f41 | |||
| c01a9c1140 | |||
| 36def0a511 | |||
| 077f768d09 | |||
| c2eafeb9a4 |
@ -82,7 +82,7 @@ public class EntranceUtils {
|
||||
public static final String KEY_MESSAGE_TYPE = "messageType";
|
||||
public static final String KEY_QUESTIONS_SEARCH_KEY = "questionsSearchKey";
|
||||
public static final String KEY_SHOW_ANSWER_COMMENT = "showAnswerComment";
|
||||
public static final String KEY_RECOMMENDS_ANSWER = "isRecommendsAnswer";
|
||||
public static final String KEY_RECOMMENDS_CONTENTS = "isRecommendsContents";
|
||||
public static final String KEY_VERSION_UPDATE = "versionUpdate";
|
||||
public static final String KEY_CHECK_QUESTION_CONCERN = "check_question_concern";
|
||||
public static final String KEY_DRAFT_ID = "draft_id";
|
||||
|
||||
@ -159,7 +159,7 @@ public class LoginUtils {
|
||||
Utils.toast(context, R.string.post_failure_hint);
|
||||
break;
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
} catch (Exception e) {
|
||||
Utils.toast(context, R.string.post_failure_hint);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -47,7 +47,9 @@ object MtaHelper {
|
||||
prop.setProperty("机型", Build.MODEL)
|
||||
prop.setProperty("厂商", Build.MANUFACTURER)
|
||||
prop.setProperty("Android版本", Build.VERSION.RELEASE)
|
||||
prop.setProperty("GID", HaloApp.getInstance().gid)
|
||||
if (!TextUtils.isEmpty(HaloApp.getInstance().gid)) {
|
||||
prop.setProperty("GID", HaloApp.getInstance().gid)
|
||||
}
|
||||
|
||||
StatService.trackCustomKVEvent(HaloApp.getInstance().application, eventId, prop)
|
||||
}
|
||||
|
||||
@ -139,7 +139,6 @@ class GameFragment : NormalFragment() {
|
||||
mBinding?.gameList?.addOnScrollListener(mExposureListener)
|
||||
|
||||
mBinding?.gameRefresh?.setOnRefreshListener {
|
||||
mViewModel?.loadStatus?.postValue(LoadStatus.INIT_LOADING)
|
||||
mViewModel?.initData()
|
||||
}
|
||||
|
||||
|
||||
@ -312,13 +312,15 @@ class GameFragmentAdapter(context: Context, model: GameViewModel, var blockName:
|
||||
j++
|
||||
}
|
||||
}
|
||||
} else if (slideList != null && pagerAdapter != null) {
|
||||
} else if (slideList != null && slideList.isNotEmpty() && pagerAdapter != null) {
|
||||
(pagerAdapter as ImagePagerAdapter).checkResetData(slideList)
|
||||
} else if (slideList == null || slideList.isEmpty()) {
|
||||
binding.viewPager.adapter = null
|
||||
}
|
||||
|
||||
if (mViewModel.blockData != null) {
|
||||
if (slideList!!.isEmpty()) binding.viewpagerContainer.visibility = View.GONE
|
||||
if (subjectDigestList!!.isEmpty()) binding.entranceContainer.visibility = View.GONE
|
||||
binding.viewpagerContainer.visibility = if (slideList!!.isEmpty()) View.GONE else View.VISIBLE
|
||||
binding.entranceContainer.visibility = if (subjectDigestList!!.isEmpty()) View.GONE else View.VISIBLE
|
||||
}
|
||||
|
||||
if (isAutoScroll) {
|
||||
|
||||
@ -225,7 +225,7 @@ class GameViewModel(application: Application, blockData: SubjectRecommendEntity?
|
||||
}
|
||||
|
||||
override fun onFailure(e: HttpException?) {
|
||||
if (initData && slideList == null && subjectDigestList == null) {
|
||||
if (initData && slideList.isEmpty() && subjectDigestList.isEmpty()) {
|
||||
loadStatus.postValue(LoadStatus.INIT_FAILED)
|
||||
} else {
|
||||
loadStatus.postValue(LoadStatus.LIST_FAILED)
|
||||
|
||||
@ -369,7 +369,7 @@ public class GameDetailFragment extends NormalFragment {
|
||||
switch (menuItem.getItemId()) {
|
||||
case R.id.menu_concern:
|
||||
CheckLoginUtils.checkLogin(getContext(), () -> {
|
||||
if (mGameDetailEntity.getMe().isGameConcerned()) {
|
||||
if (mGameDetailEntity != null && mGameDetailEntity.getMe().isGameConcerned()) {
|
||||
DialogUtils.showCancelDialog(getContext(), () -> mViewModel.concernCommand(false), null);
|
||||
} else {
|
||||
mViewModel.concernCommand(true);
|
||||
|
||||
@ -85,7 +85,7 @@ class RatingAdapter(context: Context,
|
||||
skipRatingEdit(rating)
|
||||
// 与传进评论编辑的星星保持一致
|
||||
ratingSelector.postDelayed({
|
||||
ratingSelector.rating = rating
|
||||
ratingSelector.rating = 0F
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,11 +100,13 @@ public class KaiFuVpAdapter extends BaseRecyclerAdapter {
|
||||
manager.addOrUpdate(entity);
|
||||
ApkActiveUtils.filterHideApk(entity); // 过滤隐藏apk
|
||||
|
||||
GameEntity fixedTopItem = null;
|
||||
|
||||
// 设置置顶部分
|
||||
if (i == 0) {
|
||||
// 列表顶部,若有设置置顶应用就增加置顶头部
|
||||
if (mEntityList.size() == 0 && entity.getFixedTop()) {
|
||||
GameEntity fixedTopItem = new GameEntity();
|
||||
fixedTopItem = new GameEntity();
|
||||
fixedTopItem.setFixedTopHint(true);
|
||||
fixedTopItem.setFixedTop(true);
|
||||
response.add(i, fixedTopItem);
|
||||
@ -147,6 +149,11 @@ public class KaiFuVpAdapter extends BaseRecyclerAdapter {
|
||||
}
|
||||
|
||||
if (i < response.size() - 1) {
|
||||
// 为置顶的项目添加第一个存在时间的游戏的开服时间
|
||||
if (fixedTopItem != null && fixedTopItem.getKaifuTimeHint() == null) {
|
||||
fixedTopItem.setKaifuTimeHint(entity.getServerEntity().getTime());
|
||||
}
|
||||
|
||||
KaiFuCalendarEntity serverEntity = entity.getServerEntity();
|
||||
KaiFuCalendarEntity nextServerEntity = response.get(i + 1).getServerEntity();
|
||||
if (serverEntity == null || nextServerEntity == null) continue;
|
||||
|
||||
@ -146,6 +146,7 @@ public class KaiFuVpFragment extends BaseFragment {
|
||||
|
||||
if (fixedTopHint) {
|
||||
mKaifuItemTimeTv.setText("热门开服");
|
||||
mKaifuItemTimeTv.setTag(timeGameEntity.getKaifuTimeHint());
|
||||
mKaifuItemHeaderIv.setImageResource(R.drawable.ic_kaifu_hot);
|
||||
} else {
|
||||
Long timeHint = timeGameEntity.getKaifuTimeHint();
|
||||
|
||||
@ -35,7 +35,7 @@ public class AnswerDetailActivity extends NormalActivity {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceUtils.KEY_ANSWER_ID, answerId);
|
||||
bundle.putString(EntranceUtils.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path));
|
||||
bundle.putBoolean(EntranceUtils.KEY_RECOMMENDS_ANSWER, true);
|
||||
bundle.putBoolean(EntranceUtils.KEY_RECOMMENDS_CONTENTS, true);
|
||||
bundle.putString(EntranceUtils.KEY_PATH, path);
|
||||
return getTargetIntent(context, AnswerDetailActivity.class, AnswerDetailFragment.class, bundle);
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ public class AnswerDetailFragment extends NormalFragment {
|
||||
Bundle arguments = getArguments();
|
||||
mAnswerId = arguments.getString(EntranceUtils.KEY_ANSWER_ID);
|
||||
mIsShowCommentManager = arguments.getBoolean(EntranceUtils.KEY_SHOW_ANSWER_COMMENT, false);
|
||||
mIsRecommendsAnswer = arguments.getBoolean(EntranceUtils.KEY_RECOMMENDS_ANSWER, false);
|
||||
mIsRecommendsAnswer = arguments.getBoolean(EntranceUtils.KEY_RECOMMENDS_CONTENTS, false);
|
||||
mPath = arguments.getString(EntranceUtils.KEY_PATH);
|
||||
mViewModel.getAnswerDetail(mAnswerId, mEntrance);
|
||||
}
|
||||
@ -653,10 +653,12 @@ public class AnswerDetailFragment extends NormalFragment {
|
||||
|
||||
mBinding.answerDetailFollow.setVisibility(View.VISIBLE);
|
||||
if (mDetailEntity.getMe().isAnswerOwn()) {
|
||||
mBinding.answerDetailFollow.setEnabled(false);
|
||||
mBinding.answerDetailFollow.setText(R.string.myself);
|
||||
mBinding.answerDetailFollow.setTextColor(ContextCompat.getColor(getContext(), R.color.button_gray));
|
||||
mBinding.answerDetailFollow.setBackgroundResource(R.drawable.button_border_gray);
|
||||
} else {
|
||||
mBinding.answerDetailFollow.setEnabled(true);
|
||||
if (mDetailEntity.getMe().isFollower()) {
|
||||
updateFollowBtn(true);
|
||||
} else {
|
||||
|
||||
@ -48,10 +48,11 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
|
||||
private val mArticleImgs = ArrayList<String>()
|
||||
|
||||
private var mIsShowCommentManager: Boolean = false
|
||||
|
||||
private var mElapsedHelper: TimeElapsedHelper? = null
|
||||
|
||||
private var mIsShowCommentManager: Boolean = false
|
||||
private var mIsRecommendsContent: Boolean = false
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == ARTICLE_PATCH_REQUEST && resultCode == Activity.RESULT_OK) {
|
||||
@ -93,6 +94,7 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
setNavigationTitle(getString(R.string.community_article_detail_title))
|
||||
|
||||
mIsShowCommentManager = intent.getBooleanExtra(EntranceUtils.KEY_SHOW_ARTICLE_COMMENT, false)
|
||||
mIsRecommendsContent = intent.getBooleanExtra(EntranceUtils.KEY_RECOMMENDS_CONTENTS, false)
|
||||
|
||||
mBinding = ActivityArticleDetailBinding.bind(mContentView)
|
||||
mBinding.articleDetailRd.setInputEnabled(false)
|
||||
@ -109,7 +111,23 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
if (it.exception?.code() == 404) {
|
||||
mNoConn.visibility = View.GONE
|
||||
mNoneData.visibility = View.VISIBLE
|
||||
toast(R.string.content_delete_toast)
|
||||
if (mIsRecommendsContent) {
|
||||
DialogUtils.showAlertDialog(this, "提示", "很抱歉,内容可能已被删除", "关闭", null, {
|
||||
val data = Intent()
|
||||
data.putExtra(EntranceUtils.KEY_ANSWER_ID, mViewModel.articleId)
|
||||
setResult(Activity.RESULT_OK, data)
|
||||
finish()
|
||||
}, null)
|
||||
} else {
|
||||
toast(R.string.content_delete_toast)
|
||||
}
|
||||
|
||||
val menu = menu
|
||||
if (menu != null) {
|
||||
for (i in 0 until menu.size()) {
|
||||
menu.getItem(i).isVisible = false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mNoConn.visibility = View.VISIBLE
|
||||
mNoneData.visibility = View.GONE
|
||||
@ -170,23 +188,28 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.article_detail_comment_count_container -> {
|
||||
val intent = CommentActivity.getArticleCommentIntent(this, mViewModel.articleId!!
|
||||
, mViewModel.detailEntity?.count?.comment, "", false
|
||||
, mViewModel.detailEntity?.community?.id!!)
|
||||
startActivityForResult(intent, CommentActivity.REQUEST_CODE)
|
||||
if (mViewModel.detailEntity != null) {
|
||||
val intent = CommentActivity.getArticleCommentIntent(this, mViewModel.articleId!!
|
||||
, mViewModel.detailEntity?.count?.comment, ""
|
||||
, mViewModel.detailEntity?.count?.comment == 0
|
||||
, mViewModel.detailEntity?.community?.id!!)
|
||||
startActivityForResult(intent, CommentActivity.REQUEST_CODE)
|
||||
}
|
||||
}
|
||||
R.id.article_detail_like_container -> {
|
||||
CheckLoginUtils.checkLogin(this) {
|
||||
if (!mViewModel.detailEntity?.me?.isCommunityArticleVote!!) {
|
||||
mViewModel.articleVote {
|
||||
val me = mViewModel.detailEntity?.me
|
||||
me?.isCommunityArticleVote = true
|
||||
mViewModel.detailEntity?.me = me!!
|
||||
mViewModel.detailEntity?.count?.vote = mViewModel.detailEntity?.count?.vote!! + 1
|
||||
updateVote()
|
||||
if (mViewModel.detailEntity != null) {
|
||||
CheckLoginUtils.checkLogin(this) {
|
||||
if (!mViewModel.detailEntity?.me?.isCommunityArticleVote!!) {
|
||||
mViewModel.articleVote {
|
||||
val me = mViewModel.detailEntity?.me
|
||||
me?.isCommunityArticleVote = true
|
||||
mViewModel.detailEntity?.me = me!!
|
||||
mViewModel.detailEntity?.count?.vote = mViewModel.detailEntity?.count?.vote!! + 1
|
||||
updateVote()
|
||||
}
|
||||
} else {
|
||||
toast(R.string.ask_vote_hint)
|
||||
}
|
||||
} else {
|
||||
toast(R.string.ask_vote_hint)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -196,23 +219,28 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
mViewModel.getArticleDetail()
|
||||
}
|
||||
R.id.article_detail_follow -> {
|
||||
CheckLoginUtils.checkLogin(this) {
|
||||
if (mBinding.articleDetailFollow.text == "关注") {
|
||||
mViewModel.follow()
|
||||
} else {
|
||||
DialogUtils.showAlertDialog(this,
|
||||
"取消关注",
|
||||
"确定要取消关注 ${mViewModel.detailEntity?.user?.name} 吗?",
|
||||
"确定取消",
|
||||
"暂不取消",
|
||||
DialogUtils.ConfirmListener {
|
||||
mViewModel.unfollow()
|
||||
}, null)
|
||||
if (mViewModel.detailEntity != null) {
|
||||
CheckLoginUtils.checkLogin(this) {
|
||||
if (mBinding.articleDetailFollow.text == "关注") {
|
||||
mViewModel.follow()
|
||||
} else {
|
||||
DialogUtils.showAlertDialog(this,
|
||||
"取消关注",
|
||||
"确定要取消关注 ${mViewModel.detailEntity?.user?.name} 吗?",
|
||||
"确定取消",
|
||||
"暂不取消",
|
||||
DialogUtils.ConfirmListener {
|
||||
mViewModel.unfollow()
|
||||
}, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
R.id.article_detail_usericon_container, R.id.article_detail_username -> {
|
||||
PersonalHomeActivity.startTargetActivity(this, mViewModel.detailEntity?.user?.id, mEntrance, "社区文章详情")
|
||||
if (mViewModel.detailEntity != null) {
|
||||
PersonalHomeActivity.startTargetActivity(this,
|
||||
mViewModel.detailEntity?.user?.id, mEntrance, "社区文章详情")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -362,10 +390,12 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
|
||||
mBinding.articleDetailFollow.visibility = View.VISIBLE
|
||||
if (mViewModel.detailEntity?.user?.id == UserManager.getInstance().userId) {
|
||||
mBinding.articleDetailFollow.isEnabled = false
|
||||
mBinding.articleDetailFollow.setText(R.string.myself)
|
||||
mBinding.articleDetailFollow.setTextColor(ContextCompat.getColor(this, R.color.button_gray))
|
||||
mBinding.articleDetailFollow.setBackgroundResource(R.drawable.button_border_gray)
|
||||
} else {
|
||||
mBinding.articleDetailFollow.isEnabled = true
|
||||
if (mViewModel.detailEntity?.me?.isFollower!!) {
|
||||
updateFollowBtn(true)
|
||||
} else {
|
||||
@ -431,5 +461,15 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
intent.putExtra(EntranceUtils.KEY_SHOW_ARTICLE_COMMENT, true)
|
||||
return intent
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getRecommendsIntent(context: Context, community: CommunityEntity, articleId: String, entrance: String, path: String): Intent {
|
||||
val intent = Intent(context, ArticleDetailActivity::class.java)
|
||||
intent.putExtra(EntranceUtils.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceUtils.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
intent.putExtra(EntranceUtils.KEY_COMMUNITY_DATA, community)
|
||||
intent.putExtra(EntranceUtils.KEY_RECOMMENDS_CONTENTS, true)
|
||||
return intent
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ class ArticleEditActivity : BaseActivity() {
|
||||
|
||||
// 获取新闻内容(编辑草稿时)
|
||||
mViewModel?.articleDraftsContent?.observe(this, Observer {
|
||||
mEditContent.setHtml(it, false)
|
||||
setEditHtml(it)
|
||||
})
|
||||
|
||||
mViewModel?.titleTags?.observe(this, Observer<List<String>> {
|
||||
@ -219,37 +219,36 @@ class ArticleEditActivity : BaseActivity() {
|
||||
private fun setArticleDraft() {
|
||||
mViewModel?.mSelectCommunityData = mViewModel?.draftEntity?.community
|
||||
mEditTitle.setText(mViewModel?.draftEntity?.title)
|
||||
mEditTitle.isFocusable = false
|
||||
mDraftBtn.visibility = View.GONE
|
||||
mGameName.isEnabled = true
|
||||
setGameName()
|
||||
mViewModel?.getArticleDraftsContent(mViewModel?.draftEntity?.id!!)
|
||||
mViewModel?.getDefaultTag()
|
||||
mEditContent.focusEditor()
|
||||
mEditContent.setOnInitialLoadListener { isReady ->
|
||||
if (isReady) {
|
||||
mEditContent.scrollTo(0, 10000000)
|
||||
try {
|
||||
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.showSoftInput(mEditContent, InputMethodManager.SHOW_IMPLICIT)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
mEditContent.postDelayed({ mEditContent.focusEditor() }, 800)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setPatchContent() {
|
||||
mViewModel?.mSelectCommunityData = mViewModel?.detailEntity?.community
|
||||
mEditTitle.setText(mViewModel?.detailEntity?.title)
|
||||
mEditContent.setHtml(mViewModel?.detailEntity?.content, false)
|
||||
setEditHtml(mViewModel?.detailEntity?.content)
|
||||
mDraftBtn.visibility = View.GONE
|
||||
mGameName.isEnabled = false
|
||||
setGameName()
|
||||
mGameName.setTextColor(resources.getColor(R.color.hint))
|
||||
}
|
||||
|
||||
private fun setEditHtml(html: String?) {
|
||||
mEditContent.setHtml(html, false)
|
||||
try {
|
||||
mEditContent.scrollTo(0, 10000000)
|
||||
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.showSoftInput(mEditContent, InputMethodManager.SHOW_IMPLICIT)
|
||||
mEditContent.postDelayed({ mEditContent.focusEditor() }, 800)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun handleBackPressed(): Boolean {
|
||||
if (TextUtils.isEmpty(UserManager.getInstance().token)) {
|
||||
return false
|
||||
|
||||
@ -52,7 +52,7 @@ class HotAdapter(context: Context,
|
||||
if ("community_article" == answerEntity.type) {
|
||||
mContext.startActivity(ArticleDetailActivity.getIntent(mContext, UserManager.getInstance().community, answerEntity.id!!, mEntrance, mPath))
|
||||
} else {
|
||||
mContext.startActivity(AnswerDetailActivity.getRecommendsIntent(mContext, answerEntity.id, mEntrance, mPath))
|
||||
mContext.startActivity(AnswerDetailActivity.getIntent(mContext, answerEntity.id, mEntrance, mPath))
|
||||
}
|
||||
}
|
||||
holder.mAskTitle.setOnClickListener {
|
||||
|
||||
@ -52,7 +52,7 @@ class RecommendsAdapter(context: Context,
|
||||
if ("community_article" == answerEntity.type) {
|
||||
mContext.startActivity(ArticleDetailActivity.getIntent(mContext, UserManager.getInstance().community, answerEntity.id!!, mEntrance, mPath))
|
||||
} else {
|
||||
mContext.startActivity(AnswerDetailActivity.getRecommendsIntent(mContext, answerEntity.id, mEntrance, mPath))
|
||||
mContext.startActivity(AnswerDetailActivity.getIntent(mContext, answerEntity.id, mEntrance, mPath))
|
||||
}
|
||||
}
|
||||
holder.mAskTitle.setOnClickListener {
|
||||
|
||||
@ -100,13 +100,15 @@ public class CommentFragment extends ListFragment<CommentEntity, CommentViewMode
|
||||
|
||||
mCommentCount++;
|
||||
updateCommentCount();
|
||||
setSoftInput(false);
|
||||
onRefresh();
|
||||
|
||||
if (mCommentListener != null) {
|
||||
mCommentListener.onCountChange(mCommentCount);
|
||||
mCommentListener.onCommentDraftChange("");
|
||||
}
|
||||
mCommentDetailCommentEt.postDelayed(() -> {
|
||||
setSoftInput(false);
|
||||
}, 100);
|
||||
} else if (apiResponse.getHttpException() != null) {
|
||||
mSendingDialog.dismiss();
|
||||
|
||||
|
||||
@ -126,7 +126,10 @@ public class AskQuestionsRecommendsFragment extends ListFragment<AnswerEntity, A
|
||||
|
||||
@Override
|
||||
protected void hideRefreshingLayout() {
|
||||
getSwipeRefreshHeader().postDelayed(() -> getDumbRefreshLayout().finishRefresh(0), 200);
|
||||
getSwipeRefreshHeader().postDelayed(() -> {
|
||||
getSwipeRefreshHeader().setFinishText("没有新内容,请稍后再试");
|
||||
getDumbRefreshLayout().finishRefresh(0);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -192,7 +195,7 @@ public class AskQuestionsRecommendsFragment extends ListFragment<AnswerEntity, A
|
||||
case R.id.ask_item_title:
|
||||
answerEntity = (AnswerEntity) data;
|
||||
if ("community_article".equals(answerEntity.getType())) {
|
||||
startActivity(ArticleDetailActivity.getIntent(getContext(), UserManager.getInstance().getCommunity(), answerEntity.getId(), "", path));
|
||||
startActivityForResult(ArticleDetailActivity.getRecommendsIntent(getContext(), UserManager.getInstance().getCommunity(), answerEntity.getId(), "", path), RECOMMEDS_REQUEST_CODE);
|
||||
} else {
|
||||
Questions questions = answerEntity.getQuestions();
|
||||
startActivity(QuestionsDetailActivity.getIntent(getContext(), questions.getId(), "", path));
|
||||
@ -201,7 +204,7 @@ public class AskQuestionsRecommendsFragment extends ListFragment<AnswerEntity, A
|
||||
case R.id.ask_item_constraintlayout:
|
||||
answerEntity = (AnswerEntity) data;
|
||||
if ("community_article".equals(answerEntity.getType())) {
|
||||
startActivity(ArticleDetailActivity.getIntent(getContext(), UserManager.getInstance().getCommunity(), answerEntity.getId(), "", path));
|
||||
startActivityForResult(ArticleDetailActivity.getRecommendsIntent(getContext(), UserManager.getInstance().getCommunity(), answerEntity.getId(), "", path), RECOMMEDS_REQUEST_CODE);
|
||||
} else {
|
||||
startActivityForResult(AnswerDetailActivity.getRecommendsIntent(getContext(), answerEntity.getId(), "", path), RECOMMEDS_REQUEST_CODE);
|
||||
}
|
||||
|
||||
@ -29,9 +29,6 @@ import retrofit2.Callback;
|
||||
|
||||
public class AskQuestionsRecommendsViewModel extends BaseListViewModel<AnswerEntity> {
|
||||
|
||||
|
||||
private final static String SUBJECT_DATA_KEY = "subject_data_key";
|
||||
|
||||
/**
|
||||
* 等于 0 刷新结束(没有内容了)
|
||||
* 小于 0 刷新失败
|
||||
@ -194,7 +191,7 @@ public class AskQuestionsRecommendsViewModel extends BaseListViewModel<AnswerEnt
|
||||
case NORMAL:
|
||||
for (int i = value.size() - 1; i >= 0; i--) {
|
||||
AnswerEntity entity = value.get(i);
|
||||
if (!entity.getPrimaryKey().contains(SUBJECT_DATA_KEY)) {
|
||||
if (!TextUtils.isEmpty(entity.getSequenceId())) {
|
||||
sequenceId = entity.getSequenceId();
|
||||
break;
|
||||
}
|
||||
@ -203,7 +200,7 @@ public class AskQuestionsRecommendsViewModel extends BaseListViewModel<AnswerEnt
|
||||
break;
|
||||
case REFRESH: {
|
||||
for (AnswerEntity entity : value) {
|
||||
if (!entity.getPrimaryKey().contains(SUBJECT_DATA_KEY)) {
|
||||
if (!TextUtils.isEmpty(entity.getSequenceId())) {
|
||||
sequenceId = entity.getSequenceId();
|
||||
break;
|
||||
}
|
||||
@ -234,7 +231,7 @@ public class AskQuestionsRecommendsViewModel extends BaseListViewModel<AnswerEnt
|
||||
|
||||
String sequenceId = null;
|
||||
for (AnswerEntity entity : entityList) {
|
||||
if (!entity.getPrimaryKey().contains(SUBJECT_DATA_KEY)) {
|
||||
if (!TextUtils.isEmpty(entity.getSequenceId())) {
|
||||
sequenceId = entity.getSequenceId();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ class RecommendNewestAdapter(context: Context) : ListAdapter<AnswerEntity>(conte
|
||||
if ("community_article" == answerEntity.type) {
|
||||
mContext.startActivity(ArticleDetailActivity.getIntent(mContext, UserManager.getInstance().community, answerEntity.id!!, "", path))
|
||||
} else {
|
||||
mContext.startActivity(AnswerDetailActivity.getRecommendsIntent(mContext, answerEntity.id, "", path))
|
||||
mContext.startActivity(AnswerDetailActivity.getIntent(mContext, answerEntity.id, "", path))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,10 +74,14 @@ class OpenedAdapter(context: Context, val mListViewModel: OpenedViewModel) : Lis
|
||||
holder.loading.visibility = View.GONE
|
||||
holder.hint.setText(R.string.ask_game_suggestion)
|
||||
}
|
||||
else -> {
|
||||
mIsLoading -> {
|
||||
holder.loading.visibility = View.VISIBLE
|
||||
holder.hint.setText(R.string.loading)
|
||||
}
|
||||
else -> {
|
||||
holder.loading.visibility = View.GONE
|
||||
holder.hint.setText(R.string.loading_more_hint)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
holder.itemView.setBackgroundColor(ContextCompat.getColor(mContext, R.color.background))
|
||||
@ -90,12 +94,18 @@ class OpenedAdapter(context: Context, val mListViewModel: OpenedViewModel) : Lis
|
||||
holder.hint.setCompoundDrawables(null, null, null, null)
|
||||
holder.hint.setPadding(0, 0, 0, 0)
|
||||
item.gravity = Gravity.CENTER
|
||||
} else {
|
||||
} else if (mIsLoading) {
|
||||
holder.loading.visibility = View.VISIBLE
|
||||
holder.hint.setText(R.string.loading)
|
||||
holder.hint.setCompoundDrawables(null, null, null, null)
|
||||
holder.hint.setPadding(0, 0, 0, 0)
|
||||
item.gravity = Gravity.CENTER
|
||||
} else {
|
||||
holder.loading.visibility = View.GONE
|
||||
holder.hint.setText(R.string.loading_more_hint)
|
||||
holder.hint.setCompoundDrawables(null, null, null, null)
|
||||
holder.hint.setPadding(0, 0, 0, 0)
|
||||
item.gravity = Gravity.CENTER
|
||||
}
|
||||
if (!mIsOver) {
|
||||
holder.itemView.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
|
||||
@ -103,9 +103,12 @@ public class VotingAdapter extends ListAdapter<AskGameSelectEntity> {
|
||||
} else if (mIsOver) {
|
||||
footerViewHolder.loading.setVisibility(View.GONE);
|
||||
footerViewHolder.hint.setText(R.string.ask_game_suggestion);
|
||||
} else {
|
||||
} else if (mIsLoading) {
|
||||
footerViewHolder.loading.setVisibility(View.VISIBLE);
|
||||
footerViewHolder.hint.setText(R.string.loading);
|
||||
} else {
|
||||
footerViewHolder.loading.setVisibility(View.GONE);
|
||||
footerViewHolder.hint.setText(R.string.loading_more_hint);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -20,8 +20,7 @@
|
||||
android:layout_width = "match_parent"
|
||||
android:layout_height = "wrap_content"
|
||||
android:orientation = "horizontal"
|
||||
android:paddingBottom = "15dp"
|
||||
android:paddingTop = "15dp" >
|
||||
android:paddingBottom = "15dp" >
|
||||
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id = "@+id/game_icon"
|
||||
@ -29,10 +28,24 @@
|
||||
imageUrl = "@{game.icon}"
|
||||
android:layout_width = "60dp"
|
||||
android:layout_height = "60dp"
|
||||
android:layout_marginTop = "15dp"
|
||||
app:layout_constraintLeft_toLeftOf = "parent"
|
||||
app:layout_constraintRight_toRightOf = "parent"
|
||||
app:layout_constraintTop_toTopOf = "parent"
|
||||
fresco:roundedCornerRadius = "10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id = "@+id/game_libao_icon"
|
||||
visibleGone = "@{game.libaoExists}"
|
||||
android:layout_width = "25dp"
|
||||
android:layout_height = "25dp"
|
||||
android:src = "@drawable/game_libao_icon"
|
||||
android:visibility = "visible"
|
||||
android:layout_marginRight="46dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintRight_toRightOf="@id/game_icon"/>
|
||||
|
||||
<TextView
|
||||
android:id = "@+id/game_name"
|
||||
android:layout_width = "80dp"
|
||||
|
||||
@ -21,7 +21,7 @@ org.gradle.parallel=true
|
||||
channel_file=channel.txt
|
||||
|
||||
# tinker patch version_name
|
||||
PATCH_VERSION_NAME=3.5
|
||||
PATCH_VERSION_NAME=3.5.1
|
||||
|
||||
# Third-party keys
|
||||
DEBUG_UMENG_APPKEY=58e5b0b9c62dca35a00005e6
|
||||
|
||||
Submodule libraries/LGLibrary updated: 924aa0d41d...671804fa6d
Reference in New Issue
Block a user