diff --git a/app/src/main/java/com/gh/common/util/DownloadItemUtils.java b/app/src/main/java/com/gh/common/util/DownloadItemUtils.java index e4bf4ab7ee..86d9eccd5c 100644 --- a/app/src/main/java/com/gh/common/util/DownloadItemUtils.java +++ b/app/src/main/java/com/gh/common/util/DownloadItemUtils.java @@ -2,6 +2,7 @@ package com.gh.common.util; import android.content.Context; import android.content.Intent; +import android.content.res.ColorStateList; import android.graphics.Color; import android.os.Message; import android.support.v4.util.ArrayMap; @@ -259,6 +260,13 @@ public class DownloadItemUtils { String platform = PlatformUtils.getInstance(context) .getPlatformName(downloadEntry.getMeta().get("platform")); + int[] btn_colors = new int[] { Color.WHITE + , context.getResources().getColor(R.color.theme) }; + int[][] states = new int[2][]; + states[0] = new int[] { android.R.attr.state_pressed }; + states[1] = new int[] {}; + ColorStateList btn_sl = new ColorStateList(states, btn_colors); + DownloadStatus status = downloadEntry.getStatus(); if (status.equals(DownloadStatus.downloading)) { if (!"pause".equals(DownloadManager.getInstance(context).getStatus(downloadEntry.getUrl()))) { @@ -277,7 +285,7 @@ public class DownloadItemUtils { if (isNormal) { downloadBtn.setText("下载中"); downloadBtn.setBackgroundResource(R.drawable.game_item_btn_downloading_style); - downloadBtn.setTextColor(context.getResources().getColor(R.color.theme)); + downloadBtn.setTextColor(btn_sl); } } else if (status.equals(DownloadStatus.waiting)) { game_progressbar.setProgress((int) (downloadEntry.getPercent() * 10)); @@ -291,7 +299,7 @@ public class DownloadItemUtils { if (isNormal) { downloadBtn.setText("下载中"); downloadBtn.setBackgroundResource(R.drawable.game_item_btn_downloading_style); - downloadBtn.setTextColor(context.getResources().getColor(R.color.theme)); + downloadBtn.setTextColor(btn_sl); } } else if (status.equals(DownloadStatus.pause) || status.equals(DownloadStatus.timeout) @@ -307,7 +315,7 @@ public class DownloadItemUtils { if (isNormal) { downloadBtn.setText("下载中"); downloadBtn.setBackgroundResource(R.drawable.game_item_btn_downloading_style); - downloadBtn.setTextColor(context.getResources().getColor(R.color.theme)); + downloadBtn.setTextColor(btn_sl); } } else if (status.equals(DownloadStatus.done)) { game_progressbar.setProgress(1000); @@ -538,9 +546,17 @@ public class DownloadItemUtils { addDownloadEntry(context, entity, 0, entrance); Toast.makeText(context, entity.getName() + "已加入下载队列", Toast.LENGTH_SHORT).show(); + + int[] btn_colors = new int[] { Color.WHITE + , context.getResources().getColor(R.color.theme) }; + int[][] states = new int[2][]; + states[0] = new int[] { android.R.attr.state_pressed }; + states[1] = new int[] {}; + ColorStateList btn_sl = new ColorStateList(states, btn_colors); + downloadBtn.setText("下载中"); downloadBtn.setBackgroundResource(R.drawable.game_item_btn_downloading_style); - downloadBtn.setTextColor(context.getResources().getColor(R.color.theme)); + downloadBtn.setTextColor(btn_sl); EventBus.getDefault().post(new EBRedDot(1)); DownloadManager.getInstance(context).putStatus(entity.getApk().get(0).getUrl(), "downloading"); @@ -600,9 +616,17 @@ public class DownloadItemUtils { addDownloadEntry(context, entity, 0, entrance); Toast.makeText(context, entity.getName() + "已加入下载队列", Toast.LENGTH_SHORT).show(); + + int[] btn_colors = new int[] { Color.WHITE + , context.getResources().getColor(R.color.theme) }; + int[][] states = new int[2][]; + states[0] = new int[] { android.R.attr.state_pressed }; + states[1] = new int[] {}; + ColorStateList btn_sl = new ColorStateList(states, btn_colors); + downloadBtn.setText("下载中"); downloadBtn.setBackgroundResource(R.drawable.game_item_btn_downloading_style); - downloadBtn.setTextColor(context.getResources().getColor(R.color.theme)); + downloadBtn.setTextColor(btn_sl); EventBus.getDefault().post(new EBRedDot(1)); DownloadManager.getInstance(context).putStatus(entity.getApk().get(0).getUrl(), "downloading"); diff --git a/app/src/main/java/com/gh/common/util/ShareUtils.java b/app/src/main/java/com/gh/common/util/ShareUtils.java index 006b0dc2c3..a38b515716 100644 --- a/app/src/main/java/com/gh/common/util/ShareUtils.java +++ b/app/src/main/java/com/gh/common/util/ShareUtils.java @@ -75,7 +75,7 @@ public class ShareUtils { contentView.setFocusableInTouchMode(true); RecyclerView shareRecyclerView = new RecyclerView(context); - shareRecyclerView.setPadding(DisplayUtils.dip2px(context, 4), 0, DisplayUtils.dip2px(context, 4), 0); + shareRecyclerView.setPadding(DisplayUtils.dip2px(context, 4), DisplayUtils.dip2px(context, 4), DisplayUtils.dip2px(context, 4), 0); shareRecyclerView.setBackgroundColor(Color.WHITE); //RecyclerView禁止滑动 @@ -90,7 +90,7 @@ public class ShareUtils { shareRecyclerView.setAdapter(new ShareRecyclerViewAdapter()); RelativeLayout.LayoutParams rlParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT - , maxHeight/3 - DisplayUtils.dip2px(context, 10)); + , DisplayUtils.dip2px(context, 192)); rlParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); contentView.addView(shareRecyclerView,rlParams); @@ -125,13 +125,15 @@ public class ShareUtils { @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LinearLayout linearLayout = new LinearLayout(context); - linearLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, maxHeight/6 - DisplayUtils.dip2px(context, 5))); + linearLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, DisplayUtils.dip2px(context, 96))); linearLayout.setOrientation(LinearLayout.VERTICAL); - linearLayout.setGravity(Gravity.CENTER); + linearLayout.setGravity(Gravity.CENTER_HORIZONTAL); linearLayout.setBackgroundResource(R.drawable.cardview_item_style); ImageView shareLogo = new ImageView(context); - shareLogo.setLayoutParams(new ViewGroup.LayoutParams(DisplayUtils.dip2px(context,45), DisplayUtils.dip2px(context,45))); + LinearLayout.LayoutParams logoParams = new LinearLayout.LayoutParams(DisplayUtils.dip2px(context, 45), DisplayUtils.dip2px(context, 45)); + logoParams.setMargins(0, DisplayUtils.dip2px(context, 10), 0, 0); + shareLogo.setLayoutParams(logoParams); TextView shareLabel = new TextView(context); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); diff --git a/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java index c94acce9bd..d11f499bb1 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java @@ -21,9 +21,9 @@ import com.gh.common.view.CardLinearLayout; import com.gh.gamecenter.GameNewsActivity; import com.gh.gamecenter.NewsSearchActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.GameNewsSearchViewHolder; import com.gh.gamecenter.adapter.viewholder.GameNewsTypeListViewHolder; +import com.gh.gamecenter.adapter.viewholder.NewsFooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsTextViewHolder; import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.manager.DataCollectionManager; @@ -146,8 +146,8 @@ public class GameNewsAdapter extends RecyclerView.Adapter { return new NewsTextViewHolder(view); } else { View view = LayoutInflater.from(parent.getContext()).inflate( - R.layout.refresh_footerview, parent, false); - return new FooterViewHolder(view); + R.layout.gamedetails_item_loading, parent, false); + return new NewsFooterViewHolder(view); } } @@ -209,14 +209,14 @@ public class GameNewsAdapter extends RecyclerView.Adapter { NewsUtils.startNewsActivity(context, newsEntity, "资讯-攻略"); } }); - } else if (holder instanceof FooterViewHolder){ - FooterViewHolder footerViewHolder = ((FooterViewHolder) holder); + } else if (holder instanceof NewsFooterViewHolder){ + NewsFooterViewHolder footerViewHolder = ((NewsFooterViewHolder) holder); if (isRemove){ - footerViewHolder.footerview_tv_loading.setText("加载完毕"); - footerViewHolder.footerview_progressbar.setVisibility(View.GONE); + footerViewHolder.item_tv_loading.setText("加载完毕"); + footerViewHolder.item_pb_loading.setVisibility(View.GONE); }else { - footerViewHolder.footerview_tv_loading.setText("加载中..."); - footerViewHolder.footerview_progressbar.setVisibility(View.VISIBLE); + footerViewHolder.item_tv_loading.setText("加载中..."); + footerViewHolder.item_pb_loading.setVisibility(View.VISIBLE); } } else if (holder instanceof GameNewsSearchViewHolder){ GameNewsSearchViewHolder searchViewHolder = ((GameNewsSearchViewHolder) holder); diff --git a/app/src/main/java/com/gh/gamecenter/game/Game1FragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/game/Game1FragmentAdapter.java index 3c49626201..bf2e156dd2 100644 --- a/app/src/main/java/com/gh/gamecenter/game/Game1FragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/game/Game1FragmentAdapter.java @@ -581,9 +581,9 @@ public class Game1FragmentAdapter extends RecyclerView.Adapter + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/game_item_btn_downloading_style.xml b/app/src/main/res/drawable/game_item_btn_downloading_style.xml index 65f8bca25b..e4a39cef80 100644 --- a/app/src/main/res/drawable/game_item_btn_downloading_style.xml +++ b/app/src/main/res/drawable/game_item_btn_downloading_style.xml @@ -1,13 +1,8 @@ - + - + + + - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/drawable/oval_hint_dn.xml b/app/src/main/res/drawable/oval_hint_dn.xml index 580a21bd83..f1a227ef8d 100644 --- a/app/src/main/res/drawable/oval_hint_dn.xml +++ b/app/src/main/res/drawable/oval_hint_dn.xml @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/oval_hint_up.xml b/app/src/main/res/drawable/oval_hint_up.xml index 2f690c4ba0..d3ac2782f4 100644 --- a/app/src/main/res/drawable/oval_hint_up.xml +++ b/app/src/main/res/drawable/oval_hint_up.xml @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 5d4b1e1a2b..3e118726a5 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -53,7 +53,7 @@ android:text="游戏" android:layout_marginTop="3dp" android:textColor="@color/theme" - android:textSize="12sp" /> + android:textSize="11sp" /> + android:textSize="11sp" /> + android:textSize="11sp" /> diff --git a/app/src/main/res/layout/game_download_item.xml b/app/src/main/res/layout/game_download_item.xml index 712628a477..5c05e37334 100644 --- a/app/src/main/res/layout/game_download_item.xml +++ b/app/src/main/res/layout/game_download_item.xml @@ -53,10 +53,10 @@ + android:paddingBottom="8dp"> + android:layout_height="25dp" + android:layout_margin="5dp"/> + android:orientation="horizontal" + android:paddingBottom="8dp"> @@ -34,11 +33,9 @@ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 48aeae7ca5..a57848a218 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,7 +13,7 @@ #EDF2F4 - #EDEDED + #E5E5E5 #EBEBEB