diff --git a/app/src/main/java/com/gh/gamecenter/adapter/AskSelectGameAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/AskSelectGameAdapter.java index b99ca90c32..c8a072479f 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/AskSelectGameAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/AskSelectGameAdapter.java @@ -1,6 +1,7 @@ package com.gh.gamecenter.adapter; import android.content.Context; +import android.graphics.Color; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; @@ -143,8 +144,8 @@ public class AskSelectGameAdapter extends ListAdapter { bodyHolder.mVoteBtn.setTextColor(ContextCompat.getColor(mContext, R.color.content)); bodyHolder.mVoteBtn.setText(R.string.voted); } else { - bodyHolder.mVoteBtn.setBackgroundResource(R.drawable.comment_border_bg); - bodyHolder.mVoteBtn.setTextColor(ContextCompat.getColor(mContext, R.color.theme)); + bodyHolder.mVoteBtn.setBackgroundResource(R.drawable.button_normal_style); + bodyHolder.mVoteBtn.setTextColor(Color.WHITE); bodyHolder.mVoteBtn.setText(R.string.vote); } } diff --git a/app/src/main/java/com/gh/gamecenter/adapter/VoteAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/VoteAdapter.java index 79b6e4ee74..4c30f5edba 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/VoteAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/VoteAdapter.java @@ -64,8 +64,8 @@ public class VoteAdapter extends ListAdapter { VersionVoteEntity versionVoteEntity = mEntityList.get(position); UserDataEntity userData = versionVoteEntity.getUserData(); if (userData != null && userData.isVersionRequested()) { - viewHolder.voteBtn.setBackgroundResource(R.drawable.button_normal_border); - viewHolder.voteBtn.setTextColor(ContextCompat.getColor(mContext, R.color.theme)); + viewHolder.voteBtn.setBackgroundResource(R.drawable.border_suggest_bg); + viewHolder.voteBtn.setTextColor(ContextCompat.getColor(mContext, R.color.content)); viewHolder.voteBtn.setText(R.string.voted); viewHolder.voteBtn.setEnabled(false); } else { diff --git a/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java b/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java index 3d270208c7..9a257702a6 100644 --- a/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java +++ b/app/src/main/java/com/gh/gamecenter/ask/AnswerDetailFragment.java @@ -110,6 +110,10 @@ public class AnswerDetailFragment extends NormalFragment { TextView mAnswerDetailLikeTv; @BindView(R.id.answer_detail_comment_like_iv) ImageView mAnswerDetailLiveIv; + @BindView(R.id.answer_detail_line) + View mDividerView; + @BindView(R.id.answer_detail_comment_container) + View mBottomContainer; private static final int ANSWER_STATUS_UNKNOWN = 0; private static final int ANSWERED_MY_ANSWER = 1; @@ -227,16 +231,19 @@ public class AnswerDetailFragment extends NormalFragment { HttpException e = apiResponse.getHttpException(); try { if (e != null && e.code() == 404 && e.response().errorBody().string().length() > 0) { + mBottomContainer.setVisibility(View.GONE); mNoDataTv.setText(R.string.content_delete_hint); mNoData.setVisibility(View.VISIBLE); mNoConn.setVisibility(View.GONE); mLoading.setVisibility(View.GONE); mContent.setVisibility(View.GONE); + mDividerView.setVisibility(View.GONE); Utils.toast(getContext(), R.string.content_delete_toast); } else { mNoConn.setVisibility(View.VISIBLE); mLoading.setVisibility(View.GONE); mContent.setVisibility(View.GONE); + mBottomContainer.setVisibility(View.GONE); } } catch (IOException e1) { e1.printStackTrace(); diff --git a/app/src/main/java/com/gh/gamecenter/ask/AskFragment.java b/app/src/main/java/com/gh/gamecenter/ask/AskFragment.java index 5d03e61ba0..30541b1018 100644 --- a/app/src/main/java/com/gh/gamecenter/ask/AskFragment.java +++ b/app/src/main/java/com/gh/gamecenter/ask/AskFragment.java @@ -2,7 +2,9 @@ package com.gh.gamecenter.ask; import android.app.Activity; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; +import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; @@ -58,13 +60,33 @@ public class AskFragment extends BaseFragment { View mAskTabBar; @BindView(R.id.ask_loading) View mLoading; + @BindView(R.id.select_game_hint) + View mSelectGameHint; + private SharedPreferences sp; + private boolean mHasClickedSelectGame; private AskQuestionsRecommendsFragment mRecommendsFragment; public static final int INDEX_HOT = 0; public static final int INDEX_QUESTIONS = 1; // communities public static final int COMMUNITIES_SELECT_REQUEST = 103; + private static final String SP_KEY_CLICKED_SELECT_GAME = "has_clicked_select_game"; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + sp = PreferenceManager.getDefaultSharedPreferences(getContext()); + mHasClickedSelectGame = sp.getBoolean(SP_KEY_CLICKED_SELECT_GAME, false); + } + + @Override + public void onResume() { + super.onResume(); + + mSelectGameHint.setVisibility(!mHasClickedSelectGame ? View.VISIBLE : View.GONE); + } + @Override protected int getLayoutId() { return R.layout.fragment_ask; @@ -91,19 +113,18 @@ public class AskFragment extends BaseFragment { mAskGamename.setText(UserManager.getInstance().getCommunityName(getContext())); initViewPager(); setTabbarPosition(INDEX_HOT); - mAskGamename.setOnTouchListener(new onDoubleTapListener(getContext()) { - @Override - public void onDoubleTap() { - mRecommendsFragment.scrollToTop(); - } - }); } + } @OnClick({R.id.ask_selectgame, R.id.ask_search, R.id.ask_hot, R.id.ask_questions, R.id.reuse_no_connection}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.ask_selectgame: + if (!mHasClickedSelectGame) { + mHasClickedSelectGame = true; + sp.edit().putBoolean(SP_KEY_CLICKED_SELECT_GAME, mHasClickedSelectGame).apply(); + } startActivityForResult(CommunitiesSelectActivity.getIntent(getContext()), COMMUNITIES_SELECT_REQUEST); break; case R.id.ask_search: @@ -131,6 +152,13 @@ public class AskFragment extends BaseFragment { fragmentList.add(new AskQuestionsNewFragment()); mAskViewpager.setAdapter(new FragmentAdapter(getChildFragmentManager(), fragmentList)); mAskViewpager.setScrollable(false); + + mAskGamename.setOnTouchListener(new onDoubleTapListener(getContext()) { + @Override + public void onDoubleTap() { + mRecommendsFragment.scrollToTop(); + } + }); } private void setTabbarPosition(int index) { diff --git a/app/src/main/res/layout/fragment_ask.xml b/app/src/main/res/layout/fragment_ask.xml index d9b72ed252..cb27c980fe 100644 --- a/app/src/main/res/layout/fragment_ask.xml +++ b/app/src/main/res/layout/fragment_ask.xml @@ -1,6 +1,7 @@ @@ -10,7 +11,6 @@ android:layout_height = "wrap_content" android:background = "@android:color/white" > - + +